diff --git a/src/main/java/com/xero/api/client/AccountingApi.java b/src/main/java/com/xero/api/client/AccountingApi.java index a6bd2283d..6dfa09207 100644 --- a/src/main/java/com/xero/api/client/AccountingApi.java +++ b/src/main/java/com/xero/api/client/AccountingApi.java @@ -9,24 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.http.ByteArrayContent; -import com.google.api.client.http.FileContent; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpTransport; import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; + import com.xero.models.accounting.Account; import com.xero.models.accounting.Accounts; import com.xero.models.accounting.Actions; @@ -48,7 +35,9 @@ import com.xero.models.accounting.Currencies; import com.xero.models.accounting.Currency; import com.xero.models.accounting.Employees; +import com.xero.models.accounting.Error; import com.xero.models.accounting.ExpenseClaims; +import java.io.File; import com.xero.models.accounting.HistoryRecords; import com.xero.models.accounting.ImportSummaryObject; import com.xero.models.accounting.InvoiceReminders; @@ -57,7 +46,9 @@ import com.xero.models.accounting.Journals; import com.xero.models.accounting.LinkedTransaction; import com.xero.models.accounting.LinkedTransactions; +import org.threeten.bp.LocalDate; import com.xero.models.accounting.ManualJournals; +import org.threeten.bp.OffsetDateTime; import com.xero.models.accounting.OnlineInvoices; import com.xero.models.accounting.Organisations; import com.xero.models.accounting.Overpayments; @@ -79,33430 +70,25316 @@ import com.xero.models.accounting.TrackingCategory; import com.xero.models.accounting.TrackingOption; import com.xero.models.accounting.TrackingOptions; +import java.util.UUID; import com.xero.models.accounting.Users; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.ByteArrayContent; +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpContent; +import com.google.api.client.http.HttpMethods; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpResponseException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; -import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; +import java.util.List; + import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; + import org.slf4j.LoggerFactory; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import org.slf4j.Logger; + -/** AccountingApi has methods for interacting with all endpoints in the API set */ +/** AccountingApi has methods for interacting with all endpoints in the API set */ public class AccountingApi { - private ApiClient apiClient; - private static AccountingApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(AccountingApi.class); - - /** AccountingApi */ - public AccountingApi() { - this(new ApiClient()); - } - - /** - * AccountingApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static AccountingApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new AccountingApi(apiClient); - } - return instance; - } - - /** - * AccountingApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public AccountingApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Creates a new chart of accounts - * - *

200 - Success - created new Account and return response of type Accounts array with - * new Account - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param account Account object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Accounts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Accounts createAccount( - String accessToken, String xeroTenantId, Account account, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createAccountForHttpResponse(accessToken, xeroTenantId, account, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createAccount -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Accounts", object.getMessage(), e); - } - handler.validationError("Accounts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new chart of accounts - * - *

200 - Success - created new Account and return response of type Accounts array with - * new Account - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param account Account object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createAccountForHttpResponse( - String accessToken, String xeroTenantId, Account account, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createAccount"); - } // verify the required parameter 'account' is set - if (account == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'account' when calling createAccount"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createAccount"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(account); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createAccountAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Creates an attachment on a specific account - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createAccountAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createAccountAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createAccountAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment on a specific account - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createAccountAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createAccountAttachmentByFileName"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling" - + " createAccountAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createAccountAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createAccountAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createAccountAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an attachment on a specific account - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createAccountAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createAccountAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createAccountAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment on a specific account - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createAccountAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createAccountAttachmentByFileName"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling" - + " createAccountAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createAccountAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createAccountAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createAccountAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createBankTransactionAttachmentByFileName to allow byte[] or File type to - // be passed as body - /** - * Creates an attachment for a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createBankTransactionAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransactionAttachmentByFileNameForHttpResponse( - accessToken, - xeroTenantId, - bankTransactionID, - fileName, - body, - idempotencyKey, - mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransactionAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment for a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createBankTransactionAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBankTransactionAttachmentByFileName"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " createBankTransactionAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createBankTransactionAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createBankTransactionAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBankTransactionAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an attachment for a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createBankTransactionAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransactionAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransactionAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment for a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBankTransactionAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBankTransactionAttachmentByFileName"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " createBankTransactionAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createBankTransactionAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createBankTransactionAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBankTransactionAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific bank transactions - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createBankTransactionHistoryRecord( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransactionHistoryRecordForHttpResponse( - accessToken, xeroTenantId, bankTransactionID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransactionHistoryRecord -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific bank transactions - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBankTransactionHistoryRecordForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBankTransactionHistoryRecord"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " createBankTransactionHistoryRecord"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling" - + " createBankTransactionHistoryRecord"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBankTransactionHistoryRecord"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more spent or received money transaction - * - *

200 - Success - return response of type BankTransactions array with new - * BankTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactions BankTransactions with an array of BankTransaction objects in body of - * request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BankTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransactions createBankTransactions( - String accessToken, - String xeroTenantId, - BankTransactions bankTransactions, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransactionsForHttpResponse( - accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransactions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("BankTransactions", object.getMessage(), e); - } - handler.validationError("BankTransactions", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more spent or received money transaction - * - *

200 - Success - return response of type BankTransactions array with new - * BankTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactions BankTransactions with an array of BankTransaction objects in body of - * request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBankTransactionsForHttpResponse( - String accessToken, - String xeroTenantId, - BankTransactions bankTransactions, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createBankTransactions"); - } // verify the required parameter 'bankTransactions' is set - if (bankTransactions == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactions' when calling createBankTransactions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createBankTransactions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(bankTransactions); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a bank transfer - * - *

200 - Success - return response of BankTransfers array of one BankTransfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransfers BankTransfers with array of BankTransfer objects in request body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BankTransfers - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransfers createBankTransfer( - String accessToken, String xeroTenantId, BankTransfers bankTransfers, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransferForHttpResponse( - accessToken, xeroTenantId, bankTransfers, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransfer -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("BankTransfers", object.getMessage(), e); - } - handler.validationError("BankTransfers", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a bank transfer - * - *

200 - Success - return response of BankTransfers array of one BankTransfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransfers BankTransfers with array of BankTransfer objects in request body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBankTransferForHttpResponse( - String accessToken, String xeroTenantId, BankTransfers bankTransfers, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createBankTransfer"); - } // verify the required parameter 'bankTransfers' is set - if (bankTransfers == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransfers' when calling createBankTransfer"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createBankTransfer"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(bankTransfers); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createBankTransferAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createBankTransferAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransferAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransferAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createBankTransferAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBankTransferAttachmentByFileName"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " createBankTransferAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createBankTransferAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createBankTransferAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBankTransferAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createBankTransferAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransferAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransferAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBankTransferAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBankTransferAttachmentByFileName"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " createBankTransferAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createBankTransferAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createBankTransferAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBankTransferAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific bank transfer - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createBankTransferHistoryRecord( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBankTransferHistoryRecordForHttpResponse( - accessToken, xeroTenantId, bankTransferID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBankTransferHistoryRecord -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific bank transfer - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBankTransferHistoryRecordForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBankTransferHistoryRecord"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " createBankTransferHistoryRecord"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling" - + " createBankTransferHistoryRecord"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBankTransferHistoryRecord"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or many batch payments for invoices - * - *

200 - Success - return response of type BatchPayments array of BatchPayment objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPayments BatchPayments with an array of Payments in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BatchPayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BatchPayments createBatchPayment( - String accessToken, - String xeroTenantId, - BatchPayments batchPayments, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBatchPaymentForHttpResponse( - accessToken, xeroTenantId, batchPayments, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBatchPayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("BatchPayments", object.getMessage(), e); - } - handler.validationError("BatchPayments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or many batch payments for invoices - * - *

200 - Success - return response of type BatchPayments array of BatchPayment objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPayments BatchPayments with an array of Payments in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBatchPaymentForHttpResponse( - String accessToken, - String xeroTenantId, - BatchPayments batchPayments, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createBatchPayment"); - } // verify the required parameter 'batchPayments' is set - if (batchPayments == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'batchPayments' when calling createBatchPayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createBatchPayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(batchPayments); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific batch payment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createBatchPaymentHistoryRecord( - String accessToken, - String xeroTenantId, - UUID batchPaymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBatchPaymentHistoryRecordForHttpResponse( - accessToken, xeroTenantId, batchPaymentID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBatchPaymentHistoryRecord -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific batch payment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBatchPaymentHistoryRecordForHttpResponse( - String accessToken, - String xeroTenantId, - UUID batchPaymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBatchPaymentHistoryRecord"); - } // verify the required parameter 'batchPaymentID' is set - if (batchPaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'batchPaymentID' when calling" - + " createBatchPaymentHistoryRecord"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling" - + " createBatchPaymentHistoryRecord"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBatchPaymentHistoryRecord"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BatchPaymentID", batchPaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new custom payment service for a specific branding theme - * - *

200 - Success - return response of type PaymentServices array with newly created - * PaymentService - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param brandingThemeID Unique identifier for a Branding Theme - * @param paymentServices PaymentServices array with PaymentService object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PaymentServices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentServices createBrandingThemePaymentServices( - String accessToken, - String xeroTenantId, - UUID brandingThemeID, - PaymentServices paymentServices, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBrandingThemePaymentServicesForHttpResponse( - accessToken, xeroTenantId, brandingThemeID, paymentServices, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBrandingThemePaymentServices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("PaymentServices", object.getMessage(), e); - } - handler.validationError("PaymentServices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new custom payment service for a specific branding theme - * - *

200 - Success - return response of type PaymentServices array with newly created - * PaymentService - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param brandingThemeID Unique identifier for a Branding Theme - * @param paymentServices PaymentServices array with PaymentService object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBrandingThemePaymentServicesForHttpResponse( - String accessToken, - String xeroTenantId, - UUID brandingThemeID, - PaymentServices paymentServices, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createBrandingThemePaymentServices"); - } // verify the required parameter 'brandingThemeID' is set - if (brandingThemeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'brandingThemeID' when calling" - + " createBrandingThemePaymentServices"); - } // verify the required parameter 'paymentServices' is set - if (paymentServices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentServices' when calling" - + " createBrandingThemePaymentServices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createBrandingThemePaymentServices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BrandingThemeID", brandingThemeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BrandingThemes/{BrandingThemeID}/PaymentServices"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(paymentServices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createContactAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * 200 - Success - return response of type Attachments array with an newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createContactAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createContactAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createContactAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of type Attachments array with an newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createContactAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createContactAttachmentByFileName"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling" - + " createContactAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createContactAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createContactAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createContactAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * 200 - Success - return response of type Attachments array with an newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createContactAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createContactAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createContactAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of type Attachments array with an newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createContactAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createContactAttachmentByFileName"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling" - + " createContactAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createContactAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createContactAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createContactAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a contact group - * - *

200 - Success - return response of type Contact Groups array of newly created Contact - * Group - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroups ContactGroups with an array of names in request body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ContactGroups - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ContactGroups createContactGroup( - String accessToken, String xeroTenantId, ContactGroups contactGroups, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createContactGroupForHttpResponse( - accessToken, xeroTenantId, contactGroups, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createContactGroup -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("ContactGroups", object.getMessage(), e); - } - handler.validationError("ContactGroups", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a contact group - * - *

200 - Success - return response of type Contact Groups array of newly created Contact - * Group - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroups ContactGroups with an array of names in request body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createContactGroupForHttpResponse( - String accessToken, String xeroTenantId, ContactGroups contactGroups, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createContactGroup"); - } // verify the required parameter 'contactGroups' is set - if (contactGroups == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactGroups' when calling createContactGroup"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createContactGroup"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(contactGroups); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates contacts to a specific contact group - * - *

200 - Success - return response of type Contacts array of added Contacts - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param contacts Contacts with array of contacts specifying the ContactID to be added to - * ContactGroup in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Contacts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Contacts createContactGroupContacts( - String accessToken, - String xeroTenantId, - UUID contactGroupID, - Contacts contacts, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createContactGroupContactsForHttpResponse( - accessToken, xeroTenantId, contactGroupID, contacts, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createContactGroupContacts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Contacts", object.getMessage(), e); - } - handler.validationError("Contacts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates contacts to a specific contact group - * - *

200 - Success - return response of type Contacts array of added Contacts - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param contacts Contacts with array of contacts specifying the ContactID to be added to - * ContactGroup in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createContactGroupContactsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactGroupID, - Contacts contacts, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createContactGroupContacts"); - } // verify the required parameter 'contactGroupID' is set - if (contactGroupID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactGroupID' when calling" - + " createContactGroupContacts"); - } // verify the required parameter 'contacts' is set - if (contacts == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contacts' when calling createContactGroupContacts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createContactGroupContacts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactGroupID", contactGroupID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}/Contacts"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(contacts); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new history record for a specific contact - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createContactHistory( - String accessToken, - String xeroTenantId, - UUID contactID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createContactHistoryForHttpResponse( - accessToken, xeroTenantId, contactID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createContactHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new history record for a specific contact - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createContactHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createContactHistory"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling createContactHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createContactHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createContactHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates multiple contacts (bulk) in a Xero organisation - * - *

200 - Success - return response of type Contacts array with newly created Contact - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contacts Contacts with an array of Contact objects to create in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Contacts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Contacts createContacts( - String accessToken, - String xeroTenantId, - Contacts contacts, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createContactsForHttpResponse( - accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createContacts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Contacts", object.getMessage(), e); - } - handler.validationError("Contacts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates multiple contacts (bulk) in a Xero organisation - * - *

200 - Success - return response of type Contacts array with newly created Contact - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contacts Contacts with an array of Contact objects to create in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createContactsForHttpResponse( - String accessToken, - String xeroTenantId, - Contacts contacts, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createContacts"); - } // verify the required parameter 'contacts' is set - if (contacts == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contacts' when calling createContacts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createContacts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(contacts); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates allocation for a specific credit note - * - *

200 - Success - return response of type Allocations array with newly created - * Allocation for specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param allocations Allocations with array of Allocation object in body of request. - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Allocations - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Allocations createCreditNoteAllocation( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - Allocations allocations, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createCreditNoteAllocationForHttpResponse( - accessToken, - xeroTenantId, - creditNoteID, - allocations, - summarizeErrors, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createCreditNoteAllocation -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Allocations", object.getMessage(), e); - } - handler.validationError("Allocations", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates allocation for a specific credit note - * - *

200 - Success - return response of type Allocations array with newly created - * Allocation for specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param allocations Allocations with array of Allocation object in body of request. - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createCreditNoteAllocationForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - Allocations allocations, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createCreditNoteAllocation"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling createCreditNoteAllocation"); - } // verify the required parameter 'allocations' is set - if (allocations == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'allocations' when calling createCreditNoteAllocation"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createCreditNoteAllocation"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Allocations"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(allocations); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createCreditNoteAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * Creates an attachment for a specific credit note - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createCreditNoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - byte[] body, - Boolean includeOnline, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createCreditNoteAttachmentByFileNameForHttpResponse( - accessToken, - xeroTenantId, - creditNoteID, - fileName, - body, - includeOnline, - idempotencyKey, - mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createCreditNoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment for a specific credit note - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - byte[] body, - Boolean includeOnline, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createCreditNoteAttachmentByFileName"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling" - + " createCreditNoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createCreditNoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createCreditNoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createCreditNoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); - if (includeOnline != null) { - String key = "IncludeOnline"; - Object value = includeOnline; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an attachment for a specific credit note - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createCreditNoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - File body, - Boolean includeOnline, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createCreditNoteAttachmentByFileNameForHttpResponse( - accessToken, - xeroTenantId, - creditNoteID, - fileName, - body, - includeOnline, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createCreditNoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment for a specific credit note - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - File body, - Boolean includeOnline, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createCreditNoteAttachmentByFileName"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling" - + " createCreditNoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createCreditNoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createCreditNoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createCreditNoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); - if (includeOnline != null) { - String key = "IncludeOnline"; - Object value = includeOnline; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records of a specific credit note - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createCreditNoteHistory( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createCreditNoteHistoryForHttpResponse( - accessToken, xeroTenantId, creditNoteID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createCreditNoteHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records of a specific credit note - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createCreditNoteHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createCreditNoteHistory"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling createCreditNoteHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createCreditNoteHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createCreditNoteHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new credit note - * - *

200 - Success - return response of type Credit Notes array of newly created - * CreditNote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNotes Credit Notes with array of CreditNote object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return CreditNotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CreditNotes createCreditNotes( - String accessToken, - String xeroTenantId, - CreditNotes creditNotes, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createCreditNotesForHttpResponse( - accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createCreditNotes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("CreditNotes", object.getMessage(), e); - } - handler.validationError("CreditNotes", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new credit note - * - *

200 - Success - return response of type Credit Notes array of newly created - * CreditNote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNotes Credit Notes with array of CreditNote object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createCreditNotesForHttpResponse( - String accessToken, - String xeroTenantId, - CreditNotes creditNotes, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createCreditNotes"); - } // verify the required parameter 'creditNotes' is set - if (creditNotes == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNotes' when calling createCreditNotes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createCreditNotes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(creditNotes); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Create a new currency for a Xero organisation - * - *

200 - Unsupported - return response incorrect exception, API is not able to create - * new Currency - * - * @param xeroTenantId Xero identifier for Tenant - * @param currency Currency object in the body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Currencies - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Currencies createCurrency( - String accessToken, String xeroTenantId, Currency currency, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createCurrencyForHttpResponse(accessToken, xeroTenantId, currency, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createCurrency -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Currencies", object.getMessage(), e); - } - handler.validationError("Currencies", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Create a new currency for a Xero organisation - * - *

200 - Unsupported - return response incorrect exception, API is not able to create - * new Currency - * - * @param xeroTenantId Xero identifier for Tenant - * @param currency Currency object in the body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createCurrencyForHttpResponse( - String accessToken, String xeroTenantId, Currency currency, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createCurrency"); - } // verify the required parameter 'currency' is set - if (currency == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'currency' when calling createCurrency"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createCurrency"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Currencies"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(currency); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates new employees used in Xero payrun - * - *

200 - Success - return response of type Employees array with new Employee - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param employees Employees with array of Employee object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees createEmployees( - String accessToken, - String xeroTenantId, - Employees employees, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeesForHttpResponse( - accessToken, xeroTenantId, employees, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployees -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Employees", object.getMessage(), e); - } - handler.validationError("Employees", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates new employees used in Xero payrun - * - *

200 - Success - return response of type Employees array with new Employee - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param employees Employees with array of Employee object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeesForHttpResponse( - String accessToken, - String xeroTenantId, - Employees employees, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployees"); - } // verify the required parameter 'employees' is set - if (employees == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employees' when calling createEmployees"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployees"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employees); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific expense claim - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createExpenseClaimHistory( - String accessToken, - String xeroTenantId, - UUID expenseClaimID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createExpenseClaimHistoryForHttpResponse( - accessToken, xeroTenantId, expenseClaimID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createExpenseClaimHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific expense claim - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createExpenseClaimHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID expenseClaimID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createExpenseClaimHistory"); - } // verify the required parameter 'expenseClaimID' is set - if (expenseClaimID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'expenseClaimID' when calling createExpenseClaimHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createExpenseClaimHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createExpenseClaimHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ExpenseClaimID", expenseClaimID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates expense claims - * - *

200 - Success - return response of type ExpenseClaims array with newly created - * ExpenseClaim - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaims ExpenseClaims with array of ExpenseClaim object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ExpenseClaims - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ExpenseClaims createExpenseClaims( - String accessToken, String xeroTenantId, ExpenseClaims expenseClaims, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createExpenseClaimsForHttpResponse( - accessToken, xeroTenantId, expenseClaims, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createExpenseClaims -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("ExpenseClaims", object.getMessage(), e); - } - handler.validationError("ExpenseClaims", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates expense claims - * - *

200 - Success - return response of type ExpenseClaims array with newly created - * ExpenseClaim - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaims ExpenseClaims with array of ExpenseClaim object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createExpenseClaimsForHttpResponse( - String accessToken, String xeroTenantId, ExpenseClaims expenseClaims, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createExpenseClaims"); - } // verify the required parameter 'expenseClaims' is set - if (expenseClaims == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'expenseClaims' when calling createExpenseClaims"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createExpenseClaims"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(expenseClaims); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createInvoiceAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Creates an attachment for a specific invoice or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - byte[] body, - Boolean includeOnline, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createInvoiceAttachmentByFileNameForHttpResponse( - accessToken, - xeroTenantId, - invoiceID, - fileName, - body, - includeOnline, - idempotencyKey, - mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment for a specific invoice or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - byte[] body, - Boolean includeOnline, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createInvoiceAttachmentByFileName"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling" - + " createInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); - if (includeOnline != null) { - String key = "IncludeOnline"; - Object value = includeOnline; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an attachment for a specific invoice or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - File body, - Boolean includeOnline, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createInvoiceAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, invoiceID, fileName, body, includeOnline, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment for a specific invoice or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param includeOnline Allows an attachment to be seen by the end customer within their online - * invoice - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - File body, - Boolean includeOnline, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createInvoiceAttachmentByFileName"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling" - + " createInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); - if (includeOnline != null) { - String key = "IncludeOnline"; - Object value = includeOnline; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific invoice - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createInvoiceHistory( - String accessToken, - String xeroTenantId, - UUID invoiceID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createInvoiceHistoryForHttpResponse( - accessToken, xeroTenantId, invoiceID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createInvoiceHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific invoice - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createInvoiceHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createInvoiceHistory"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling createInvoiceHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createInvoiceHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createInvoiceHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with newly created Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoices Invoices with an array of invoice objects in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Invoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Invoices createInvoices( - String accessToken, - String xeroTenantId, - Invoices invoices, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createInvoicesForHttpResponse( - accessToken, xeroTenantId, invoices, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createInvoices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Invoices", object.getMessage(), e); - } - handler.validationError("Invoices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with newly created Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoices Invoices with an array of invoice objects in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createInvoicesForHttpResponse( - String accessToken, - String xeroTenantId, - Invoices invoices, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createInvoices"); - } // verify the required parameter 'invoices' is set - if (invoices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoices' when calling createInvoices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createInvoices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(invoices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific item - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createItemHistory( - String accessToken, - String xeroTenantId, - UUID itemID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createItemHistoryForHttpResponse( - accessToken, xeroTenantId, itemID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createItemHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific item - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createItemHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID itemID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createItemHistory"); - } // verify the required parameter 'itemID' is set - if (itemID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'itemID' when calling createItemHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createItemHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createItemHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ItemID", itemID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more items - * - *

200 - Success - return response of type Items array with newly created Item - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param items Items with an array of Item objects in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Items - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Items createItems( - String accessToken, - String xeroTenantId, - Items items, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createItemsForHttpResponse( - accessToken, xeroTenantId, items, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createItems -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Items", object.getMessage(), e); - } - handler.validationError("Items", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more items - * - *

200 - Success - return response of type Items array with newly created Item - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param items Items with an array of Item objects in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createItemsForHttpResponse( - String accessToken, - String xeroTenantId, - Items items, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createItems"); - } // verify the required parameter 'items' is set - if (items == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'items' when calling createItems"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createItems"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(items); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates linked transactions (billable expenses) - * - *

200 - Success - return response of type LinkedTransactions array with newly created - * LinkedTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransaction LinkedTransaction object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LinkedTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LinkedTransactions createLinkedTransaction( - String accessToken, - String xeroTenantId, - LinkedTransaction linkedTransaction, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createLinkedTransactionForHttpResponse( - accessToken, xeroTenantId, linkedTransaction, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createLinkedTransaction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("LinkedTransactions", object.getMessage(), e); - } - handler.validationError("LinkedTransactions", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates linked transactions (billable expenses) - * - *

200 - Success - return response of type LinkedTransactions array with newly created - * LinkedTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransaction LinkedTransaction object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createLinkedTransactionForHttpResponse( - String accessToken, - String xeroTenantId, - LinkedTransaction linkedTransaction, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createLinkedTransaction"); - } // verify the required parameter 'linkedTransaction' is set - if (linkedTransaction == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'linkedTransaction' when calling" - + " createLinkedTransaction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createLinkedTransaction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(linkedTransaction); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createManualJournalAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * Creates a specific attachment for a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with a newly created - * Attachment for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createManualJournalAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createManualJournalAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createManualJournalAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a specific attachment for a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with a newly created - * Attachment for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createManualJournalAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createManualJournalAttachmentByFileName"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " createManualJournalAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createManualJournalAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createManualJournalAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createManualJournalAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a specific attachment for a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with a newly created - * Attachment for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createManualJournalAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createManualJournalAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createManualJournalAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a specific attachment for a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with a newly created - * Attachment for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createManualJournalAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createManualJournalAttachmentByFileName"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " createManualJournalAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createManualJournalAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createManualJournalAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createManualJournalAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific manual journal - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createManualJournalHistoryRecord( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createManualJournalHistoryRecordForHttpResponse( - accessToken, xeroTenantId, manualJournalID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createManualJournalHistoryRecord -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific manual journal - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createManualJournalHistoryRecordForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createManualJournalHistoryRecord"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " createManualJournalHistoryRecord"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling" - + " createManualJournalHistoryRecord"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createManualJournalHistoryRecord"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more manual journals - * - *

200 - Success - return response of type ManualJournals array with newly created - * ManualJournal - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournals ManualJournals array with ManualJournal object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ManualJournals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ManualJournals createManualJournals( - String accessToken, - String xeroTenantId, - ManualJournals manualJournals, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createManualJournalsForHttpResponse( - accessToken, xeroTenantId, manualJournals, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createManualJournals -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("ManualJournals", object.getMessage(), e); - } - handler.validationError("ManualJournals", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more manual journals - * - *

200 - Success - return response of type ManualJournals array with newly created - * ManualJournal - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournals ManualJournals array with ManualJournal object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createManualJournalsForHttpResponse( - String accessToken, - String xeroTenantId, - ManualJournals manualJournals, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createManualJournals"); - } // verify the required parameter 'manualJournals' is set - if (manualJournals == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournals' when calling createManualJournals"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createManualJournals"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(manualJournals); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a single allocation for a specific overpayment - * - *

200 - Success - return response of type Allocations array with all Allocation for - * Overpayments - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param allocations Allocations array with Allocation object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Allocations - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Allocations createOverpaymentAllocations( - String accessToken, - String xeroTenantId, - UUID overpaymentID, - Allocations allocations, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createOverpaymentAllocationsForHttpResponse( - accessToken, - xeroTenantId, - overpaymentID, - allocations, - summarizeErrors, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createOverpaymentAllocations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Allocations", object.getMessage(), e); - } - handler.validationError("Allocations", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a single allocation for a specific overpayment - * - *

200 - Success - return response of type Allocations array with all Allocation for - * Overpayments - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param allocations Allocations array with Allocation object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createOverpaymentAllocationsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID overpaymentID, - Allocations allocations, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createOverpaymentAllocations"); - } // verify the required parameter 'overpaymentID' is set - if (overpaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'overpaymentID' when calling" - + " createOverpaymentAllocations"); - } // verify the required parameter 'allocations' is set - if (allocations == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'allocations' when calling createOverpaymentAllocations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createOverpaymentAllocations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("OverpaymentID", overpaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/Allocations"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(allocations); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific overpayment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - API is not able to create - * HistoryRecord for Overpayments - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createOverpaymentHistory( - String accessToken, - String xeroTenantId, - UUID overpaymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createOverpaymentHistoryForHttpResponse( - accessToken, xeroTenantId, overpaymentID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createOverpaymentHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific overpayment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - API is not able to create - * HistoryRecord for Overpayments - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createOverpaymentHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID overpaymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createOverpaymentHistory"); - } // verify the required parameter 'overpaymentID' is set - if (overpaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'overpaymentID' when calling createOverpaymentHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createOverpaymentHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createOverpaymentHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("OverpaymentID", overpaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a single payment for invoice or credit notes - * - *

200 - Success - return response of type Payments array for newly created Payment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param payment Request body with a single Payment object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Payments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Payments createPayment( - String accessToken, String xeroTenantId, Payment payment, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPaymentForHttpResponse(accessToken, xeroTenantId, payment, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Payments", object.getMessage(), e); - } - handler.validationError("Payments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a single payment for invoice or credit notes - * - *

200 - Success - return response of type Payments array for newly created Payment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param payment Request body with a single Payment object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPaymentForHttpResponse( - String accessToken, String xeroTenantId, Payment payment, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayment"); - } // verify the required parameter 'payment' is set - if (payment == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payment' when calling createPayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payment); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific payment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - API is not able to create - * HistoryRecord for Payments - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createPaymentHistory( - String accessToken, - String xeroTenantId, - UUID paymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPaymentHistoryForHttpResponse( - accessToken, xeroTenantId, paymentID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPaymentHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific payment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - API is not able to create - * HistoryRecord for Payments - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPaymentHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID paymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPaymentHistory"); - } // verify the required parameter 'paymentID' is set - if (paymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentID' when calling createPaymentHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createPaymentHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPaymentHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PaymentID", paymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a payment service - * - *

200 - Success - return response of type PaymentServices array for newly created - * PaymentService - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentServices PaymentServices array with PaymentService object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PaymentServices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentServices createPaymentService( - String accessToken, - String xeroTenantId, - PaymentServices paymentServices, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPaymentServiceForHttpResponse( - accessToken, xeroTenantId, paymentServices, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPaymentService -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("PaymentServices", object.getMessage(), e); - } - handler.validationError("PaymentServices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a payment service - * - *

200 - Success - return response of type PaymentServices array for newly created - * PaymentService - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentServices PaymentServices array with PaymentService object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPaymentServiceForHttpResponse( - String accessToken, - String xeroTenantId, - PaymentServices paymentServices, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPaymentService"); - } // verify the required parameter 'paymentServices' is set - if (paymentServices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentServices' when calling createPaymentService"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPaymentService"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaymentServices"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(paymentServices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates multiple payments for invoices or credit notes - * - *

200 - Success - return response of type Payments array for newly created Payment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param payments Payments array with Payment object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Payments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Payments createPayments( - String accessToken, - String xeroTenantId, - Payments payments, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPaymentsForHttpResponse( - accessToken, xeroTenantId, payments, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Payments", object.getMessage(), e); - } - handler.validationError("Payments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates multiple payments for invoices or credit notes - * - *

200 - Success - return response of type Payments array for newly created Payment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param payments Payments array with Payment object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPaymentsForHttpResponse( - String accessToken, - String xeroTenantId, - Payments payments, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayments"); - } // verify the required parameter 'payments' is set - if (payments == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payments' when calling createPayments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payments); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Allows you to create an Allocation for prepayments - * - *

200 - Success - return response of type Allocations array of Allocation for all - * Prepayment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param allocations Allocations with an array of Allocation object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Allocations - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Allocations createPrepaymentAllocations( - String accessToken, - String xeroTenantId, - UUID prepaymentID, - Allocations allocations, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPrepaymentAllocationsForHttpResponse( - accessToken, - xeroTenantId, - prepaymentID, - allocations, - summarizeErrors, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPrepaymentAllocations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Allocations", object.getMessage(), e); - } - handler.validationError("Allocations", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Allows you to create an Allocation for prepayments - * - *

200 - Success - return response of type Allocations array of Allocation for all - * Prepayment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param allocations Allocations with an array of Allocation object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPrepaymentAllocationsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID prepaymentID, - Allocations allocations, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPrepaymentAllocations"); - } // verify the required parameter 'prepaymentID' is set - if (prepaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'prepaymentID' when calling createPrepaymentAllocations"); - } // verify the required parameter 'allocations' is set - if (allocations == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'allocations' when calling createPrepaymentAllocations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPrepaymentAllocations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PrepaymentID", prepaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/Allocations"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(allocations); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific prepayment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - Unsupported - return response incorrect exception, API is not able to create - * HistoryRecord for Expense Claims - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createPrepaymentHistory( - String accessToken, - String xeroTenantId, - UUID prepaymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPrepaymentHistoryForHttpResponse( - accessToken, xeroTenantId, prepaymentID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPrepaymentHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific prepayment - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - Unsupported - return response incorrect exception, API is not able to create - * HistoryRecord for Expense Claims - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPrepaymentHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID prepaymentID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPrepaymentHistory"); - } // verify the required parameter 'prepaymentID' is set - if (prepaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'prepaymentID' when calling createPrepaymentHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createPrepaymentHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPrepaymentHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PrepaymentID", prepaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createPurchaseOrderAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * Creates attachment for a specific purchase order - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createPurchaseOrderAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPurchaseOrderAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPurchaseOrderAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates attachment for a specific purchase order - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createPurchaseOrderAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates attachment for a specific purchase order - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createPurchaseOrderAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPurchaseOrderAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPurchaseOrderAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates attachment for a specific purchase order - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPurchaseOrderAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createPurchaseOrderAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific purchase orders - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createPurchaseOrderHistory( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPurchaseOrderHistoryForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPurchaseOrderHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific purchase orders - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPurchaseOrderHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPurchaseOrderHistory"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " createPurchaseOrderHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling" - + " createPurchaseOrderHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPurchaseOrderHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more purchase orders - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrders PurchaseOrders with an array of PurchaseOrder object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PurchaseOrders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PurchaseOrders createPurchaseOrders( - String accessToken, - String xeroTenantId, - PurchaseOrders purchaseOrders, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPurchaseOrdersForHttpResponse( - accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPurchaseOrders -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("PurchaseOrders", object.getMessage(), e); - } - handler.validationError("PurchaseOrders", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more purchase orders - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrders PurchaseOrders with an array of PurchaseOrder object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPurchaseOrdersForHttpResponse( - String accessToken, - String xeroTenantId, - PurchaseOrders purchaseOrders, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPurchaseOrders"); - } // verify the required parameter 'purchaseOrders' is set - if (purchaseOrders == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrders' when calling createPurchaseOrders"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPurchaseOrders"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(purchaseOrders); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createQuoteAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Creates attachment for a specific quote - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createQuoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createQuoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createQuoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates attachment for a specific quote - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createQuoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createQuoteAttachmentByFileName"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling createQuoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling createQuoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createQuoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createQuoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates attachment for a specific quote - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createQuoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createQuoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createQuoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates attachment for a specific quote - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createQuoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createQuoteAttachmentByFileName"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling createQuoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling createQuoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createQuoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createQuoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific quote - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createQuoteHistory( - String accessToken, - String xeroTenantId, - UUID quoteID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createQuoteHistoryForHttpResponse( - accessToken, xeroTenantId, quoteID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createQuoteHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific quote - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createQuoteHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID quoteID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createQuoteHistory"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling createQuoteHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createQuoteHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createQuoteHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Create one or more quotes - * - *

200 - Success - return response of type Quotes with array with newly created Quote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quotes Quotes with an array of Quote object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Quotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Quotes createQuotes( - String accessToken, - String xeroTenantId, - Quotes quotes, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createQuotesForHttpResponse( - accessToken, xeroTenantId, quotes, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createQuotes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Quotes", object.getMessage(), e); - } - handler.validationError("Quotes", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Create one or more quotes - * - *

200 - Success - return response of type Quotes with array with newly created Quote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quotes Quotes with an array of Quote object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createQuotesForHttpResponse( - String accessToken, - String xeroTenantId, - Quotes quotes, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createQuotes"); - } // verify the required parameter 'quotes' is set - if (quotes == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quotes' when calling createQuotes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createQuotes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(quotes); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates draft expense claim receipts for any user - * - *

200 - Success - return response of type Receipts array for newly created Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receipts Receipts with an array of Receipt object in body of request - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Receipts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Receipts createReceipt( - String accessToken, - String xeroTenantId, - Receipts receipts, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createReceiptForHttpResponse(accessToken, xeroTenantId, receipts, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createReceipt -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Receipts", object.getMessage(), e); - } - handler.validationError("Receipts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates draft expense claim receipts for any user - * - *

200 - Success - return response of type Receipts array for newly created Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receipts Receipts with an array of Receipt object in body of request - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createReceiptForHttpResponse( - String accessToken, - String xeroTenantId, - Receipts receipts, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createReceipt"); - } // verify the required parameter 'receipts' is set - if (receipts == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receipts' when calling createReceipt"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createReceipt"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(receipts); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createReceiptAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Creates an attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createReceiptAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createReceiptAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createReceiptAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createReceiptAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createReceiptAttachmentByFileName"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling" - + " createReceiptAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createReceiptAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createReceiptAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createReceiptAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createReceiptAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createReceiptAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createReceiptAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with newly created - * Attachment for a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createReceiptAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createReceiptAttachmentByFileName"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling" - + " createReceiptAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createReceiptAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling createReceiptAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createReceiptAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific receipt - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - Unsupported - return response incorrect exception, API is not able to create - * HistoryRecord for Receipts - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createReceiptHistory( - String accessToken, - String xeroTenantId, - UUID receiptID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createReceiptHistoryForHttpResponse( - accessToken, xeroTenantId, receiptID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createReceiptHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific receipt - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - Unsupported - return response incorrect exception, API is not able to create - * HistoryRecord for Receipts - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createReceiptHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID receiptID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createReceiptHistory"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling createReceiptHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling createReceiptHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createReceiptHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for createRepeatingInvoiceAttachmentByFileName to allow byte[] or File type to - // be passed as body - /** - * Creates an attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments createRepeatingInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createRepeatingInvoiceAttachmentByFileNameForHttpResponse( - accessToken, - xeroTenantId, - repeatingInvoiceID, - fileName, - body, - idempotencyKey, - mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createRepeatingInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse createRepeatingInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments createRepeatingInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createRepeatingInvoiceAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createRepeatingInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createRepeatingInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createRepeatingInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a history record for a specific repeating invoice - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords createRepeatingInvoiceHistory( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createRepeatingInvoiceHistoryForHttpResponse( - accessToken, xeroTenantId, repeatingInvoiceID, historyRecords, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createRepeatingInvoiceHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("HistoryRecords", object.getMessage(), e); - } - handler.validationError("HistoryRecords", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a history record for a specific repeating invoice - * - *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of - * request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createRepeatingInvoiceHistoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - HistoryRecords historyRecords, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createRepeatingInvoiceHistory"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " createRepeatingInvoiceHistory"); - } // verify the required parameter 'historyRecords' is set - if (historyRecords == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'historyRecords' when calling" - + " createRepeatingInvoiceHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createRepeatingInvoiceHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(historyRecords); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more repeating invoice templates - * - *

200 - Success - return response of type RepeatingInvoices array with newly created - * RepeatingInvoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body - * of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return RepeatingInvoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public RepeatingInvoices createRepeatingInvoices( - String accessToken, - String xeroTenantId, - RepeatingInvoices repeatingInvoices, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createRepeatingInvoicesForHttpResponse( - accessToken, xeroTenantId, repeatingInvoices, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createRepeatingInvoices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("RepeatingInvoices", object.getMessage(), e); - } - handler.validationError("RepeatingInvoices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more repeating invoice templates - * - *

200 - Success - return response of type RepeatingInvoices array with newly created - * RepeatingInvoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body - * of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createRepeatingInvoicesForHttpResponse( - String accessToken, - String xeroTenantId, - RepeatingInvoices repeatingInvoices, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createRepeatingInvoices"); - } // verify the required parameter 'repeatingInvoices' is set - if (repeatingInvoices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoices' when calling" - + " createRepeatingInvoices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createRepeatingInvoices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(repeatingInvoices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more tax rates - * - *

200 - Success - return response of type TaxRates array newly created TaxRate - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param taxRates TaxRates array with TaxRate object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TaxRates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TaxRates createTaxRates( - String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTaxRatesForHttpResponse(accessToken, xeroTenantId, taxRates, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTaxRates -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("TaxRates", object.getMessage(), e); - } - handler.validationError("TaxRates", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more tax rates - * - *

200 - Success - return response of type TaxRates array newly created TaxRate - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param taxRates TaxRates array with TaxRate object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTaxRatesForHttpResponse( - String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTaxRates"); - } // verify the required parameter 'taxRates' is set - if (taxRates == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taxRates' when calling createTaxRates"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTaxRates"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(taxRates); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Create tracking categories - * - *

200 - Success - return response of type TrackingCategories array of newly created - * TrackingCategory - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategory TrackingCategory object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TrackingCategories - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingCategories createTrackingCategory( - String accessToken, - String xeroTenantId, - TrackingCategory trackingCategory, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTrackingCategoryForHttpResponse( - accessToken, xeroTenantId, trackingCategory, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTrackingCategory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("TrackingCategories", object.getMessage(), e); - } - handler.validationError("TrackingCategories", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Create tracking categories - * - *

200 - Success - return response of type TrackingCategories array of newly created - * TrackingCategory - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategory TrackingCategory object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTrackingCategoryForHttpResponse( - String accessToken, - String xeroTenantId, - TrackingCategory trackingCategory, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTrackingCategory"); - } // verify the required parameter 'trackingCategory' is set - if (trackingCategory == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategory' when calling createTrackingCategory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTrackingCategory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(trackingCategory); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates options for a specific tracking category - * - *

200 - Success - return response of type TrackingOptions array of options for a - * specified category - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingOption TrackingOption object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TrackingOptions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingOptions createTrackingOptions( - String accessToken, - String xeroTenantId, - UUID trackingCategoryID, - TrackingOption trackingOption, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTrackingOptionsForHttpResponse( - accessToken, xeroTenantId, trackingCategoryID, trackingOption, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTrackingOptions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("TrackingOptions", object.getMessage(), e); - } - handler.validationError("TrackingOptions", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates options for a specific tracking category - * - *

200 - Success - return response of type TrackingOptions array of options for a - * specified category - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingOption TrackingOption object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTrackingOptionsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID trackingCategoryID, - TrackingOption trackingOption, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTrackingOptions"); - } // verify the required parameter 'trackingCategoryID' is set - if (trackingCategoryID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategoryID' when calling createTrackingOptions"); - } // verify the required parameter 'trackingOption' is set - if (trackingOption == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingOption' when calling createTrackingOptions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTrackingOptions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TrackingCategoryID", trackingCategoryID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}/Options"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(trackingOption); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a chart of accounts - * - *

200 - Success - delete existing Account and return response of type Accounts array - * with deleted Account - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accessToken Authorization token for user set in header of each request - * @return Accounts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Accounts deleteAccount(String accessToken, String xeroTenantId, UUID accountID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = deleteAccountForHttpResponse(accessToken, xeroTenantId, accountID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteAccount -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Accounts", object.getMessage(), e); - } - handler.validationError("Accounts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a chart of accounts - * - *

200 - Success - delete existing Account and return response of type Accounts array - * with deleted Account - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteAccountForHttpResponse( - String accessToken, String xeroTenantId, UUID accountID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteAccount"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling deleteAccount"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteAccount"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific batch payment for invoices and credit notes - * - *

200 - Success - return response of type BatchPayments array for updated BatchPayment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentDelete The batchPaymentDelete parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BatchPayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BatchPayments deleteBatchPayment( - String accessToken, - String xeroTenantId, - BatchPaymentDelete batchPaymentDelete, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteBatchPaymentForHttpResponse( - accessToken, xeroTenantId, batchPaymentDelete, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteBatchPayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("BatchPayments", object.getMessage(), e); - } - handler.validationError("BatchPayments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific batch payment for invoices and credit notes - * - *

200 - Success - return response of type BatchPayments array for updated BatchPayment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentDelete The batchPaymentDelete parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteBatchPaymentForHttpResponse( - String accessToken, - String xeroTenantId, - BatchPaymentDelete batchPaymentDelete, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteBatchPayment"); - } // verify the required parameter 'batchPaymentDelete' is set - if (batchPaymentDelete == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'batchPaymentDelete' when calling deleteBatchPayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteBatchPayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(batchPaymentDelete); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific batch payment for invoices and credit notes - * - *

200 - Success - return response of type BatchPayments array for updated BatchPayment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param batchPaymentDeleteByUrlParam The batchPaymentDeleteByUrlParam parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BatchPayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BatchPayments deleteBatchPaymentByUrlParam( - String accessToken, - String xeroTenantId, - UUID batchPaymentID, - BatchPaymentDeleteByUrlParam batchPaymentDeleteByUrlParam, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteBatchPaymentByUrlParamForHttpResponse( - accessToken, - xeroTenantId, - batchPaymentID, - batchPaymentDeleteByUrlParam, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteBatchPaymentByUrlParam -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific batch payment for invoices and credit notes - * - *

200 - Success - return response of type BatchPayments array for updated BatchPayment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param batchPaymentDeleteByUrlParam The batchPaymentDeleteByUrlParam parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteBatchPaymentByUrlParamForHttpResponse( - String accessToken, - String xeroTenantId, - UUID batchPaymentID, - BatchPaymentDeleteByUrlParam batchPaymentDeleteByUrlParam, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " deleteBatchPaymentByUrlParam"); - } // verify the required parameter 'batchPaymentID' is set - if (batchPaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'batchPaymentID' when calling" - + " deleteBatchPaymentByUrlParam"); - } // verify the required parameter 'batchPaymentDeleteByUrlParam' is set - if (batchPaymentDeleteByUrlParam == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'batchPaymentDeleteByUrlParam' when calling" - + " deleteBatchPaymentByUrlParam"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteBatchPaymentByUrlParam"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BatchPaymentID", batchPaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(batchPaymentDeleteByUrlParam); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific contact from a contact group using a unique contact Id - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteContactGroupContact( - String accessToken, String xeroTenantId, UUID contactGroupID, UUID contactID) - throws IOException { - try { - deleteContactGroupContactForHttpResponse( - accessToken, xeroTenantId, contactGroupID, contactID); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteContactGroupContact -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a specific contact from a contact group using a unique contact Id - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteContactGroupContactForHttpResponse( - String accessToken, String xeroTenantId, UUID contactGroupID, UUID contactID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteContactGroupContact"); - } // verify the required parameter 'contactGroupID' is set - if (contactGroupID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactGroupID' when calling deleteContactGroupContact"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling deleteContactGroupContact"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteContactGroupContact"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactGroupID", contactGroupID); - uriVariables.put("ContactID", contactID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}/Contacts/{ContactID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes all contacts from a specific contact group - * - *

204 - Success - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteContactGroupContacts( - String accessToken, String xeroTenantId, UUID contactGroupID) throws IOException { - try { - deleteContactGroupContactsForHttpResponse(accessToken, xeroTenantId, contactGroupID); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteContactGroupContacts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes all contacts from a specific contact group - * - *

204 - Success - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteContactGroupContactsForHttpResponse( - String accessToken, String xeroTenantId, UUID contactGroupID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteContactGroupContacts"); - } // verify the required parameter 'contactGroupID' is set - if (contactGroupID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactGroupID' when calling" - + " deleteContactGroupContacts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteContactGroupContacts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept(""); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactGroupID", contactGroupID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}/Contacts"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes an Allocation from a Credit Note - * - *

200 - Success - return response of type Allocation with the isDeleted flag as true - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param allocationID Unique identifier for Allocation object - * @param accessToken Authorization token for user set in header of each request - * @return Allocation - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Allocation deleteCreditNoteAllocations( - String accessToken, String xeroTenantId, UUID creditNoteID, UUID allocationID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteCreditNoteAllocationsForHttpResponse( - accessToken, xeroTenantId, creditNoteID, allocationID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteCreditNoteAllocations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes an Allocation from a Credit Note - * - *

200 - Success - return response of type Allocation with the isDeleted flag as true - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param allocationID Unique identifier for Allocation object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteCreditNoteAllocationsForHttpResponse( - String accessToken, String xeroTenantId, UUID creditNoteID, UUID allocationID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteCreditNoteAllocations"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling deleteCreditNoteAllocations"); - } // verify the required parameter 'allocationID' is set - if (allocationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'allocationID' when calling deleteCreditNoteAllocations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteCreditNoteAllocations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - uriVariables.put("AllocationID", allocationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Allocations/{AllocationID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific item - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteItem(String accessToken, String xeroTenantId, UUID itemID) throws IOException { - try { - deleteItemForHttpResponse(accessToken, xeroTenantId, itemID); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteItem -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a specific item - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteItemForHttpResponse( - String accessToken, String xeroTenantId, UUID itemID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteItem"); - } // verify the required parameter 'itemID' is set - if (itemID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'itemID' when calling deleteItem"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteItem"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ItemID", itemID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific linked transactions (billable expenses) - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransactionID Unique identifier for a LinkedTransaction - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteLinkedTransaction( - String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { - try { - deleteLinkedTransactionForHttpResponse(accessToken, xeroTenantId, linkedTransactionID); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteLinkedTransaction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a specific linked transactions (billable expenses) - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransactionID Unique identifier for a LinkedTransaction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteLinkedTransactionForHttpResponse( - String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteLinkedTransaction"); - } // verify the required parameter 'linkedTransactionID' is set - if (linkedTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'linkedTransactionID' when calling" - + " deleteLinkedTransaction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteLinkedTransaction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LinkedTransactionID", linkedTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions/{LinkedTransactionID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes an Allocation from an overpayment - * - *

200 - Success - return response of type Allocation with the isDeleted flag as true - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param allocationID Unique identifier for Allocation object - * @param accessToken Authorization token for user set in header of each request - * @return Allocation - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Allocation deleteOverpaymentAllocations( - String accessToken, String xeroTenantId, UUID overpaymentID, UUID allocationID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteOverpaymentAllocationsForHttpResponse( - accessToken, xeroTenantId, overpaymentID, allocationID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteOverpaymentAllocations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes an Allocation from an overpayment - * - *

200 - Success - return response of type Allocation with the isDeleted flag as true - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param allocationID Unique identifier for Allocation object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteOverpaymentAllocationsForHttpResponse( - String accessToken, String xeroTenantId, UUID overpaymentID, UUID allocationID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " deleteOverpaymentAllocations"); - } // verify the required parameter 'overpaymentID' is set - if (overpaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'overpaymentID' when calling" - + " deleteOverpaymentAllocations"); - } // verify the required parameter 'allocationID' is set - if (allocationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'allocationID' when calling" - + " deleteOverpaymentAllocations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteOverpaymentAllocations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("OverpaymentID", overpaymentID); - uriVariables.put("AllocationID", allocationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/Allocations/{AllocationID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific payment for invoices and credit notes - * - *

200 - Success - return response of type Payments array for updated Payment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param paymentDelete The paymentDelete parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Payments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Payments deletePayment( - String accessToken, - String xeroTenantId, - UUID paymentID, - PaymentDelete paymentDelete, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deletePaymentForHttpResponse( - accessToken, xeroTenantId, paymentID, paymentDelete, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deletePayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Payments", object.getMessage(), e); - } - handler.validationError("Payments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific payment for invoices and credit notes - * - *

200 - Success - return response of type Payments array for updated Payment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param paymentDelete The paymentDelete parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deletePaymentForHttpResponse( - String accessToken, - String xeroTenantId, - UUID paymentID, - PaymentDelete paymentDelete, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deletePayment"); - } // verify the required parameter 'paymentID' is set - if (paymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentID' when calling deletePayment"); - } // verify the required parameter 'paymentDelete' is set - if (paymentDelete == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentDelete' when calling deletePayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deletePayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PaymentID", paymentID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(paymentDelete); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes an Allocation from a Prepayment - * - *

200 - Success - return response of type Allocation with the isDeleted flag as true - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param allocationID Unique identifier for Allocation object - * @param accessToken Authorization token for user set in header of each request - * @return Allocation - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Allocation deletePrepaymentAllocations( - String accessToken, String xeroTenantId, UUID prepaymentID, UUID allocationID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deletePrepaymentAllocationsForHttpResponse( - accessToken, xeroTenantId, prepaymentID, allocationID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deletePrepaymentAllocations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes an Allocation from a Prepayment - * - *

200 - Success - return response of type Allocation with the isDeleted flag as true - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param allocationID Unique identifier for Allocation object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deletePrepaymentAllocationsForHttpResponse( - String accessToken, String xeroTenantId, UUID prepaymentID, UUID allocationID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deletePrepaymentAllocations"); - } // verify the required parameter 'prepaymentID' is set - if (prepaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'prepaymentID' when calling deletePrepaymentAllocations"); - } // verify the required parameter 'allocationID' is set - if (allocationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'allocationID' when calling deletePrepaymentAllocations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deletePrepaymentAllocations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PrepaymentID", prepaymentID); - uriVariables.put("AllocationID", allocationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/Allocations/{AllocationID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific tracking category - * - *

200 - Success - return response of type TrackingCategories array of deleted - * TrackingCategory - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param accessToken Authorization token for user set in header of each request - * @return TrackingCategories - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingCategories deleteTrackingCategory( - String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteTrackingCategoryForHttpResponse(accessToken, xeroTenantId, trackingCategoryID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTrackingCategory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a specific tracking category - * - *

200 - Success - return response of type TrackingCategories array of deleted - * TrackingCategory - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTrackingCategoryForHttpResponse( - String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTrackingCategory"); - } // verify the required parameter 'trackingCategoryID' is set - if (trackingCategoryID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategoryID' when calling" - + " deleteTrackingCategory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTrackingCategory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TrackingCategoryID", trackingCategoryID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific option for a specific tracking category - * - *

200 - Success - return response of type TrackingOptions array of remaining options - * for a specified category - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingOptionID Unique identifier for a Tracking Option - * @param accessToken Authorization token for user set in header of each request - * @return TrackingOptions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingOptions deleteTrackingOptions( - String accessToken, String xeroTenantId, UUID trackingCategoryID, UUID trackingOptionID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteTrackingOptionsForHttpResponse( - accessToken, xeroTenantId, trackingCategoryID, trackingOptionID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTrackingOptions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a specific option for a specific tracking category - * - *

200 - Success - return response of type TrackingOptions array of remaining options - * for a specified category - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingOptionID Unique identifier for a Tracking Option - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTrackingOptionsForHttpResponse( - String accessToken, String xeroTenantId, UUID trackingCategoryID, UUID trackingOptionID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTrackingOptions"); - } // verify the required parameter 'trackingCategoryID' is set - if (trackingCategoryID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategoryID' when calling deleteTrackingOptions"); - } // verify the required parameter 'trackingOptionID' is set - if (trackingOptionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingOptionID' when calling deleteTrackingOptions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTrackingOptions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TrackingCategoryID", trackingCategoryID); - uriVariables.put("TrackingOptionID", trackingOptionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Sends a copy of a specific invoice to related contact via email - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param requestEmpty The requestEmpty parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void emailInvoice( - String accessToken, - String xeroTenantId, - UUID invoiceID, - RequestEmpty requestEmpty, - String idempotencyKey) - throws IOException { - try { - emailInvoiceForHttpResponse( - accessToken, xeroTenantId, invoiceID, requestEmpty, idempotencyKey); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : emailInvoice -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("", object.getMessage(), e); - } - handler.validationError("", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Sends a copy of a specific invoice to related contact via email - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param requestEmpty The requestEmpty parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse emailInvoiceForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - RequestEmpty requestEmpty, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling emailInvoice"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling emailInvoice"); - } // verify the required parameter 'requestEmpty' is set - if (requestEmpty == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'requestEmpty' when calling emailInvoice"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling emailInvoice"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Email"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(requestEmpty); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a single chart of accounts by using a unique account Id - * - *

200 - Success - return response of type Accounts array with one Account - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accessToken Authorization token for user set in header of each request - * @return Accounts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Accounts getAccount(String accessToken, String xeroTenantId, UUID accountID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getAccountForHttpResponse(accessToken, xeroTenantId, accountID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccount -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a single chart of accounts by using a unique account Id - * - *

200 - Success - return response of type Accounts array with one Account - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountForHttpResponse( - String accessToken, String xeroTenantId, UUID accountID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAccount"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling getAccount"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAccount"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves an attachment for a specific account by filename - * - *

200 - Success - return response of attachment for Account as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getAccountAttachmentByFileName( - String accessToken, String xeroTenantId, UUID accountID, String fileName, String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAccountAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, accountID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccountAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves an attachment for a specific account by filename - * - *

200 - Success - return response of attachment for Account as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountAttachmentByFileNameForHttpResponse( - String accessToken, String xeroTenantId, UUID accountID, String fileName, String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getAccountAttachmentByFileName"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling getAccountAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling getAccountAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getAccountAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getAccountAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific account using a unique attachment Id - * - *

200 - Success - return response of attachment for Account as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getAccountAttachmentById( - String accessToken, - String xeroTenantId, - UUID accountID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAccountAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, accountID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccountAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific account using a unique attachment Id - * - *

200 - Success - return response of attachment for Account as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID accountID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAccountAttachmentById"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling getAccountAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling getAccountAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling getAccountAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAccountAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments for a specific accounts by using a unique account Id - * - *

200 - Success - return response of type Attachments array of Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getAccountAttachments(String accessToken, String xeroTenantId, UUID accountID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAccountAttachmentsForHttpResponse(accessToken, xeroTenantId, accountID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccountAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments for a specific accounts by using a unique account Id - * - *

200 - Success - return response of type Attachments array of Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID accountID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAccountAttachments"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling getAccountAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAccountAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves the full chart of accounts - * - *

200 - Success - return response of type Accounts array with 0 to n Account - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return Accounts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Accounts getAccounts( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAccountsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccounts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves the full chart of accounts - * - *

200 - Success - return response of type Accounts array with 0 to n Account - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAccounts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAccounts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a single spent or received money transaction by using a unique bank transaction Id - * - *

200 - Success - return response of type BankTransactions array with a specific - * BankTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return BankTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransactions getBankTransaction( - String accessToken, String xeroTenantId, UUID bankTransactionID, Integer unitdp) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransactionForHttpResponse(accessToken, xeroTenantId, bankTransactionID, unitdp); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransaction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a single spent or received money transaction by using a unique bank transaction Id - * - *

200 - Success - return response of type BankTransactions array with a specific - * BankTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransactionForHttpResponse( - String accessToken, String xeroTenantId, UUID bankTransactionID, Integer unitdp) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankTransaction"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling getBankTransaction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankTransaction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific bank transaction by filename - * - *

200 - Success - return response of attachment for BankTransaction as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getBankTransactionAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransactionAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransactionID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransactionAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific bank transaction by filename - * - *

200 - Success - return response of attachment for BankTransaction as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransactionAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getBankTransactionAttachmentByFileName"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " getBankTransactionAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " getBankTransactionAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getBankTransactionAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getBankTransactionAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id - * - *

200 - Success - return response of attachment for BankTransaction as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getBankTransactionAttachmentById( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransactionAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, bankTransactionID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransactionAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id - * - *

200 - Success - return response of attachment for BankTransaction as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransactionAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getBankTransactionAttachmentById"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " getBankTransactionAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling" - + " getBankTransactionAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getBankTransactionAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getBankTransactionAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves any attachments from a specific bank transactions - * - *

200 - Success - return response of type Attachments array with 0 to n Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getBankTransactionAttachments( - String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransactionAttachmentsForHttpResponse( - accessToken, xeroTenantId, bankTransactionID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransactionAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves any attachments from a specific bank transactions - * - *

200 - Success - return response of type Attachments array with 0 to n Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransactionAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getBankTransactionAttachments"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " getBankTransactionAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getBankTransactionAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves any spent or received money transactions - * - *

200 - Success - return response of type BankTransactions array with 0 to n - * BankTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page Up to 100 bank transactions will be returned in a single API call with line items - * details - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return BankTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransactions getBankTransactions( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransactionsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransactions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves any spent or received money transactions - * - *

200 - Success - return response of type BankTransactions array with 0 to n - * BankTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page Up to 100 bank transactions will be returned in a single API call with line items - * details - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransactionsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankTransactions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankTransactions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } + private ApiClient apiClient; + private static AccountingApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(AccountingApi.class); + + /** AccountingApi */ + public AccountingApi() { + this(new ApiClient()); + } + + /** AccountingApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static AccountingApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new AccountingApi(apiClient); + } + return instance; + } + + /** AccountingApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public AccountingApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * Creates a new chart of accounts + *

200 - Success - created new Account and return response of type Accounts array with new Account + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param account Account object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Accounts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Accounts createAccount(String accessToken, String xeroTenantId, Account account, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createAccountForHttpResponse(accessToken, xeroTenantId, account, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createAccount -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Accounts",object.getMessage(), e); + } + handler.validationError("Accounts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new chart of accounts + *

200 - Success - created new Account and return response of type Accounts array with new Account + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param account Account object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createAccountForHttpResponse(String accessToken, String xeroTenantId, Account account, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createAccount"); + }// verify the required parameter 'account' is set + if (account == null) { + throw new IllegalArgumentException("Missing the required parameter 'account' when calling createAccount"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createAccount"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(account); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createAccountAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates an attachment on a specific account + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createAccountAttachmentByFileName(String accessToken, String xeroTenantId, UUID accountID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createAccountAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createAccountAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment on a specific account + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createAccountAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID accountID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createAccountAttachmentByFileName"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling createAccountAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createAccountAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createAccountAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createAccountAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates an attachment on a specific account + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createAccountAttachmentByFileName(String accessToken, String xeroTenantId, UUID accountID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createAccountAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createAccountAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment on a specific account + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createAccountAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID accountID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createAccountAttachmentByFileName"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling createAccountAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createAccountAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createAccountAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createAccountAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createBankTransactionAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates an attachment for a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createBankTransactionAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransactionAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransactionAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment for a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createBankTransactionAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransactionAttachmentByFileName"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling createBankTransactionAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createBankTransactionAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createBankTransactionAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransactionAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates an attachment for a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createBankTransactionAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransactionAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransactionAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment for a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBankTransactionAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransactionAttachmentByFileName"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling createBankTransactionAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createBankTransactionAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createBankTransactionAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransactionAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific bank transactions + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createBankTransactionHistoryRecord(String accessToken, String xeroTenantId, UUID bankTransactionID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransactionHistoryRecordForHttpResponse(accessToken, xeroTenantId, bankTransactionID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransactionHistoryRecord -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific bank transactions + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBankTransactionHistoryRecordForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransactionHistoryRecord"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling createBankTransactionHistoryRecord"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createBankTransactionHistoryRecord"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransactionHistoryRecord"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more spent or received money transaction + *

200 - Success - return response of type BankTransactions array with new BankTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactions BankTransactions with an array of BankTransaction objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BankTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransactions createBankTransactions(String accessToken, String xeroTenantId, BankTransactions bankTransactions, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransactionsForHttpResponse(accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransactions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("BankTransactions",object.getMessage(), e); + } + handler.validationError("BankTransactions",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more spent or received money transaction + *

200 - Success - return response of type BankTransactions array with new BankTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactions BankTransactions with an array of BankTransaction objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBankTransactionsForHttpResponse(String accessToken, String xeroTenantId, BankTransactions bankTransactions, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransactions"); + }// verify the required parameter 'bankTransactions' is set + if (bankTransactions == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactions' when calling createBankTransactions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransactions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(bankTransactions); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a bank transfer + *

200 - Success - return response of BankTransfers array of one BankTransfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransfers BankTransfers with array of BankTransfer objects in request body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BankTransfers + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransfers createBankTransfer(String accessToken, String xeroTenantId, BankTransfers bankTransfers, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransferForHttpResponse(accessToken, xeroTenantId, bankTransfers, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransfer -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("BankTransfers",object.getMessage(), e); + } + handler.validationError("BankTransfers",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a bank transfer + *

200 - Success - return response of BankTransfers array of one BankTransfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransfers BankTransfers with array of BankTransfer objects in request body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBankTransferForHttpResponse(String accessToken, String xeroTenantId, BankTransfers bankTransfers, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransfer"); + }// verify the required parameter 'bankTransfers' is set + if (bankTransfers == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransfers' when calling createBankTransfer"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransfer"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(bankTransfers); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createBankTransferAttachmentByFileName to allow byte[] or File type to be passed as body + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createBankTransferAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransferAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransferAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createBankTransferAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransferAttachmentByFileName"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling createBankTransferAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createBankTransferAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createBankTransferAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransferAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createBankTransferAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransferAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransferAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBankTransferAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransferAttachmentByFileName"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling createBankTransferAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createBankTransferAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createBankTransferAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransferAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific bank transfer + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createBankTransferHistoryRecord(String accessToken, String xeroTenantId, UUID bankTransferID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBankTransferHistoryRecordForHttpResponse(accessToken, xeroTenantId, bankTransferID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBankTransferHistoryRecord -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific bank transfer + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBankTransferHistoryRecordForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBankTransferHistoryRecord"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling createBankTransferHistoryRecord"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createBankTransferHistoryRecord"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBankTransferHistoryRecord"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or many batch payments for invoices + *

200 - Success - return response of type BatchPayments array of BatchPayment objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPayments BatchPayments with an array of Payments in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BatchPayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BatchPayments createBatchPayment(String accessToken, String xeroTenantId, BatchPayments batchPayments, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBatchPaymentForHttpResponse(accessToken, xeroTenantId, batchPayments, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBatchPayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("BatchPayments",object.getMessage(), e); + } + handler.validationError("BatchPayments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or many batch payments for invoices + *

200 - Success - return response of type BatchPayments array of BatchPayment objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPayments BatchPayments with an array of Payments in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBatchPaymentForHttpResponse(String accessToken, String xeroTenantId, BatchPayments batchPayments, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBatchPayment"); + }// verify the required parameter 'batchPayments' is set + if (batchPayments == null) { + throw new IllegalArgumentException("Missing the required parameter 'batchPayments' when calling createBatchPayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBatchPayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(batchPayments); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific batch payment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createBatchPaymentHistoryRecord(String accessToken, String xeroTenantId, UUID batchPaymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBatchPaymentHistoryRecordForHttpResponse(accessToken, xeroTenantId, batchPaymentID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBatchPaymentHistoryRecord -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific batch payment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBatchPaymentHistoryRecordForHttpResponse(String accessToken, String xeroTenantId, UUID batchPaymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBatchPaymentHistoryRecord"); + }// verify the required parameter 'batchPaymentID' is set + if (batchPaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'batchPaymentID' when calling createBatchPaymentHistoryRecord"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createBatchPaymentHistoryRecord"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBatchPaymentHistoryRecord"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BatchPaymentID", batchPaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new custom payment service for a specific branding theme + *

200 - Success - return response of type PaymentServices array with newly created PaymentService + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param brandingThemeID Unique identifier for a Branding Theme + * @param paymentServices PaymentServices array with PaymentService object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PaymentServices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentServices createBrandingThemePaymentServices(String accessToken, String xeroTenantId, UUID brandingThemeID, PaymentServices paymentServices, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBrandingThemePaymentServicesForHttpResponse(accessToken, xeroTenantId, brandingThemeID, paymentServices, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBrandingThemePaymentServices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("PaymentServices",object.getMessage(), e); + } + handler.validationError("PaymentServices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new custom payment service for a specific branding theme + *

200 - Success - return response of type PaymentServices array with newly created PaymentService + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param brandingThemeID Unique identifier for a Branding Theme + * @param paymentServices PaymentServices array with PaymentService object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBrandingThemePaymentServicesForHttpResponse(String accessToken, String xeroTenantId, UUID brandingThemeID, PaymentServices paymentServices, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBrandingThemePaymentServices"); + }// verify the required parameter 'brandingThemeID' is set + if (brandingThemeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'brandingThemeID' when calling createBrandingThemePaymentServices"); + }// verify the required parameter 'paymentServices' is set + if (paymentServices == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentServices' when calling createBrandingThemePaymentServices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBrandingThemePaymentServices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BrandingThemeID", brandingThemeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BrandingThemes/{BrandingThemeID}/PaymentServices"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(paymentServices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createContactAttachmentByFileName to allow byte[] or File type to be passed as body + /** + *

200 - Success - return response of type Attachments array with an newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createContactAttachmentByFileName(String accessToken, String xeroTenantId, UUID contactID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createContactAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createContactAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of type Attachments array with an newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createContactAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createContactAttachmentByFileName"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling createContactAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createContactAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createContactAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createContactAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + *

200 - Success - return response of type Attachments array with an newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createContactAttachmentByFileName(String accessToken, String xeroTenantId, UUID contactID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createContactAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createContactAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of type Attachments array with an newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createContactAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createContactAttachmentByFileName"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling createContactAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createContactAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createContactAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createContactAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a contact group + *

200 - Success - return response of type Contact Groups array of newly created Contact Group + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroups ContactGroups with an array of names in request body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ContactGroups + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ContactGroups createContactGroup(String accessToken, String xeroTenantId, ContactGroups contactGroups, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createContactGroupForHttpResponse(accessToken, xeroTenantId, contactGroups, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createContactGroup -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("ContactGroups",object.getMessage(), e); + } + handler.validationError("ContactGroups",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a contact group + *

200 - Success - return response of type Contact Groups array of newly created Contact Group + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroups ContactGroups with an array of names in request body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createContactGroupForHttpResponse(String accessToken, String xeroTenantId, ContactGroups contactGroups, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createContactGroup"); + }// verify the required parameter 'contactGroups' is set + if (contactGroups == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactGroups' when calling createContactGroup"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createContactGroup"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(contactGroups); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates contacts to a specific contact group + *

200 - Success - return response of type Contacts array of added Contacts + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param contacts Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Contacts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Contacts createContactGroupContacts(String accessToken, String xeroTenantId, UUID contactGroupID, Contacts contacts, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createContactGroupContactsForHttpResponse(accessToken, xeroTenantId, contactGroupID, contacts, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createContactGroupContacts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Contacts",object.getMessage(), e); + } + handler.validationError("Contacts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates contacts to a specific contact group + *

200 - Success - return response of type Contacts array of added Contacts + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param contacts Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createContactGroupContactsForHttpResponse(String accessToken, String xeroTenantId, UUID contactGroupID, Contacts contacts, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createContactGroupContacts"); + }// verify the required parameter 'contactGroupID' is set + if (contactGroupID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactGroupID' when calling createContactGroupContacts"); + }// verify the required parameter 'contacts' is set + if (contacts == null) { + throw new IllegalArgumentException("Missing the required parameter 'contacts' when calling createContactGroupContacts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createContactGroupContacts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactGroupID", contactGroupID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}/Contacts"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(contacts); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new history record for a specific contact + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createContactHistory(String accessToken, String xeroTenantId, UUID contactID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createContactHistoryForHttpResponse(accessToken, xeroTenantId, contactID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createContactHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new history record for a specific contact + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createContactHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createContactHistory"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling createContactHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createContactHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createContactHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates multiple contacts (bulk) in a Xero organisation + *

200 - Success - return response of type Contacts array with newly created Contact + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param contacts Contacts with an array of Contact objects to create in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Contacts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Contacts createContacts(String accessToken, String xeroTenantId, Contacts contacts, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createContactsForHttpResponse(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createContacts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Contacts",object.getMessage(), e); + } + handler.validationError("Contacts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates multiple contacts (bulk) in a Xero organisation + *

200 - Success - return response of type Contacts array with newly created Contact + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param contacts Contacts with an array of Contact objects to create in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createContactsForHttpResponse(String accessToken, String xeroTenantId, Contacts contacts, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createContacts"); + }// verify the required parameter 'contacts' is set + if (contacts == null) { + throw new IllegalArgumentException("Missing the required parameter 'contacts' when calling createContacts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createContacts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(contacts); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates allocation for a specific credit note + *

200 - Success - return response of type Allocations array with newly created Allocation for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param allocations Allocations with array of Allocation object in body of request. + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Allocations + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Allocations createCreditNoteAllocation(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createCreditNoteAllocationForHttpResponse(accessToken, xeroTenantId, creditNoteID, allocations, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createCreditNoteAllocation -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Allocations",object.getMessage(), e); + } + handler.validationError("Allocations",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates allocation for a specific credit note + *

200 - Success - return response of type Allocations array with newly created Allocation for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param allocations Allocations with array of Allocation object in body of request. + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNoteAllocation"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling createCreditNoteAllocation"); + }// verify the required parameter 'allocations' is set + if (allocations == null) { + throw new IllegalArgumentException("Missing the required parameter 'allocations' when calling createCreditNoteAllocation"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createCreditNoteAllocation"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Allocations"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(allocations); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createCreditNoteAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates an attachment for a specific credit note + *

200 - Success - return response of type Attachments array with newly created Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createCreditNoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, byte[] body, Boolean includeOnline, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createCreditNoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, creditNoteID, fileName, body, includeOnline, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createCreditNoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment for a specific credit note + *

200 - Success - return response of type Attachments array with newly created Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, byte[] body, Boolean includeOnline, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNoteAttachmentByFileName"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling createCreditNoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createCreditNoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createCreditNoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createCreditNoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); + if (includeOnline != null) { + String key = "IncludeOnline"; + Object value = includeOnline; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates an attachment for a specific credit note + *

200 - Success - return response of type Attachments array with newly created Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createCreditNoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, File body, Boolean includeOnline, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createCreditNoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, creditNoteID, fileName, body, includeOnline, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createCreditNoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment for a specific credit note + *

200 - Success - return response of type Attachments array with newly created Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, File body, Boolean includeOnline, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNoteAttachmentByFileName"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling createCreditNoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createCreditNoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createCreditNoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createCreditNoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); + if (includeOnline != null) { + String key = "IncludeOnline"; + Object value = includeOnline; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records of a specific credit note + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createCreditNoteHistory(String accessToken, String xeroTenantId, UUID creditNoteID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createCreditNoteHistoryForHttpResponse(accessToken, xeroTenantId, creditNoteID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createCreditNoteHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records of a specific credit note + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createCreditNoteHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNoteHistory"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling createCreditNoteHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createCreditNoteHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createCreditNoteHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new credit note + *

200 - Success - return response of type Credit Notes array of newly created CreditNote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNotes Credit Notes with array of CreditNote object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return CreditNotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CreditNotes createCreditNotes(String accessToken, String xeroTenantId, CreditNotes creditNotes, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createCreditNotesForHttpResponse(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createCreditNotes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("CreditNotes",object.getMessage(), e); + } + handler.validationError("CreditNotes",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new credit note + *

200 - Success - return response of type Credit Notes array of newly created CreditNote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNotes Credit Notes with array of CreditNote object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createCreditNotesForHttpResponse(String accessToken, String xeroTenantId, CreditNotes creditNotes, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNotes"); + }// verify the required parameter 'creditNotes' is set + if (creditNotes == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNotes' when calling createCreditNotes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createCreditNotes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(creditNotes); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Create a new currency for a Xero organisation + *

200 - Unsupported - return response incorrect exception, API is not able to create new Currency + * @param xeroTenantId Xero identifier for Tenant + * @param currency Currency object in the body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Currencies + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Currencies createCurrency(String accessToken, String xeroTenantId, Currency currency, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createCurrencyForHttpResponse(accessToken, xeroTenantId, currency, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createCurrency -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Currencies",object.getMessage(), e); + } + handler.validationError("Currencies",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Create a new currency for a Xero organisation + *

200 - Unsupported - return response incorrect exception, API is not able to create new Currency + * @param xeroTenantId Xero identifier for Tenant + * @param currency Currency object in the body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createCurrencyForHttpResponse(String accessToken, String xeroTenantId, Currency currency, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCurrency"); + }// verify the required parameter 'currency' is set + if (currency == null) { + throw new IllegalArgumentException("Missing the required parameter 'currency' when calling createCurrency"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createCurrency"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Currencies"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(currency); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates new employees used in Xero payrun + *

200 - Success - return response of type Employees array with new Employee + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param employees Employees with array of Employee object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees createEmployees(String accessToken, String xeroTenantId, Employees employees, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeesForHttpResponse(accessToken, xeroTenantId, employees, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployees -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Employees",object.getMessage(), e); + } + handler.validationError("Employees",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates new employees used in Xero payrun + *

200 - Success - return response of type Employees array with new Employee + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param employees Employees with array of Employee object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeesForHttpResponse(String accessToken, String xeroTenantId, Employees employees, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployees"); + }// verify the required parameter 'employees' is set + if (employees == null) { + throw new IllegalArgumentException("Missing the required parameter 'employees' when calling createEmployees"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployees"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employees); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific expense claim + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createExpenseClaimHistory(String accessToken, String xeroTenantId, UUID expenseClaimID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createExpenseClaimHistoryForHttpResponse(accessToken, xeroTenantId, expenseClaimID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createExpenseClaimHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific expense claim + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createExpenseClaimHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID expenseClaimID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createExpenseClaimHistory"); + }// verify the required parameter 'expenseClaimID' is set + if (expenseClaimID == null) { + throw new IllegalArgumentException("Missing the required parameter 'expenseClaimID' when calling createExpenseClaimHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createExpenseClaimHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createExpenseClaimHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ExpenseClaimID", expenseClaimID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates expense claims + *

200 - Success - return response of type ExpenseClaims array with newly created ExpenseClaim + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaims ExpenseClaims with array of ExpenseClaim object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ExpenseClaims + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ExpenseClaims createExpenseClaims(String accessToken, String xeroTenantId, ExpenseClaims expenseClaims, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createExpenseClaimsForHttpResponse(accessToken, xeroTenantId, expenseClaims, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createExpenseClaims -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("ExpenseClaims",object.getMessage(), e); + } + handler.validationError("ExpenseClaims",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates expense claims + *

200 - Success - return response of type ExpenseClaims array with newly created ExpenseClaim + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaims ExpenseClaims with array of ExpenseClaim object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createExpenseClaimsForHttpResponse(String accessToken, String xeroTenantId, ExpenseClaims expenseClaims, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createExpenseClaims"); + }// verify the required parameter 'expenseClaims' is set + if (expenseClaims == null) { + throw new IllegalArgumentException("Missing the required parameter 'expenseClaims' when calling createExpenseClaims"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createExpenseClaims"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(expenseClaims); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createInvoiceAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates an attachment for a specific invoice or purchase bill by filename + *

200 - Success - return response of type Attachments array with newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, byte[] body, Boolean includeOnline, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, invoiceID, fileName, body, includeOnline, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment for a specific invoice or purchase bill by filename + *

200 - Success - return response of type Attachments array with newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, byte[] body, Boolean includeOnline, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createInvoiceAttachmentByFileName"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling createInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); + if (includeOnline != null) { + String key = "IncludeOnline"; + Object value = includeOnline; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates an attachment for a specific invoice or purchase bill by filename + *

200 - Success - return response of type Attachments array with newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, File body, Boolean includeOnline, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, invoiceID, fileName, body, includeOnline, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment for a specific invoice or purchase bill by filename + *

200 - Success - return response of type Attachments array with newly created Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, File body, Boolean includeOnline, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createInvoiceAttachmentByFileName"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling createInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); + if (includeOnline != null) { + String key = "IncludeOnline"; + Object value = includeOnline; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific invoice + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createInvoiceHistory(String accessToken, String xeroTenantId, UUID invoiceID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createInvoiceHistoryForHttpResponse(accessToken, xeroTenantId, invoiceID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createInvoiceHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific invoice + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createInvoiceHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createInvoiceHistory"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling createInvoiceHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createInvoiceHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createInvoiceHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with newly created Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoices Invoices with an array of invoice objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Invoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Invoices createInvoices(String accessToken, String xeroTenantId, Invoices invoices, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createInvoicesForHttpResponse(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createInvoices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Invoices",object.getMessage(), e); + } + handler.validationError("Invoices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with newly created Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoices Invoices with an array of invoice objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createInvoicesForHttpResponse(String accessToken, String xeroTenantId, Invoices invoices, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createInvoices"); + }// verify the required parameter 'invoices' is set + if (invoices == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoices' when calling createInvoices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createInvoices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(invoices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific item + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createItemHistory(String accessToken, String xeroTenantId, UUID itemID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createItemHistoryForHttpResponse(accessToken, xeroTenantId, itemID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createItemHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific item + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createItemHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID itemID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createItemHistory"); + }// verify the required parameter 'itemID' is set + if (itemID == null) { + throw new IllegalArgumentException("Missing the required parameter 'itemID' when calling createItemHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createItemHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createItemHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ItemID", itemID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more items + *

200 - Success - return response of type Items array with newly created Item + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param items Items with an array of Item objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Items + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Items createItems(String accessToken, String xeroTenantId, Items items, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createItemsForHttpResponse(accessToken, xeroTenantId, items, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createItems -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Items",object.getMessage(), e); + } + handler.validationError("Items",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more items + *

200 - Success - return response of type Items array with newly created Item + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param items Items with an array of Item objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createItemsForHttpResponse(String accessToken, String xeroTenantId, Items items, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createItems"); + }// verify the required parameter 'items' is set + if (items == null) { + throw new IllegalArgumentException("Missing the required parameter 'items' when calling createItems"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createItems"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(items); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates linked transactions (billable expenses) + *

200 - Success - return response of type LinkedTransactions array with newly created LinkedTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransaction LinkedTransaction object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LinkedTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LinkedTransactions createLinkedTransaction(String accessToken, String xeroTenantId, LinkedTransaction linkedTransaction, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createLinkedTransactionForHttpResponse(accessToken, xeroTenantId, linkedTransaction, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createLinkedTransaction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("LinkedTransactions",object.getMessage(), e); + } + handler.validationError("LinkedTransactions",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates linked transactions (billable expenses) + *

200 - Success - return response of type LinkedTransactions array with newly created LinkedTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransaction LinkedTransaction object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createLinkedTransactionForHttpResponse(String accessToken, String xeroTenantId, LinkedTransaction linkedTransaction, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createLinkedTransaction"); + }// verify the required parameter 'linkedTransaction' is set + if (linkedTransaction == null) { + throw new IllegalArgumentException("Missing the required parameter 'linkedTransaction' when calling createLinkedTransaction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createLinkedTransaction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(linkedTransaction); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createManualJournalAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates a specific attachment for a specific manual journal by file name + *

200 - Success - return response of type Attachments array with a newly created Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createManualJournalAttachmentByFileName(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createManualJournalAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createManualJournalAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a specific attachment for a specific manual journal by file name + *

200 - Success - return response of type Attachments array with a newly created Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createManualJournalAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createManualJournalAttachmentByFileName"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling createManualJournalAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createManualJournalAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createManualJournalAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createManualJournalAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates a specific attachment for a specific manual journal by file name + *

200 - Success - return response of type Attachments array with a newly created Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createManualJournalAttachmentByFileName(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createManualJournalAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createManualJournalAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a specific attachment for a specific manual journal by file name + *

200 - Success - return response of type Attachments array with a newly created Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createManualJournalAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createManualJournalAttachmentByFileName"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling createManualJournalAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createManualJournalAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createManualJournalAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createManualJournalAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific manual journal + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createManualJournalHistoryRecord(String accessToken, String xeroTenantId, UUID manualJournalID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createManualJournalHistoryRecordForHttpResponse(accessToken, xeroTenantId, manualJournalID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createManualJournalHistoryRecord -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific manual journal + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createManualJournalHistoryRecordForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createManualJournalHistoryRecord"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling createManualJournalHistoryRecord"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createManualJournalHistoryRecord"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createManualJournalHistoryRecord"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more manual journals + *

200 - Success - return response of type ManualJournals array with newly created ManualJournal + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournals ManualJournals array with ManualJournal object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ManualJournals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ManualJournals createManualJournals(String accessToken, String xeroTenantId, ManualJournals manualJournals, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createManualJournalsForHttpResponse(accessToken, xeroTenantId, manualJournals, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createManualJournals -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("ManualJournals",object.getMessage(), e); + } + handler.validationError("ManualJournals",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more manual journals + *

200 - Success - return response of type ManualJournals array with newly created ManualJournal + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournals ManualJournals array with ManualJournal object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createManualJournalsForHttpResponse(String accessToken, String xeroTenantId, ManualJournals manualJournals, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createManualJournals"); + }// verify the required parameter 'manualJournals' is set + if (manualJournals == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournals' when calling createManualJournals"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createManualJournals"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(manualJournals); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a single allocation for a specific overpayment + *

200 - Success - return response of type Allocations array with all Allocation for Overpayments + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param allocations Allocations array with Allocation object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Allocations + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Allocations createOverpaymentAllocations(String accessToken, String xeroTenantId, UUID overpaymentID, Allocations allocations, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createOverpaymentAllocationsForHttpResponse(accessToken, xeroTenantId, overpaymentID, allocations, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createOverpaymentAllocations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Allocations",object.getMessage(), e); + } + handler.validationError("Allocations",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a single allocation for a specific overpayment + *

200 - Success - return response of type Allocations array with all Allocation for Overpayments + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param allocations Allocations array with Allocation object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createOverpaymentAllocationsForHttpResponse(String accessToken, String xeroTenantId, UUID overpaymentID, Allocations allocations, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createOverpaymentAllocations"); + }// verify the required parameter 'overpaymentID' is set + if (overpaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'overpaymentID' when calling createOverpaymentAllocations"); + }// verify the required parameter 'allocations' is set + if (allocations == null) { + throw new IllegalArgumentException("Missing the required parameter 'allocations' when calling createOverpaymentAllocations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createOverpaymentAllocations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("OverpaymentID", overpaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/Allocations"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(allocations); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific overpayment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error - API is not able to create HistoryRecord for Overpayments + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createOverpaymentHistory(String accessToken, String xeroTenantId, UUID overpaymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createOverpaymentHistoryForHttpResponse(accessToken, xeroTenantId, overpaymentID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createOverpaymentHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific overpayment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error - API is not able to create HistoryRecord for Overpayments + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createOverpaymentHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID overpaymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createOverpaymentHistory"); + }// verify the required parameter 'overpaymentID' is set + if (overpaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'overpaymentID' when calling createOverpaymentHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createOverpaymentHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createOverpaymentHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("OverpaymentID", overpaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a single payment for invoice or credit notes + *

200 - Success - return response of type Payments array for newly created Payment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param payment Request body with a single Payment object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Payments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Payments createPayment(String accessToken, String xeroTenantId, Payment payment, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPaymentForHttpResponse(accessToken, xeroTenantId, payment, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Payments",object.getMessage(), e); + } + handler.validationError("Payments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a single payment for invoice or credit notes + *

200 - Success - return response of type Payments array for newly created Payment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param payment Request body with a single Payment object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPaymentForHttpResponse(String accessToken, String xeroTenantId, Payment payment, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayment"); + }// verify the required parameter 'payment' is set + if (payment == null) { + throw new IllegalArgumentException("Missing the required parameter 'payment' when calling createPayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payment); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific payment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error - API is not able to create HistoryRecord for Payments + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createPaymentHistory(String accessToken, String xeroTenantId, UUID paymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPaymentHistoryForHttpResponse(accessToken, xeroTenantId, paymentID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPaymentHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific payment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error - API is not able to create HistoryRecord for Payments + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPaymentHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID paymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPaymentHistory"); + }// verify the required parameter 'paymentID' is set + if (paymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentID' when calling createPaymentHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createPaymentHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPaymentHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PaymentID", paymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a payment service + *

200 - Success - return response of type PaymentServices array for newly created PaymentService + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param paymentServices PaymentServices array with PaymentService object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PaymentServices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentServices createPaymentService(String accessToken, String xeroTenantId, PaymentServices paymentServices, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPaymentServiceForHttpResponse(accessToken, xeroTenantId, paymentServices, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPaymentService -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("PaymentServices",object.getMessage(), e); + } + handler.validationError("PaymentServices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a payment service + *

200 - Success - return response of type PaymentServices array for newly created PaymentService + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param paymentServices PaymentServices array with PaymentService object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPaymentServiceForHttpResponse(String accessToken, String xeroTenantId, PaymentServices paymentServices, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPaymentService"); + }// verify the required parameter 'paymentServices' is set + if (paymentServices == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentServices' when calling createPaymentService"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPaymentService"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaymentServices"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(paymentServices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates multiple payments for invoices or credit notes + *

200 - Success - return response of type Payments array for newly created Payment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param payments Payments array with Payment object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Payments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Payments createPayments(String accessToken, String xeroTenantId, Payments payments, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPaymentsForHttpResponse(accessToken, xeroTenantId, payments, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Payments",object.getMessage(), e); + } + handler.validationError("Payments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates multiple payments for invoices or credit notes + *

200 - Success - return response of type Payments array for newly created Payment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param payments Payments array with Payment object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPaymentsForHttpResponse(String accessToken, String xeroTenantId, Payments payments, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayments"); + }// verify the required parameter 'payments' is set + if (payments == null) { + throw new IllegalArgumentException("Missing the required parameter 'payments' when calling createPayments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payments); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Allows you to create an Allocation for prepayments + *

200 - Success - return response of type Allocations array of Allocation for all Prepayment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param allocations Allocations with an array of Allocation object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Allocations + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Allocations createPrepaymentAllocations(String accessToken, String xeroTenantId, UUID prepaymentID, Allocations allocations, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPrepaymentAllocationsForHttpResponse(accessToken, xeroTenantId, prepaymentID, allocations, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPrepaymentAllocations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Allocations",object.getMessage(), e); + } + handler.validationError("Allocations",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Allows you to create an Allocation for prepayments + *

200 - Success - return response of type Allocations array of Allocation for all Prepayment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param allocations Allocations with an array of Allocation object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPrepaymentAllocationsForHttpResponse(String accessToken, String xeroTenantId, UUID prepaymentID, Allocations allocations, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPrepaymentAllocations"); + }// verify the required parameter 'prepaymentID' is set + if (prepaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'prepaymentID' when calling createPrepaymentAllocations"); + }// verify the required parameter 'allocations' is set + if (allocations == null) { + throw new IllegalArgumentException("Missing the required parameter 'allocations' when calling createPrepaymentAllocations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPrepaymentAllocations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PrepaymentID", prepaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/Allocations"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(allocations); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific prepayment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - Unsupported - return response incorrect exception, API is not able to create HistoryRecord for Expense Claims + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createPrepaymentHistory(String accessToken, String xeroTenantId, UUID prepaymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPrepaymentHistoryForHttpResponse(accessToken, xeroTenantId, prepaymentID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPrepaymentHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific prepayment + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - Unsupported - return response incorrect exception, API is not able to create HistoryRecord for Expense Claims + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPrepaymentHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID prepaymentID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPrepaymentHistory"); + }// verify the required parameter 'prepaymentID' is set + if (prepaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'prepaymentID' when calling createPrepaymentHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createPrepaymentHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPrepaymentHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PrepaymentID", prepaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createPurchaseOrderAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates attachment for a specific purchase order + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createPurchaseOrderAttachmentByFileName(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPurchaseOrderAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPurchaseOrderAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates attachment for a specific purchase order + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createPurchaseOrderAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling createPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createPurchaseOrderAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPurchaseOrderAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates attachment for a specific purchase order + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createPurchaseOrderAttachmentByFileName(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPurchaseOrderAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPurchaseOrderAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates attachment for a specific purchase order + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPurchaseOrderAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling createPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createPurchaseOrderAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPurchaseOrderAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific purchase orders + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createPurchaseOrderHistory(String accessToken, String xeroTenantId, UUID purchaseOrderID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPurchaseOrderHistoryForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPurchaseOrderHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific purchase orders + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPurchaseOrderHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPurchaseOrderHistory"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling createPurchaseOrderHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createPurchaseOrderHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPurchaseOrderHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more purchase orders + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrders PurchaseOrders with an array of PurchaseOrder object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PurchaseOrders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PurchaseOrders createPurchaseOrders(String accessToken, String xeroTenantId, PurchaseOrders purchaseOrders, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPurchaseOrdersForHttpResponse(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPurchaseOrders -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("PurchaseOrders",object.getMessage(), e); + } + handler.validationError("PurchaseOrders",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more purchase orders + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrders PurchaseOrders with an array of PurchaseOrder object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPurchaseOrdersForHttpResponse(String accessToken, String xeroTenantId, PurchaseOrders purchaseOrders, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPurchaseOrders"); + }// verify the required parameter 'purchaseOrders' is set + if (purchaseOrders == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrders' when calling createPurchaseOrders"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPurchaseOrders"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(purchaseOrders); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createQuoteAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates attachment for a specific quote + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createQuoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID quoteID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createQuoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createQuoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates attachment for a specific quote + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createQuoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createQuoteAttachmentByFileName"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling createQuoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createQuoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createQuoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createQuoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates attachment for a specific quote + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createQuoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID quoteID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createQuoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createQuoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates attachment for a specific quote + *

200 - Success - return response of type Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createQuoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createQuoteAttachmentByFileName"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling createQuoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createQuoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createQuoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createQuoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific quote + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createQuoteHistory(String accessToken, String xeroTenantId, UUID quoteID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createQuoteHistoryForHttpResponse(accessToken, xeroTenantId, quoteID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createQuoteHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific quote + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createQuoteHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createQuoteHistory"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling createQuoteHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createQuoteHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createQuoteHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Create one or more quotes + *

200 - Success - return response of type Quotes with array with newly created Quote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quotes Quotes with an array of Quote object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Quotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Quotes createQuotes(String accessToken, String xeroTenantId, Quotes quotes, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createQuotesForHttpResponse(accessToken, xeroTenantId, quotes, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createQuotes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Quotes",object.getMessage(), e); + } + handler.validationError("Quotes",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Create one or more quotes + *

200 - Success - return response of type Quotes with array with newly created Quote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quotes Quotes with an array of Quote object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createQuotesForHttpResponse(String accessToken, String xeroTenantId, Quotes quotes, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createQuotes"); + }// verify the required parameter 'quotes' is set + if (quotes == null) { + throw new IllegalArgumentException("Missing the required parameter 'quotes' when calling createQuotes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createQuotes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(quotes); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates draft expense claim receipts for any user + *

200 - Success - return response of type Receipts array for newly created Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receipts Receipts with an array of Receipt object in body of request + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Receipts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Receipts createReceipt(String accessToken, String xeroTenantId, Receipts receipts, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createReceiptForHttpResponse(accessToken, xeroTenantId, receipts, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createReceipt -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Receipts",object.getMessage(), e); + } + handler.validationError("Receipts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates draft expense claim receipts for any user + *

200 - Success - return response of type Receipts array for newly created Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receipts Receipts with an array of Receipt object in body of request + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createReceiptForHttpResponse(String accessToken, String xeroTenantId, Receipts receipts, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createReceipt"); + }// verify the required parameter 'receipts' is set + if (receipts == null) { + throw new IllegalArgumentException("Missing the required parameter 'receipts' when calling createReceipt"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createReceipt"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(receipts); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createReceiptAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates an attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with newly created Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createReceiptAttachmentByFileName(String accessToken, String xeroTenantId, UUID receiptID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createReceiptAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createReceiptAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with newly created Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createReceiptAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createReceiptAttachmentByFileName"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling createReceiptAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createReceiptAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createReceiptAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createReceiptAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates an attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with newly created Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createReceiptAttachmentByFileName(String accessToken, String xeroTenantId, UUID receiptID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createReceiptAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createReceiptAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with newly created Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createReceiptAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createReceiptAttachmentByFileName"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling createReceiptAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createReceiptAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createReceiptAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createReceiptAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific receipt + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - Unsupported - return response incorrect exception, API is not able to create HistoryRecord for Receipts + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createReceiptHistory(String accessToken, String xeroTenantId, UUID receiptID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createReceiptHistoryForHttpResponse(accessToken, xeroTenantId, receiptID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createReceiptHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific receipt + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - Unsupported - return response incorrect exception, API is not able to create HistoryRecord for Receipts + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createReceiptHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createReceiptHistory"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling createReceiptHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createReceiptHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createReceiptHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for createRepeatingInvoiceAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Creates an attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments createRepeatingInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createRepeatingInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createRepeatingInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse createRepeatingInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling createRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createRepeatingInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createRepeatingInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Creates an attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments createRepeatingInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createRepeatingInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createRepeatingInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createRepeatingInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling createRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling createRepeatingInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createRepeatingInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a history record for a specific repeating invoice + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords createRepeatingInvoiceHistory(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createRepeatingInvoiceHistoryForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, historyRecords, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createRepeatingInvoiceHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("HistoryRecords",object.getMessage(), e); + } + handler.validationError("HistoryRecords",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a history record for a specific repeating invoice + *

200 - Success - return response of type HistoryRecords array of HistoryRecord objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param historyRecords HistoryRecords containing an array of HistoryRecord objects in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createRepeatingInvoiceHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, HistoryRecords historyRecords, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createRepeatingInvoiceHistory"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling createRepeatingInvoiceHistory"); + }// verify the required parameter 'historyRecords' is set + if (historyRecords == null) { + throw new IllegalArgumentException("Missing the required parameter 'historyRecords' when calling createRepeatingInvoiceHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createRepeatingInvoiceHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(historyRecords); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more repeating invoice templates + *

200 - Success - return response of type RepeatingInvoices array with newly created RepeatingInvoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return RepeatingInvoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public RepeatingInvoices createRepeatingInvoices(String accessToken, String xeroTenantId, RepeatingInvoices repeatingInvoices, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createRepeatingInvoicesForHttpResponse(accessToken, xeroTenantId, repeatingInvoices, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createRepeatingInvoices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("RepeatingInvoices",object.getMessage(), e); + } + handler.validationError("RepeatingInvoices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more repeating invoice templates + *

200 - Success - return response of type RepeatingInvoices array with newly created RepeatingInvoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createRepeatingInvoicesForHttpResponse(String accessToken, String xeroTenantId, RepeatingInvoices repeatingInvoices, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createRepeatingInvoices"); + }// verify the required parameter 'repeatingInvoices' is set + if (repeatingInvoices == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoices' when calling createRepeatingInvoices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createRepeatingInvoices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(repeatingInvoices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more tax rates + *

200 - Success - return response of type TaxRates array newly created TaxRate + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param taxRates TaxRates array with TaxRate object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TaxRates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TaxRates createTaxRates(String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTaxRatesForHttpResponse(accessToken, xeroTenantId, taxRates, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTaxRates -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("TaxRates",object.getMessage(), e); + } + handler.validationError("TaxRates",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more tax rates + *

200 - Success - return response of type TaxRates array newly created TaxRate + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param taxRates TaxRates array with TaxRate object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTaxRatesForHttpResponse(String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTaxRates"); + }// verify the required parameter 'taxRates' is set + if (taxRates == null) { + throw new IllegalArgumentException("Missing the required parameter 'taxRates' when calling createTaxRates"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTaxRates"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(taxRates); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Create tracking categories + *

200 - Success - return response of type TrackingCategories array of newly created TrackingCategory + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategory TrackingCategory object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TrackingCategories + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingCategories createTrackingCategory(String accessToken, String xeroTenantId, TrackingCategory trackingCategory, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTrackingCategoryForHttpResponse(accessToken, xeroTenantId, trackingCategory, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTrackingCategory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("TrackingCategories",object.getMessage(), e); + } + handler.validationError("TrackingCategories",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Create tracking categories + *

200 - Success - return response of type TrackingCategories array of newly created TrackingCategory + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategory TrackingCategory object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTrackingCategoryForHttpResponse(String accessToken, String xeroTenantId, TrackingCategory trackingCategory, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTrackingCategory"); + }// verify the required parameter 'trackingCategory' is set + if (trackingCategory == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategory' when calling createTrackingCategory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTrackingCategory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(trackingCategory); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates options for a specific tracking category + *

200 - Success - return response of type TrackingOptions array of options for a specified category + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingOption TrackingOption object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TrackingOptions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingOptions createTrackingOptions(String accessToken, String xeroTenantId, UUID trackingCategoryID, TrackingOption trackingOption, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTrackingOptionsForHttpResponse(accessToken, xeroTenantId, trackingCategoryID, trackingOption, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTrackingOptions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("TrackingOptions",object.getMessage(), e); + } + handler.validationError("TrackingOptions",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates options for a specific tracking category + *

200 - Success - return response of type TrackingOptions array of options for a specified category + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingOption TrackingOption object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTrackingOptionsForHttpResponse(String accessToken, String xeroTenantId, UUID trackingCategoryID, TrackingOption trackingOption, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTrackingOptions"); + }// verify the required parameter 'trackingCategoryID' is set + if (trackingCategoryID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategoryID' when calling createTrackingOptions"); + }// verify the required parameter 'trackingOption' is set + if (trackingOption == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingOption' when calling createTrackingOptions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTrackingOptions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TrackingCategoryID", trackingCategoryID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}/Options"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(trackingOption); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a chart of accounts + *

200 - Success - delete existing Account and return response of type Accounts array with deleted Account + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accessToken Authorization token for user set in header of each request + * @return Accounts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Accounts deleteAccount(String accessToken, String xeroTenantId, UUID accountID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteAccountForHttpResponse(accessToken, xeroTenantId, accountID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteAccount -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Accounts",object.getMessage(), e); + } + handler.validationError("Accounts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a chart of accounts + *

200 - Success - delete existing Account and return response of type Accounts array with deleted Account + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteAccountForHttpResponse(String accessToken, String xeroTenantId, UUID accountID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteAccount"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling deleteAccount"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteAccount"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific batch payment for invoices and credit notes + *

200 - Success - return response of type BatchPayments array for updated BatchPayment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentDelete The batchPaymentDelete parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BatchPayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BatchPayments deleteBatchPayment(String accessToken, String xeroTenantId, BatchPaymentDelete batchPaymentDelete, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteBatchPaymentForHttpResponse(accessToken, xeroTenantId, batchPaymentDelete, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteBatchPayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("BatchPayments",object.getMessage(), e); + } + handler.validationError("BatchPayments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific batch payment for invoices and credit notes + *

200 - Success - return response of type BatchPayments array for updated BatchPayment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentDelete The batchPaymentDelete parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteBatchPaymentForHttpResponse(String accessToken, String xeroTenantId, BatchPaymentDelete batchPaymentDelete, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteBatchPayment"); + }// verify the required parameter 'batchPaymentDelete' is set + if (batchPaymentDelete == null) { + throw new IllegalArgumentException("Missing the required parameter 'batchPaymentDelete' when calling deleteBatchPayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteBatchPayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(batchPaymentDelete); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific batch payment for invoices and credit notes + *

200 - Success - return response of type BatchPayments array for updated BatchPayment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param batchPaymentDeleteByUrlParam The batchPaymentDeleteByUrlParam parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BatchPayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BatchPayments deleteBatchPaymentByUrlParam(String accessToken, String xeroTenantId, UUID batchPaymentID, BatchPaymentDeleteByUrlParam batchPaymentDeleteByUrlParam, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteBatchPaymentByUrlParamForHttpResponse(accessToken, xeroTenantId, batchPaymentID, batchPaymentDeleteByUrlParam, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteBatchPaymentByUrlParam -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific batch payment for invoices and credit notes + *

200 - Success - return response of type BatchPayments array for updated BatchPayment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param batchPaymentDeleteByUrlParam The batchPaymentDeleteByUrlParam parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteBatchPaymentByUrlParamForHttpResponse(String accessToken, String xeroTenantId, UUID batchPaymentID, BatchPaymentDeleteByUrlParam batchPaymentDeleteByUrlParam, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteBatchPaymentByUrlParam"); + }// verify the required parameter 'batchPaymentID' is set + if (batchPaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'batchPaymentID' when calling deleteBatchPaymentByUrlParam"); + }// verify the required parameter 'batchPaymentDeleteByUrlParam' is set + if (batchPaymentDeleteByUrlParam == null) { + throw new IllegalArgumentException("Missing the required parameter 'batchPaymentDeleteByUrlParam' when calling deleteBatchPaymentByUrlParam"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteBatchPaymentByUrlParam"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BatchPaymentID", batchPaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(batchPaymentDeleteByUrlParam); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific contact from a contact group using a unique contact Id + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteContactGroupContact(String accessToken, String xeroTenantId, UUID contactGroupID, UUID contactID) throws IOException { + try { + deleteContactGroupContactForHttpResponse(accessToken, xeroTenantId, contactGroupID, contactID); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteContactGroupContact -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a specific contact from a contact group using a unique contact Id + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteContactGroupContactForHttpResponse(String accessToken, String xeroTenantId, UUID contactGroupID, UUID contactID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteContactGroupContact"); + }// verify the required parameter 'contactGroupID' is set + if (contactGroupID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactGroupID' when calling deleteContactGroupContact"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling deleteContactGroupContact"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteContactGroupContact"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactGroupID", contactGroupID); + uriVariables.put("ContactID", contactID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}/Contacts/{ContactID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes all contacts from a specific contact group + *

204 - Success - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteContactGroupContacts(String accessToken, String xeroTenantId, UUID contactGroupID) throws IOException { + try { + deleteContactGroupContactsForHttpResponse(accessToken, xeroTenantId, contactGroupID); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteContactGroupContacts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes all contacts from a specific contact group + *

204 - Success - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteContactGroupContactsForHttpResponse(String accessToken, String xeroTenantId, UUID contactGroupID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteContactGroupContacts"); + }// verify the required parameter 'contactGroupID' is set + if (contactGroupID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactGroupID' when calling deleteContactGroupContacts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteContactGroupContacts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept(""); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactGroupID", contactGroupID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}/Contacts"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes an Allocation from a Credit Note + *

200 - Success - return response of type Allocation with the isDeleted flag as true + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param allocationID Unique identifier for Allocation object + * @param accessToken Authorization token for user set in header of each request + * @return Allocation + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Allocation deleteCreditNoteAllocations(String accessToken, String xeroTenantId, UUID creditNoteID, UUID allocationID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteCreditNoteAllocationsForHttpResponse(accessToken, xeroTenantId, creditNoteID, allocationID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteCreditNoteAllocations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes an Allocation from a Credit Note + *

200 - Success - return response of type Allocation with the isDeleted flag as true + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param allocationID Unique identifier for Allocation object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteCreditNoteAllocationsForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, UUID allocationID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteCreditNoteAllocations"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling deleteCreditNoteAllocations"); + }// verify the required parameter 'allocationID' is set + if (allocationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'allocationID' when calling deleteCreditNoteAllocations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteCreditNoteAllocations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + uriVariables.put("AllocationID", allocationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Allocations/{AllocationID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific item + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteItem(String accessToken, String xeroTenantId, UUID itemID) throws IOException { + try { + deleteItemForHttpResponse(accessToken, xeroTenantId, itemID); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteItem -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a specific item + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteItemForHttpResponse(String accessToken, String xeroTenantId, UUID itemID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteItem"); + }// verify the required parameter 'itemID' is set + if (itemID == null) { + throw new IllegalArgumentException("Missing the required parameter 'itemID' when calling deleteItem"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteItem"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ItemID", itemID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific linked transactions (billable expenses) + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransactionID Unique identifier for a LinkedTransaction + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteLinkedTransaction(String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { + try { + deleteLinkedTransactionForHttpResponse(accessToken, xeroTenantId, linkedTransactionID); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteLinkedTransaction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a specific linked transactions (billable expenses) + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransactionID Unique identifier for a LinkedTransaction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteLinkedTransactionForHttpResponse(String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteLinkedTransaction"); + }// verify the required parameter 'linkedTransactionID' is set + if (linkedTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'linkedTransactionID' when calling deleteLinkedTransaction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteLinkedTransaction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LinkedTransactionID", linkedTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions/{LinkedTransactionID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes an Allocation from an overpayment + *

200 - Success - return response of type Allocation with the isDeleted flag as true + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param allocationID Unique identifier for Allocation object + * @param accessToken Authorization token for user set in header of each request + * @return Allocation + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Allocation deleteOverpaymentAllocations(String accessToken, String xeroTenantId, UUID overpaymentID, UUID allocationID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteOverpaymentAllocationsForHttpResponse(accessToken, xeroTenantId, overpaymentID, allocationID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteOverpaymentAllocations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes an Allocation from an overpayment + *

200 - Success - return response of type Allocation with the isDeleted flag as true + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param allocationID Unique identifier for Allocation object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteOverpaymentAllocationsForHttpResponse(String accessToken, String xeroTenantId, UUID overpaymentID, UUID allocationID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteOverpaymentAllocations"); + }// verify the required parameter 'overpaymentID' is set + if (overpaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'overpaymentID' when calling deleteOverpaymentAllocations"); + }// verify the required parameter 'allocationID' is set + if (allocationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'allocationID' when calling deleteOverpaymentAllocations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteOverpaymentAllocations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("OverpaymentID", overpaymentID); + uriVariables.put("AllocationID", allocationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/Allocations/{AllocationID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific payment for invoices and credit notes + *

200 - Success - return response of type Payments array for updated Payment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param paymentDelete The paymentDelete parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Payments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Payments deletePayment(String accessToken, String xeroTenantId, UUID paymentID, PaymentDelete paymentDelete, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deletePaymentForHttpResponse(accessToken, xeroTenantId, paymentID, paymentDelete, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deletePayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Payments",object.getMessage(), e); + } + handler.validationError("Payments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific payment for invoices and credit notes + *

200 - Success - return response of type Payments array for updated Payment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param paymentDelete The paymentDelete parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deletePaymentForHttpResponse(String accessToken, String xeroTenantId, UUID paymentID, PaymentDelete paymentDelete, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deletePayment"); + }// verify the required parameter 'paymentID' is set + if (paymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentID' when calling deletePayment"); + }// verify the required parameter 'paymentDelete' is set + if (paymentDelete == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentDelete' when calling deletePayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deletePayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PaymentID", paymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(paymentDelete); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes an Allocation from a Prepayment + *

200 - Success - return response of type Allocation with the isDeleted flag as true + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param allocationID Unique identifier for Allocation object + * @param accessToken Authorization token for user set in header of each request + * @return Allocation + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Allocation deletePrepaymentAllocations(String accessToken, String xeroTenantId, UUID prepaymentID, UUID allocationID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deletePrepaymentAllocationsForHttpResponse(accessToken, xeroTenantId, prepaymentID, allocationID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deletePrepaymentAllocations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes an Allocation from a Prepayment + *

200 - Success - return response of type Allocation with the isDeleted flag as true + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param allocationID Unique identifier for Allocation object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deletePrepaymentAllocationsForHttpResponse(String accessToken, String xeroTenantId, UUID prepaymentID, UUID allocationID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deletePrepaymentAllocations"); + }// verify the required parameter 'prepaymentID' is set + if (prepaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'prepaymentID' when calling deletePrepaymentAllocations"); + }// verify the required parameter 'allocationID' is set + if (allocationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'allocationID' when calling deletePrepaymentAllocations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deletePrepaymentAllocations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PrepaymentID", prepaymentID); + uriVariables.put("AllocationID", allocationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/Allocations/{AllocationID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific tracking category + *

200 - Success - return response of type TrackingCategories array of deleted TrackingCategory + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param accessToken Authorization token for user set in header of each request + * @return TrackingCategories + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingCategories deleteTrackingCategory(String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteTrackingCategoryForHttpResponse(accessToken, xeroTenantId, trackingCategoryID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTrackingCategory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a specific tracking category + *

200 - Success - return response of type TrackingCategories array of deleted TrackingCategory + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTrackingCategoryForHttpResponse(String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTrackingCategory"); + }// verify the required parameter 'trackingCategoryID' is set + if (trackingCategoryID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategoryID' when calling deleteTrackingCategory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTrackingCategory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TrackingCategoryID", trackingCategoryID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific option for a specific tracking category + *

200 - Success - return response of type TrackingOptions array of remaining options for a specified category + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingOptionID Unique identifier for a Tracking Option + * @param accessToken Authorization token for user set in header of each request + * @return TrackingOptions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingOptions deleteTrackingOptions(String accessToken, String xeroTenantId, UUID trackingCategoryID, UUID trackingOptionID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteTrackingOptionsForHttpResponse(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTrackingOptions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a specific option for a specific tracking category + *

200 - Success - return response of type TrackingOptions array of remaining options for a specified category + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingOptionID Unique identifier for a Tracking Option + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTrackingOptionsForHttpResponse(String accessToken, String xeroTenantId, UUID trackingCategoryID, UUID trackingOptionID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTrackingOptions"); + }// verify the required parameter 'trackingCategoryID' is set + if (trackingCategoryID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategoryID' when calling deleteTrackingOptions"); + }// verify the required parameter 'trackingOptionID' is set + if (trackingOptionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingOptionID' when calling deleteTrackingOptions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTrackingOptions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TrackingCategoryID", trackingCategoryID); + uriVariables.put("TrackingOptionID", trackingOptionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Sends a copy of a specific invoice to related contact via email + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param requestEmpty The requestEmpty parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void emailInvoice(String accessToken, String xeroTenantId, UUID invoiceID, RequestEmpty requestEmpty, String idempotencyKey) throws IOException { + try { + emailInvoiceForHttpResponse(accessToken, xeroTenantId, invoiceID, requestEmpty, idempotencyKey); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : emailInvoice -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("",object.getMessage(), e); + } + handler.validationError("",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Sends a copy of a specific invoice to related contact via email + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param requestEmpty The requestEmpty parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse emailInvoiceForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, RequestEmpty requestEmpty, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling emailInvoice"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling emailInvoice"); + }// verify the required parameter 'requestEmpty' is set + if (requestEmpty == null) { + throw new IllegalArgumentException("Missing the required parameter 'requestEmpty' when calling emailInvoice"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling emailInvoice"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Email"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(requestEmpty); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a single chart of accounts by using a unique account Id + *

200 - Success - return response of type Accounts array with one Account + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accessToken Authorization token for user set in header of each request + * @return Accounts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Accounts getAccount(String accessToken, String xeroTenantId, UUID accountID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountForHttpResponse(accessToken, xeroTenantId, accountID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccount -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a single chart of accounts by using a unique account Id + *

200 - Success - return response of type Accounts array with one Account + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountForHttpResponse(String accessToken, String xeroTenantId, UUID accountID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccount"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling getAccount"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccount"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves an attachment for a specific account by filename + *

200 - Success - return response of attachment for Account as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getAccountAttachmentByFileName(String accessToken, String xeroTenantId, UUID accountID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, accountID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccountAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves an attachment for a specific account by filename + *

200 - Success - return response of attachment for Account as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID accountID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccountAttachmentByFileName"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling getAccountAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getAccountAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getAccountAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccountAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific account using a unique attachment Id + *

200 - Success - return response of attachment for Account as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getAccountAttachmentById(String accessToken, String xeroTenantId, UUID accountID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountAttachmentByIdForHttpResponse(accessToken, xeroTenantId, accountID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccountAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific account using a unique attachment Id + *

200 - Success - return response of attachment for Account as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID accountID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccountAttachmentById"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling getAccountAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getAccountAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getAccountAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccountAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments for a specific accounts by using a unique account Id + *

200 - Success - return response of type Attachments array of Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getAccountAttachments(String accessToken, String xeroTenantId, UUID accountID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountAttachmentsForHttpResponse(accessToken, xeroTenantId, accountID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccountAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments for a specific accounts by using a unique account Id + *

200 - Success - return response of type Attachments array of Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID accountID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccountAttachments"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling getAccountAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccountAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves the full chart of accounts + *

200 - Success - return response of type Accounts array with 0 to n Account + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return Accounts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Accounts getAccounts(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccounts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves the full chart of accounts + *

200 - Success - return response of type Accounts array with 0 to n Account + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccounts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccounts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a single spent or received money transaction by using a unique bank transaction Id + *

200 - Success - return response of type BankTransactions array with a specific BankTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return BankTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransactions getBankTransaction(String accessToken, String xeroTenantId, UUID bankTransactionID, Integer unitdp) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransactionForHttpResponse(accessToken, xeroTenantId, bankTransactionID, unitdp); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransaction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a single spent or received money transaction by using a unique bank transaction Id + *

200 - Success - return response of type BankTransactions array with a specific BankTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransactionForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, Integer unitdp) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransaction"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling getBankTransaction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransaction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific bank transaction by filename + *

200 - Success - return response of attachment for BankTransaction as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getBankTransactionAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransactionAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransactionID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransactionAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific bank transaction by filename + *

200 - Success - return response of attachment for BankTransaction as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransactionAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransactionAttachmentByFileName"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling getBankTransactionAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getBankTransactionAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getBankTransactionAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransactionAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id + *

200 - Success - return response of attachment for BankTransaction as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getBankTransactionAttachmentById(String accessToken, String xeroTenantId, UUID bankTransactionID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransactionAttachmentByIdForHttpResponse(accessToken, xeroTenantId, bankTransactionID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransactionAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id + *

200 - Success - return response of attachment for BankTransaction as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransactionAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransactionAttachmentById"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling getBankTransactionAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getBankTransactionAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getBankTransactionAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransactionAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves any attachments from a specific bank transactions + *

200 - Success - return response of type Attachments array with 0 to n Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getBankTransactionAttachments(String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransactionAttachmentsForHttpResponse(accessToken, xeroTenantId, bankTransactionID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransactionAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves any attachments from a specific bank transactions + *

200 - Success - return response of type Attachments array with 0 to n Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransactionAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransactionAttachments"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling getBankTransactionAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransactionAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves any spent or received money transactions + *

200 - Success - return response of type BankTransactions array with 0 to n BankTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page Up to 100 bank transactions will be returned in a single API call with line items details + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return BankTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransactions getBankTransactions(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransactionsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransactions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves any spent or received money transactions + *

200 - Success - return response of type BankTransactions array with 0 to n BankTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page Up to 100 bank transactions will be returned in a single API call with line items details + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransactionsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransactions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransactions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history from a specific bank transaction using a unique bank transaction Id + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getBankTransactionsHistory(String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransactionsHistoryForHttpResponse(accessToken, xeroTenantId, bankTransactionID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransactionsHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history from a specific bank transaction using a unique bank transaction Id + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransactionsHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransactionsHistory"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling getBankTransactionsHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransactionsHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves specific bank transfers by using a unique bank transfer Id + *

200 - Success - return response of BankTransfers array with one BankTransfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param accessToken Authorization token for user set in header of each request + * @return BankTransfers + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransfers getBankTransfer(String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransferForHttpResponse(accessToken, xeroTenantId, bankTransferID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransfer -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves specific bank transfers by using a unique bank transfer Id + *

200 - Success - return response of BankTransfers array with one BankTransfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransferForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransfer"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling getBankTransfer"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransfer"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment on a specific bank transfer by file name + *

200 - Success - return response of binary data from the Attachment to a Bank Transfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getBankTransferAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransferAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransferID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransferAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment on a specific bank transfer by file name + *

200 - Success - return response of binary data from the Attachment to a Bank Transfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransferAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransferAttachmentByFileName"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling getBankTransferAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getBankTransferAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getBankTransferAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransferAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID + *

200 - Success - return response of binary data from the Attachment to a Bank Transfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getBankTransferAttachmentById(String accessToken, String xeroTenantId, UUID bankTransferID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransferAttachmentByIdForHttpResponse(accessToken, xeroTenantId, bankTransferID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransferAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID + *

200 - Success - return response of binary data from the Attachment to a Bank Transfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransferAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransferAttachmentById"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling getBankTransferAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getBankTransferAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getBankTransferAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransferAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments from a specific bank transfer + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getBankTransferAttachments(String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransferAttachmentsForHttpResponse(accessToken, xeroTenantId, bankTransferID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransferAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments from a specific bank transfer + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransferAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransferAttachments"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling getBankTransferAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransferAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history from a specific bank transfer using a unique bank transfer Id + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getBankTransferHistory(String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransferHistoryForHttpResponse(accessToken, xeroTenantId, bankTransferID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransferHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history from a specific bank transfer using a unique bank transfer Id + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransferHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransferHistory"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling getBankTransferHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransferHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves all bank transfers + *

200 - Success - return response of BankTransfers array of 0 to N BankTransfer + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return BankTransfers + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransfers getBankTransfers(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankTransfersForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankTransfers -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves all bank transfers + *

200 - Success - return response of BankTransfers array of 0 to N BankTransfer + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankTransfersForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankTransfers"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankTransfers"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific batch payment using a unique batch payment Id + *

200 - Success - return response of type BatchPayments array with matching batch payment Id + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param accessToken Authorization token for user set in header of each request + * @return BatchPayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BatchPayments getBatchPayment(String accessToken, String xeroTenantId, UUID batchPaymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBatchPaymentForHttpResponse(accessToken, xeroTenantId, batchPaymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBatchPayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific batch payment using a unique batch payment Id + *

200 - Success - return response of type BatchPayments array with matching batch payment Id + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBatchPaymentForHttpResponse(String accessToken, String xeroTenantId, UUID batchPaymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBatchPayment"); + }// verify the required parameter 'batchPaymentID' is set + if (batchPaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'batchPaymentID' when calling getBatchPayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBatchPayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BatchPaymentID", batchPaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history from a specific batch payment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getBatchPaymentHistory(String accessToken, String xeroTenantId, UUID batchPaymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBatchPaymentHistoryForHttpResponse(accessToken, xeroTenantId, batchPaymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBatchPaymentHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history from a specific batch payment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param batchPaymentID Unique identifier for BatchPayment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBatchPaymentHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID batchPaymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBatchPaymentHistory"); + }// verify the required parameter 'batchPaymentID' is set + if (batchPaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'batchPaymentID' when calling getBatchPaymentHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBatchPaymentHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BatchPaymentID", batchPaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves either one or many batch payments for invoices + *

200 - Success - return response of type BatchPayments array of BatchPayment objects + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return BatchPayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BatchPayments getBatchPayments(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBatchPaymentsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBatchPayments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves either one or many batch payments for invoices + *

200 - Success - return response of type BatchPayments array of BatchPayment objects + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBatchPaymentsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBatchPayments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBatchPayments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific branding theme using a unique branding theme Id + *

200 - Success - return response of type BrandingThemes with one BrandingTheme + * @param xeroTenantId Xero identifier for Tenant + * @param brandingThemeID Unique identifier for a Branding Theme + * @param accessToken Authorization token for user set in header of each request + * @return BrandingThemes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BrandingThemes getBrandingTheme(String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBrandingThemeForHttpResponse(accessToken, xeroTenantId, brandingThemeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBrandingTheme -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific branding theme using a unique branding theme Id + *

200 - Success - return response of type BrandingThemes with one BrandingTheme + * @param xeroTenantId Xero identifier for Tenant + * @param brandingThemeID Unique identifier for a Branding Theme + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBrandingThemeForHttpResponse(String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBrandingTheme"); + }// verify the required parameter 'brandingThemeID' is set + if (brandingThemeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'brandingThemeID' when calling getBrandingTheme"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBrandingTheme"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BrandingThemeID", brandingThemeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BrandingThemes/{BrandingThemeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves the payment services for a specific branding theme + *

200 - Success - return response of type PaymentServices array with 0 to N PaymentService + * @param xeroTenantId Xero identifier for Tenant + * @param brandingThemeID Unique identifier for a Branding Theme + * @param accessToken Authorization token for user set in header of each request + * @return PaymentServices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentServices getBrandingThemePaymentServices(String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBrandingThemePaymentServicesForHttpResponse(accessToken, xeroTenantId, brandingThemeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBrandingThemePaymentServices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves the payment services for a specific branding theme + *

200 - Success - return response of type PaymentServices array with 0 to N PaymentService + * @param xeroTenantId Xero identifier for Tenant + * @param brandingThemeID Unique identifier for a Branding Theme + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBrandingThemePaymentServicesForHttpResponse(String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBrandingThemePaymentServices"); + }// verify the required parameter 'brandingThemeID' is set + if (brandingThemeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'brandingThemeID' when calling getBrandingThemePaymentServices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBrandingThemePaymentServices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BrandingThemeID", brandingThemeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BrandingThemes/{BrandingThemeID}/PaymentServices"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves all the branding themes + *

200 - Success - return response of type BrandingThemes + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return BrandingThemes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BrandingThemes getBrandingThemes(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBrandingThemesForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBrandingThemes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves all the branding themes + *

200 - Success - return response of type BrandingThemes + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBrandingThemesForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBrandingThemes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBrandingThemes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BrandingThemes"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific budget, which includes budget lines + *

200 - Success - return response of type Invoices array with specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param budgetID Unique identifier for Budgets + * @param dateTo Filter by start date + * @param dateFrom Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return Budgets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Budgets getBudget(String accessToken, String xeroTenantId, UUID budgetID, LocalDate dateTo, LocalDate dateFrom) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBudgetForHttpResponse(accessToken, xeroTenantId, budgetID, dateTo, dateFrom); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBudget -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific budget, which includes budget lines + *

200 - Success - return response of type Invoices array with specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param budgetID Unique identifier for Budgets + * @param dateTo Filter by start date + * @param dateFrom Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBudgetForHttpResponse(String accessToken, String xeroTenantId, UUID budgetID, LocalDate dateTo, LocalDate dateFrom) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBudget"); + }// verify the required parameter 'budgetID' is set + if (budgetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'budgetID' when calling getBudget"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBudget"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BudgetID", budgetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Budgets/{BudgetID}"); + if (dateTo != null) { + String key = "DateTo"; + Object value = dateTo; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateFrom != null) { + String key = "DateFrom"; + Object value = dateFrom; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieve a list of budgets + *

200 - Success - return response of type Budgets array with 0 to N Budgets + * @param xeroTenantId Xero identifier for Tenant + * @param ids Filter by BudgetID. Allows you to retrieve a specific individual budget. + * @param dateTo Filter by start date + * @param dateFrom Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return Budgets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Budgets getBudgets(String accessToken, String xeroTenantId, List ids, LocalDate dateTo, LocalDate dateFrom) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBudgetsForHttpResponse(accessToken, xeroTenantId, ids, dateTo, dateFrom); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBudgets -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieve a list of budgets + *

200 - Success - return response of type Budgets array with 0 to N Budgets + * @param xeroTenantId Xero identifier for Tenant + * @param ids Filter by BudgetID. Allows you to retrieve a specific individual budget. + * @param dateTo Filter by start date + * @param dateFrom Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBudgetsForHttpResponse(String accessToken, String xeroTenantId, List ids, LocalDate dateTo, LocalDate dateFrom) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBudgets"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBudgets"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Budgets"); + if (ids != null) { + String key = "IDs"; + Object value = ids; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateTo != null) { + String key = "DateTo"; + Object value = dateTo; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateFrom != null) { + String key = "DateFrom"; + Object value = dateFrom; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific contacts in a Xero organisation using a unique contact Id + *

200 - Success - return response of type Contacts array with a unique Contact + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return Contacts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Contacts getContact(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactForHttpResponse(accessToken, xeroTenantId, contactID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContact -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific contacts in a Xero organisation using a unique contact Id + *

200 - Success - return response of type Contacts array with a unique Contact + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactForHttpResponse(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContact"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling getContact"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContact"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific contact by file name + *

200 - Success - return response of attachment for Contact as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getContactAttachmentByFileName(String accessToken, String xeroTenantId, UUID contactID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, contactID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific contact by file name + *

200 - Success - return response of attachment for Contact as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactAttachmentByFileName"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling getContactAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getContactAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getContactAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific contact using a unique attachment Id + *

200 - Success - return response of attachment for Contact as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getContactAttachmentById(String accessToken, String xeroTenantId, UUID contactID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactAttachmentByIdForHttpResponse(accessToken, xeroTenantId, contactID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific contact using a unique attachment Id + *

200 - Success - return response of attachment for Contact as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactAttachmentById"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling getContactAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getContactAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getContactAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments for a specific contact in a Xero organisation + *

200 - Success - return response of type Attachments array with 0 to N Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getContactAttachments(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactAttachmentsForHttpResponse(accessToken, xeroTenantId, contactID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments for a specific contact in a Xero organisation + *

200 - Success - return response of type Attachments array with 0 to N Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactAttachments"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling getContactAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific contact by contact number in a Xero organisation + *

200 - Success - return response of type Contacts array with a unique Contact + * @param xeroTenantId Xero identifier for Tenant + * @param contactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). + * @param accessToken Authorization token for user set in header of each request + * @return Contacts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Contacts getContactByContactNumber(String accessToken, String xeroTenantId, String contactNumber) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactByContactNumberForHttpResponse(accessToken, xeroTenantId, contactNumber); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactByContactNumber -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific contact by contact number in a Xero organisation + *

200 - Success - return response of type Contacts array with a unique Contact + * @param xeroTenantId Xero identifier for Tenant + * @param contactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactByContactNumberForHttpResponse(String accessToken, String xeroTenantId, String contactNumber) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactByContactNumber"); + }// verify the required parameter 'contactNumber' is set + if (contactNumber == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactNumber' when calling getContactByContactNumber"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactByContactNumber"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactNumber", contactNumber); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactNumber}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves CIS settings for a specific contact in a Xero organisation + *

200 - Success - return response of type CISSettings for a specific Contact + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return CISSettings + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CISSettings getContactCISSettings(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactCISSettingsForHttpResponse(accessToken, xeroTenantId, contactID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactCISSettings -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves CIS settings for a specific contact in a Xero organisation + *

200 - Success - return response of type CISSettings for a specific Contact + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactCISSettingsForHttpResponse(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactCISSettings"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling getContactCISSettings"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactCISSettings"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/CISSettings"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific contact group by using a unique contact group Id + *

200 - Success - return response of type Contact Groups array with a specific Contact Group + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param accessToken Authorization token for user set in header of each request + * @return ContactGroups + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ContactGroups getContactGroup(String accessToken, String xeroTenantId, UUID contactGroupID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactGroupForHttpResponse(accessToken, xeroTenantId, contactGroupID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactGroup -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific contact group by using a unique contact group Id + *

200 - Success - return response of type Contact Groups array with a specific Contact Group + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactGroupForHttpResponse(String accessToken, String xeroTenantId, UUID contactGroupID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactGroup"); + }// verify the required parameter 'contactGroupID' is set + if (contactGroupID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactGroupID' when calling getContactGroup"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactGroup"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactGroupID", contactGroupID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves the contact Id and name of each contact group + *

200 - Success - return response of type Contact Groups array of Contact Group + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return ContactGroups + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ContactGroups getContactGroups(String accessToken, String xeroTenantId, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactGroupsForHttpResponse(accessToken, xeroTenantId, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactGroups -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves the contact Id and name of each contact group + *

200 - Success - return response of type Contact Groups array of Contact Group + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactGroupsForHttpResponse(String accessToken, String xeroTenantId, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactGroups"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactGroups"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records for a specific contact + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getContactHistory(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactHistoryForHttpResponse(accessToken, xeroTenantId, contactID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records for a specific contact + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID contactID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactHistory"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling getContactHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves all contacts in a Xero organisation + *

200 - Success - return response of type Contacts array with 0 to N Contact + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param ids Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + * @param page e.g. page=1 - Up to 100 contacts will be returned in a single API call. + * @param includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. + * @param searchTerm Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return Contacts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Contacts getContacts(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, List ids, Integer page, Boolean includeArchived, Boolean summaryOnly, String searchTerm, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getContactsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, ids, page, includeArchived, summaryOnly, searchTerm, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContacts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves all contacts in a Xero organisation + *

200 - Success - return response of type Contacts array with 0 to N Contact + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param ids Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + * @param page e.g. page=1 - Up to 100 contacts will be returned in a single API call. + * @param includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. + * @param searchTerm Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getContactsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, List ids, Integer page, Boolean includeArchived, Boolean summaryOnly, String searchTerm, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContacts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContacts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (ids != null) { + String key = "IDs"; + Object value = ids; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (includeArchived != null) { + String key = "includeArchived"; + Object value = includeArchived; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (summaryOnly != null) { + String key = "summaryOnly"; + Object value = summaryOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (searchTerm != null) { + String key = "searchTerm"; + Object value = searchTerm; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific credit note using a unique credit note Id + *

200 - Success - return response of type Credit Notes array with a unique CreditNote + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return CreditNotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CreditNotes getCreditNote(String accessToken, String xeroTenantId, UUID creditNoteID, Integer unitdp) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCreditNoteForHttpResponse(accessToken, xeroTenantId, creditNoteID, unitdp); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCreditNote -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific credit note using a unique credit note Id + *

200 - Success - return response of type Credit Notes array with a unique CreditNote + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCreditNoteForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, Integer unitdp) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCreditNote"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling getCreditNote"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCreditNote"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves credit notes as PDF files + *

200 - Success - return response of binary data from the Attachment to a Credit Note + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getCreditNoteAsPdf(String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCreditNoteAsPdfForHttpResponse(accessToken, xeroTenantId, creditNoteID); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCreditNoteAsPdf -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves credit notes as PDF files + *

200 - Success - return response of binary data from the Attachment to a Credit Note + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCreditNoteAsPdfForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCreditNoteAsPdf"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling getCreditNoteAsPdf"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCreditNoteAsPdf"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/pdf"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment on a specific credit note by file name + *

200 - Success - return response of attachment for Credit Note as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getCreditNoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCreditNoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, creditNoteID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCreditNoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment on a specific credit note by file name + *

200 - Success - return response of attachment for Credit Note as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCreditNoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCreditNoteAttachmentByFileName"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling getCreditNoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getCreditNoteAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getCreditNoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCreditNoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific credit note using a unique attachment Id + *

200 - Success - return response of attachment for Credit Note as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getCreditNoteAttachmentById(String accessToken, String xeroTenantId, UUID creditNoteID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCreditNoteAttachmentByIdForHttpResponse(accessToken, xeroTenantId, creditNoteID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCreditNoteAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific credit note using a unique attachment Id + *

200 - Success - return response of attachment for Credit Note as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCreditNoteAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCreditNoteAttachmentById"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling getCreditNoteAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getCreditNoteAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getCreditNoteAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCreditNoteAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments for a specific credit notes + *

200 - Success - return response of type Attachments array with all Attachment for specific Credit Note + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getCreditNoteAttachments(String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCreditNoteAttachmentsForHttpResponse(accessToken, xeroTenantId, creditNoteID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCreditNoteAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments for a specific credit notes + *

200 - Success - return response of type Attachments array with all Attachment for specific Credit Note + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCreditNoteAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCreditNoteAttachments"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling getCreditNoteAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCreditNoteAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records of a specific credit note + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getCreditNoteHistory(String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCreditNoteHistoryForHttpResponse(accessToken, xeroTenantId, creditNoteID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCreditNoteHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records of a specific credit note + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCreditNoteHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCreditNoteHistory"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling getCreditNoteHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCreditNoteHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves any credit notes + *

200 - Success - return response of type Credit Notes array of CreditNote + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return CreditNotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CreditNotes getCreditNotes(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCreditNotesForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCreditNotes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves any credit notes + *

200 - Success - return response of type Credit Notes array of CreditNote + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCreditNotesForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCreditNotes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCreditNotes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves currencies for your Xero organisation + *

200 - Success - return response of type Currencies array with all Currencies + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return Currencies + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Currencies getCurrencies(String accessToken, String xeroTenantId, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getCurrenciesForHttpResponse(accessToken, xeroTenantId, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCurrencies -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves currencies for your Xero organisation + *

200 - Success - return response of type Currencies array with all Currencies + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCurrenciesForHttpResponse(String accessToken, String xeroTenantId, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCurrencies"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCurrencies"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Currencies"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee used in Xero payrun using a unique employee Id + *

200 - Success - return response of type Employees array with specified Employee + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Unique identifier for a Employee + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees getEmployee(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee used in Xero payrun using a unique employee Id + *

200 - Success - return response of type Employees array with specified Employee + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Unique identifier for a Employee + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployee"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves employees used in Xero payrun + *

200 - Success - return response of type Employees array with all Employee + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees getEmployees(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeesForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployees -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves employees used in Xero payrun + *

200 - Success - return response of type Employees array with all Employee + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeesForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployees"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployees"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific expense claim using a unique expense claim Id + *

200 - Success - return response of type ExpenseClaims array with specified ExpenseClaim + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param accessToken Authorization token for user set in header of each request + * @return ExpenseClaims + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ExpenseClaims getExpenseClaim(String accessToken, String xeroTenantId, UUID expenseClaimID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getExpenseClaimForHttpResponse(accessToken, xeroTenantId, expenseClaimID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getExpenseClaim -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific expense claim using a unique expense claim Id + *

200 - Success - return response of type ExpenseClaims array with specified ExpenseClaim + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getExpenseClaimForHttpResponse(String accessToken, String xeroTenantId, UUID expenseClaimID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getExpenseClaim"); + }// verify the required parameter 'expenseClaimID' is set + if (expenseClaimID == null) { + throw new IllegalArgumentException("Missing the required parameter 'expenseClaimID' when calling getExpenseClaim"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getExpenseClaim"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ExpenseClaimID", expenseClaimID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records of a specific expense claim + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getExpenseClaimHistory(String accessToken, String xeroTenantId, UUID expenseClaimID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getExpenseClaimHistoryForHttpResponse(accessToken, xeroTenantId, expenseClaimID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getExpenseClaimHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records of a specific expense claim + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getExpenseClaimHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID expenseClaimID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getExpenseClaimHistory"); + }// verify the required parameter 'expenseClaimID' is set + if (expenseClaimID == null) { + throw new IllegalArgumentException("Missing the required parameter 'expenseClaimID' when calling getExpenseClaimHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getExpenseClaimHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ExpenseClaimID", expenseClaimID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves expense claims + *

200 - Success - return response of type ExpenseClaims array with all ExpenseClaims + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return ExpenseClaims + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ExpenseClaims getExpenseClaims(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getExpenseClaimsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getExpenseClaims -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves expense claims + *

200 - Success - return response of type ExpenseClaims array with all ExpenseClaims + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getExpenseClaimsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getExpenseClaims"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getExpenseClaims"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific sales invoice or purchase bill using a unique invoice Id + *

200 - Success - return response of type Invoices array with specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return Invoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Invoices getInvoice(String accessToken, String xeroTenantId, UUID invoiceID, Integer unitdp) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoiceForHttpResponse(accessToken, xeroTenantId, invoiceID, unitdp); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoice -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific sales invoice or purchase bill using a unique invoice Id + *

200 - Success - return response of type Invoices array with specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoiceForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, Integer unitdp) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoice"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling getInvoice"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoice"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves invoices or purchase bills as PDF files + *

200 - Success - return response of byte array pdf version of specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getInvoiceAsPdf(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoiceAsPdfForHttpResponse(accessToken, xeroTenantId, invoiceID); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoiceAsPdf -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves invoices or purchase bills as PDF files + *

200 - Success - return response of byte array pdf version of specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoiceAsPdfForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoiceAsPdf"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling getInvoiceAsPdf"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoiceAsPdf"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/pdf"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves an attachment from a specific invoice or purchase bill by filename + *

200 - Success - return response of attachment for Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, invoiceID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves an attachment from a specific invoice or purchase bill by filename + *

200 - Success - return response of attachment for Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoiceAttachmentByFileName"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling getInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getInvoiceAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific invoices or purchase bills by using a unique attachment Id + *

200 - Success - return response of attachment for Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getInvoiceAttachmentById(String accessToken, String xeroTenantId, UUID invoiceID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoiceAttachmentByIdForHttpResponse(accessToken, xeroTenantId, invoiceID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoiceAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific invoices or purchase bills by using a unique attachment Id + *

200 - Success - return response of attachment for Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoiceAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoiceAttachmentById"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling getInvoiceAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getInvoiceAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getInvoiceAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoiceAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments for a specific invoice or purchase bill + *

200 - Success - return response of type Attachments array of Attachments for specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getInvoiceAttachments(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoiceAttachmentsForHttpResponse(accessToken, xeroTenantId, invoiceID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoiceAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments for a specific invoice or purchase bill + *

200 - Success - return response of type Attachments array of Attachments for specified Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoiceAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoiceAttachments"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling getInvoiceAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoiceAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records for a specific invoice + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getInvoiceHistory(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoiceHistoryForHttpResponse(accessToken, xeroTenantId, invoiceID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoiceHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records for a specific invoice + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoiceHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoiceHistory"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling getInvoiceHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoiceHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves invoice reminder settings + *

200 - Success - return response of Invoice Reminders + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return InvoiceReminders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public InvoiceReminders getInvoiceReminders(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoiceRemindersForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoiceReminders -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves invoice reminder settings + *

200 - Success - return response of Invoice Reminders + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoiceRemindersForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoiceReminders"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoiceReminders"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/InvoiceReminders/Settings"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with all Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param ids Filter by a comma-separated list of InvoicesIDs. + * @param invoiceNumbers Filter by a comma-separated list of InvoiceNumbers. + * @param contactIDs Filter by a comma-separated list of ContactIDs. + * @param statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + * @param page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice + * @param includeArchived e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response + * @param createdByMyApp When set to true you'll only retrieve Invoices created by your app + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. + * @param pageSize Number of records to retrieve per page + * @param searchTerm Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. + * @param accessToken Authorization token for user set in header of each request + * @return Invoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Invoices getInvoices(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, List ids, List invoiceNumbers, List contactIDs, List statuses, Integer page, Boolean includeArchived, Boolean createdByMyApp, Integer unitdp, Boolean summaryOnly, Integer pageSize, String searchTerm) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInvoicesForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, ids, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp, summaryOnly, pageSize, searchTerm); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInvoices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with all Invoices + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param ids Filter by a comma-separated list of InvoicesIDs. + * @param invoiceNumbers Filter by a comma-separated list of InvoiceNumbers. + * @param contactIDs Filter by a comma-separated list of ContactIDs. + * @param statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + * @param page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice + * @param includeArchived e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response + * @param createdByMyApp When set to true you'll only retrieve Invoices created by your app + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. + * @param pageSize Number of records to retrieve per page + * @param searchTerm Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInvoicesForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, List ids, List invoiceNumbers, List contactIDs, List statuses, Integer page, Boolean includeArchived, Boolean createdByMyApp, Integer unitdp, Boolean summaryOnly, Integer pageSize, String searchTerm) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInvoices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInvoices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (ids != null) { + String key = "IDs"; + Object value = ids; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (invoiceNumbers != null) { + String key = "InvoiceNumbers"; + Object value = invoiceNumbers; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (contactIDs != null) { + String key = "ContactIDs"; + Object value = contactIDs; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (statuses != null) { + String key = "Statuses"; + Object value = statuses; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (includeArchived != null) { + String key = "includeArchived"; + Object value = includeArchived; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (createdByMyApp != null) { + String key = "createdByMyApp"; + Object value = createdByMyApp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (summaryOnly != null) { + String key = "summaryOnly"; + Object value = summaryOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (searchTerm != null) { + String key = "searchTerm"; + Object value = searchTerm; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific item using a unique item Id + *

200 - Success - return response of type Items array with specified Item + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return Items + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Items getItem(String accessToken, String xeroTenantId, UUID itemID, Integer unitdp) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getItemForHttpResponse(accessToken, xeroTenantId, itemID, unitdp); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getItem -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific item using a unique item Id + *

200 - Success - return response of type Items array with specified Item + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getItemForHttpResponse(String accessToken, String xeroTenantId, UUID itemID, Integer unitdp) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getItem"); + }// verify the required parameter 'itemID' is set + if (itemID == null) { + throw new IllegalArgumentException("Missing the required parameter 'itemID' when calling getItem"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getItem"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ItemID", itemID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history for a specific item + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getItemHistory(String accessToken, String xeroTenantId, UUID itemID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getItemHistoryForHttpResponse(accessToken, xeroTenantId, itemID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getItemHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history for a specific item + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getItemHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID itemID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getItemHistory"); + }// verify the required parameter 'itemID' is set + if (itemID == null) { + throw new IllegalArgumentException("Missing the required parameter 'itemID' when calling getItemHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getItemHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ItemID", itemID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves items + *

200 - Success - return response of type Items array with all Item + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return Items + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Items getItems(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer unitdp) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getItemsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getItems -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves items + *

200 - Success - return response of type Items array with all Item + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getItemsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer unitdp) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getItems"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getItems"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific journal using a unique journal Id. + *

200 - Success - return response of type Journals array with specified Journal + * @param xeroTenantId Xero identifier for Tenant + * @param journalID Unique identifier for a Journal + * @param accessToken Authorization token for user set in header of each request + * @return Journals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Journals getJournal(String accessToken, String xeroTenantId, UUID journalID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getJournalForHttpResponse(accessToken, xeroTenantId, journalID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getJournal -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific journal using a unique journal Id. + *

200 - Success - return response of type Journals array with specified Journal + * @param xeroTenantId Xero identifier for Tenant + * @param journalID Unique identifier for a Journal + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getJournalForHttpResponse(String accessToken, String xeroTenantId, UUID journalID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getJournal"); + }// verify the required parameter 'journalID' is set + if (journalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'journalID' when calling getJournal"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getJournal"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("JournalID", journalID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Journals/{JournalID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific journal using a unique journal number. + *

200 - Success - return response of type Journals array with specified Journal + * @param xeroTenantId Xero identifier for Tenant + * @param journalNumber Number of a Journal + * @param accessToken Authorization token for user set in header of each request + * @return Journals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Journals getJournalByNumber(String accessToken, String xeroTenantId, Integer journalNumber) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getJournalByNumberForHttpResponse(accessToken, xeroTenantId, journalNumber); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getJournalByNumber -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific journal using a unique journal number. + *

200 - Success - return response of type Journals array with specified Journal + * @param xeroTenantId Xero identifier for Tenant + * @param journalNumber Number of a Journal + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getJournalByNumberForHttpResponse(String accessToken, String xeroTenantId, Integer journalNumber) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getJournalByNumber"); + }// verify the required parameter 'journalNumber' is set + if (journalNumber == null) { + throw new IllegalArgumentException("Missing the required parameter 'journalNumber' when calling getJournalByNumber"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getJournalByNumber"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("JournalNumber", journalNumber); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Journals/{JournalNumber}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves journals + *

200 - Success - return response of type Journals array with all Journals + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + * @param paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. + * @param accessToken Authorization token for user set in header of each request + * @return Journals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Journals getJournals(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, Integer offset, Boolean paymentsOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getJournalsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, offset, paymentsOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getJournals -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves journals + *

200 - Success - return response of type Journals array with all Journals + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + * @param paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getJournalsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, Integer offset, Boolean paymentsOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getJournals"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getJournals"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Journals"); + if (offset != null) { + String key = "offset"; + Object value = offset; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (paymentsOnly != null) { + String key = "paymentsOnly"; + Object value = paymentsOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific linked transaction (billable expenses) using a unique linked transaction Id + *

200 - Success - return response of type LinkedTransactions array with a specified LinkedTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransactionID Unique identifier for a LinkedTransaction + * @param accessToken Authorization token for user set in header of each request + * @return LinkedTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LinkedTransactions getLinkedTransaction(String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLinkedTransactionForHttpResponse(accessToken, xeroTenantId, linkedTransactionID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLinkedTransaction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific linked transaction (billable expenses) using a unique linked transaction Id + *

200 - Success - return response of type LinkedTransactions array with a specified LinkedTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransactionID Unique identifier for a LinkedTransaction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLinkedTransactionForHttpResponse(String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLinkedTransaction"); + }// verify the required parameter 'linkedTransactionID' is set + if (linkedTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'linkedTransactionID' when calling getLinkedTransaction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLinkedTransaction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LinkedTransactionID", linkedTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions/{LinkedTransactionID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves linked transactions (billable expenses) + *

200 - Success - return response of type LinkedTransactions array with all LinkedTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + * @param linkedTransactionID The Xero identifier for an Linked Transaction + * @param sourceTransactionID Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + * @param contactID Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + * @param status Filter by the combination of ContactID and Status. Get the linked transactions associated to a customer and with a status + * @param targetTransactionID Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + * @param accessToken Authorization token for user set in header of each request + * @return LinkedTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LinkedTransactions getLinkedTransactions(String accessToken, String xeroTenantId, Integer page, UUID linkedTransactionID, UUID sourceTransactionID, UUID contactID, String status, UUID targetTransactionID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLinkedTransactionsForHttpResponse(accessToken, xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLinkedTransactions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves linked transactions (billable expenses) + *

200 - Success - return response of type LinkedTransactions array with all LinkedTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + * @param linkedTransactionID The Xero identifier for an Linked Transaction + * @param sourceTransactionID Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + * @param contactID Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + * @param status Filter by the combination of ContactID and Status. Get the linked transactions associated to a customer and with a status + * @param targetTransactionID Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLinkedTransactionsForHttpResponse(String accessToken, String xeroTenantId, Integer page, UUID linkedTransactionID, UUID sourceTransactionID, UUID contactID, String status, UUID targetTransactionID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLinkedTransactions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLinkedTransactions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (linkedTransactionID != null) { + String key = "LinkedTransactionID"; + Object value = linkedTransactionID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (sourceTransactionID != null) { + String key = "SourceTransactionID"; + Object value = sourceTransactionID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (contactID != null) { + String key = "ContactID"; + Object value = contactID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (status != null) { + String key = "Status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (targetTransactionID != null) { + String key = "TargetTransactionID"; + Object value = targetTransactionID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific manual journal + *

200 - Success - return response of type ManualJournals array with a specified ManualJournals + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param accessToken Authorization token for user set in header of each request + * @return ManualJournals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ManualJournals getManualJournal(String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getManualJournalForHttpResponse(accessToken, xeroTenantId, manualJournalID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getManualJournal -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific manual journal + *

200 - Success - return response of type ManualJournals array with a specified ManualJournals + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getManualJournalForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getManualJournal"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling getManualJournal"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getManualJournal"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific manual journal by file name + *

200 - Success - return response of attachment for Manual Journal as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getManualJournalAttachmentByFileName(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getManualJournalAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, manualJournalID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getManualJournalAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific manual journal by file name + *

200 - Success - return response of attachment for Manual Journal as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getManualJournalAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getManualJournalAttachmentByFileName"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling getManualJournalAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getManualJournalAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getManualJournalAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getManualJournalAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Allows you to retrieve a specific attachment from a specific manual journal using a unique attachment Id + *

200 - Success - return response of attachment for Manual Journal as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getManualJournalAttachmentById(String accessToken, String xeroTenantId, UUID manualJournalID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getManualJournalAttachmentByIdForHttpResponse(accessToken, xeroTenantId, manualJournalID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getManualJournalAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Allows you to retrieve a specific attachment from a specific manual journal using a unique attachment Id + *

200 - Success - return response of attachment for Manual Journal as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getManualJournalAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getManualJournalAttachmentById"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling getManualJournalAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getManualJournalAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getManualJournalAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getManualJournalAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachment for a specific manual journal + *

200 - Success - return response of type Attachments array with all Attachments for a ManualJournals + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getManualJournalAttachments(String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getManualJournalAttachmentsForHttpResponse(accessToken, xeroTenantId, manualJournalID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getManualJournalAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachment for a specific manual journal + *

200 - Success - return response of type Attachments array with all Attachments for a ManualJournals + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getManualJournalAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getManualJournalAttachments"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling getManualJournalAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getManualJournalAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves manual journals + *

200 - Success - return response of type ManualJournals array with a all ManualJournals + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return ManualJournals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ManualJournals getManualJournals(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getManualJournalsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getManualJournals -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves manual journals + *

200 - Success - return response of type ManualJournals array with a all ManualJournals + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getManualJournalsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getManualJournals"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getManualJournals"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history for a specific manual journal + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getManualJournalsHistory(String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getManualJournalsHistoryForHttpResponse(accessToken, xeroTenantId, manualJournalID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getManualJournalsHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history for a specific manual journal + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getManualJournalsHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getManualJournalsHistory"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling getManualJournalsHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getManualJournalsHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a URL to an online invoice + *

200 - Success - return response of type OnlineInvoice array with one OnlineInvoice + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return OnlineInvoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public OnlineInvoices getOnlineInvoice(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getOnlineInvoiceForHttpResponse(accessToken, xeroTenantId, invoiceID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getOnlineInvoice -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a URL to an online invoice + *

200 - Success - return response of type OnlineInvoice array with one OnlineInvoice + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getOnlineInvoiceForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getOnlineInvoice"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling getOnlineInvoice"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getOnlineInvoice"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/OnlineInvoice"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a list of the key actions your app has permission to perform in the connected Xero organisation. + *

200 - Success - return response of type Actions array with all key actions + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return Actions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Actions getOrganisationActions(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getOrganisationActionsForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getOrganisationActions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a list of the key actions your app has permission to perform in the connected Xero organisation. + *

200 - Success - return response of type Actions array with all key actions + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getOrganisationActionsForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getOrganisationActions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getOrganisationActions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Organisation/Actions"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves the CIS settings for the Xero organistaion. + *

200 - Success - return response of type Organisation array with specified Organisation + * @param xeroTenantId Xero identifier for Tenant + * @param organisationID The unique Xero identifier for an organisation + * @param accessToken Authorization token for user set in header of each request + * @return CISOrgSettings + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CISOrgSettings getOrganisationCISSettings(String accessToken, String xeroTenantId, UUID organisationID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getOrganisationCISSettingsForHttpResponse(accessToken, xeroTenantId, organisationID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getOrganisationCISSettings -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves the CIS settings for the Xero organistaion. + *

200 - Success - return response of type Organisation array with specified Organisation + * @param xeroTenantId Xero identifier for Tenant + * @param organisationID The unique Xero identifier for an organisation + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getOrganisationCISSettingsForHttpResponse(String accessToken, String xeroTenantId, UUID organisationID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getOrganisationCISSettings"); + }// verify the required parameter 'organisationID' is set + if (organisationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'organisationID' when calling getOrganisationCISSettings"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getOrganisationCISSettings"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("OrganisationID", organisationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Organisation/{OrganisationID}/CISSettings"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves Xero organisation details + *

200 - Success - return response of type Organisation array with all Organisation + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return Organisations + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Organisations getOrganisations(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getOrganisationsForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getOrganisations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves Xero organisation details + *

200 - Success - return response of type Organisation array with all Organisation + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getOrganisationsForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getOrganisations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getOrganisations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Organisation"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific overpayment using a unique overpayment Id + *

200 - Success - return response of type Overpayments array with specified Overpayments + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param accessToken Authorization token for user set in header of each request + * @return Overpayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Overpayments getOverpayment(String accessToken, String xeroTenantId, UUID overpaymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getOverpaymentForHttpResponse(accessToken, xeroTenantId, overpaymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getOverpayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific overpayment using a unique overpayment Id + *

200 - Success - return response of type Overpayments array with specified Overpayments + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getOverpaymentForHttpResponse(String accessToken, String xeroTenantId, UUID overpaymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getOverpayment"); + }// verify the required parameter 'overpaymentID' is set + if (overpaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'overpaymentID' when calling getOverpayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getOverpayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("OverpaymentID", overpaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records of a specific overpayment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getOverpaymentHistory(String accessToken, String xeroTenantId, UUID overpaymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getOverpaymentHistoryForHttpResponse(accessToken, xeroTenantId, overpaymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getOverpaymentHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records of a specific overpayment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param overpaymentID Unique identifier for a Overpayment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getOverpaymentHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID overpaymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getOverpaymentHistory"); + }// verify the required parameter 'overpaymentID' is set + if (overpaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'overpaymentID' when calling getOverpaymentHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getOverpaymentHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("OverpaymentID", overpaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves overpayments + *

200 - Success - return response of type Overpayments array with all Overpayments + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return Overpayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Overpayments getOverpayments(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getOverpaymentsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getOverpayments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves overpayments + *

200 - Success - return response of type Overpayments array with all Overpayments + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getOverpaymentsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getOverpayments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getOverpayments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific payment for invoices and credit notes using a unique payment Id + *

200 - Success - return response of type Payments array for specified Payment + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param accessToken Authorization token for user set in header of each request + * @return Payments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Payments getPayment(String accessToken, String xeroTenantId, UUID paymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaymentForHttpResponse(accessToken, xeroTenantId, paymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific payment for invoices and credit notes using a unique payment Id + *

200 - Success - return response of type Payments array for specified Payment + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaymentForHttpResponse(String accessToken, String xeroTenantId, UUID paymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayment"); + }// verify the required parameter 'paymentID' is set + if (paymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentID' when calling getPayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PaymentID", paymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records of a specific payment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getPaymentHistory(String accessToken, String xeroTenantId, UUID paymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaymentHistoryForHttpResponse(accessToken, xeroTenantId, paymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPaymentHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records of a specific payment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param paymentID Unique identifier for a Payment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaymentHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID paymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPaymentHistory"); + }// verify the required parameter 'paymentID' is set + if (paymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentID' when calling getPaymentHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPaymentHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PaymentID", paymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payment services + *

200 - Success - return response of type PaymentServices array for all PaymentService + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return PaymentServices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentServices getPaymentServices(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaymentServicesForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPaymentServices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payment services + *

200 - Success - return response of type PaymentServices array for all PaymentService + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaymentServicesForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPaymentServices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPaymentServices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaymentServices"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payments for invoices and credit notes + *

200 - Success - return response of type Payments array for all Payments + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page Up to 100 payments will be returned in a single API call + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return Payments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Payments getPayments(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaymentsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payments for invoices and credit notes + *

200 - Success - return response of type Payments array for all Payments + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page Up to 100 payments will be returned in a single API call + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaymentsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Allows you to retrieve a specified prepayments + *

200 - Success - return response of type Prepayments array for a specified Prepayment + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param accessToken Authorization token for user set in header of each request + * @return Prepayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Prepayments getPrepayment(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPrepaymentForHttpResponse(accessToken, xeroTenantId, prepaymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPrepayment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Allows you to retrieve a specified prepayments + *

200 - Success - return response of type Prepayments array for a specified Prepayment + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPrepaymentForHttpResponse(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPrepayment"); + }// verify the required parameter 'prepaymentID' is set + if (prepaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'prepaymentID' when calling getPrepayment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPrepayment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PrepaymentID", prepaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history record for a specific prepayment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getPrepaymentHistory(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPrepaymentHistoryForHttpResponse(accessToken, xeroTenantId, prepaymentID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPrepaymentHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history record for a specific prepayment + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param prepaymentID Unique identifier for a PrePayment + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPrepaymentHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPrepaymentHistory"); + }// verify the required parameter 'prepaymentID' is set + if (prepaymentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'prepaymentID' when calling getPrepaymentHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPrepaymentHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PrepaymentID", prepaymentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves prepayments + *

200 - Success - return response of type Prepayments array for all Prepayment + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return Prepayments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Prepayments getPrepayments(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPrepaymentsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPrepayments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves prepayments + *

200 - Success - return response of type Prepayments array for all Prepayment + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPrepaymentsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPrepayments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPrepayments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific purchase order using a unique purchase order Id + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return PurchaseOrders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PurchaseOrders getPurchaseOrder(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrderForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific purchase order using a unique purchase order Id + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrderForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrder"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves specific purchase order as PDF files using a unique purchase order Id + *

200 - Success - return response of byte array pdf version of specified Purchase Orders + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getPurchaseOrderAsPdf(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrderAsPdfForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrderAsPdf -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves specific purchase order as PDF files using a unique purchase order Id + *

200 - Success - return response of byte array pdf version of specified Purchase Orders + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrderAsPdfForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderAsPdf"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrderAsPdf"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrderAsPdf"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/pdf"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment for a specific purchase order by filename + *

200 - Success - return response of attachment for Purchase Order as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getPurchaseOrderAttachmentByFileName(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrderAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrderAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment for a specific purchase order by filename + *

200 - Success - return response of attachment for Purchase Order as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrderAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getPurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getPurchaseOrderAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrderAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves specific attachment for a specific purchase order using a unique attachment Id + *

200 - Success - return response of attachment for Account as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getPurchaseOrderAttachmentById(String accessToken, String xeroTenantId, UUID purchaseOrderID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrderAttachmentByIdForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrderAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves specific attachment for a specific purchase order using a unique attachment Id + *

200 - Success - return response of attachment for Account as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrderAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderAttachmentById"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrderAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getPurchaseOrderAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getPurchaseOrderAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrderAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments for a specific purchase order + *

200 - Success - return response of type Attachments array of Purchase Orders + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getPurchaseOrderAttachments(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrderAttachmentsForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrderAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments for a specific purchase order + *

200 - Success - return response of type Attachments array of Purchase Orders + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrderAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderAttachments"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrderAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrderAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific purchase order using purchase order number + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderNumber Unique identifier for a PurchaseOrder + * @param accessToken Authorization token for user set in header of each request + * @return PurchaseOrders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PurchaseOrders getPurchaseOrderByNumber(String accessToken, String xeroTenantId, String purchaseOrderNumber) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrderByNumberForHttpResponse(accessToken, xeroTenantId, purchaseOrderNumber); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrderByNumber -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific purchase order using purchase order number + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderNumber Unique identifier for a PurchaseOrder + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrderByNumberForHttpResponse(String accessToken, String xeroTenantId, String purchaseOrderNumber) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderByNumber"); + }// verify the required parameter 'purchaseOrderNumber' is set + if (purchaseOrderNumber == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderNumber' when calling getPurchaseOrderByNumber"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrderByNumber"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderNumber", purchaseOrderNumber); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderNumber}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history for a specific purchase order + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getPurchaseOrderHistory(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrderHistoryForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrderHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history for a specific purchase order + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrderHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderHistory"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrderHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrderHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves purchase orders + *

200 - Success - return response of type PurchaseOrder array of all PurchaseOrder + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param status Filter by purchase order status + * @param dateFrom Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param dateTo Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param order Order by an any element + * @param page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return PurchaseOrders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PurchaseOrders getPurchaseOrders(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String status, String dateFrom, String dateTo, String order, Integer page, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPurchaseOrdersForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPurchaseOrders -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves purchase orders + *

200 - Success - return response of type PurchaseOrder array of all PurchaseOrder + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param status Filter by purchase order status + * @param dateFrom Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param dateTo Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param order Order by an any element + * @param page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. + * @param pageSize Number of records to retrieve per page + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPurchaseOrdersForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String status, String dateFrom, String dateTo, String order, Integer page, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPurchaseOrders"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPurchaseOrders"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders"); + if (status != null) { + String key = "Status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateFrom != null) { + String key = "DateFrom"; + Object value = dateFrom; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateTo != null) { + String key = "DateTo"; + Object value = dateTo; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific quote using a unique quote Id + *

200 - Success - return response of type Quotes array with specified Quote + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return Quotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Quotes getQuote(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getQuoteForHttpResponse(accessToken, xeroTenantId, quoteID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getQuote -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific quote using a unique quote Id + *

200 - Success - return response of type Quotes array with specified Quote + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getQuoteForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getQuote"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling getQuote"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getQuote"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific quote as a PDF file using a unique quote Id + *

200 - Success - return response of byte array pdf version of specified Quotes + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getQuoteAsPdf(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getQuoteAsPdfForHttpResponse(accessToken, xeroTenantId, quoteID); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getQuoteAsPdf -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific quote as a PDF file using a unique quote Id + *

200 - Success - return response of byte array pdf version of specified Quotes + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getQuoteAsPdfForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getQuoteAsPdf"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling getQuoteAsPdf"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getQuoteAsPdf"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/pdf"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific quote by filename + *

200 - Success - return response of attachment for Quote as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getQuoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID quoteID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getQuoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, quoteID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getQuoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific quote by filename + *

200 - Success - return response of attachment for Quote as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getQuoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getQuoteAttachmentByFileName"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling getQuoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getQuoteAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getQuoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getQuoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific quote using a unique attachment Id + *

200 - Success - return response of attachment for Quote as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getQuoteAttachmentById(String accessToken, String xeroTenantId, UUID quoteID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getQuoteAttachmentByIdForHttpResponse(accessToken, xeroTenantId, quoteID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getQuoteAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific quote using a unique attachment Id + *

200 - Success - return response of attachment for Quote as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getQuoteAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getQuoteAttachmentById"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling getQuoteAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getQuoteAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getQuoteAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getQuoteAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments for a specific quote + *

200 - Success - return response of type Attachments array of Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getQuoteAttachments(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getQuoteAttachmentsForHttpResponse(accessToken, xeroTenantId, quoteID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getQuoteAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments for a specific quote + *

200 - Success - return response of type Attachments array of Attachment + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getQuoteAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getQuoteAttachments"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling getQuoteAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getQuoteAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history records of a specific quote + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getQuoteHistory(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getQuoteHistoryForHttpResponse(accessToken, xeroTenantId, quoteID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getQuoteHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history records of a specific quote + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getQuoteHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getQuoteHistory"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling getQuoteHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getQuoteHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves sales quotes + *

200 - Success - return response of type quotes array with all quotes + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param dateFrom Filter for quotes after a particular date + * @param dateTo Filter for quotes before a particular date + * @param expiryDateFrom Filter for quotes expiring after a particular date + * @param expiryDateTo Filter for quotes before a particular date + * @param contactID Filter for quotes belonging to a particular contact + * @param status Filter for quotes of a particular Status + * @param page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote + * @param order Order by an any element + * @param quoteNumber Filter by quote number (e.g. GET https://.../Quotes?QuoteNumber=QU-0001) + * @param accessToken Authorization token for user set in header of each request + * @return Quotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Quotes getQuotes(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, LocalDate dateFrom, LocalDate dateTo, LocalDate expiryDateFrom, LocalDate expiryDateTo, UUID contactID, String status, Integer page, String order, String quoteNumber) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getQuotesForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order, quoteNumber); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getQuotes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves sales quotes + *

200 - Success - return response of type quotes array with all quotes + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param dateFrom Filter for quotes after a particular date + * @param dateTo Filter for quotes before a particular date + * @param expiryDateFrom Filter for quotes expiring after a particular date + * @param expiryDateTo Filter for quotes before a particular date + * @param contactID Filter for quotes belonging to a particular contact + * @param status Filter for quotes of a particular Status + * @param page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote + * @param order Order by an any element + * @param quoteNumber Filter by quote number (e.g. GET https://.../Quotes?QuoteNumber=QU-0001) + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getQuotesForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, LocalDate dateFrom, LocalDate dateTo, LocalDate expiryDateFrom, LocalDate expiryDateTo, UUID contactID, String status, Integer page, String order, String quoteNumber) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getQuotes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getQuotes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes"); + if (dateFrom != null) { + String key = "DateFrom"; + Object value = dateFrom; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateTo != null) { + String key = "DateTo"; + Object value = dateTo; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (expiryDateFrom != null) { + String key = "ExpiryDateFrom"; + Object value = expiryDateFrom; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (expiryDateTo != null) { + String key = "ExpiryDateTo"; + Object value = expiryDateTo; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (contactID != null) { + String key = "ContactID"; + Object value = contactID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (status != null) { + String key = "Status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (quoteNumber != null) { + String key = "QuoteNumber"; + Object value = quoteNumber; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific draft expense claim receipt by using a unique receipt Id + *

200 - Success - return response of type Receipts array for a specified Receipt + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return Receipts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Receipts getReceipt(String accessToken, String xeroTenantId, UUID receiptID, Integer unitdp) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReceiptForHttpResponse(accessToken, xeroTenantId, receiptID, unitdp); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReceipt -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific draft expense claim receipt by using a unique receipt Id + *

200 - Success - return response of type Receipts array for a specified Receipt + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReceiptForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, Integer unitdp) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReceipt"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling getReceipt"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReceipt"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific expense claim receipts by file name + *

200 - Success - return response of attachment for Receipt as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getReceiptAttachmentByFileName(String accessToken, String xeroTenantId, UUID receiptID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReceiptAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, receiptID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReceiptAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific expense claim receipts by file name + *

200 - Success - return response of attachment for Receipt as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReceiptAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReceiptAttachmentByFileName"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling getReceiptAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getReceiptAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getReceiptAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReceiptAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachments from a specific expense claim receipts by using a unique attachment Id + *

200 - Success - return response of attachment for Receipt as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getReceiptAttachmentById(String accessToken, String xeroTenantId, UUID receiptID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReceiptAttachmentByIdForHttpResponse(accessToken, xeroTenantId, receiptID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReceiptAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachments from a specific expense claim receipts by using a unique attachment Id + *

200 - Success - return response of attachment for Receipt as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReceiptAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReceiptAttachmentById"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling getReceiptAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getReceiptAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getReceiptAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReceiptAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments for a specific expense claim receipt + *

200 - Success - return response of type Attachments array of Attachments for a specified Receipt + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getReceiptAttachments(String accessToken, String xeroTenantId, UUID receiptID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReceiptAttachmentsForHttpResponse(accessToken, xeroTenantId, receiptID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReceiptAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments for a specific expense claim receipt + *

200 - Success - return response of type Attachments array of Attachments for a specified Receipt + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReceiptAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReceiptAttachments"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling getReceiptAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReceiptAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a history record for a specific receipt + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getReceiptHistory(String accessToken, String xeroTenantId, UUID receiptID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReceiptHistoryForHttpResponse(accessToken, xeroTenantId, receiptID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReceiptHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a history record for a specific receipt + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReceiptHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReceiptHistory"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling getReceiptHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReceiptHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves draft expense claim receipts for any user + *

200 - Success - return response of type Receipts array for all Receipt + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return Receipts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Receipts getReceipts(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer unitdp) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReceiptsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReceipts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves draft expense claim receipts for any user + *

200 - Success - return response of type Receipts array for all Receipt + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReceiptsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer unitdp) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReceipts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReceipts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific repeating invoice by using a unique repeating invoice Id + *

200 - Success - return response of type Repeating Invoices array with a specified Repeating Invoice + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param accessToken Authorization token for user set in header of each request + * @return RepeatingInvoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public RepeatingInvoices getRepeatingInvoice(String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getRepeatingInvoiceForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getRepeatingInvoice -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific repeating invoice by using a unique repeating invoice Id + *

200 - Success - return response of type Repeating Invoices array with a specified Repeating Invoice + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getRepeatingInvoiceForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoice"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling getRepeatingInvoice"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getRepeatingInvoice"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific repeating invoices by file name + *

200 - Success - return response of attachment for Repeating Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getRepeatingInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getRepeatingInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, fileName, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getRepeatingInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific repeating invoices by file name + *

200 - Success - return response of attachment for Repeating Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getRepeatingInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling getRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling getRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getRepeatingInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getRepeatingInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific attachment from a specific repeating invoice + *

200 - Success - return response of attachment for Repeating Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getRepeatingInvoiceAttachmentById(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, UUID attachmentID, String contentType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getRepeatingInvoiceAttachmentByIdForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, attachmentID, contentType); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getRepeatingInvoiceAttachmentById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific attachment from a specific repeating invoice + *

200 - Success - return response of attachment for Repeating Invoice as binary data + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param attachmentID Unique identifier for Attachment object + * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getRepeatingInvoiceAttachmentByIdForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, UUID attachmentID, String contentType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoiceAttachmentById"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling getRepeatingInvoiceAttachmentById"); + }// verify the required parameter 'attachmentID' is set + if (attachmentID == null) { + throw new IllegalArgumentException("Missing the required parameter 'attachmentID' when calling getRepeatingInvoiceAttachmentById"); + }// verify the required parameter 'contentType' is set + if (contentType == null) { + throw new IllegalArgumentException("Missing the required parameter 'contentType' when calling getRepeatingInvoiceAttachmentById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getRepeatingInvoiceAttachmentById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("contentType", contentType); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + uriVariables.put("AttachmentID", attachmentID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves attachments from a specific repeating invoice + *

200 - Success - return response of type Attachments array with all Attachments for a specified Repeating Invoice + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments getRepeatingInvoiceAttachments(String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getRepeatingInvoiceAttachmentsForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getRepeatingInvoiceAttachments -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves attachments from a specific repeating invoice + *

200 - Success - return response of type Attachments array with all Attachments for a specified Repeating Invoice + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getRepeatingInvoiceAttachmentsForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoiceAttachments"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling getRepeatingInvoiceAttachments"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getRepeatingInvoiceAttachments"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves history record for a specific repeating invoice + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HistoryRecords + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HistoryRecords getRepeatingInvoiceHistory(String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getRepeatingInvoiceHistoryForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getRepeatingInvoiceHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves history record for a specific repeating invoice + *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getRepeatingInvoiceHistoryForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoiceHistory"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling getRepeatingInvoiceHistory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getRepeatingInvoiceHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/History"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves repeating invoices + *

200 - Success - return response of type Repeating Invoices array for all Repeating Invoice + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return RepeatingInvoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public RepeatingInvoices getRepeatingInvoices(String accessToken, String xeroTenantId, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getRepeatingInvoicesForHttpResponse(accessToken, xeroTenantId, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getRepeatingInvoices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves repeating invoices + *

200 - Success - return response of type Repeating Invoices array for all Repeating Invoice + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getRepeatingInvoicesForHttpResponse(String accessToken, String xeroTenantId, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getRepeatingInvoices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for aged payables by contact + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param contactId Unique identifier for a Contact + * @param date The date of the Aged Payables By Contact report + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportAgedPayablesByContact(String accessToken, String xeroTenantId, UUID contactId, LocalDate date, LocalDate fromDate, LocalDate toDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportAgedPayablesByContactForHttpResponse(accessToken, xeroTenantId, contactId, date, fromDate, toDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportAgedPayablesByContact -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for aged payables by contact + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param contactId Unique identifier for a Contact + * @param date The date of the Aged Payables By Contact report + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportAgedPayablesByContactForHttpResponse(String accessToken, String xeroTenantId, UUID contactId, LocalDate date, LocalDate fromDate, LocalDate toDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportAgedPayablesByContact"); + }// verify the required parameter 'contactId' is set + if (contactId == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactId' when calling getReportAgedPayablesByContact"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportAgedPayablesByContact"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/AgedPayablesByContact"); + if (contactId != null) { + String key = "contactId"; + Object value = contactId; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (date != null) { + String key = "date"; + Object value = date; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (fromDate != null) { + String key = "fromDate"; + Object value = fromDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (toDate != null) { + String key = "toDate"; + Object value = toDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for aged receivables by contact + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param contactId Unique identifier for a Contact + * @param date The date of the Aged Receivables By Contact report + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportAgedReceivablesByContact(String accessToken, String xeroTenantId, UUID contactId, LocalDate date, LocalDate fromDate, LocalDate toDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportAgedReceivablesByContactForHttpResponse(accessToken, xeroTenantId, contactId, date, fromDate, toDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportAgedReceivablesByContact -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for aged receivables by contact + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param contactId Unique identifier for a Contact + * @param date The date of the Aged Receivables By Contact report + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportAgedReceivablesByContactForHttpResponse(String accessToken, String xeroTenantId, UUID contactId, LocalDate date, LocalDate fromDate, LocalDate toDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportAgedReceivablesByContact"); + }// verify the required parameter 'contactId' is set + if (contactId == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactId' when calling getReportAgedReceivablesByContact"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportAgedReceivablesByContact"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/AgedReceivablesByContact"); + if (contactId != null) { + String key = "contactId"; + Object value = contactId; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (date != null) { + String key = "date"; + Object value = date; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (fromDate != null) { + String key = "fromDate"; + Object value = fromDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (toDate != null) { + String key = "toDate"; + Object value = toDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for balancesheet + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param date The date of the Balance Sheet report + * @param periods The number of periods for the Balance Sheet report + * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param trackingOptionID1 The tracking option 1 for the Balance Sheet report + * @param trackingOptionID2 The tracking option 2 for the Balance Sheet report + * @param standardLayout The standard layout boolean for the Balance Sheet report + * @param paymentsOnly return a cash basis for the Balance Sheet report + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportBalanceSheet(String accessToken, String xeroTenantId, LocalDate date, Integer periods, String timeframe, String trackingOptionID1, String trackingOptionID2, Boolean standardLayout, Boolean paymentsOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportBalanceSheetForHttpResponse(accessToken, xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportBalanceSheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for balancesheet + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param date The date of the Balance Sheet report + * @param periods The number of periods for the Balance Sheet report + * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param trackingOptionID1 The tracking option 1 for the Balance Sheet report + * @param trackingOptionID2 The tracking option 2 for the Balance Sheet report + * @param standardLayout The standard layout boolean for the Balance Sheet report + * @param paymentsOnly return a cash basis for the Balance Sheet report + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportBalanceSheetForHttpResponse(String accessToken, String xeroTenantId, LocalDate date, Integer periods, String timeframe, String trackingOptionID1, String trackingOptionID2, Boolean standardLayout, Boolean paymentsOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportBalanceSheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportBalanceSheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/BalanceSheet"); + if (date != null) { + String key = "date"; + Object value = date; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (periods != null) { + String key = "periods"; + Object value = periods; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (timeframe != null) { + String key = "timeframe"; + Object value = timeframe; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (trackingOptionID1 != null) { + String key = "trackingOptionID1"; + Object value = trackingOptionID1; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (trackingOptionID2 != null) { + String key = "trackingOptionID2"; + Object value = trackingOptionID2; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (standardLayout != null) { + String key = "standardLayout"; + Object value = standardLayout; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (paymentsOnly != null) { + String key = "paymentsOnly"; + Object value = paymentsOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for bank summary + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportBankSummary(String accessToken, String xeroTenantId, LocalDate fromDate, LocalDate toDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportBankSummaryForHttpResponse(accessToken, xeroTenantId, fromDate, toDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportBankSummary -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for bank summary + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportBankSummaryForHttpResponse(String accessToken, String xeroTenantId, LocalDate fromDate, LocalDate toDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportBankSummary"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportBankSummary"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/BankSummary"); + if (fromDate != null) { + String key = "fromDate"; + Object value = fromDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (toDate != null) { + String key = "toDate"; + Object value = toDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for budget summary + *

200 - success- return a Report with Rows object + * @param xeroTenantId Xero identifier for Tenant + * @param date The date for the Bank Summary report e.g. 2018-03-31 + * @param periods The number of periods to compare (integer between 1 and 12) + * @param timeframe The period size to compare to (1=month, 3=quarter, 12=year) + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportBudgetSummary(String accessToken, String xeroTenantId, LocalDate date, Integer periods, Integer timeframe) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportBudgetSummaryForHttpResponse(accessToken, xeroTenantId, date, periods, timeframe); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportBudgetSummary -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for budget summary + *

200 - success- return a Report with Rows object + * @param xeroTenantId Xero identifier for Tenant + * @param date The date for the Bank Summary report e.g. 2018-03-31 + * @param periods The number of periods to compare (integer between 1 and 12) + * @param timeframe The period size to compare to (1=month, 3=quarter, 12=year) + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportBudgetSummaryForHttpResponse(String accessToken, String xeroTenantId, LocalDate date, Integer periods, Integer timeframe) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportBudgetSummary"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportBudgetSummary"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/BudgetSummary"); + if (date != null) { + String key = "date"; + Object value = date; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (periods != null) { + String key = "periods"; + Object value = periods; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (timeframe != null) { + String key = "timeframe"; + Object value = timeframe; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for executive summary + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param date The date for the Bank Summary report e.g. 2018-03-31 + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportExecutiveSummary(String accessToken, String xeroTenantId, LocalDate date) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportExecutiveSummaryForHttpResponse(accessToken, xeroTenantId, date); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportExecutiveSummary -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for executive summary + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param date The date for the Bank Summary report e.g. 2018-03-31 + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportExecutiveSummaryForHttpResponse(String accessToken, String xeroTenantId, LocalDate date) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportExecutiveSummary"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportExecutiveSummary"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/ExecutiveSummary"); + if (date != null) { + String key = "date"; + Object value = date; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific report using a unique ReportID + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param reportID Unique identifier for a Report + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportFromId(String accessToken, String xeroTenantId, String reportID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportFromIdForHttpResponse(accessToken, xeroTenantId, reportID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportFromId -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific report using a unique ReportID + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param reportID Unique identifier for a Report + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportFromIdForHttpResponse(String accessToken, String xeroTenantId, String reportID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportFromId"); + }// verify the required parameter 'reportID' is set + if (reportID == null) { + throw new IllegalArgumentException("Missing the required parameter 'reportID' when calling getReportFromId"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportFromId"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReportID", reportID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/{ReportID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for profit and loss + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param periods The number of periods to compare (integer between 1 and 12) + * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report + * @param trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report + * @param trackingOptionID The tracking option 1 for the ProfitAndLoss report + * @param trackingOptionID2 The tracking option 2 for the ProfitAndLoss report + * @param standardLayout Return the standard layout for the ProfitAndLoss report + * @param paymentsOnly Return cash only basis for the ProfitAndLoss report + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportProfitAndLoss(String accessToken, String xeroTenantId, LocalDate fromDate, LocalDate toDate, Integer periods, String timeframe, String trackingCategoryID, String trackingCategoryID2, String trackingOptionID, String trackingOptionID2, Boolean standardLayout, Boolean paymentsOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportProfitAndLossForHttpResponse(accessToken, xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportProfitAndLoss -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for profit and loss + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param fromDate filter by the from date of the report e.g. 2021-02-01 + * @param toDate filter by the to date of the report e.g. 2021-02-28 + * @param periods The number of periods to compare (integer between 1 and 12) + * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report + * @param trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report + * @param trackingOptionID The tracking option 1 for the ProfitAndLoss report + * @param trackingOptionID2 The tracking option 2 for the ProfitAndLoss report + * @param standardLayout Return the standard layout for the ProfitAndLoss report + * @param paymentsOnly Return cash only basis for the ProfitAndLoss report + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportProfitAndLossForHttpResponse(String accessToken, String xeroTenantId, LocalDate fromDate, LocalDate toDate, Integer periods, String timeframe, String trackingCategoryID, String trackingCategoryID2, String trackingOptionID, String trackingOptionID2, Boolean standardLayout, Boolean paymentsOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportProfitAndLoss"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportProfitAndLoss"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/ProfitAndLoss"); + if (fromDate != null) { + String key = "fromDate"; + Object value = fromDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (toDate != null) { + String key = "toDate"; + Object value = toDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (periods != null) { + String key = "periods"; + Object value = periods; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (timeframe != null) { + String key = "timeframe"; + Object value = timeframe; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (trackingCategoryID != null) { + String key = "trackingCategoryID"; + Object value = trackingCategoryID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (trackingCategoryID2 != null) { + String key = "trackingCategoryID2"; + Object value = trackingCategoryID2; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (trackingOptionID != null) { + String key = "trackingOptionID"; + Object value = trackingOptionID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (trackingOptionID2 != null) { + String key = "trackingOptionID2"; + Object value = trackingOptionID2; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (standardLayout != null) { + String key = "standardLayout"; + Object value = standardLayout; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (paymentsOnly != null) { + String key = "paymentsOnly"; + Object value = paymentsOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieve reports for 1099 + *

200 - Success - return response of type Reports + * @param xeroTenantId Xero identifier for Tenant + * @param reportYear The year of the 1099 report + * @param accessToken Authorization token for user set in header of each request + * @return Reports + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Reports getReportTenNinetyNine(String accessToken, String xeroTenantId, String reportYear) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportTenNinetyNineForHttpResponse(accessToken, xeroTenantId, reportYear); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportTenNinetyNine -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieve reports for 1099 + *

200 - Success - return response of type Reports + * @param xeroTenantId Xero identifier for Tenant + * @param reportYear The year of the 1099 report + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportTenNinetyNineForHttpResponse(String accessToken, String xeroTenantId, String reportYear) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportTenNinetyNine"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportTenNinetyNine"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/TenNinetyNine"); + if (reportYear != null) { + String key = "reportYear"; + Object value = reportYear; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves report for trial balance + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param date The date for the Trial Balance report e.g. 2018-03-31 + * @param paymentsOnly Return cash only basis for the Trial Balance report + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportTrialBalance(String accessToken, String xeroTenantId, LocalDate date, Boolean paymentsOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportTrialBalanceForHttpResponse(accessToken, xeroTenantId, date, paymentsOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportTrialBalance -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves report for trial balance + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param date The date for the Trial Balance report e.g. 2018-03-31 + * @param paymentsOnly Return cash only basis for the Trial Balance report + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportTrialBalanceForHttpResponse(String accessToken, String xeroTenantId, LocalDate date, Boolean paymentsOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportTrialBalance"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportTrialBalance"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/TrialBalance"); + if (date != null) { + String key = "date"; + Object value = date; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (paymentsOnly != null) { + String key = "paymentsOnly"; + Object value = paymentsOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a list of the organistaions unique reports that require a uuid to fetch + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return ReportWithRows + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportWithRows getReportsList(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReportsListForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReportsList -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a list of the organistaions unique reports that require a uuid to fetch + *

200 - Success - return response of type ReportWithRows + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReportsListForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReportsList"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReportsList"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific tax rate according to given TaxType code + *

200 - Success - return response of type TaxRates array with one TaxRate + * @param xeroTenantId Xero identifier for Tenant + * @param taxType A valid TaxType code + * @param accessToken Authorization token for user set in header of each request + * @return TaxRates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TaxRates getTaxRateByTaxType(String accessToken, String xeroTenantId, String taxType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTaxRateByTaxTypeForHttpResponse(accessToken, xeroTenantId, taxType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTaxRateByTaxType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific tax rate according to given TaxType code + *

200 - Success - return response of type TaxRates array with one TaxRate + * @param xeroTenantId Xero identifier for Tenant + * @param taxType A valid TaxType code + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTaxRateByTaxTypeForHttpResponse(String accessToken, String xeroTenantId, String taxType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTaxRateByTaxType"); + }// verify the required parameter 'taxType' is set + if (taxType == null) { + throw new IllegalArgumentException("Missing the required parameter 'taxType' when calling getTaxRateByTaxType"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTaxRateByTaxType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TaxType", taxType); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates/{TaxType}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves tax rates + *

200 - Success - return response of type TaxRates array with TaxRates + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return TaxRates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TaxRates getTaxRates(String accessToken, String xeroTenantId, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTaxRatesForHttpResponse(accessToken, xeroTenantId, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTaxRates -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves tax rates + *

200 - Success - return response of type TaxRates array with TaxRates + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTaxRatesForHttpResponse(String accessToken, String xeroTenantId, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTaxRates"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTaxRates"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves tracking categories and options + *

200 - Success - return response of type TrackingCategories array of TrackingCategory + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param includeArchived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response + * @param accessToken Authorization token for user set in header of each request + * @return TrackingCategories + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingCategories getTrackingCategories(String accessToken, String xeroTenantId, String where, String order, Boolean includeArchived) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTrackingCategoriesForHttpResponse(accessToken, xeroTenantId, where, order, includeArchived); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTrackingCategories -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves tracking categories and options + *

200 - Success - return response of type TrackingCategories array of TrackingCategory + * @param xeroTenantId Xero identifier for Tenant + * @param where Filter by an any element + * @param order Order by an any element + * @param includeArchived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTrackingCategoriesForHttpResponse(String accessToken, String xeroTenantId, String where, String order, Boolean includeArchived) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTrackingCategories"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTrackingCategories"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (includeArchived != null) { + String key = "includeArchived"; + Object value = includeArchived; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves specific tracking categories and options using a unique tracking category Id + *

200 - Success - return response of type TrackingCategories array of specified TrackingCategory + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param accessToken Authorization token for user set in header of each request + * @return TrackingCategories + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingCategories getTrackingCategory(String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTrackingCategoryForHttpResponse(accessToken, xeroTenantId, trackingCategoryID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTrackingCategory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves specific tracking categories and options using a unique tracking category Id + *

200 - Success - return response of type TrackingCategories array of specified TrackingCategory + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTrackingCategoryForHttpResponse(String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTrackingCategory"); + }// verify the required parameter 'trackingCategoryID' is set + if (trackingCategoryID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategoryID' when calling getTrackingCategory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTrackingCategory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TrackingCategoryID", trackingCategoryID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific user + *

200 - Success - return response of type Users array of specified User + * @param xeroTenantId Xero identifier for Tenant + * @param userID Unique identifier for a User + * @param accessToken Authorization token for user set in header of each request + * @return Users + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Users getUser(String accessToken, String xeroTenantId, UUID userID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getUserForHttpResponse(accessToken, xeroTenantId, userID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getUser -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific user + *

200 - Success - return response of type Users array of specified User + * @param xeroTenantId Xero identifier for Tenant + * @param userID Unique identifier for a User + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getUserForHttpResponse(String accessToken, String xeroTenantId, UUID userID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getUser"); + }// verify the required parameter 'userID' is set + if (userID == null) { + throw new IllegalArgumentException("Missing the required parameter 'userID' when calling getUser"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getUser"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("UserID", userID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Users/{UserID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves users + *

200 - Success - return response of type Users array of all User + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return Users + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Users getUsers(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getUsersForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getUsers -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves users + *

200 - Success - return response of type Users array of all User + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getUsersForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getUsers"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getUsers"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Users"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Sets the chart of accounts, the conversion date and conversion balances + *

200 - Success - returns a summary of the chart of accounts updates + * @param xeroTenantId Xero identifier for Tenant + * @param setup Object including an accounts array, a conversion balances array and a conversion date object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ImportSummaryObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ImportSummaryObject postSetup(String accessToken, String xeroTenantId, Setup setup, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = postSetupForHttpResponse(accessToken, xeroTenantId, setup, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : postSetup -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Sets the chart of accounts, the conversion date and conversion balances + *

200 - Success - returns a summary of the chart of accounts updates + * @param xeroTenantId Xero identifier for Tenant + * @param setup Object including an accounts array, a conversion balances array and a conversion date object in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse postSetupForHttpResponse(String accessToken, String xeroTenantId, Setup setup, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling postSetup"); + }// verify the required parameter 'setup' is set + if (setup == null) { + throw new IllegalArgumentException("Missing the required parameter 'setup' when calling postSetup"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling postSetup"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Setup"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(setup); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a chart of accounts + *

200 - Success - update existing Account and return response of type Accounts array with updated Account + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accounts Request of type Accounts array with one Account + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Accounts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Accounts updateAccount(String accessToken, String xeroTenantId, UUID accountID, Accounts accounts, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateAccountForHttpResponse(accessToken, xeroTenantId, accountID, accounts, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateAccount -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Accounts",object.getMessage(), e); + } + handler.validationError("Accounts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a chart of accounts + *

200 - Success - update existing Account and return response of type Accounts array with updated Account + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param accounts Request of type Accounts array with one Account + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateAccountForHttpResponse(String accessToken, String xeroTenantId, UUID accountID, Accounts accounts, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateAccount"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling updateAccount"); + }// verify the required parameter 'accounts' is set + if (accounts == null) { + throw new IllegalArgumentException("Missing the required parameter 'accounts' when calling updateAccount"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateAccount"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(accounts); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateAccountAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates attachment on a specific account by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateAccountAttachmentByFileName(String accessToken, String xeroTenantId, UUID accountID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateAccountAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateAccountAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates attachment on a specific account by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateAccountAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID accountID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateAccountAttachmentByFileName"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling updateAccountAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateAccountAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateAccountAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateAccountAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates attachment on a specific account by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateAccountAttachmentByFileName(String accessToken, String xeroTenantId, UUID accountID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateAccountAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateAccountAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates attachment on a specific account by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param accountID Unique identifier for Account object + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateAccountAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID accountID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateAccountAttachmentByFileName"); + }// verify the required parameter 'accountID' is set + if (accountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'accountID' when calling updateAccountAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateAccountAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateAccountAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateAccountAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("AccountID", accountID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a single spent or received money transaction + *

200 - Success - return response of type BankTransactions array with updated BankTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param bankTransactions The bankTransactions parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BankTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransactions updateBankTransaction(String accessToken, String xeroTenantId, UUID bankTransactionID, BankTransactions bankTransactions, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateBankTransactionForHttpResponse(accessToken, xeroTenantId, bankTransactionID, bankTransactions, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateBankTransaction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("BankTransactions",object.getMessage(), e); + } + handler.validationError("BankTransactions",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a single spent or received money transaction + *

200 - Success - return response of type BankTransactions array with updated BankTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param bankTransactions The bankTransactions parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateBankTransactionForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, BankTransactions bankTransactions, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateBankTransaction"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling updateBankTransaction"); + }// verify the required parameter 'bankTransactions' is set + if (bankTransactions == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactions' when calling updateBankTransaction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateBankTransaction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(bankTransactions); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateBankTransactionAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates a specific attachment from a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateBankTransactionAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateBankTransactionAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateBankTransactionAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateBankTransactionAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateBankTransactionAttachmentByFileName"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling updateBankTransactionAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateBankTransactionAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateBankTransactionAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateBankTransactionAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates a specific attachment from a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateBankTransactionAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateBankTransactionAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateBankTransactionAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific bank transaction by filename + *

200 - Success - return response of Attachments array of Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactionID Xero generated unique identifier for a bank transaction + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateBankTransactionAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransactionID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateBankTransactionAttachmentByFileName"); + }// verify the required parameter 'bankTransactionID' is set + if (bankTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactionID' when calling updateBankTransactionAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateBankTransactionAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateBankTransactionAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateBankTransactionAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransactionID", bankTransactionID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateBankTransferAttachmentByFileName to allow byte[] or File type to be passed as body + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateBankTransferAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateBankTransferAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateBankTransferAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateBankTransferAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateBankTransferAttachmentByFileName"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling updateBankTransferAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateBankTransferAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateBankTransferAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateBankTransferAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateBankTransferAttachmentByFileName(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateBankTransferAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateBankTransferAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransferID Xero generated unique identifier for a bank transfer + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateBankTransferAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID bankTransferID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateBankTransferAttachmentByFileName"); + }// verify the required parameter 'bankTransferID' is set + if (bankTransferID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransferID' when calling updateBankTransferAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateBankTransferAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateBankTransferAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateBankTransferAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("BankTransferID", bankTransferID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific contact in a Xero organisation + *

200 - Success - return response of type Contacts array with an updated Contact + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param contacts an array of Contacts containing single Contact object with properties to update + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Contacts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Contacts updateContact(String accessToken, String xeroTenantId, UUID contactID, Contacts contacts, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateContactForHttpResponse(accessToken, xeroTenantId, contactID, contacts, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateContact -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Contacts",object.getMessage(), e); + } + handler.validationError("Contacts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific contact in a Xero organisation + *

200 - Success - return response of type Contacts array with an updated Contact + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param contacts an array of Contacts containing single Contact object with properties to update + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateContactForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, Contacts contacts, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateContact"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling updateContact"); + }// verify the required parameter 'contacts' is set + if (contacts == null) { + throw new IllegalArgumentException("Missing the required parameter 'contacts' when calling updateContact"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateContact"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(contacts); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateContactAttachmentByFileName to allow byte[] or File type to be passed as body + /** + *

200 - Success - return response of type Attachments array with an updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateContactAttachmentByFileName(String accessToken, String xeroTenantId, UUID contactID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateContactAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateContactAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of type Attachments array with an updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateContactAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateContactAttachmentByFileName"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling updateContactAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateContactAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateContactAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateContactAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + *

200 - Success - return response of type Attachments array with an updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateContactAttachmentByFileName(String accessToken, String xeroTenantId, UUID contactID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateContactAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateContactAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + *

200 - Success - return response of type Attachments array with an updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactID Unique identifier for a Contact + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateContactAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID contactID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateContactAttachmentByFileName"); + }// verify the required parameter 'contactID' is set + if (contactID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactID' when calling updateContactAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateContactAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateContactAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateContactAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactID", contactID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific contact group + *

200 - Success - return response of type Contact Groups array of updated Contact Group + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param contactGroups an array of Contact groups with Name of specific group to update + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ContactGroups + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ContactGroups updateContactGroup(String accessToken, String xeroTenantId, UUID contactGroupID, ContactGroups contactGroups, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateContactGroupForHttpResponse(accessToken, xeroTenantId, contactGroupID, contactGroups, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateContactGroup -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("ContactGroups",object.getMessage(), e); + } + handler.validationError("ContactGroups",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific contact group + *

200 - Success - return response of type Contact Groups array of updated Contact Group + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param contactGroupID Unique identifier for a Contact Group + * @param contactGroups an array of Contact groups with Name of specific group to update + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateContactGroupForHttpResponse(String accessToken, String xeroTenantId, UUID contactGroupID, ContactGroups contactGroups, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateContactGroup"); + }// verify the required parameter 'contactGroupID' is set + if (contactGroupID == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactGroupID' when calling updateContactGroup"); + }// verify the required parameter 'contactGroups' is set + if (contactGroups == null) { + throw new IllegalArgumentException("Missing the required parameter 'contactGroups' when calling updateContactGroup"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateContactGroup"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ContactGroupID", contactGroupID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(contactGroups); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific credit note + *

200 - Success - return response of type Credit Notes array with updated CreditNote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param creditNotes an array of Credit Notes containing credit note details to update + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return CreditNotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CreditNotes updateCreditNote(String accessToken, String xeroTenantId, UUID creditNoteID, CreditNotes creditNotes, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateCreditNoteForHttpResponse(accessToken, xeroTenantId, creditNoteID, creditNotes, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateCreditNote -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("CreditNotes",object.getMessage(), e); + } + handler.validationError("CreditNotes",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific credit note + *

200 - Success - return response of type Credit Notes array with updated CreditNote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param creditNotes an array of Credit Notes containing credit note details to update + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateCreditNoteForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, CreditNotes creditNotes, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateCreditNote"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling updateCreditNote"); + }// verify the required parameter 'creditNotes' is set + if (creditNotes == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNotes' when calling updateCreditNote"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateCreditNote"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(creditNotes); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateCreditNoteAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates attachments on a specific credit note by file name + *

200 - Success - return response of type Attachments array with updated Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateCreditNoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateCreditNoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, creditNoteID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateCreditNoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates attachments on a specific credit note by file name + *

200 - Success - return response of type Attachments array with updated Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateCreditNoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateCreditNoteAttachmentByFileName"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling updateCreditNoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateCreditNoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateCreditNoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateCreditNoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates attachments on a specific credit note by file name + *

200 - Success - return response of type Attachments array with updated Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateCreditNoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateCreditNoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, creditNoteID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateCreditNoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates attachments on a specific credit note by file name + *

200 - Success - return response of type Attachments array with updated Attachment for specific Credit Note + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNoteID Unique identifier for a Credit Note + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateCreditNoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateCreditNoteAttachmentByFileName"); + }// verify the required parameter 'creditNoteID' is set + if (creditNoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNoteID' when calling updateCreditNoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateCreditNoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateCreditNoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateCreditNoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("CreditNoteID", creditNoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific expense claims + *

200 - Success - return response of type ExpenseClaims array with updated ExpenseClaim + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param expenseClaims The expenseClaims parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ExpenseClaims + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ExpenseClaims updateExpenseClaim(String accessToken, String xeroTenantId, UUID expenseClaimID, ExpenseClaims expenseClaims, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateExpenseClaimForHttpResponse(accessToken, xeroTenantId, expenseClaimID, expenseClaims, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateExpenseClaim -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("ExpenseClaims",object.getMessage(), e); + } + handler.validationError("ExpenseClaims",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific expense claims + *

200 - Success - return response of type ExpenseClaims array with updated ExpenseClaim + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param expenseClaimID Unique identifier for a ExpenseClaim + * @param expenseClaims The expenseClaims parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateExpenseClaimForHttpResponse(String accessToken, String xeroTenantId, UUID expenseClaimID, ExpenseClaims expenseClaims, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateExpenseClaim"); + }// verify the required parameter 'expenseClaimID' is set + if (expenseClaimID == null) { + throw new IllegalArgumentException("Missing the required parameter 'expenseClaimID' when calling updateExpenseClaim"); + }// verify the required parameter 'expenseClaims' is set + if (expenseClaims == null) { + throw new IllegalArgumentException("Missing the required parameter 'expenseClaims' when calling updateExpenseClaim"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateExpenseClaim"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ExpenseClaimID", expenseClaimID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(expenseClaims); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with updated Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param invoices The invoices parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Invoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Invoices updateInvoice(String accessToken, String xeroTenantId, UUID invoiceID, Invoices invoices, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateInvoiceForHttpResponse(accessToken, xeroTenantId, invoiceID, invoices, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateInvoice -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Invoices",object.getMessage(), e); + } + handler.validationError("Invoices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with updated Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param invoices The invoices parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateInvoiceForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, Invoices invoices, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateInvoice"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling updateInvoice"); + }// verify the required parameter 'invoices' is set + if (invoices == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoices' when calling updateInvoice"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateInvoice"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(invoices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateInvoiceAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates an attachment from a specific invoices or purchase bill by filename + *

200 - Success - return response of type Attachments array with updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, invoiceID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates an attachment from a specific invoices or purchase bill by filename + *

200 - Success - return response of type Attachments array with updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateInvoiceAttachmentByFileName"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling updateInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates an attachment from a specific invoices or purchase bill by filename + *

200 - Success - return response of type Attachments array with updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, invoiceID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates an attachment from a specific invoices or purchase bill by filename + *

200 - Success - return response of type Attachments array with updated Attachment + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoiceID Unique identifier for an Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateInvoiceAttachmentByFileName"); + }// verify the required parameter 'invoiceID' is set + if (invoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoiceID' when calling updateInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("InvoiceID", invoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific item + *

200 - Success - return response of type Items array with updated Item + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param items The items parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Items + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Items updateItem(String accessToken, String xeroTenantId, UUID itemID, Items items, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateItemForHttpResponse(accessToken, xeroTenantId, itemID, items, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateItem -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Items",object.getMessage(), e); + } + handler.validationError("Items",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific item + *

200 - Success - return response of type Items array with updated Item + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param itemID Unique identifier for an Item + * @param items The items parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateItemForHttpResponse(String accessToken, String xeroTenantId, UUID itemID, Items items, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateItem"); + }// verify the required parameter 'itemID' is set + if (itemID == null) { + throw new IllegalArgumentException("Missing the required parameter 'itemID' when calling updateItem"); + }// verify the required parameter 'items' is set + if (items == null) { + throw new IllegalArgumentException("Missing the required parameter 'items' when calling updateItem"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateItem"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ItemID", itemID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(items); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific linked transactions (billable expenses) + *

200 - Success - return response of type LinkedTransactions array with updated LinkedTransaction + *

400 - Success - return response of type LinkedTransactions array with updated LinkedTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransactionID Unique identifier for a LinkedTransaction + * @param linkedTransactions The linkedTransactions parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LinkedTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LinkedTransactions updateLinkedTransaction(String accessToken, String xeroTenantId, UUID linkedTransactionID, LinkedTransactions linkedTransactions, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateLinkedTransactionForHttpResponse(accessToken, xeroTenantId, linkedTransactionID, linkedTransactions, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateLinkedTransaction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("LinkedTransactions",object.getMessage(), e); + } + handler.validationError("LinkedTransactions",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific linked transactions (billable expenses) + *

200 - Success - return response of type LinkedTransactions array with updated LinkedTransaction + *

400 - Success - return response of type LinkedTransactions array with updated LinkedTransaction + * @param xeroTenantId Xero identifier for Tenant + * @param linkedTransactionID Unique identifier for a LinkedTransaction + * @param linkedTransactions The linkedTransactions parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateLinkedTransactionForHttpResponse(String accessToken, String xeroTenantId, UUID linkedTransactionID, LinkedTransactions linkedTransactions, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateLinkedTransaction"); + }// verify the required parameter 'linkedTransactionID' is set + if (linkedTransactionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'linkedTransactionID' when calling updateLinkedTransaction"); + }// verify the required parameter 'linkedTransactions' is set + if (linkedTransactions == null) { + throw new IllegalArgumentException("Missing the required parameter 'linkedTransactions' when calling updateLinkedTransaction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateLinkedTransaction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LinkedTransactionID", linkedTransactionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions/{LinkedTransactionID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(linkedTransactions); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific manual journal + *

200 - Success - return response of type ManualJournals array with an updated ManualJournal + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param manualJournals The manualJournals parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ManualJournals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ManualJournals updateManualJournal(String accessToken, String xeroTenantId, UUID manualJournalID, ManualJournals manualJournals, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateManualJournalForHttpResponse(accessToken, xeroTenantId, manualJournalID, manualJournals, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateManualJournal -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("ManualJournals",object.getMessage(), e); + } + handler.validationError("ManualJournals",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific manual journal + *

200 - Success - return response of type ManualJournals array with an updated ManualJournal + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param manualJournals The manualJournals parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateManualJournalForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, ManualJournals manualJournals, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateManualJournal"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling updateManualJournal"); + }// verify the required parameter 'manualJournals' is set + if (manualJournals == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournals' when calling updateManualJournal"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateManualJournal"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(manualJournals); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateManualJournalAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates a specific attachment from a specific manual journal by file name + *

200 - Success - return response of type Attachments array with an update Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateManualJournalAttachmentByFileName(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateManualJournalAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateManualJournalAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific manual journal by file name + *

200 - Success - return response of type Attachments array with an update Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateManualJournalAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateManualJournalAttachmentByFileName"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling updateManualJournalAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateManualJournalAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateManualJournalAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateManualJournalAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates a specific attachment from a specific manual journal by file name + *

200 - Success - return response of type Attachments array with an update Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateManualJournalAttachmentByFileName(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateManualJournalAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateManualJournalAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific manual journal by file name + *

200 - Success - return response of type Attachments array with an update Attachment for a ManualJournals + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournalID Unique identifier for a ManualJournal + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateManualJournalAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID manualJournalID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateManualJournalAttachmentByFileName"); + }// verify the required parameter 'manualJournalID' is set + if (manualJournalID == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournalID' when calling updateManualJournalAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateManualJournalAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateManualJournalAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateManualJournalAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ManualJournalID", manualJournalID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates one or more spent or received money transaction + *

200 - Success - return response of type BankTransactions array with new BankTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactions The bankTransactions parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BankTransactions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankTransactions updateOrCreateBankTransactions(String accessToken, String xeroTenantId, BankTransactions bankTransactions, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateBankTransactionsForHttpResponse(accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateBankTransactions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("BankTransactions",object.getMessage(), e); + } + handler.validationError("BankTransactions",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates one or more spent or received money transaction + *

200 - Success - return response of type BankTransactions array with new BankTransaction + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param bankTransactions The bankTransactions parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateBankTransactionsForHttpResponse(String accessToken, String xeroTenantId, BankTransactions bankTransactions, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateBankTransactions"); + }// verify the required parameter 'bankTransactions' is set + if (bankTransactions == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankTransactions' when calling updateOrCreateBankTransactions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateBankTransactions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(bankTransactions); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates one or more contacts in a Xero organisation + *

200 - Success - return response of type Contacts array with newly created Contact + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param contacts The contacts parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Contacts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Contacts updateOrCreateContacts(String accessToken, String xeroTenantId, Contacts contacts, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateContactsForHttpResponse(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateContacts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Contacts",object.getMessage(), e); + } + handler.validationError("Contacts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates one or more contacts in a Xero organisation + *

200 - Success - return response of type Contacts array with newly created Contact + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param contacts The contacts parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateContactsForHttpResponse(String accessToken, String xeroTenantId, Contacts contacts, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateContacts"); + }// verify the required parameter 'contacts' is set + if (contacts == null) { + throw new IllegalArgumentException("Missing the required parameter 'contacts' when calling updateOrCreateContacts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateContacts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(contacts); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates one or more credit notes + *

200 - Success - return response of type Credit Notes array of newly created CreditNote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNotes an array of Credit Notes with a single CreditNote object. + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return CreditNotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CreditNotes updateOrCreateCreditNotes(String accessToken, String xeroTenantId, CreditNotes creditNotes, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateCreditNotesForHttpResponse(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateCreditNotes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("CreditNotes",object.getMessage(), e); + } + handler.validationError("CreditNotes",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates one or more credit notes + *

200 - Success - return response of type Credit Notes array of newly created CreditNote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param creditNotes an array of Credit Notes with a single CreditNote object. + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateCreditNotesForHttpResponse(String accessToken, String xeroTenantId, CreditNotes creditNotes, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateCreditNotes"); + }// verify the required parameter 'creditNotes' is set + if (creditNotes == null) { + throw new IllegalArgumentException("Missing the required parameter 'creditNotes' when calling updateOrCreateCreditNotes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateCreditNotes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(creditNotes); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a single new employees used in Xero payrun + *

200 - Success - return response of type Employees array with new Employee + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param employees Employees with array of Employee object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees updateOrCreateEmployees(String accessToken, String xeroTenantId, Employees employees, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateEmployeesForHttpResponse(accessToken, xeroTenantId, employees, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateEmployees -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Employees",object.getMessage(), e); + } + handler.validationError("Employees",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a single new employees used in Xero payrun + *

200 - Success - return response of type Employees array with new Employee + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param employees Employees with array of Employee object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateEmployeesForHttpResponse(String accessToken, String xeroTenantId, Employees employees, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateEmployees"); + }// verify the required parameter 'employees' is set + if (employees == null) { + throw new IllegalArgumentException("Missing the required parameter 'employees' when calling updateOrCreateEmployees"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateEmployees"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employees); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates one or more sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with newly created Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoices The invoices parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Invoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Invoices updateOrCreateInvoices(String accessToken, String xeroTenantId, Invoices invoices, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateInvoicesForHttpResponse(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateInvoices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Invoices",object.getMessage(), e); + } + handler.validationError("Invoices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates one or more sales invoices or purchase bills + *

200 - Success - return response of type Invoices array with newly created Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param invoices The invoices parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateInvoicesForHttpResponse(String accessToken, String xeroTenantId, Invoices invoices, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateInvoices"); + }// verify the required parameter 'invoices' is set + if (invoices == null) { + throw new IllegalArgumentException("Missing the required parameter 'invoices' when calling updateOrCreateInvoices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateInvoices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(invoices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates one or more items + *

200 - Success - return response of type Items array with newly created Item + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param items The items parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Items + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Items updateOrCreateItems(String accessToken, String xeroTenantId, Items items, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateItemsForHttpResponse(accessToken, xeroTenantId, items, summarizeErrors, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateItems -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Items",object.getMessage(), e); + } + handler.validationError("Items",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates one or more items + *

200 - Success - return response of type Items array with newly created Item + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param items The items parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateItemsForHttpResponse(String accessToken, String xeroTenantId, Items items, Boolean summarizeErrors, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateItems"); + }// verify the required parameter 'items' is set + if (items == null) { + throw new IllegalArgumentException("Missing the required parameter 'items' when calling updateOrCreateItems"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateItems"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(items); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates a single manual journal + *

200 - Success - return response of type ManualJournals array with newly created ManualJournal + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournals ManualJournals array with ManualJournal object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ManualJournals + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ManualJournals updateOrCreateManualJournals(String accessToken, String xeroTenantId, ManualJournals manualJournals, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateManualJournalsForHttpResponse(accessToken, xeroTenantId, manualJournals, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateManualJournals -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("ManualJournals",object.getMessage(), e); + } + handler.validationError("ManualJournals",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates a single manual journal + *

200 - Success - return response of type ManualJournals array with newly created ManualJournal + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param manualJournals ManualJournals array with ManualJournal object in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateManualJournalsForHttpResponse(String accessToken, String xeroTenantId, ManualJournals manualJournals, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateManualJournals"); + }// verify the required parameter 'manualJournals' is set + if (manualJournals == null) { + throw new IllegalArgumentException("Missing the required parameter 'manualJournals' when calling updateOrCreateManualJournals"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateManualJournals"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(manualJournals); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates one or more purchase orders + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrders The purchaseOrders parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PurchaseOrders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PurchaseOrders updateOrCreatePurchaseOrders(String accessToken, String xeroTenantId, PurchaseOrders purchaseOrders, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreatePurchaseOrdersForHttpResponse(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreatePurchaseOrders -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("PurchaseOrders",object.getMessage(), e); + } + handler.validationError("PurchaseOrders",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates one or more purchase orders + *

200 - Success - return response of type PurchaseOrder array for specified PurchaseOrder + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrders The purchaseOrders parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreatePurchaseOrdersForHttpResponse(String accessToken, String xeroTenantId, PurchaseOrders purchaseOrders, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreatePurchaseOrders"); + }// verify the required parameter 'purchaseOrders' is set + if (purchaseOrders == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrders' when calling updateOrCreatePurchaseOrders"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreatePurchaseOrders"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(purchaseOrders); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates or creates one or more quotes + *

200 - Success - return response of type Quotes array with updated or created Quote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quotes The quotes parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Quotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Quotes updateOrCreateQuotes(String accessToken, String xeroTenantId, Quotes quotes, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateQuotesForHttpResponse(accessToken, xeroTenantId, quotes, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateQuotes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Quotes",object.getMessage(), e); + } + handler.validationError("Quotes",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates or creates one or more quotes + *

200 - Success - return response of type Quotes array with updated or created Quote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quotes The quotes parameter + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateQuotesForHttpResponse(String accessToken, String xeroTenantId, Quotes quotes, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateQuotes"); + }// verify the required parameter 'quotes' is set + if (quotes == null) { + throw new IllegalArgumentException("Missing the required parameter 'quotes' when calling updateOrCreateQuotes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateQuotes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(quotes); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates or deletes one or more repeating invoice templates + *

200 - Success - return response of type RepeatingInvoices array with newly created RepeatingInvoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return RepeatingInvoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public RepeatingInvoices updateOrCreateRepeatingInvoices(String accessToken, String xeroTenantId, RepeatingInvoices repeatingInvoices, Boolean summarizeErrors, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateOrCreateRepeatingInvoicesForHttpResponse(accessToken, xeroTenantId, repeatingInvoices, summarizeErrors, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateOrCreateRepeatingInvoices -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("RepeatingInvoices",object.getMessage(), e); + } + handler.validationError("RepeatingInvoices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates or deletes one or more repeating invoice templates + *

200 - Success - return response of type RepeatingInvoices array with newly created RepeatingInvoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body of request + * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateOrCreateRepeatingInvoicesForHttpResponse(String accessToken, String xeroTenantId, RepeatingInvoices repeatingInvoices, Boolean summarizeErrors, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateOrCreateRepeatingInvoices"); + }// verify the required parameter 'repeatingInvoices' is set + if (repeatingInvoices == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoices' when calling updateOrCreateRepeatingInvoices"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateOrCreateRepeatingInvoices"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices"); + if (summarizeErrors != null) { + String key = "summarizeErrors"; + Object value = summarizeErrors; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(repeatingInvoices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific purchase order + *

200 - Success - return response of type PurchaseOrder array for updated PurchaseOrder + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param purchaseOrders The purchaseOrders parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PurchaseOrders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PurchaseOrders updatePurchaseOrder(String accessToken, String xeroTenantId, UUID purchaseOrderID, PurchaseOrders purchaseOrders, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePurchaseOrderForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, purchaseOrders, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePurchaseOrder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("PurchaseOrders",object.getMessage(), e); + } + handler.validationError("PurchaseOrders",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific purchase order + *

200 - Success - return response of type PurchaseOrder array for updated PurchaseOrder + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param purchaseOrders The purchaseOrders parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updatePurchaseOrderForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, PurchaseOrders purchaseOrders, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePurchaseOrder"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling updatePurchaseOrder"); + }// verify the required parameter 'purchaseOrders' is set + if (purchaseOrders == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrders' when calling updatePurchaseOrder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePurchaseOrder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(purchaseOrders); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updatePurchaseOrderAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates a specific attachment for a specific purchase order by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updatePurchaseOrderAttachmentByFileName(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePurchaseOrderAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePurchaseOrderAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment for a specific purchase order by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updatePurchaseOrderAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling updatePurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updatePurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePurchaseOrderAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePurchaseOrderAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates a specific attachment for a specific purchase order by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updatePurchaseOrderAttachmentByFileName(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePurchaseOrderAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePurchaseOrderAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment for a specific purchase order by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param purchaseOrderID Unique identifier for an Purchase Order + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updatePurchaseOrderAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID purchaseOrderID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'purchaseOrderID' is set + if (purchaseOrderID == null) { + throw new IllegalArgumentException("Missing the required parameter 'purchaseOrderID' when calling updatePurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updatePurchaseOrderAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePurchaseOrderAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePurchaseOrderAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PurchaseOrderID", purchaseOrderID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific quote + *

200 - Success - return response of type Quotes array with updated Quote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param quotes The quotes parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Quotes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Quotes updateQuote(String accessToken, String xeroTenantId, UUID quoteID, Quotes quotes, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateQuoteForHttpResponse(accessToken, xeroTenantId, quoteID, quotes, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateQuote -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Quotes",object.getMessage(), e); + } + handler.validationError("Quotes",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific quote + *

200 - Success - return response of type Quotes array with updated Quote + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param quotes The quotes parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateQuoteForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, Quotes quotes, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateQuote"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling updateQuote"); + }// verify the required parameter 'quotes' is set + if (quotes == null) { + throw new IllegalArgumentException("Missing the required parameter 'quotes' when calling updateQuote"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateQuote"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(quotes); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateQuoteAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates a specific attachment from a specific quote by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateQuoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID quoteID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateQuoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateQuoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific quote by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateQuoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateQuoteAttachmentByFileName"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling updateQuoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateQuoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateQuoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateQuoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates a specific attachment from a specific quote by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateQuoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID quoteID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateQuoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateQuoteAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific quote by filename + *

200 - Success - return response of type Attachments array of Attachment + *

400 - Validation Error - some data was incorrect returns response of type Error + * @param xeroTenantId Xero identifier for Tenant + * @param quoteID Unique identifier for an Quote + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateQuoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateQuoteAttachmentByFileName"); + }// verify the required parameter 'quoteID' is set + if (quoteID == null) { + throw new IllegalArgumentException("Missing the required parameter 'quoteID' when calling updateQuoteAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateQuoteAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateQuoteAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateQuoteAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("QuoteID", quoteID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific draft expense claim receipts + *

200 - Success - return response of type Receipts array for updated Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param receipts The receipts parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Receipts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Receipts updateReceipt(String accessToken, String xeroTenantId, UUID receiptID, Receipts receipts, Integer unitdp, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateReceiptForHttpResponse(accessToken, xeroTenantId, receiptID, receipts, unitdp, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateReceipt -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Receipts",object.getMessage(), e); + } + handler.validationError("Receipts",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific draft expense claim receipts + *

200 - Success - return response of type Receipts array for updated Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param receipts The receipts parameter + * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateReceiptForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, Receipts receipts, Integer unitdp, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateReceipt"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling updateReceipt"); + }// verify the required parameter 'receipts' is set + if (receipts == null) { + throw new IllegalArgumentException("Missing the required parameter 'receipts' when calling updateReceipt"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateReceipt"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}"); + if (unitdp != null) { + String key = "unitdp"; + Object value = unitdp; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(receipts); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateReceiptAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates a specific attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateReceiptAttachmentByFileName(String accessToken, String xeroTenantId, UUID receiptID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateReceiptAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateReceiptAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateReceiptAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateReceiptAttachmentByFileName"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling updateReceiptAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateReceiptAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateReceiptAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateReceiptAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates a specific attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateReceiptAttachmentByFileName(String accessToken, String xeroTenantId, UUID receiptID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateReceiptAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateReceiptAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment on a specific expense claim receipts by file name + *

200 - Success - return response of type Attachments array with updated Attachment for a specified Receipt + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param receiptID Unique identifier for a Receipt + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateReceiptAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID receiptID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateReceiptAttachmentByFileName"); + }// verify the required parameter 'receiptID' is set + if (receiptID == null) { + throw new IllegalArgumentException("Missing the required parameter 'receiptID' when calling updateReceiptAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateReceiptAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateReceiptAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateReceiptAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReceiptID", receiptID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific repeating invoice template + *

200 - Success - return response of type RepeatingInvoices array with deleted Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param repeatingInvoices The repeatingInvoices parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return RepeatingInvoices + * @throws IOException if an error occurs while attempting to invoke the API **/ + public RepeatingInvoices updateRepeatingInvoice(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, RepeatingInvoices repeatingInvoices, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateRepeatingInvoiceForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, repeatingInvoices, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateRepeatingInvoice -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("RepeatingInvoices",object.getMessage(), e); + } + handler.validationError("RepeatingInvoices",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a specific repeating invoice template + *

200 - Success - return response of type RepeatingInvoices array with deleted Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param repeatingInvoices The repeatingInvoices parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateRepeatingInvoiceForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, RepeatingInvoices repeatingInvoices, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateRepeatingInvoice"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling updateRepeatingInvoice"); + }// verify the required parameter 'repeatingInvoices' is set + if (repeatingInvoices == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoices' when calling updateRepeatingInvoice"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateRepeatingInvoice"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(repeatingInvoices); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + //Overload params for updateRepeatingInvoiceAttachmentByFileName to allow byte[] or File type to be passed as body + /** + * Updates a specific attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with specified Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public Attachments updateRepeatingInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateRepeatingInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateRepeatingInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with specified Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The type of file being attached + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public HttpResponse updateRepeatingInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, byte[] body, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling updateRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateRepeatingInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateRepeatingInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + ByteArrayContent content = null; + + + content = new ByteArrayContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + /** + * Updates a specific attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with specified Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Attachments + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Attachments updateRepeatingInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, File body, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateRepeatingInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateRepeatingInvoiceAttachmentByFileName -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("Attachments",object.getMessage(), e); + } + handler.validationError("Attachments",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific attachment from a specific repeating invoices by file name + *

200 - Success - return response of type Attachments array with specified Attachment for a specified Repeating Invoice + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param repeatingInvoiceID Unique identifier for a Repeating Invoice + * @param fileName Name of the attachment + * @param body Byte array of file in body of request + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateRepeatingInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID repeatingInvoiceID, String fileName, File body, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'repeatingInvoiceID' is set + if (repeatingInvoiceID == null) { + throw new IllegalArgumentException("Missing the required parameter 'repeatingInvoiceID' when calling updateRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'fileName' is set + if (fileName == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling updateRepeatingInvoiceAttachmentByFileName"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateRepeatingInvoiceAttachmentByFileName"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateRepeatingInvoiceAttachmentByFileName"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); + uriVariables.put("FileName", fileName); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + java.nio.file.Path bodyPath = body.toPath(); + String mimeType = java.nio.file.Files.probeContentType(bodyPath); + HttpContent content = null; + content = new FileContent(mimeType, body); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates tax rates + *

200 - Success - return response of type TaxRates array updated TaxRate + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param taxRates The taxRates parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TaxRates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TaxRates updateTaxRate(String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateTaxRateForHttpResponse(accessToken, xeroTenantId, taxRates, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTaxRate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("TaxRates",object.getMessage(), e); + } + handler.validationError("TaxRates",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates tax rates + *

200 - Success - return response of type TaxRates array updated TaxRate + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param taxRates The taxRates parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTaxRateForHttpResponse(String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTaxRate"); + }// verify the required parameter 'taxRates' is set + if (taxRates == null) { + throw new IllegalArgumentException("Missing the required parameter 'taxRates' when calling updateTaxRate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTaxRate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(taxRates); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific tracking category + *

200 - Success - return response of type TrackingCategories array of updated TrackingCategory + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingCategory The trackingCategory parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TrackingCategories + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingCategories updateTrackingCategory(String accessToken, String xeroTenantId, UUID trackingCategoryID, TrackingCategory trackingCategory, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateTrackingCategoryForHttpResponse(accessToken, xeroTenantId, trackingCategoryID, trackingCategory, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTrackingCategory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("TrackingCategories",object.getMessage(), e); + } + handler.validationError("TrackingCategories",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific tracking category + *

200 - Success - return response of type TrackingCategories array of updated TrackingCategory + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingCategory The trackingCategory parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTrackingCategoryForHttpResponse(String accessToken, String xeroTenantId, UUID trackingCategoryID, TrackingCategory trackingCategory, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTrackingCategory"); + }// verify the required parameter 'trackingCategoryID' is set + if (trackingCategoryID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategoryID' when calling updateTrackingCategory"); + }// verify the required parameter 'trackingCategory' is set + if (trackingCategory == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategory' when calling updateTrackingCategory"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTrackingCategory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TrackingCategoryID", trackingCategoryID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(trackingCategory); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific option for a specific tracking category + *

200 - Success - return response of type TrackingOptions array of options for a specified category + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingOptionID Unique identifier for a Tracking Option + * @param trackingOption The trackingOption parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TrackingOptions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingOptions updateTrackingOptions(String accessToken, String xeroTenantId, UUID trackingCategoryID, UUID trackingOptionID, TrackingOption trackingOption, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateTrackingOptionsForHttpResponse(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTrackingOptions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + if (object.getElements() == null || object.getElements().isEmpty()) { + handler.validationError("TrackingOptions",object.getMessage(), e); + } + handler.validationError("TrackingOptions",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific option for a specific tracking category + *

200 - Success - return response of type TrackingOptions array of options for a specified category + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param trackingCategoryID Unique identifier for a TrackingCategory + * @param trackingOptionID Unique identifier for a Tracking Option + * @param trackingOption The trackingOption parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTrackingOptionsForHttpResponse(String accessToken, String xeroTenantId, UUID trackingCategoryID, UUID trackingOptionID, TrackingOption trackingOption, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTrackingOptions"); + }// verify the required parameter 'trackingCategoryID' is set + if (trackingCategoryID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingCategoryID' when calling updateTrackingOptions"); + }// verify the required parameter 'trackingOptionID' is set + if (trackingOptionID == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingOptionID' when calling updateTrackingOptions"); + }// verify the required parameter 'trackingOption' is set + if (trackingOption == null) { + throw new IllegalArgumentException("Missing the required parameter 'trackingOption' when calling updateTrackingOptions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTrackingOptions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TrackingCategoryID", trackingCategoryID); + uriVariables.put("TrackingOptionID", trackingOptionID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(trackingOption); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history from a specific bank transaction using a unique bank transaction Id - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getBankTransactionsHistory( - String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransactionsHistoryForHttpResponse(accessToken, xeroTenantId, bankTransactionID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransactionsHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history from a specific bank transaction using a unique bank transaction Id - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransactionsHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID bankTransactionID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankTransactionsHistory"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " getBankTransactionsHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankTransactionsHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves specific bank transfers by using a unique bank transfer Id - * - *

200 - Success - return response of BankTransfers array with one BankTransfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param accessToken Authorization token for user set in header of each request - * @return BankTransfers - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransfers getBankTransfer(String accessToken, String xeroTenantId, UUID bankTransferID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransferForHttpResponse(accessToken, xeroTenantId, bankTransferID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransfer -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves specific bank transfers by using a unique bank transfer Id - * - *

200 - Success - return response of BankTransfers array with one BankTransfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransferForHttpResponse( - String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankTransfer"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling getBankTransfer"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankTransfer"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment on a specific bank transfer by file name - * - *

200 - Success - return response of binary data from the Attachment to a Bank Transfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getBankTransferAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransferAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransferID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransferAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment on a specific bank transfer by file name - * - *

200 - Success - return response of binary data from the Attachment to a Bank Transfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransferAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getBankTransferAttachmentByFileName"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " getBankTransferAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " getBankTransferAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getBankTransferAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getBankTransferAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID - * - *

200 - Success - return response of binary data from the Attachment to a Bank Transfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getBankTransferAttachmentById( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransferAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, bankTransferID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransferAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID - * - *

200 - Success - return response of binary data from the Attachment to a Bank Transfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransferAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getBankTransferAttachmentById"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " getBankTransferAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling" - + " getBankTransferAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getBankTransferAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getBankTransferAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments from a specific bank transfer - * - *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getBankTransferAttachments( - String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransferAttachmentsForHttpResponse(accessToken, xeroTenantId, bankTransferID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransferAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments from a specific bank transfer - * - *

200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransferAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankTransferAttachments"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " getBankTransferAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankTransferAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history from a specific bank transfer using a unique bank transfer Id - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getBankTransferHistory( - String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransferHistoryForHttpResponse(accessToken, xeroTenantId, bankTransferID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransferHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history from a specific bank transfer using a unique bank transfer Id - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransferHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID bankTransferID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankTransferHistory"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling getBankTransferHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankTransferHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves all bank transfers - * - *

200 - Success - return response of BankTransfers array of 0 to N BankTransfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return BankTransfers - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransfers getBankTransfers( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBankTransfersForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankTransfers -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves all bank transfers - * - *

200 - Success - return response of BankTransfers array of 0 to N BankTransfer - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankTransfersForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankTransfers"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankTransfers"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransfers"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific batch payment using a unique batch payment Id - * - *

200 - Success - return response of type BatchPayments array with matching batch - * payment Id - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param accessToken Authorization token for user set in header of each request - * @return BatchPayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BatchPayments getBatchPayment(String accessToken, String xeroTenantId, UUID batchPaymentID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBatchPaymentForHttpResponse(accessToken, xeroTenantId, batchPaymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBatchPayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific batch payment using a unique batch payment Id - * - *

200 - Success - return response of type BatchPayments array with matching batch - * payment Id - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBatchPaymentForHttpResponse( - String accessToken, String xeroTenantId, UUID batchPaymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBatchPayment"); - } // verify the required parameter 'batchPaymentID' is set - if (batchPaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'batchPaymentID' when calling getBatchPayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBatchPayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BatchPaymentID", batchPaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history from a specific batch payment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getBatchPaymentHistory( - String accessToken, String xeroTenantId, UUID batchPaymentID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBatchPaymentHistoryForHttpResponse(accessToken, xeroTenantId, batchPaymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBatchPaymentHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history from a specific batch payment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param batchPaymentID Unique identifier for BatchPayment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBatchPaymentHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID batchPaymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBatchPaymentHistory"); - } // verify the required parameter 'batchPaymentID' is set - if (batchPaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'batchPaymentID' when calling getBatchPaymentHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBatchPaymentHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BatchPaymentID", batchPaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments/{BatchPaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves either one or many batch payments for invoices - * - *

200 - Success - return response of type BatchPayments array of BatchPayment objects - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return BatchPayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BatchPayments getBatchPayments( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBatchPaymentsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBatchPayments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves either one or many batch payments for invoices - * - *

200 - Success - return response of type BatchPayments array of BatchPayment objects - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBatchPaymentsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBatchPayments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBatchPayments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BatchPayments"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific branding theme using a unique branding theme Id - * - *

200 - Success - return response of type BrandingThemes with one BrandingTheme - * - * @param xeroTenantId Xero identifier for Tenant - * @param brandingThemeID Unique identifier for a Branding Theme - * @param accessToken Authorization token for user set in header of each request - * @return BrandingThemes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BrandingThemes getBrandingTheme( - String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBrandingThemeForHttpResponse(accessToken, xeroTenantId, brandingThemeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBrandingTheme -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific branding theme using a unique branding theme Id - * - *

200 - Success - return response of type BrandingThemes with one BrandingTheme - * - * @param xeroTenantId Xero identifier for Tenant - * @param brandingThemeID Unique identifier for a Branding Theme - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBrandingThemeForHttpResponse( - String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBrandingTheme"); - } // verify the required parameter 'brandingThemeID' is set - if (brandingThemeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'brandingThemeID' when calling getBrandingTheme"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBrandingTheme"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BrandingThemeID", brandingThemeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BrandingThemes/{BrandingThemeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves the payment services for a specific branding theme - * - *

200 - Success - return response of type PaymentServices array with 0 to N - * PaymentService - * - * @param xeroTenantId Xero identifier for Tenant - * @param brandingThemeID Unique identifier for a Branding Theme - * @param accessToken Authorization token for user set in header of each request - * @return PaymentServices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentServices getBrandingThemePaymentServices( - String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBrandingThemePaymentServicesForHttpResponse( - accessToken, xeroTenantId, brandingThemeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBrandingThemePaymentServices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves the payment services for a specific branding theme - * - *

200 - Success - return response of type PaymentServices array with 0 to N - * PaymentService - * - * @param xeroTenantId Xero identifier for Tenant - * @param brandingThemeID Unique identifier for a Branding Theme - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBrandingThemePaymentServicesForHttpResponse( - String accessToken, String xeroTenantId, UUID brandingThemeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getBrandingThemePaymentServices"); - } // verify the required parameter 'brandingThemeID' is set - if (brandingThemeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'brandingThemeID' when calling" - + " getBrandingThemePaymentServices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getBrandingThemePaymentServices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BrandingThemeID", brandingThemeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BrandingThemes/{BrandingThemeID}/PaymentServices"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves all the branding themes - * - *

200 - Success - return response of type BrandingThemes - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return BrandingThemes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BrandingThemes getBrandingThemes(String accessToken, String xeroTenantId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getBrandingThemesForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBrandingThemes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves all the branding themes - * - *

200 - Success - return response of type BrandingThemes - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBrandingThemesForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBrandingThemes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBrandingThemes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BrandingThemes"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific budget, which includes budget lines - * - *

200 - Success - return response of type Invoices array with specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param budgetID Unique identifier for Budgets - * @param dateTo Filter by start date - * @param dateFrom Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return Budgets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Budgets getBudget( - String accessToken, String xeroTenantId, UUID budgetID, LocalDate dateTo, LocalDate dateFrom) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBudgetForHttpResponse(accessToken, xeroTenantId, budgetID, dateTo, dateFrom); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBudget -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific budget, which includes budget lines - * - *

200 - Success - return response of type Invoices array with specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param budgetID Unique identifier for Budgets - * @param dateTo Filter by start date - * @param dateFrom Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBudgetForHttpResponse( - String accessToken, String xeroTenantId, UUID budgetID, LocalDate dateTo, LocalDate dateFrom) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBudget"); - } // verify the required parameter 'budgetID' is set - if (budgetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'budgetID' when calling getBudget"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBudget"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BudgetID", budgetID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Budgets/{BudgetID}"); - if (dateTo != null) { - String key = "DateTo"; - Object value = dateTo; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateFrom != null) { - String key = "DateFrom"; - Object value = dateFrom; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieve a list of budgets - * - *

200 - Success - return response of type Budgets array with 0 to N Budgets - * - * @param xeroTenantId Xero identifier for Tenant - * @param ids Filter by BudgetID. Allows you to retrieve a specific individual budget. - * @param dateTo Filter by start date - * @param dateFrom Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return Budgets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Budgets getBudgets( - String accessToken, String xeroTenantId, List ids, LocalDate dateTo, LocalDate dateFrom) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getBudgetsForHttpResponse(accessToken, xeroTenantId, ids, dateTo, dateFrom); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBudgets -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieve a list of budgets - * - *

200 - Success - return response of type Budgets array with 0 to N Budgets - * - * @param xeroTenantId Xero identifier for Tenant - * @param ids Filter by BudgetID. Allows you to retrieve a specific individual budget. - * @param dateTo Filter by start date - * @param dateFrom Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBudgetsForHttpResponse( - String accessToken, String xeroTenantId, List ids, LocalDate dateTo, LocalDate dateFrom) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBudgets"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBudgets"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Budgets"); - if (ids != null) { - String key = "IDs"; - Object value = ids; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateTo != null) { - String key = "DateTo"; - Object value = dateTo; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateFrom != null) { - String key = "DateFrom"; - Object value = dateFrom; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific contacts in a Xero organisation using a unique contact Id - * - *

200 - Success - return response of type Contacts array with a unique Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return Contacts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Contacts getContact(String accessToken, String xeroTenantId, UUID contactID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getContactForHttpResponse(accessToken, xeroTenantId, contactID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContact -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific contacts in a Xero organisation using a unique contact Id - * - *

200 - Success - return response of type Contacts array with a unique Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactForHttpResponse( - String accessToken, String xeroTenantId, UUID contactID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContact"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling getContact"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContact"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific contact by file name - * - *

200 - Success - return response of attachment for Contact as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getContactAttachmentByFileName( - String accessToken, String xeroTenantId, UUID contactID, String fileName, String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, contactID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific contact by file name - * - *

200 - Success - return response of attachment for Contact as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactAttachmentByFileNameForHttpResponse( - String accessToken, String xeroTenantId, UUID contactID, String fileName, String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getContactAttachmentByFileName"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling getContactAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling getContactAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getContactAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getContactAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific contact using a unique attachment Id - * - *

200 - Success - return response of attachment for Contact as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getContactAttachmentById( - String accessToken, - String xeroTenantId, - UUID contactID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, contactID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific contact using a unique attachment Id - * - *

200 - Success - return response of attachment for Contact as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContactAttachmentById"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling getContactAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling getContactAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling getContactAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContactAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments for a specific contact in a Xero organisation - * - *

200 - Success - return response of type Attachments array with 0 to N Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getContactAttachments(String accessToken, String xeroTenantId, UUID contactID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactAttachmentsForHttpResponse(accessToken, xeroTenantId, contactID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments for a specific contact in a Xero organisation - * - *

200 - Success - return response of type Attachments array with 0 to N Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID contactID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContactAttachments"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling getContactAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContactAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific contact by contact number in a Xero organisation - * - *

200 - Success - return response of type Contacts array with a unique Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactNumber This field is read only on the Xero contact screen, used to identify - * contacts in external systems (max length = 50). - * @param accessToken Authorization token for user set in header of each request - * @return Contacts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Contacts getContactByContactNumber( - String accessToken, String xeroTenantId, String contactNumber) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactByContactNumberForHttpResponse(accessToken, xeroTenantId, contactNumber); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactByContactNumber -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific contact by contact number in a Xero organisation - * - *

200 - Success - return response of type Contacts array with a unique Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactNumber This field is read only on the Xero contact screen, used to identify - * contacts in external systems (max length = 50). - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactByContactNumberForHttpResponse( - String accessToken, String xeroTenantId, String contactNumber) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContactByContactNumber"); - } // verify the required parameter 'contactNumber' is set - if (contactNumber == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactNumber' when calling getContactByContactNumber"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContactByContactNumber"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactNumber", contactNumber); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactNumber}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves CIS settings for a specific contact in a Xero organisation - * - *

200 - Success - return response of type CISSettings for a specific Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return CISSettings - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CISSettings getContactCISSettings(String accessToken, String xeroTenantId, UUID contactID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactCISSettingsForHttpResponse(accessToken, xeroTenantId, contactID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactCISSettings -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves CIS settings for a specific contact in a Xero organisation - * - *

200 - Success - return response of type CISSettings for a specific Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactCISSettingsForHttpResponse( - String accessToken, String xeroTenantId, UUID contactID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContactCISSettings"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling getContactCISSettings"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContactCISSettings"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/CISSettings"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific contact group by using a unique contact group Id - * - *

200 - Success - return response of type Contact Groups array with a specific Contact - * Group - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param accessToken Authorization token for user set in header of each request - * @return ContactGroups - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ContactGroups getContactGroup(String accessToken, String xeroTenantId, UUID contactGroupID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactGroupForHttpResponse(accessToken, xeroTenantId, contactGroupID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactGroup -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific contact group by using a unique contact group Id - * - *

200 - Success - return response of type Contact Groups array with a specific Contact - * Group - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactGroupForHttpResponse( - String accessToken, String xeroTenantId, UUID contactGroupID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContactGroup"); - } // verify the required parameter 'contactGroupID' is set - if (contactGroupID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactGroupID' when calling getContactGroup"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContactGroup"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactGroupID", contactGroupID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves the contact Id and name of each contact group - * - *

200 - Success - return response of type Contact Groups array of Contact Group - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return ContactGroups - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ContactGroups getContactGroups( - String accessToken, String xeroTenantId, String where, String order) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactGroupsForHttpResponse(accessToken, xeroTenantId, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactGroups -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves the contact Id and name of each contact group - * - *

200 - Success - return response of type Contact Groups array of Contact Group - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactGroupsForHttpResponse( - String accessToken, String xeroTenantId, String where, String order) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContactGroups"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContactGroups"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records for a specific contact - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getContactHistory(String accessToken, String xeroTenantId, UUID contactID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactHistoryForHttpResponse(accessToken, xeroTenantId, contactID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContactHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records for a specific contact - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID contactID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContactHistory"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling getContactHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContactHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves all contacts in a Xero organisation - * - *

200 - Success - return response of type Contacts array with 0 to N Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param ids Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific - * set of contacts in a single call. - * @param page e.g. page=1 - Up to 100 contacts will be returned in a single API call. - * @param includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will - * be included in the response - * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve - * a smaller version of the response object. This returns only lightweight fields, excluding - * computation-heavy fields from the response, making the API calls quick and efficient. - * @param searchTerm Search parameter that performs a case-insensitive text search across the - * Name, FirstName, LastName, ContactNumber and EmailAddress fields. - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return Contacts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Contacts getContacts( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - List ids, - Integer page, - Boolean includeArchived, - Boolean summaryOnly, - String searchTerm, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getContactsForHttpResponse( - accessToken, - xeroTenantId, - ifModifiedSince, - where, - order, - ids, - page, - includeArchived, - summaryOnly, - searchTerm, - pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getContacts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves all contacts in a Xero organisation - * - *

200 - Success - return response of type Contacts array with 0 to N Contact - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param ids Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific - * set of contacts in a single call. - * @param page e.g. page=1 - Up to 100 contacts will be returned in a single API call. - * @param includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will - * be included in the response - * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve - * a smaller version of the response object. This returns only lightweight fields, excluding - * computation-heavy fields from the response, making the API calls quick and efficient. - * @param searchTerm Search parameter that performs a case-insensitive text search across the - * Name, FirstName, LastName, ContactNumber and EmailAddress fields. - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getContactsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - List ids, - Integer page, - Boolean includeArchived, - Boolean summaryOnly, - String searchTerm, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getContacts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getContacts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (ids != null) { - String key = "IDs"; - Object value = ids; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (includeArchived != null) { - String key = "includeArchived"; - Object value = includeArchived; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (summaryOnly != null) { - String key = "summaryOnly"; - Object value = summaryOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (searchTerm != null) { - String key = "searchTerm"; - Object value = searchTerm; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific credit note using a unique credit note Id - * - *

200 - Success - return response of type Credit Notes array with a unique CreditNote - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return CreditNotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CreditNotes getCreditNote( - String accessToken, String xeroTenantId, UUID creditNoteID, Integer unitdp) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getCreditNoteForHttpResponse(accessToken, xeroTenantId, creditNoteID, unitdp); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCreditNote -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific credit note using a unique credit note Id - * - *

200 - Success - return response of type Credit Notes array with a unique CreditNote - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCreditNoteForHttpResponse( - String accessToken, String xeroTenantId, UUID creditNoteID, Integer unitdp) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCreditNote"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling getCreditNote"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCreditNote"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves credit notes as PDF files - * - *

200 - Success - return response of binary data from the Attachment to a Credit Note - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getCreditNoteAsPdf( - String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getCreditNoteAsPdfForHttpResponse(accessToken, xeroTenantId, creditNoteID); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCreditNoteAsPdf -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves credit notes as PDF files - * - *

200 - Success - return response of binary data from the Attachment to a Credit Note - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCreditNoteAsPdfForHttpResponse( - String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCreditNoteAsPdf"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling getCreditNoteAsPdf"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCreditNoteAsPdf"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/pdf"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment on a specific credit note by file name - * - *

200 - Success - return response of attachment for Credit Note as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getCreditNoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getCreditNoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, creditNoteID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCreditNoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment on a specific credit note by file name - * - *

200 - Success - return response of attachment for Credit Note as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCreditNoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getCreditNoteAttachmentByFileName"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling" - + " getCreditNoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " getCreditNoteAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getCreditNoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getCreditNoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific credit note using a unique attachment Id - * - *

200 - Success - return response of attachment for Credit Note as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getCreditNoteAttachmentById( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getCreditNoteAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, creditNoteID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCreditNoteAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific credit note using a unique attachment Id - * - *

200 - Success - return response of attachment for Credit Note as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCreditNoteAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCreditNoteAttachmentById"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling getCreditNoteAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling getCreditNoteAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling getCreditNoteAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCreditNoteAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments for a specific credit notes - * - *

200 - Success - return response of type Attachments array with all Attachment for - * specific Credit Note - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getCreditNoteAttachments( - String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getCreditNoteAttachmentsForHttpResponse(accessToken, xeroTenantId, creditNoteID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCreditNoteAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments for a specific credit notes - * - *

200 - Success - return response of type Attachments array with all Attachment for - * specific Credit Note - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCreditNoteAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCreditNoteAttachments"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling getCreditNoteAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCreditNoteAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records of a specific credit note - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getCreditNoteHistory( - String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getCreditNoteHistoryForHttpResponse(accessToken, xeroTenantId, creditNoteID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCreditNoteHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records of a specific credit note - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCreditNoteHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID creditNoteID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCreditNoteHistory"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling getCreditNoteHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCreditNoteHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves any credit notes - * - *

200 - Success - return response of type Credit Notes array of CreditNote - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 credit notes will be returned in a single API call - * with line items shown for each credit note - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return CreditNotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CreditNotes getCreditNotes( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getCreditNotesForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCreditNotes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves any credit notes - * - *

200 - Success - return response of type Credit Notes array of CreditNote - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 credit notes will be returned in a single API call - * with line items shown for each credit note - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCreditNotesForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCreditNotes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCreditNotes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves currencies for your Xero organisation - * - *

200 - Success - return response of type Currencies array with all Currencies - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return Currencies - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Currencies getCurrencies( - String accessToken, String xeroTenantId, String where, String order) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getCurrenciesForHttpResponse(accessToken, xeroTenantId, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCurrencies -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves currencies for your Xero organisation - * - *

200 - Success - return response of type Currencies array with all Currencies - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCurrenciesForHttpResponse( - String accessToken, String xeroTenantId, String where, String order) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCurrencies"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCurrencies"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Currencies"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee used in Xero payrun using a unique employee Id - * - *

200 - Success - return response of type Employees array with specified Employee - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Unique identifier for a Employee - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees getEmployee(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee used in Xero payrun using a unique employee Id - * - *

200 - Success - return response of type Employees array with specified Employee - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Unique identifier for a Employee - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployee"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves employees used in Xero payrun - * - *

200 - Success - return response of type Employees array with all Employee - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees getEmployees( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeesForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployees -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves employees used in Xero payrun - * - *

200 - Success - return response of type Employees array with all Employee - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeesForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployees"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployees"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific expense claim using a unique expense claim Id - * - *

200 - Success - return response of type ExpenseClaims array with specified - * ExpenseClaim - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param accessToken Authorization token for user set in header of each request - * @return ExpenseClaims - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ExpenseClaims getExpenseClaim(String accessToken, String xeroTenantId, UUID expenseClaimID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getExpenseClaimForHttpResponse(accessToken, xeroTenantId, expenseClaimID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getExpenseClaim -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific expense claim using a unique expense claim Id - * - *

200 - Success - return response of type ExpenseClaims array with specified - * ExpenseClaim - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getExpenseClaimForHttpResponse( - String accessToken, String xeroTenantId, UUID expenseClaimID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getExpenseClaim"); - } // verify the required parameter 'expenseClaimID' is set - if (expenseClaimID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'expenseClaimID' when calling getExpenseClaim"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getExpenseClaim"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ExpenseClaimID", expenseClaimID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records of a specific expense claim - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getExpenseClaimHistory( - String accessToken, String xeroTenantId, UUID expenseClaimID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getExpenseClaimHistoryForHttpResponse(accessToken, xeroTenantId, expenseClaimID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getExpenseClaimHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records of a specific expense claim - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getExpenseClaimHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID expenseClaimID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getExpenseClaimHistory"); - } // verify the required parameter 'expenseClaimID' is set - if (expenseClaimID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'expenseClaimID' when calling getExpenseClaimHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getExpenseClaimHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ExpenseClaimID", expenseClaimID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves expense claims - * - *

200 - Success - return response of type ExpenseClaims array with all ExpenseClaims - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return ExpenseClaims - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ExpenseClaims getExpenseClaims( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getExpenseClaimsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getExpenseClaims -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves expense claims - * - *

200 - Success - return response of type ExpenseClaims array with all ExpenseClaims - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getExpenseClaimsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getExpenseClaims"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getExpenseClaims"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific sales invoice or purchase bill using a unique invoice Id - * - *

200 - Success - return response of type Invoices array with specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return Invoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Invoices getInvoice( - String accessToken, String xeroTenantId, UUID invoiceID, Integer unitdp) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getInvoiceForHttpResponse(accessToken, xeroTenantId, invoiceID, unitdp); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoice -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific sales invoice or purchase bill using a unique invoice Id - * - *

200 - Success - return response of type Invoices array with specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoiceForHttpResponse( - String accessToken, String xeroTenantId, UUID invoiceID, Integer unitdp) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInvoice"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling getInvoice"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInvoice"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves invoices or purchase bills as PDF files - * - *

200 - Success - return response of byte array pdf version of specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getInvoiceAsPdf( - String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getInvoiceAsPdfForHttpResponse(accessToken, xeroTenantId, invoiceID); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoiceAsPdf -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves invoices or purchase bills as PDF files - * - *

200 - Success - return response of byte array pdf version of specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoiceAsPdfForHttpResponse( - String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInvoiceAsPdf"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling getInvoiceAsPdf"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInvoiceAsPdf"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/pdf"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves an attachment from a specific invoice or purchase bill by filename - * - *

200 - Success - return response of attachment for Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getInvoiceAttachmentByFileName( - String accessToken, String xeroTenantId, UUID invoiceID, String fileName, String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getInvoiceAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, invoiceID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves an attachment from a specific invoice or purchase bill by filename - * - *

200 - Success - return response of attachment for Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, String xeroTenantId, UUID invoiceID, String fileName, String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getInvoiceAttachmentByFileName"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling getInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling getInvoiceAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific invoices or purchase bills by using a unique - * attachment Id - * - *

200 - Success - return response of attachment for Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getInvoiceAttachmentById( - String accessToken, - String xeroTenantId, - UUID invoiceID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getInvoiceAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, invoiceID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoiceAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific invoices or purchase bills by using a unique - * attachment Id - * - *

200 - Success - return response of attachment for Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoiceAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInvoiceAttachmentById"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling getInvoiceAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling getInvoiceAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling getInvoiceAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInvoiceAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments for a specific invoice or purchase bill - * - *

200 - Success - return response of type Attachments array of Attachments for - * specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getInvoiceAttachments(String accessToken, String xeroTenantId, UUID invoiceID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getInvoiceAttachmentsForHttpResponse(accessToken, xeroTenantId, invoiceID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoiceAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments for a specific invoice or purchase bill - * - *

200 - Success - return response of type Attachments array of Attachments for - * specified Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoiceAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInvoiceAttachments"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling getInvoiceAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInvoiceAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records for a specific invoice - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getInvoiceHistory(String accessToken, String xeroTenantId, UUID invoiceID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getInvoiceHistoryForHttpResponse(accessToken, xeroTenantId, invoiceID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoiceHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records for a specific invoice - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoiceHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInvoiceHistory"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling getInvoiceHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInvoiceHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves invoice reminder settings - * - *

200 - Success - return response of Invoice Reminders - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return InvoiceReminders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public InvoiceReminders getInvoiceReminders(String accessToken, String xeroTenantId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getInvoiceRemindersForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoiceReminders -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves invoice reminder settings - * - *

200 - Success - return response of Invoice Reminders - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoiceRemindersForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInvoiceReminders"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInvoiceReminders"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/InvoiceReminders/Settings"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with all Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param ids Filter by a comma-separated list of InvoicesIDs. - * @param invoiceNumbers Filter by a comma-separated list of InvoiceNumbers. - * @param contactIDs Filter by a comma-separated list of ContactIDs. - * @param statuses Filter by a comma-separated list Statuses. For faster response times we - * recommend using these explicit parameters instead of passing OR conditions into the Where - * filter. - * @param page e.g. page=1 – Up to 100 invoices will be returned in a single API call with - * line items shown for each invoice - * @param includeArchived e.g. includeArchived=true - Invoices with a status of ARCHIVED will - * be included in the response - * @param createdByMyApp When set to true you'll only retrieve Invoices created by your app - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve - * a smaller version of the response object. This returns only lightweight fields, excluding - * computation-heavy fields from the response, making the API calls quick and efficient. - * @param pageSize Number of records to retrieve per page - * @param searchTerm Search parameter that performs a case-insensitive text search across the - * fields e.g. InvoiceNumber, Reference. - * @param accessToken Authorization token for user set in header of each request - * @return Invoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Invoices getInvoices( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - List ids, - List invoiceNumbers, - List contactIDs, - List statuses, - Integer page, - Boolean includeArchived, - Boolean createdByMyApp, - Integer unitdp, - Boolean summaryOnly, - Integer pageSize, - String searchTerm) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getInvoicesForHttpResponse( - accessToken, - xeroTenantId, - ifModifiedSince, - where, - order, - ids, - invoiceNumbers, - contactIDs, - statuses, - page, - includeArchived, - createdByMyApp, - unitdp, - summaryOnly, - pageSize, - searchTerm); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInvoices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with all Invoices - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param ids Filter by a comma-separated list of InvoicesIDs. - * @param invoiceNumbers Filter by a comma-separated list of InvoiceNumbers. - * @param contactIDs Filter by a comma-separated list of ContactIDs. - * @param statuses Filter by a comma-separated list Statuses. For faster response times we - * recommend using these explicit parameters instead of passing OR conditions into the Where - * filter. - * @param page e.g. page=1 – Up to 100 invoices will be returned in a single API call with - * line items shown for each invoice - * @param includeArchived e.g. includeArchived=true - Invoices with a status of ARCHIVED will - * be included in the response - * @param createdByMyApp When set to true you'll only retrieve Invoices created by your app - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve - * a smaller version of the response object. This returns only lightweight fields, excluding - * computation-heavy fields from the response, making the API calls quick and efficient. - * @param pageSize Number of records to retrieve per page - * @param searchTerm Search parameter that performs a case-insensitive text search across the - * fields e.g. InvoiceNumber, Reference. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInvoicesForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - List ids, - List invoiceNumbers, - List contactIDs, - List statuses, - Integer page, - Boolean includeArchived, - Boolean createdByMyApp, - Integer unitdp, - Boolean summaryOnly, - Integer pageSize, - String searchTerm) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInvoices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInvoices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (ids != null) { - String key = "IDs"; - Object value = ids; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (invoiceNumbers != null) { - String key = "InvoiceNumbers"; - Object value = invoiceNumbers; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (contactIDs != null) { - String key = "ContactIDs"; - Object value = contactIDs; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (statuses != null) { - String key = "Statuses"; - Object value = statuses; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (includeArchived != null) { - String key = "includeArchived"; - Object value = includeArchived; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (createdByMyApp != null) { - String key = "createdByMyApp"; - Object value = createdByMyApp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (summaryOnly != null) { - String key = "summaryOnly"; - Object value = summaryOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (searchTerm != null) { - String key = "searchTerm"; - Object value = searchTerm; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific item using a unique item Id - * - *

200 - Success - return response of type Items array with specified Item - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return Items - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Items getItem(String accessToken, String xeroTenantId, UUID itemID, Integer unitdp) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getItemForHttpResponse(accessToken, xeroTenantId, itemID, unitdp); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getItem -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific item using a unique item Id - * - *

200 - Success - return response of type Items array with specified Item - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getItemForHttpResponse( - String accessToken, String xeroTenantId, UUID itemID, Integer unitdp) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getItem"); - } // verify the required parameter 'itemID' is set - if (itemID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'itemID' when calling getItem"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getItem"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ItemID", itemID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history for a specific item - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getItemHistory(String accessToken, String xeroTenantId, UUID itemID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getItemHistoryForHttpResponse(accessToken, xeroTenantId, itemID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getItemHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history for a specific item - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getItemHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID itemID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getItemHistory"); - } // verify the required parameter 'itemID' is set - if (itemID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'itemID' when calling getItemHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getItemHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ItemID", itemID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves items - * - *

200 - Success - return response of type Items array with all Item - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return Items - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Items getItems( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer unitdp) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getItemsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getItems -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves items - * - *

200 - Success - return response of type Items array with all Item - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getItemsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer unitdp) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getItems"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getItems"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific journal using a unique journal Id. - * - *

200 - Success - return response of type Journals array with specified Journal - * - * @param xeroTenantId Xero identifier for Tenant - * @param journalID Unique identifier for a Journal - * @param accessToken Authorization token for user set in header of each request - * @return Journals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Journals getJournal(String accessToken, String xeroTenantId, UUID journalID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getJournalForHttpResponse(accessToken, xeroTenantId, journalID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getJournal -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific journal using a unique journal Id. - * - *

200 - Success - return response of type Journals array with specified Journal - * - * @param xeroTenantId Xero identifier for Tenant - * @param journalID Unique identifier for a Journal - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getJournalForHttpResponse( - String accessToken, String xeroTenantId, UUID journalID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getJournal"); - } // verify the required parameter 'journalID' is set - if (journalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'journalID' when calling getJournal"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getJournal"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("JournalID", journalID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Journals/{JournalID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific journal using a unique journal number. - * - *

200 - Success - return response of type Journals array with specified Journal - * - * @param xeroTenantId Xero identifier for Tenant - * @param journalNumber Number of a Journal - * @param accessToken Authorization token for user set in header of each request - * @return Journals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Journals getJournalByNumber(String accessToken, String xeroTenantId, Integer journalNumber) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getJournalByNumberForHttpResponse(accessToken, xeroTenantId, journalNumber); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getJournalByNumber -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific journal using a unique journal number. - * - *

200 - Success - return response of type Journals array with specified Journal - * - * @param xeroTenantId Xero identifier for Tenant - * @param journalNumber Number of a Journal - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getJournalByNumberForHttpResponse( - String accessToken, String xeroTenantId, Integer journalNumber) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getJournalByNumber"); - } // verify the required parameter 'journalNumber' is set - if (journalNumber == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'journalNumber' when calling getJournalByNumber"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getJournalByNumber"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("JournalNumber", journalNumber); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Journals/{JournalNumber}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves journals - * - *

200 - Success - return response of type Journals array with all Journals - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param offset Offset by a specified journal number. e.g. journals with a JournalNumber greater - * than the offset will be returned - * @param paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an - * accrual basis by default. - * @param accessToken Authorization token for user set in header of each request - * @return Journals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Journals getJournals( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - Integer offset, - Boolean paymentsOnly) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getJournalsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, offset, paymentsOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getJournals -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves journals - * - *

200 - Success - return response of type Journals array with all Journals - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param offset Offset by a specified journal number. e.g. journals with a JournalNumber greater - * than the offset will be returned - * @param paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an - * accrual basis by default. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getJournalsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - Integer offset, - Boolean paymentsOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getJournals"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getJournals"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Journals"); - if (offset != null) { - String key = "offset"; - Object value = offset; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (paymentsOnly != null) { - String key = "paymentsOnly"; - Object value = paymentsOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific linked transaction (billable expenses) using a unique linked transaction - * Id - * - *

200 - Success - return response of type LinkedTransactions array with a specified - * LinkedTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransactionID Unique identifier for a LinkedTransaction - * @param accessToken Authorization token for user set in header of each request - * @return LinkedTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LinkedTransactions getLinkedTransaction( - String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getLinkedTransactionForHttpResponse(accessToken, xeroTenantId, linkedTransactionID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLinkedTransaction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific linked transaction (billable expenses) using a unique linked transaction - * Id - * - *

200 - Success - return response of type LinkedTransactions array with a specified - * LinkedTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransactionID Unique identifier for a LinkedTransaction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLinkedTransactionForHttpResponse( - String accessToken, String xeroTenantId, UUID linkedTransactionID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLinkedTransaction"); - } // verify the required parameter 'linkedTransactionID' is set - if (linkedTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'linkedTransactionID' when calling getLinkedTransaction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLinkedTransaction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LinkedTransactionID", linkedTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions/{LinkedTransactionID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves linked transactions (billable expenses) - * - *

200 - Success - return response of type LinkedTransactions array with all - * LinkedTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Up to 100 linked transactions will be returned in a single API call. Use the page - * parameter to specify the page to be returned e.g. page=1. - * @param linkedTransactionID The Xero identifier for an Linked Transaction - * @param sourceTransactionID Filter by the SourceTransactionID. Get the linked transactions - * created from a particular ACCPAY invoice - * @param contactID Filter by the ContactID. Get all the linked transactions that have been - * assigned to a particular customer. - * @param status Filter by the combination of ContactID and Status. Get the linked transactions - * associated to a customer and with a status - * @param targetTransactionID Filter by the TargetTransactionID. Get all the linked transactions - * allocated to a particular ACCREC invoice - * @param accessToken Authorization token for user set in header of each request - * @return LinkedTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LinkedTransactions getLinkedTransactions( - String accessToken, - String xeroTenantId, - Integer page, - UUID linkedTransactionID, - UUID sourceTransactionID, - UUID contactID, - String status, - UUID targetTransactionID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getLinkedTransactionsForHttpResponse( - accessToken, - xeroTenantId, - page, - linkedTransactionID, - sourceTransactionID, - contactID, - status, - targetTransactionID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLinkedTransactions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves linked transactions (billable expenses) - * - *

200 - Success - return response of type LinkedTransactions array with all - * LinkedTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Up to 100 linked transactions will be returned in a single API call. Use the page - * parameter to specify the page to be returned e.g. page=1. - * @param linkedTransactionID The Xero identifier for an Linked Transaction - * @param sourceTransactionID Filter by the SourceTransactionID. Get the linked transactions - * created from a particular ACCPAY invoice - * @param contactID Filter by the ContactID. Get all the linked transactions that have been - * assigned to a particular customer. - * @param status Filter by the combination of ContactID and Status. Get the linked transactions - * associated to a customer and with a status - * @param targetTransactionID Filter by the TargetTransactionID. Get all the linked transactions - * allocated to a particular ACCREC invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLinkedTransactionsForHttpResponse( - String accessToken, - String xeroTenantId, - Integer page, - UUID linkedTransactionID, - UUID sourceTransactionID, - UUID contactID, - String status, - UUID targetTransactionID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLinkedTransactions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLinkedTransactions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (linkedTransactionID != null) { - String key = "LinkedTransactionID"; - Object value = linkedTransactionID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (sourceTransactionID != null) { - String key = "SourceTransactionID"; - Object value = sourceTransactionID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (contactID != null) { - String key = "ContactID"; - Object value = contactID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (status != null) { - String key = "Status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (targetTransactionID != null) { - String key = "TargetTransactionID"; - Object value = targetTransactionID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific manual journal - * - *

200 - Success - return response of type ManualJournals array with a specified - * ManualJournals - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param accessToken Authorization token for user set in header of each request - * @return ManualJournals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ManualJournals getManualJournal( - String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getManualJournalForHttpResponse(accessToken, xeroTenantId, manualJournalID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getManualJournal -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific manual journal - * - *

200 - Success - return response of type ManualJournals array with a specified - * ManualJournals - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getManualJournalForHttpResponse( - String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getManualJournal"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling getManualJournal"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getManualJournal"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific manual journal by file name - * - *

200 - Success - return response of attachment for Manual Journal as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getManualJournalAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getManualJournalAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, manualJournalID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getManualJournalAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific manual journal by file name - * - *

200 - Success - return response of attachment for Manual Journal as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getManualJournalAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getManualJournalAttachmentByFileName"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " getManualJournalAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " getManualJournalAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getManualJournalAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getManualJournalAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Allows you to retrieve a specific attachment from a specific manual journal using a unique - * attachment Id - * - *

200 - Success - return response of attachment for Manual Journal as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getManualJournalAttachmentById( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getManualJournalAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, manualJournalID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getManualJournalAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Allows you to retrieve a specific attachment from a specific manual journal using a unique - * attachment Id - * - *

200 - Success - return response of attachment for Manual Journal as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getManualJournalAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getManualJournalAttachmentById"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " getManualJournalAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling" - + " getManualJournalAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getManualJournalAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getManualJournalAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachment for a specific manual journal - * - *

200 - Success - return response of type Attachments array with all Attachments for a - * ManualJournals - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getManualJournalAttachments( - String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getManualJournalAttachmentsForHttpResponse(accessToken, xeroTenantId, manualJournalID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getManualJournalAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachment for a specific manual journal - * - *

200 - Success - return response of type Attachments array with all Attachments for a - * ManualJournals - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getManualJournalAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getManualJournalAttachments"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " getManualJournalAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getManualJournalAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves manual journals - * - *

200 - Success - return response of type ManualJournals array with a all - * ManualJournals - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 manual journals will be returned in a single API call - * with line items shown for each overpayment - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return ManualJournals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ManualJournals getManualJournals( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getManualJournalsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getManualJournals -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves manual journals - * - *

200 - Success - return response of type ManualJournals array with a all - * ManualJournals - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 manual journals will be returned in a single API call - * with line items shown for each overpayment - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getManualJournalsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getManualJournals"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getManualJournals"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history for a specific manual journal - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getManualJournalsHistory( - String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getManualJournalsHistoryForHttpResponse(accessToken, xeroTenantId, manualJournalID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getManualJournalsHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history for a specific manual journal - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getManualJournalsHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID manualJournalID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getManualJournalsHistory"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling getManualJournalsHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getManualJournalsHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a URL to an online invoice - * - *

200 - Success - return response of type OnlineInvoice array with one OnlineInvoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return OnlineInvoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public OnlineInvoices getOnlineInvoice(String accessToken, String xeroTenantId, UUID invoiceID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getOnlineInvoiceForHttpResponse(accessToken, xeroTenantId, invoiceID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getOnlineInvoice -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a URL to an online invoice - * - *

200 - Success - return response of type OnlineInvoice array with one OnlineInvoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getOnlineInvoiceForHttpResponse( - String accessToken, String xeroTenantId, UUID invoiceID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getOnlineInvoice"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling getOnlineInvoice"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getOnlineInvoice"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}/OnlineInvoice"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a list of the key actions your app has permission to perform in the connected Xero - * organisation. - * - *

200 - Success - return response of type Actions array with all key actions - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return Actions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Actions getOrganisationActions(String accessToken, String xeroTenantId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getOrganisationActionsForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getOrganisationActions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a list of the key actions your app has permission to perform in the connected Xero - * organisation. - * - *

200 - Success - return response of type Actions array with all key actions - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getOrganisationActionsForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getOrganisationActions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getOrganisationActions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Organisation/Actions"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves the CIS settings for the Xero organistaion. - * - *

200 - Success - return response of type Organisation array with specified - * Organisation - * - * @param xeroTenantId Xero identifier for Tenant - * @param organisationID The unique Xero identifier for an organisation - * @param accessToken Authorization token for user set in header of each request - * @return CISOrgSettings - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CISOrgSettings getOrganisationCISSettings( - String accessToken, String xeroTenantId, UUID organisationID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getOrganisationCISSettingsForHttpResponse(accessToken, xeroTenantId, organisationID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getOrganisationCISSettings -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves the CIS settings for the Xero organistaion. - * - *

200 - Success - return response of type Organisation array with specified - * Organisation - * - * @param xeroTenantId Xero identifier for Tenant - * @param organisationID The unique Xero identifier for an organisation - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getOrganisationCISSettingsForHttpResponse( - String accessToken, String xeroTenantId, UUID organisationID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getOrganisationCISSettings"); - } // verify the required parameter 'organisationID' is set - if (organisationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'organisationID' when calling" - + " getOrganisationCISSettings"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getOrganisationCISSettings"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("OrganisationID", organisationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Organisation/{OrganisationID}/CISSettings"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves Xero organisation details - * - *

200 - Success - return response of type Organisation array with all Organisation - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return Organisations - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Organisations getOrganisations(String accessToken, String xeroTenantId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getOrganisationsForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getOrganisations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves Xero organisation details - * - *

200 - Success - return response of type Organisation array with all Organisation - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getOrganisationsForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getOrganisations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getOrganisations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Organisation"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific overpayment using a unique overpayment Id - * - *

200 - Success - return response of type Overpayments array with specified - * Overpayments - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param accessToken Authorization token for user set in header of each request - * @return Overpayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Overpayments getOverpayment(String accessToken, String xeroTenantId, UUID overpaymentID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getOverpaymentForHttpResponse(accessToken, xeroTenantId, overpaymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getOverpayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific overpayment using a unique overpayment Id - * - *

200 - Success - return response of type Overpayments array with specified - * Overpayments - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getOverpaymentForHttpResponse( - String accessToken, String xeroTenantId, UUID overpaymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getOverpayment"); - } // verify the required parameter 'overpaymentID' is set - if (overpaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'overpaymentID' when calling getOverpayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getOverpayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("OverpaymentID", overpaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records of a specific overpayment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getOverpaymentHistory( - String accessToken, String xeroTenantId, UUID overpaymentID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getOverpaymentHistoryForHttpResponse(accessToken, xeroTenantId, overpaymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getOverpaymentHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records of a specific overpayment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param overpaymentID Unique identifier for a Overpayment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getOverpaymentHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID overpaymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getOverpaymentHistory"); - } // verify the required parameter 'overpaymentID' is set - if (overpaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'overpaymentID' when calling getOverpaymentHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getOverpaymentHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("OverpaymentID", overpaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments/{OverpaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves overpayments - * - *

200 - Success - return response of type Overpayments array with all Overpayments - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 overpayments will be returned in a single API call - * with line items shown for each overpayment - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return Overpayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Overpayments getOverpayments( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getOverpaymentsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getOverpayments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves overpayments - * - *

200 - Success - return response of type Overpayments array with all Overpayments - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 overpayments will be returned in a single API call - * with line items shown for each overpayment - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getOverpaymentsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getOverpayments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getOverpayments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Overpayments"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific payment for invoices and credit notes using a unique payment Id - * - *

200 - Success - return response of type Payments array for specified Payment - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param accessToken Authorization token for user set in header of each request - * @return Payments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Payments getPayment(String accessToken, String xeroTenantId, UUID paymentID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPaymentForHttpResponse(accessToken, xeroTenantId, paymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific payment for invoices and credit notes using a unique payment Id - * - *

200 - Success - return response of type Payments array for specified Payment - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaymentForHttpResponse( - String accessToken, String xeroTenantId, UUID paymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayment"); - } // verify the required parameter 'paymentID' is set - if (paymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentID' when calling getPayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PaymentID", paymentID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records of a specific payment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getPaymentHistory(String accessToken, String xeroTenantId, UUID paymentID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPaymentHistoryForHttpResponse(accessToken, xeroTenantId, paymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPaymentHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records of a specific payment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param paymentID Unique identifier for a Payment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaymentHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID paymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPaymentHistory"); - } // verify the required parameter 'paymentID' is set - if (paymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentID' when calling getPaymentHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPaymentHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PaymentID", paymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Payments/{PaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payment services - * - *

200 - Success - return response of type PaymentServices array for all PaymentService - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return PaymentServices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentServices getPaymentServices(String accessToken, String xeroTenantId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPaymentServicesForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPaymentServices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payment services - * - *

200 - Success - return response of type PaymentServices array for all PaymentService - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaymentServicesForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPaymentServices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPaymentServices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaymentServices"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payments for invoices and credit notes - * - *

200 - Success - return response of type Payments array for all Payments - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page Up to 100 payments will be returned in a single API call - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return Payments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Payments getPayments( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPaymentsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payments for invoices and credit notes - * - *

200 - Success - return response of type Payments array for all Payments - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page Up to 100 payments will be returned in a single API call - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaymentsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payments"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Allows you to retrieve a specified prepayments - * - *

200 - Success - return response of type Prepayments array for a specified Prepayment - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param accessToken Authorization token for user set in header of each request - * @return Prepayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Prepayments getPrepayment(String accessToken, String xeroTenantId, UUID prepaymentID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPrepaymentForHttpResponse(accessToken, xeroTenantId, prepaymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPrepayment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Allows you to retrieve a specified prepayments - * - *

200 - Success - return response of type Prepayments array for a specified Prepayment - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPrepaymentForHttpResponse( - String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPrepayment"); - } // verify the required parameter 'prepaymentID' is set - if (prepaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'prepaymentID' when calling getPrepayment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPrepayment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PrepaymentID", prepaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history record for a specific prepayment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getPrepaymentHistory( - String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPrepaymentHistoryForHttpResponse(accessToken, xeroTenantId, prepaymentID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPrepaymentHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history record for a specific prepayment - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param prepaymentID Unique identifier for a PrePayment - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPrepaymentHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPrepaymentHistory"); - } // verify the required parameter 'prepaymentID' is set - if (prepaymentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'prepaymentID' when calling getPrepaymentHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPrepaymentHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PrepaymentID", prepaymentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves prepayments - * - *

200 - Success - return response of type Prepayments array for all Prepayment - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with - * line items shown for each overpayment - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return Prepayments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Prepayments getPrepayments( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPrepaymentsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPrepayments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves prepayments - * - *

200 - Success - return response of type Prepayments array for all Prepayment - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with - * line items shown for each overpayment - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPrepaymentsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page, - Integer unitdp, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPrepayments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPrepayments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific purchase order using a unique purchase order Id - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return PurchaseOrders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PurchaseOrders getPurchaseOrder( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrderForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrder -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific purchase order using a unique purchase order Id - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrderForHttpResponse( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPurchaseOrder"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPurchaseOrder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves specific purchase order as PDF files using a unique purchase order Id - * - *

200 - Success - return response of byte array pdf version of specified Purchase - * Orders - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getPurchaseOrderAsPdf( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrderAsPdfForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrderAsPdf -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves specific purchase order as PDF files using a unique purchase order Id - * - *

200 - Success - return response of byte array pdf version of specified Purchase - * Orders - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrderAsPdfForHttpResponse( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderAsPdf"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrderAsPdf"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPurchaseOrderAsPdf"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/pdf"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment for a specific purchase order by filename - * - *

200 - Success - return response of attachment for Purchase Order as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getPurchaseOrderAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrderAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrderAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment for a specific purchase order by filename - * - *

200 - Success - return response of attachment for Purchase Order as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrderAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " getPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " getPurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getPurchaseOrderAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getPurchaseOrderAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves specific attachment for a specific purchase order using a unique attachment Id - * - *

200 - Success - return response of attachment for Account as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getPurchaseOrderAttachmentById( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrderAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrderAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves specific attachment for a specific purchase order using a unique attachment Id - * - *

200 - Success - return response of attachment for Account as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrderAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getPurchaseOrderAttachmentById"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " getPurchaseOrderAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling" - + " getPurchaseOrderAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getPurchaseOrderAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getPurchaseOrderAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments for a specific purchase order - * - *

200 - Success - return response of type Attachments array of Purchase Orders - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getPurchaseOrderAttachments( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrderAttachmentsForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrderAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments for a specific purchase order - * - *

200 - Success - return response of type Attachments array of Purchase Orders - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrderAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderAttachments"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " getPurchaseOrderAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPurchaseOrderAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific purchase order using purchase order number - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderNumber Unique identifier for a PurchaseOrder - * @param accessToken Authorization token for user set in header of each request - * @return PurchaseOrders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PurchaseOrders getPurchaseOrderByNumber( - String accessToken, String xeroTenantId, String purchaseOrderNumber) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrderByNumberForHttpResponse(accessToken, xeroTenantId, purchaseOrderNumber); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrderByNumber -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific purchase order using purchase order number - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderNumber Unique identifier for a PurchaseOrder - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrderByNumberForHttpResponse( - String accessToken, String xeroTenantId, String purchaseOrderNumber) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderByNumber"); - } // verify the required parameter 'purchaseOrderNumber' is set - if (purchaseOrderNumber == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderNumber' when calling" - + " getPurchaseOrderByNumber"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPurchaseOrderByNumber"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderNumber", purchaseOrderNumber); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderNumber}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history for a specific purchase order - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getPurchaseOrderHistory( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrderHistoryForHttpResponse(accessToken, xeroTenantId, purchaseOrderID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrderHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history for a specific purchase order - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrderHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID purchaseOrderID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPurchaseOrderHistory"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling getPurchaseOrderHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPurchaseOrderHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves purchase orders - * - *

200 - Success - return response of type PurchaseOrder array of all PurchaseOrder - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param status Filter by purchase order status - * @param dateFrom Filter by purchase order date (e.g. GET - * https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param dateTo Filter by purchase order date (e.g. GET - * https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param order Order by an any element - * @param page To specify a page, append the page parameter to the URL e.g. ?page=1. If there - * are 100 records in the response you will need to check if there is any more data by - * fetching the next page e.g ?page=2 and continuing this process until no more results - * are returned. - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return PurchaseOrders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PurchaseOrders getPurchaseOrders( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String status, - String dateFrom, - String dateTo, - String order, - Integer page, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPurchaseOrdersForHttpResponse( - accessToken, - xeroTenantId, - ifModifiedSince, - status, - dateFrom, - dateTo, - order, - page, - pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPurchaseOrders -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves purchase orders - * - *

200 - Success - return response of type PurchaseOrder array of all PurchaseOrder - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param status Filter by purchase order status - * @param dateFrom Filter by purchase order date (e.g. GET - * https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param dateTo Filter by purchase order date (e.g. GET - * https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param order Order by an any element - * @param page To specify a page, append the page parameter to the URL e.g. ?page=1. If there - * are 100 records in the response you will need to check if there is any more data by - * fetching the next page e.g ?page=2 and continuing this process until no more results - * are returned. - * @param pageSize Number of records to retrieve per page - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPurchaseOrdersForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String status, - String dateFrom, - String dateTo, - String order, - Integer page, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPurchaseOrders"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPurchaseOrders"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders"); - if (status != null) { - String key = "Status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateFrom != null) { - String key = "DateFrom"; - Object value = dateFrom; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateTo != null) { - String key = "DateTo"; - Object value = dateTo; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific quote using a unique quote Id - * - *

200 - Success - return response of type Quotes array with specified Quote - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return Quotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Quotes getQuote(String accessToken, String xeroTenantId, UUID quoteID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getQuoteForHttpResponse(accessToken, xeroTenantId, quoteID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getQuote -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific quote using a unique quote Id - * - *

200 - Success - return response of type Quotes array with specified Quote - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getQuoteForHttpResponse(String accessToken, String xeroTenantId, UUID quoteID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getQuote"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling getQuote"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getQuote"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific quote as a PDF file using a unique quote Id - * - *

200 - Success - return response of byte array pdf version of specified Quotes - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getQuoteAsPdf(String accessToken, String xeroTenantId, UUID quoteID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getQuoteAsPdfForHttpResponse(accessToken, xeroTenantId, quoteID); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getQuoteAsPdf -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific quote as a PDF file using a unique quote Id - * - *

200 - Success - return response of byte array pdf version of specified Quotes - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getQuoteAsPdfForHttpResponse( - String accessToken, String xeroTenantId, UUID quoteID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getQuoteAsPdf"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling getQuoteAsPdf"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getQuoteAsPdf"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/pdf"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific quote by filename - * - *

200 - Success - return response of attachment for Quote as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getQuoteAttachmentByFileName( - String accessToken, String xeroTenantId, UUID quoteID, String fileName, String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getQuoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, quoteID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getQuoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific quote by filename - * - *

200 - Success - return response of attachment for Quote as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getQuoteAttachmentByFileNameForHttpResponse( - String accessToken, String xeroTenantId, UUID quoteID, String fileName, String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getQuoteAttachmentByFileName"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling getQuoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling getQuoteAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling getQuoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getQuoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific quote using a unique attachment Id - * - *

200 - Success - return response of attachment for Quote as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getQuoteAttachmentById( - String accessToken, String xeroTenantId, UUID quoteID, UUID attachmentID, String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getQuoteAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, quoteID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getQuoteAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific quote using a unique attachment Id - * - *

200 - Success - return response of attachment for Quote as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getQuoteAttachmentByIdForHttpResponse( - String accessToken, String xeroTenantId, UUID quoteID, UUID attachmentID, String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getQuoteAttachmentById"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling getQuoteAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling getQuoteAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling getQuoteAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getQuoteAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments for a specific quote - * - *

200 - Success - return response of type Attachments array of Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getQuoteAttachments(String accessToken, String xeroTenantId, UUID quoteID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getQuoteAttachmentsForHttpResponse(accessToken, xeroTenantId, quoteID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getQuoteAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments for a specific quote - * - *

200 - Success - return response of type Attachments array of Attachment - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getQuoteAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID quoteID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getQuoteAttachments"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling getQuoteAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getQuoteAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history records of a specific quote - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getQuoteHistory(String accessToken, String xeroTenantId, UUID quoteID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getQuoteHistoryForHttpResponse(accessToken, xeroTenantId, quoteID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getQuoteHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history records of a specific quote - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getQuoteHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID quoteID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getQuoteHistory"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling getQuoteHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getQuoteHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves sales quotes - * - *

200 - Success - return response of type quotes array with all quotes - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param dateFrom Filter for quotes after a particular date - * @param dateTo Filter for quotes before a particular date - * @param expiryDateFrom Filter for quotes expiring after a particular date - * @param expiryDateTo Filter for quotes before a particular date - * @param contactID Filter for quotes belonging to a particular contact - * @param status Filter for quotes of a particular Status - * @param page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line - * items shown for each quote - * @param order Order by an any element - * @param quoteNumber Filter by quote number (e.g. GET - * https://.../Quotes?QuoteNumber=QU-0001) - * @param accessToken Authorization token for user set in header of each request - * @return Quotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Quotes getQuotes( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - LocalDate dateFrom, - LocalDate dateTo, - LocalDate expiryDateFrom, - LocalDate expiryDateTo, - UUID contactID, - String status, - Integer page, - String order, - String quoteNumber) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getQuotesForHttpResponse( - accessToken, - xeroTenantId, - ifModifiedSince, - dateFrom, - dateTo, - expiryDateFrom, - expiryDateTo, - contactID, - status, - page, - order, - quoteNumber); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getQuotes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves sales quotes - * - *

200 - Success - return response of type quotes array with all quotes - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param dateFrom Filter for quotes after a particular date - * @param dateTo Filter for quotes before a particular date - * @param expiryDateFrom Filter for quotes expiring after a particular date - * @param expiryDateTo Filter for quotes before a particular date - * @param contactID Filter for quotes belonging to a particular contact - * @param status Filter for quotes of a particular Status - * @param page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line - * items shown for each quote - * @param order Order by an any element - * @param quoteNumber Filter by quote number (e.g. GET - * https://.../Quotes?QuoteNumber=QU-0001) - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getQuotesForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - LocalDate dateFrom, - LocalDate dateTo, - LocalDate expiryDateFrom, - LocalDate expiryDateTo, - UUID contactID, - String status, - Integer page, - String order, - String quoteNumber) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getQuotes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getQuotes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes"); - if (dateFrom != null) { - String key = "DateFrom"; - Object value = dateFrom; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateTo != null) { - String key = "DateTo"; - Object value = dateTo; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (expiryDateFrom != null) { - String key = "ExpiryDateFrom"; - Object value = expiryDateFrom; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (expiryDateTo != null) { - String key = "ExpiryDateTo"; - Object value = expiryDateTo; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (contactID != null) { - String key = "ContactID"; - Object value = contactID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (status != null) { - String key = "Status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (quoteNumber != null) { - String key = "QuoteNumber"; - Object value = quoteNumber; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific draft expense claim receipt by using a unique receipt Id - * - *

200 - Success - return response of type Receipts array for a specified Receipt - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return Receipts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Receipts getReceipt( - String accessToken, String xeroTenantId, UUID receiptID, Integer unitdp) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReceiptForHttpResponse(accessToken, xeroTenantId, receiptID, unitdp); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReceipt -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific draft expense claim receipt by using a unique receipt Id - * - *

200 - Success - return response of type Receipts array for a specified Receipt - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReceiptForHttpResponse( - String accessToken, String xeroTenantId, UUID receiptID, Integer unitdp) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReceipt"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling getReceipt"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReceipt"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific expense claim receipts by file name - * - *

200 - Success - return response of attachment for Receipt as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getReceiptAttachmentByFileName( - String accessToken, String xeroTenantId, UUID receiptID, String fileName, String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReceiptAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, receiptID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReceiptAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific expense claim receipts by file name - * - *

200 - Success - return response of attachment for Receipt as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReceiptAttachmentByFileNameForHttpResponse( - String accessToken, String xeroTenantId, UUID receiptID, String fileName, String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getReceiptAttachmentByFileName"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling getReceiptAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling getReceiptAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getReceiptAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getReceiptAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachments from a specific expense claim receipts by using a unique - * attachment Id - * - *

200 - Success - return response of attachment for Receipt as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getReceiptAttachmentById( - String accessToken, - String xeroTenantId, - UUID receiptID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReceiptAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, receiptID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReceiptAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachments from a specific expense claim receipts by using a unique - * attachment Id - * - *

200 - Success - return response of attachment for Receipt as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReceiptAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID receiptID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReceiptAttachmentById"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling getReceiptAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling getReceiptAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling getReceiptAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReceiptAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments for a specific expense claim receipt - * - *

200 - Success - return response of type Attachments array of Attachments for a - * specified Receipt - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getReceiptAttachments(String accessToken, String xeroTenantId, UUID receiptID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReceiptAttachmentsForHttpResponse(accessToken, xeroTenantId, receiptID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReceiptAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments for a specific expense claim receipt - * - *

200 - Success - return response of type Attachments array of Attachments for a - * specified Receipt - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReceiptAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID receiptID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReceiptAttachments"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling getReceiptAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReceiptAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a history record for a specific receipt - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getReceiptHistory(String accessToken, String xeroTenantId, UUID receiptID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReceiptHistoryForHttpResponse(accessToken, xeroTenantId, receiptID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReceiptHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a history record for a specific receipt - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReceiptHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID receiptID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReceiptHistory"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling getReceiptHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReceiptHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves draft expense claim receipts for any user - * - *

200 - Success - return response of type Receipts array for all Receipt - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return Receipts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Receipts getReceipts( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer unitdp) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReceiptsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReceipts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves draft expense claim receipts for any user - * - *

200 - Success - return response of type Receipts array for all Receipt - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReceiptsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer unitdp) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReceipts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReceipts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific repeating invoice by using a unique repeating invoice Id - * - *

200 - Success - return response of type Repeating Invoices array with a specified - * Repeating Invoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param accessToken Authorization token for user set in header of each request - * @return RepeatingInvoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public RepeatingInvoices getRepeatingInvoice( - String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getRepeatingInvoiceForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getRepeatingInvoice -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific repeating invoice by using a unique repeating invoice Id - * - *

200 - Success - return response of type Repeating Invoices array with a specified - * Repeating Invoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getRepeatingInvoiceForHttpResponse( - String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoice"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling getRepeatingInvoice"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getRepeatingInvoice"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of attachment for Repeating Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getRepeatingInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getRepeatingInvoiceAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, repeatingInvoiceID, fileName, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getRepeatingInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of attachment for Repeating Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getRepeatingInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " getRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " getRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getRepeatingInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getRepeatingInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific attachment from a specific repeating invoice - * - *

200 - Success - return response of attachment for Repeating Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getRepeatingInvoiceAttachmentById( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - UUID attachmentID, - String contentType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getRepeatingInvoiceAttachmentByIdForHttpResponse( - accessToken, xeroTenantId, repeatingInvoiceID, attachmentID, contentType); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getRepeatingInvoiceAttachmentById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific attachment from a specific repeating invoice - * - *

200 - Success - return response of attachment for Repeating Invoice as binary data - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param attachmentID Unique identifier for Attachment object - * @param contentType The mime type of the attachment file you are retrieving i.e image/jpg, - * application/pdf - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getRepeatingInvoiceAttachmentByIdForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - UUID attachmentID, - String contentType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getRepeatingInvoiceAttachmentById"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " getRepeatingInvoiceAttachmentById"); - } // verify the required parameter 'attachmentID' is set - if (attachmentID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'attachmentID' when calling" - + " getRepeatingInvoiceAttachmentById"); - } // verify the required parameter 'contentType' is set - if (contentType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contentType' when calling" - + " getRepeatingInvoiceAttachmentById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getRepeatingInvoiceAttachmentById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("contentType", contentType); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - uriVariables.put("AttachmentID", attachmentID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves attachments from a specific repeating invoice - * - *

200 - Success - return response of type Attachments array with all Attachments for a - * specified Repeating Invoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments getRepeatingInvoiceAttachments( - String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getRepeatingInvoiceAttachmentsForHttpResponse( - accessToken, xeroTenantId, repeatingInvoiceID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getRepeatingInvoiceAttachments -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves attachments from a specific repeating invoice - * - *

200 - Success - return response of type Attachments array with all Attachments for a - * specified Repeating Invoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getRepeatingInvoiceAttachmentsForHttpResponse( - String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getRepeatingInvoiceAttachments"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " getRepeatingInvoiceAttachments"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getRepeatingInvoiceAttachments"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves history record for a specific repeating invoice - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HistoryRecords - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HistoryRecords getRepeatingInvoiceHistory( - String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getRepeatingInvoiceHistoryForHttpResponse(accessToken, xeroTenantId, repeatingInvoiceID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getRepeatingInvoiceHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves history record for a specific repeating invoice - * - *

200 - Success - return response of HistoryRecords array of 0 to N HistoryRecord - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getRepeatingInvoiceHistoryForHttpResponse( - String accessToken, String xeroTenantId, UUID repeatingInvoiceID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoiceHistory"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " getRepeatingInvoiceHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getRepeatingInvoiceHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}/History"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves repeating invoices - * - *

200 - Success - return response of type Repeating Invoices array for all Repeating - * Invoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return RepeatingInvoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public RepeatingInvoices getRepeatingInvoices( - String accessToken, String xeroTenantId, String where, String order) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getRepeatingInvoicesForHttpResponse(accessToken, xeroTenantId, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getRepeatingInvoices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves repeating invoices - * - *

200 - Success - return response of type Repeating Invoices array for all Repeating - * Invoice - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getRepeatingInvoicesForHttpResponse( - String accessToken, String xeroTenantId, String where, String order) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getRepeatingInvoices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getRepeatingInvoices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for aged payables by contact - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactId Unique identifier for a Contact - * @param date The date of the Aged Payables By Contact report - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportAgedPayablesByContact( - String accessToken, - String xeroTenantId, - UUID contactId, - LocalDate date, - LocalDate fromDate, - LocalDate toDate) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportAgedPayablesByContactForHttpResponse( - accessToken, xeroTenantId, contactId, date, fromDate, toDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportAgedPayablesByContact -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for aged payables by contact - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactId Unique identifier for a Contact - * @param date The date of the Aged Payables By Contact report - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportAgedPayablesByContactForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactId, - LocalDate date, - LocalDate fromDate, - LocalDate toDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getReportAgedPayablesByContact"); - } // verify the required parameter 'contactId' is set - if (contactId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactId' when calling getReportAgedPayablesByContact"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getReportAgedPayablesByContact"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/AgedPayablesByContact"); - if (contactId != null) { - String key = "contactId"; - Object value = contactId; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (date != null) { - String key = "date"; - Object value = date; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (fromDate != null) { - String key = "fromDate"; - Object value = fromDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (toDate != null) { - String key = "toDate"; - Object value = toDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for aged receivables by contact - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactId Unique identifier for a Contact - * @param date The date of the Aged Receivables By Contact report - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportAgedReceivablesByContact( - String accessToken, - String xeroTenantId, - UUID contactId, - LocalDate date, - LocalDate fromDate, - LocalDate toDate) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportAgedReceivablesByContactForHttpResponse( - accessToken, xeroTenantId, contactId, date, fromDate, toDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportAgedReceivablesByContact -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for aged receivables by contact - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactId Unique identifier for a Contact - * @param date The date of the Aged Receivables By Contact report - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportAgedReceivablesByContactForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactId, - LocalDate date, - LocalDate fromDate, - LocalDate toDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getReportAgedReceivablesByContact"); - } // verify the required parameter 'contactId' is set - if (contactId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactId' when calling" - + " getReportAgedReceivablesByContact"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getReportAgedReceivablesByContact"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/AgedReceivablesByContact"); - if (contactId != null) { - String key = "contactId"; - Object value = contactId; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (date != null) { - String key = "date"; - Object value = date; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (fromDate != null) { - String key = "fromDate"; - Object value = fromDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (toDate != null) { - String key = "toDate"; - Object value = toDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for balancesheet - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date of the Balance Sheet report - * @param periods The number of periods for the Balance Sheet report - * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param trackingOptionID1 The tracking option 1 for the Balance Sheet report - * @param trackingOptionID2 The tracking option 2 for the Balance Sheet report - * @param standardLayout The standard layout boolean for the Balance Sheet report - * @param paymentsOnly return a cash basis for the Balance Sheet report - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportBalanceSheet( - String accessToken, - String xeroTenantId, - LocalDate date, - Integer periods, - String timeframe, - String trackingOptionID1, - String trackingOptionID2, - Boolean standardLayout, - Boolean paymentsOnly) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportBalanceSheetForHttpResponse( - accessToken, - xeroTenantId, - date, - periods, - timeframe, - trackingOptionID1, - trackingOptionID2, - standardLayout, - paymentsOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportBalanceSheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for balancesheet - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date of the Balance Sheet report - * @param periods The number of periods for the Balance Sheet report - * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param trackingOptionID1 The tracking option 1 for the Balance Sheet report - * @param trackingOptionID2 The tracking option 2 for the Balance Sheet report - * @param standardLayout The standard layout boolean for the Balance Sheet report - * @param paymentsOnly return a cash basis for the Balance Sheet report - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportBalanceSheetForHttpResponse( - String accessToken, - String xeroTenantId, - LocalDate date, - Integer periods, - String timeframe, - String trackingOptionID1, - String trackingOptionID2, - Boolean standardLayout, - Boolean paymentsOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportBalanceSheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportBalanceSheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/BalanceSheet"); - if (date != null) { - String key = "date"; - Object value = date; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (periods != null) { - String key = "periods"; - Object value = periods; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (timeframe != null) { - String key = "timeframe"; - Object value = timeframe; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (trackingOptionID1 != null) { - String key = "trackingOptionID1"; - Object value = trackingOptionID1; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (trackingOptionID2 != null) { - String key = "trackingOptionID2"; - Object value = trackingOptionID2; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (standardLayout != null) { - String key = "standardLayout"; - Object value = standardLayout; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (paymentsOnly != null) { - String key = "paymentsOnly"; - Object value = paymentsOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for bank summary - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportBankSummary( - String accessToken, String xeroTenantId, LocalDate fromDate, LocalDate toDate) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportBankSummaryForHttpResponse(accessToken, xeroTenantId, fromDate, toDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportBankSummary -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for bank summary - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportBankSummaryForHttpResponse( - String accessToken, String xeroTenantId, LocalDate fromDate, LocalDate toDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportBankSummary"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportBankSummary"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/BankSummary"); - if (fromDate != null) { - String key = "fromDate"; - Object value = fromDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (toDate != null) { - String key = "toDate"; - Object value = toDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for budget summary - * - *

200 - success- return a Report with Rows object - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date for the Bank Summary report e.g. 2018-03-31 - * @param periods The number of periods to compare (integer between 1 and 12) - * @param timeframe The period size to compare to (1=month, 3=quarter, 12=year) - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportBudgetSummary( - String accessToken, String xeroTenantId, LocalDate date, Integer periods, Integer timeframe) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportBudgetSummaryForHttpResponse( - accessToken, xeroTenantId, date, periods, timeframe); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportBudgetSummary -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for budget summary - * - *

200 - success- return a Report with Rows object - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date for the Bank Summary report e.g. 2018-03-31 - * @param periods The number of periods to compare (integer between 1 and 12) - * @param timeframe The period size to compare to (1=month, 3=quarter, 12=year) - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportBudgetSummaryForHttpResponse( - String accessToken, String xeroTenantId, LocalDate date, Integer periods, Integer timeframe) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportBudgetSummary"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportBudgetSummary"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/BudgetSummary"); - if (date != null) { - String key = "date"; - Object value = date; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (periods != null) { - String key = "periods"; - Object value = periods; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (timeframe != null) { - String key = "timeframe"; - Object value = timeframe; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for executive summary - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date for the Bank Summary report e.g. 2018-03-31 - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportExecutiveSummary( - String accessToken, String xeroTenantId, LocalDate date) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportExecutiveSummaryForHttpResponse(accessToken, xeroTenantId, date); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportExecutiveSummary -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for executive summary - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date for the Bank Summary report e.g. 2018-03-31 - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportExecutiveSummaryForHttpResponse( - String accessToken, String xeroTenantId, LocalDate date) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportExecutiveSummary"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportExecutiveSummary"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/ExecutiveSummary"); - if (date != null) { - String key = "date"; - Object value = date; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific report using a unique ReportID - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param reportID Unique identifier for a Report - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportFromId(String accessToken, String xeroTenantId, String reportID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getReportFromIdForHttpResponse(accessToken, xeroTenantId, reportID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportFromId -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific report using a unique ReportID - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param reportID Unique identifier for a Report - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportFromIdForHttpResponse( - String accessToken, String xeroTenantId, String reportID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportFromId"); - } // verify the required parameter 'reportID' is set - if (reportID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'reportID' when calling getReportFromId"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportFromId"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReportID", reportID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/{ReportID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for profit and loss - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param periods The number of periods to compare (integer between 1 and 12) - * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report - * @param trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report - * @param trackingOptionID The tracking option 1 for the ProfitAndLoss report - * @param trackingOptionID2 The tracking option 2 for the ProfitAndLoss report - * @param standardLayout Return the standard layout for the ProfitAndLoss report - * @param paymentsOnly Return cash only basis for the ProfitAndLoss report - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportProfitAndLoss( - String accessToken, - String xeroTenantId, - LocalDate fromDate, - LocalDate toDate, - Integer periods, - String timeframe, - String trackingCategoryID, - String trackingCategoryID2, - String trackingOptionID, - String trackingOptionID2, - Boolean standardLayout, - Boolean paymentsOnly) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportProfitAndLossForHttpResponse( - accessToken, - xeroTenantId, - fromDate, - toDate, - periods, - timeframe, - trackingCategoryID, - trackingCategoryID2, - trackingOptionID, - trackingOptionID2, - standardLayout, - paymentsOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportProfitAndLoss -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for profit and loss - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param fromDate filter by the from date of the report e.g. 2021-02-01 - * @param toDate filter by the to date of the report e.g. 2021-02-28 - * @param periods The number of periods to compare (integer between 1 and 12) - * @param timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report - * @param trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report - * @param trackingOptionID The tracking option 1 for the ProfitAndLoss report - * @param trackingOptionID2 The tracking option 2 for the ProfitAndLoss report - * @param standardLayout Return the standard layout for the ProfitAndLoss report - * @param paymentsOnly Return cash only basis for the ProfitAndLoss report - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportProfitAndLossForHttpResponse( - String accessToken, - String xeroTenantId, - LocalDate fromDate, - LocalDate toDate, - Integer periods, - String timeframe, - String trackingCategoryID, - String trackingCategoryID2, - String trackingOptionID, - String trackingOptionID2, - Boolean standardLayout, - Boolean paymentsOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportProfitAndLoss"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportProfitAndLoss"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/ProfitAndLoss"); - if (fromDate != null) { - String key = "fromDate"; - Object value = fromDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (toDate != null) { - String key = "toDate"; - Object value = toDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (periods != null) { - String key = "periods"; - Object value = periods; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (timeframe != null) { - String key = "timeframe"; - Object value = timeframe; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (trackingCategoryID != null) { - String key = "trackingCategoryID"; - Object value = trackingCategoryID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (trackingCategoryID2 != null) { - String key = "trackingCategoryID2"; - Object value = trackingCategoryID2; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (trackingOptionID != null) { - String key = "trackingOptionID"; - Object value = trackingOptionID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (trackingOptionID2 != null) { - String key = "trackingOptionID2"; - Object value = trackingOptionID2; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (standardLayout != null) { - String key = "standardLayout"; - Object value = standardLayout; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (paymentsOnly != null) { - String key = "paymentsOnly"; - Object value = paymentsOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieve reports for 1099 - * - *

200 - Success - return response of type Reports - * - * @param xeroTenantId Xero identifier for Tenant - * @param reportYear The year of the 1099 report - * @param accessToken Authorization token for user set in header of each request - * @return Reports - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Reports getReportTenNinetyNine(String accessToken, String xeroTenantId, String reportYear) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportTenNinetyNineForHttpResponse(accessToken, xeroTenantId, reportYear); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportTenNinetyNine -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieve reports for 1099 - * - *

200 - Success - return response of type Reports - * - * @param xeroTenantId Xero identifier for Tenant - * @param reportYear The year of the 1099 report - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportTenNinetyNineForHttpResponse( - String accessToken, String xeroTenantId, String reportYear) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportTenNinetyNine"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportTenNinetyNine"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/TenNinetyNine"); - if (reportYear != null) { - String key = "reportYear"; - Object value = reportYear; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves report for trial balance - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date for the Trial Balance report e.g. 2018-03-31 - * @param paymentsOnly Return cash only basis for the Trial Balance report - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportTrialBalance( - String accessToken, String xeroTenantId, LocalDate date, Boolean paymentsOnly) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReportTrialBalanceForHttpResponse(accessToken, xeroTenantId, date, paymentsOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportTrialBalance -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves report for trial balance - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param date The date for the Trial Balance report e.g. 2018-03-31 - * @param paymentsOnly Return cash only basis for the Trial Balance report - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportTrialBalanceForHttpResponse( - String accessToken, String xeroTenantId, LocalDate date, Boolean paymentsOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportTrialBalance"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportTrialBalance"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports/TrialBalance"); - if (date != null) { - String key = "date"; - Object value = date; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (paymentsOnly != null) { - String key = "paymentsOnly"; - Object value = paymentsOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a list of the organistaions unique reports that require a uuid to fetch - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return ReportWithRows - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportWithRows getReportsList(String accessToken, String xeroTenantId) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getReportsListForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReportsList -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a list of the organistaions unique reports that require a uuid to fetch - * - *

200 - Success - return response of type ReportWithRows - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReportsListForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReportsList"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReportsList"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reports"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific tax rate according to given TaxType code - * - *

200 - Success - return response of type TaxRates array with one TaxRate - * - * @param xeroTenantId Xero identifier for Tenant - * @param taxType A valid TaxType code - * @param accessToken Authorization token for user set in header of each request - * @return TaxRates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TaxRates getTaxRateByTaxType(String accessToken, String xeroTenantId, String taxType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTaxRateByTaxTypeForHttpResponse(accessToken, xeroTenantId, taxType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTaxRateByTaxType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific tax rate according to given TaxType code - * - *

200 - Success - return response of type TaxRates array with one TaxRate - * - * @param xeroTenantId Xero identifier for Tenant - * @param taxType A valid TaxType code - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTaxRateByTaxTypeForHttpResponse( - String accessToken, String xeroTenantId, String taxType) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTaxRateByTaxType"); - } // verify the required parameter 'taxType' is set - if (taxType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taxType' when calling getTaxRateByTaxType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTaxRateByTaxType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TaxType", taxType); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates/{TaxType}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves tax rates - * - *

200 - Success - return response of type TaxRates array with TaxRates - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return TaxRates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TaxRates getTaxRates(String accessToken, String xeroTenantId, String where, String order) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getTaxRatesForHttpResponse(accessToken, xeroTenantId, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTaxRates -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves tax rates - * - *

200 - Success - return response of type TaxRates array with TaxRates - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTaxRatesForHttpResponse( - String accessToken, String xeroTenantId, String where, String order) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTaxRates"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTaxRates"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves tracking categories and options - * - *

200 - Success - return response of type TrackingCategories array of TrackingCategory - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param includeArchived e.g. includeArchived=true - Categories and options with a status of - * ARCHIVED will be included in the response - * @param accessToken Authorization token for user set in header of each request - * @return TrackingCategories - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingCategories getTrackingCategories( - String accessToken, String xeroTenantId, String where, String order, Boolean includeArchived) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTrackingCategoriesForHttpResponse( - accessToken, xeroTenantId, where, order, includeArchived); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTrackingCategories -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves tracking categories and options - * - *

200 - Success - return response of type TrackingCategories array of TrackingCategory - * - * @param xeroTenantId Xero identifier for Tenant - * @param where Filter by an any element - * @param order Order by an any element - * @param includeArchived e.g. includeArchived=true - Categories and options with a status of - * ARCHIVED will be included in the response - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTrackingCategoriesForHttpResponse( - String accessToken, String xeroTenantId, String where, String order, Boolean includeArchived) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTrackingCategories"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTrackingCategories"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (includeArchived != null) { - String key = "includeArchived"; - Object value = includeArchived; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves specific tracking categories and options using a unique tracking category Id - * - *

200 - Success - return response of type TrackingCategories array of specified - * TrackingCategory - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param accessToken Authorization token for user set in header of each request - * @return TrackingCategories - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingCategories getTrackingCategory( - String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTrackingCategoryForHttpResponse(accessToken, xeroTenantId, trackingCategoryID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTrackingCategory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves specific tracking categories and options using a unique tracking category Id - * - *

200 - Success - return response of type TrackingCategories array of specified - * TrackingCategory - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTrackingCategoryForHttpResponse( - String accessToken, String xeroTenantId, UUID trackingCategoryID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTrackingCategory"); - } // verify the required parameter 'trackingCategoryID' is set - if (trackingCategoryID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategoryID' when calling getTrackingCategory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTrackingCategory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TrackingCategoryID", trackingCategoryID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific user - * - *

200 - Success - return response of type Users array of specified User - * - * @param xeroTenantId Xero identifier for Tenant - * @param userID Unique identifier for a User - * @param accessToken Authorization token for user set in header of each request - * @return Users - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Users getUser(String accessToken, String xeroTenantId, UUID userID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getUserForHttpResponse(accessToken, xeroTenantId, userID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getUser -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific user - * - *

200 - Success - return response of type Users array of specified User - * - * @param xeroTenantId Xero identifier for Tenant - * @param userID Unique identifier for a User - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getUserForHttpResponse(String accessToken, String xeroTenantId, UUID userID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getUser"); - } // verify the required parameter 'userID' is set - if (userID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'userID' when calling getUser"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getUser"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("UserID", userID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Users/{UserID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves users - * - *

200 - Success - return response of type Users array of all User - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return Users - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Users getUsers( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getUsersForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getUsers -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves users - * - *

200 - Success - return response of type Users array of all User - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getUsersForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getUsers"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getUsers"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Users"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Sets the chart of accounts, the conversion date and conversion balances - * - *

200 - Success - returns a summary of the chart of accounts updates - * - * @param xeroTenantId Xero identifier for Tenant - * @param setup Object including an accounts array, a conversion balances array and a conversion - * date object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ImportSummaryObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ImportSummaryObject postSetup( - String accessToken, String xeroTenantId, Setup setup, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - postSetupForHttpResponse(accessToken, xeroTenantId, setup, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : postSetup -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Sets the chart of accounts, the conversion date and conversion balances - * - *

200 - Success - returns a summary of the chart of accounts updates - * - * @param xeroTenantId Xero identifier for Tenant - * @param setup Object including an accounts array, a conversion balances array and a conversion - * date object in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse postSetupForHttpResponse( - String accessToken, String xeroTenantId, Setup setup, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling postSetup"); - } // verify the required parameter 'setup' is set - if (setup == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'setup' when calling postSetup"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling postSetup"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Setup"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(setup); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a chart of accounts - * - *

200 - Success - update existing Account and return response of type Accounts array - * with updated Account - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accounts Request of type Accounts array with one Account - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Accounts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Accounts updateAccount( - String accessToken, - String xeroTenantId, - UUID accountID, - Accounts accounts, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateAccountForHttpResponse( - accessToken, xeroTenantId, accountID, accounts, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateAccount -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Accounts", object.getMessage(), e); - } - handler.validationError("Accounts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a chart of accounts - * - *

200 - Success - update existing Account and return response of type Accounts array - * with updated Account - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param accounts Request of type Accounts array with one Account - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateAccountForHttpResponse( - String accessToken, - String xeroTenantId, - UUID accountID, - Accounts accounts, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateAccount"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling updateAccount"); - } // verify the required parameter 'accounts' is set - if (accounts == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accounts' when calling updateAccount"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateAccount"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Accounts/{AccountID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(accounts); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateAccountAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Updates attachment on a specific account by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateAccountAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateAccountAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateAccountAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates attachment on a specific account by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateAccountAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateAccountAttachmentByFileName"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling" - + " updateAccountAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateAccountAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateAccountAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateAccountAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates attachment on a specific account by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateAccountAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateAccountAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateAccountAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates attachment on a specific account by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param accountID Unique identifier for Account object - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateAccountAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID accountID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateAccountAttachmentByFileName"); - } // verify the required parameter 'accountID' is set - if (accountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accountID' when calling" - + " updateAccountAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateAccountAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateAccountAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateAccountAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("AccountID", accountID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Accounts/{AccountID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a single spent or received money transaction - * - *

200 - Success - return response of type BankTransactions array with updated - * BankTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param bankTransactions The bankTransactions parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BankTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransactions updateBankTransaction( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - BankTransactions bankTransactions, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateBankTransactionForHttpResponse( - accessToken, - xeroTenantId, - bankTransactionID, - bankTransactions, - unitdp, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateBankTransaction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("BankTransactions", object.getMessage(), e); - } - handler.validationError("BankTransactions", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a single spent or received money transaction - * - *

200 - Success - return response of type BankTransactions array with updated - * BankTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param bankTransactions The bankTransactions parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateBankTransactionForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - BankTransactions bankTransactions, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateBankTransaction"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling updateBankTransaction"); - } // verify the required parameter 'bankTransactions' is set - if (bankTransactions == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactions' when calling updateBankTransaction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateBankTransaction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions/{BankTransactionID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(bankTransactions); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateBankTransactionAttachmentByFileName to allow byte[] or File type to - // be passed as body - /** - * Updates a specific attachment from a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateBankTransactionAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateBankTransactionAttachmentByFileNameForHttpResponse( - accessToken, - xeroTenantId, - bankTransactionID, - fileName, - body, - idempotencyKey, - mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateBankTransactionAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateBankTransactionAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateBankTransactionAttachmentByFileName"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " updateBankTransactionAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateBankTransactionAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateBankTransactionAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateBankTransactionAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific attachment from a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateBankTransactionAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateBankTransactionAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateBankTransactionAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific bank transaction by filename - * - *

200 - Success - return response of Attachments array of Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactionID Xero generated unique identifier for a bank transaction - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateBankTransactionAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransactionID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateBankTransactionAttachmentByFileName"); - } // verify the required parameter 'bankTransactionID' is set - if (bankTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactionID' when calling" - + " updateBankTransactionAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateBankTransactionAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateBankTransactionAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateBankTransactionAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransactionID", bankTransactionID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/BankTransactions/{BankTransactionID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateBankTransferAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateBankTransferAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateBankTransferAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateBankTransferAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateBankTransferAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateBankTransferAttachmentByFileName"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " updateBankTransferAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateBankTransferAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateBankTransferAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateBankTransferAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateBankTransferAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateBankTransferAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateBankTransferAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of Attachments array of 0 to N Attachment for a Bank - * Transfer - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransferID Xero generated unique identifier for a bank transfer - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateBankTransferAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankTransferID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateBankTransferAttachmentByFileName"); - } // verify the required parameter 'bankTransferID' is set - if (bankTransferID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransferID' when calling" - + " updateBankTransferAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateBankTransferAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateBankTransferAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateBankTransferAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("BankTransferID", bankTransferID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/BankTransfers/{BankTransferID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific contact in a Xero organisation - * - *

200 - Success - return response of type Contacts array with an updated Contact - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param contacts an array of Contacts containing single Contact object with properties to update - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Contacts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Contacts updateContact( - String accessToken, - String xeroTenantId, - UUID contactID, - Contacts contacts, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateContactForHttpResponse( - accessToken, xeroTenantId, contactID, contacts, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateContact -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Contacts", object.getMessage(), e); - } - handler.validationError("Contacts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific contact in a Xero organisation - * - *

200 - Success - return response of type Contacts array with an updated Contact - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param contacts an array of Contacts containing single Contact object with properties to update - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateContactForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactID, - Contacts contacts, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateContact"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling updateContact"); - } // verify the required parameter 'contacts' is set - if (contacts == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contacts' when calling updateContact"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateContact"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(contacts); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateContactAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * 200 - Success - return response of type Attachments array with an updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateContactAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateContactAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateContactAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of type Attachments array with an updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateContactAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateContactAttachmentByFileName"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling" - + " updateContactAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateContactAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateContactAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateContactAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * 200 - Success - return response of type Attachments array with an updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateContactAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateContactAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateContactAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * 200 - Success - return response of type Attachments array with an updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactID Unique identifier for a Contact - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateContactAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateContactAttachmentByFileName"); - } // verify the required parameter 'contactID' is set - if (contactID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactID' when calling" - + " updateContactAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateContactAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateContactAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateContactAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactID", contactID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Contacts/{ContactID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific contact group - * - *

200 - Success - return response of type Contact Groups array of updated Contact Group - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param contactGroups an array of Contact groups with Name of specific group to update - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ContactGroups - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ContactGroups updateContactGroup( - String accessToken, - String xeroTenantId, - UUID contactGroupID, - ContactGroups contactGroups, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateContactGroupForHttpResponse( - accessToken, xeroTenantId, contactGroupID, contactGroups, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateContactGroup -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("ContactGroups", object.getMessage(), e); - } - handler.validationError("ContactGroups", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific contact group - * - *

200 - Success - return response of type Contact Groups array of updated Contact Group - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactGroupID Unique identifier for a Contact Group - * @param contactGroups an array of Contact groups with Name of specific group to update - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateContactGroupForHttpResponse( - String accessToken, - String xeroTenantId, - UUID contactGroupID, - ContactGroups contactGroups, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateContactGroup"); - } // verify the required parameter 'contactGroupID' is set - if (contactGroupID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactGroupID' when calling updateContactGroup"); - } // verify the required parameter 'contactGroups' is set - if (contactGroups == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contactGroups' when calling updateContactGroup"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateContactGroup"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ContactGroupID", contactGroupID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ContactGroups/{ContactGroupID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(contactGroups); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific credit note - * - *

200 - Success - return response of type Credit Notes array with updated CreditNote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param creditNotes an array of Credit Notes containing credit note details to update - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return CreditNotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CreditNotes updateCreditNote( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - CreditNotes creditNotes, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateCreditNoteForHttpResponse( - accessToken, xeroTenantId, creditNoteID, creditNotes, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateCreditNote -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("CreditNotes", object.getMessage(), e); - } - handler.validationError("CreditNotes", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific credit note - * - *

200 - Success - return response of type Credit Notes array with updated CreditNote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param creditNotes an array of Credit Notes containing credit note details to update - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateCreditNoteForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - CreditNotes creditNotes, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateCreditNote"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling updateCreditNote"); - } // verify the required parameter 'creditNotes' is set - if (creditNotes == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNotes' when calling updateCreditNote"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateCreditNote"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(creditNotes); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateCreditNoteAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * Updates attachments on a specific credit note by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateCreditNoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateCreditNoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, creditNoteID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateCreditNoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates attachments on a specific credit note by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateCreditNoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateCreditNoteAttachmentByFileName"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling" - + " updateCreditNoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateCreditNoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateCreditNoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateCreditNoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates attachments on a specific credit note by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateCreditNoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateCreditNoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, creditNoteID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateCreditNoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates attachments on a specific credit note by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * specific Credit Note - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNoteID Unique identifier for a Credit Note - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateCreditNoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID creditNoteID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateCreditNoteAttachmentByFileName"); - } // verify the required parameter 'creditNoteID' is set - if (creditNoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNoteID' when calling" - + " updateCreditNoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateCreditNoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateCreditNoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateCreditNoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("CreditNoteID", creditNoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific expense claims - * - *

200 - Success - return response of type ExpenseClaims array with updated ExpenseClaim - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param expenseClaims The expenseClaims parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ExpenseClaims - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ExpenseClaims updateExpenseClaim( - String accessToken, - String xeroTenantId, - UUID expenseClaimID, - ExpenseClaims expenseClaims, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateExpenseClaimForHttpResponse( - accessToken, xeroTenantId, expenseClaimID, expenseClaims, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateExpenseClaim -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("ExpenseClaims", object.getMessage(), e); - } - handler.validationError("ExpenseClaims", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific expense claims - * - *

200 - Success - return response of type ExpenseClaims array with updated ExpenseClaim - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param expenseClaimID Unique identifier for a ExpenseClaim - * @param expenseClaims The expenseClaims parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateExpenseClaimForHttpResponse( - String accessToken, - String xeroTenantId, - UUID expenseClaimID, - ExpenseClaims expenseClaims, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateExpenseClaim"); - } // verify the required parameter 'expenseClaimID' is set - if (expenseClaimID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'expenseClaimID' when calling updateExpenseClaim"); - } // verify the required parameter 'expenseClaims' is set - if (expenseClaims == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'expenseClaims' when calling updateExpenseClaim"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateExpenseClaim"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ExpenseClaimID", expenseClaimID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ExpenseClaims/{ExpenseClaimID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(expenseClaims); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with updated Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param invoices The invoices parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Invoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Invoices updateInvoice( - String accessToken, - String xeroTenantId, - UUID invoiceID, - Invoices invoices, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateInvoiceForHttpResponse( - accessToken, xeroTenantId, invoiceID, invoices, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateInvoice -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Invoices", object.getMessage(), e); - } - handler.validationError("Invoices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with updated Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param invoices The invoices parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateInvoiceForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - Invoices invoices, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateInvoice"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling updateInvoice"); - } // verify the required parameter 'invoices' is set - if (invoices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoices' when calling updateInvoice"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateInvoice"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices/{InvoiceID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(invoices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateInvoiceAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Updates an attachment from a specific invoices or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateInvoiceAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, invoiceID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates an attachment from a specific invoices or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateInvoiceAttachmentByFileName"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling" - + " updateInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates an attachment from a specific invoices or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateInvoiceAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, invoiceID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates an attachment from a specific invoices or purchase bill by filename - * - *

200 - Success - return response of type Attachments array with updated Attachment - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoiceID Unique identifier for an Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID invoiceID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateInvoiceAttachmentByFileName"); - } // verify the required parameter 'invoiceID' is set - if (invoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoiceID' when calling" - + " updateInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("InvoiceID", invoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Invoices/{InvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific item - * - *

200 - Success - return response of type Items array with updated Item - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param items The items parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Items - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Items updateItem( - String accessToken, - String xeroTenantId, - UUID itemID, - Items items, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateItemForHttpResponse( - accessToken, xeroTenantId, itemID, items, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateItem -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Items", object.getMessage(), e); - } - handler.validationError("Items", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific item - * - *

200 - Success - return response of type Items array with updated Item - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param itemID Unique identifier for an Item - * @param items The items parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateItemForHttpResponse( - String accessToken, - String xeroTenantId, - UUID itemID, - Items items, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateItem"); - } // verify the required parameter 'itemID' is set - if (itemID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'itemID' when calling updateItem"); - } // verify the required parameter 'items' is set - if (items == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'items' when calling updateItem"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateItem"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ItemID", itemID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items/{ItemID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(items); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific linked transactions (billable expenses) - * - *

200 - Success - return response of type LinkedTransactions array with updated - * LinkedTransaction - * - *

400 - Success - return response of type LinkedTransactions array with updated - * LinkedTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransactionID Unique identifier for a LinkedTransaction - * @param linkedTransactions The linkedTransactions parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LinkedTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LinkedTransactions updateLinkedTransaction( - String accessToken, - String xeroTenantId, - UUID linkedTransactionID, - LinkedTransactions linkedTransactions, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateLinkedTransactionForHttpResponse( - accessToken, xeroTenantId, linkedTransactionID, linkedTransactions, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateLinkedTransaction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("LinkedTransactions", object.getMessage(), e); - } - handler.validationError("LinkedTransactions", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific linked transactions (billable expenses) - * - *

200 - Success - return response of type LinkedTransactions array with updated - * LinkedTransaction - * - *

400 - Success - return response of type LinkedTransactions array with updated - * LinkedTransaction - * - * @param xeroTenantId Xero identifier for Tenant - * @param linkedTransactionID Unique identifier for a LinkedTransaction - * @param linkedTransactions The linkedTransactions parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateLinkedTransactionForHttpResponse( - String accessToken, - String xeroTenantId, - UUID linkedTransactionID, - LinkedTransactions linkedTransactions, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateLinkedTransaction"); - } // verify the required parameter 'linkedTransactionID' is set - if (linkedTransactionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'linkedTransactionID' when calling" - + " updateLinkedTransaction"); - } // verify the required parameter 'linkedTransactions' is set - if (linkedTransactions == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'linkedTransactions' when calling" - + " updateLinkedTransaction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateLinkedTransaction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LinkedTransactionID", linkedTransactionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/LinkedTransactions/{LinkedTransactionID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(linkedTransactions); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific manual journal - * - *

200 - Success - return response of type ManualJournals array with an updated - * ManualJournal - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param manualJournals The manualJournals parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ManualJournals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ManualJournals updateManualJournal( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - ManualJournals manualJournals, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateManualJournalForHttpResponse( - accessToken, xeroTenantId, manualJournalID, manualJournals, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateManualJournal -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("ManualJournals", object.getMessage(), e); - } - handler.validationError("ManualJournals", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific manual journal - * - *

200 - Success - return response of type ManualJournals array with an updated - * ManualJournal - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param manualJournals The manualJournals parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateManualJournalForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - ManualJournals manualJournals, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateManualJournal"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling updateManualJournal"); - } // verify the required parameter 'manualJournals' is set - if (manualJournals == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournals' when calling updateManualJournal"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateManualJournal"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(manualJournals); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateManualJournalAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * Updates a specific attachment from a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with an update Attachment - * for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateManualJournalAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateManualJournalAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateManualJournalAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with an update Attachment - * for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateManualJournalAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateManualJournalAttachmentByFileName"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " updateManualJournalAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateManualJournalAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateManualJournalAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateManualJournalAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific attachment from a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with an update Attachment - * for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateManualJournalAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateManualJournalAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateManualJournalAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific manual journal by file name - * - *

200 - Success - return response of type Attachments array with an update Attachment - * for a ManualJournals - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournalID Unique identifier for a ManualJournal - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateManualJournalAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID manualJournalID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateManualJournalAttachmentByFileName"); - } // verify the required parameter 'manualJournalID' is set - if (manualJournalID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournalID' when calling" - + " updateManualJournalAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateManualJournalAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateManualJournalAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateManualJournalAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ManualJournalID", manualJournalID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/ManualJournals/{ManualJournalID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates one or more spent or received money transaction - * - *

200 - Success - return response of type BankTransactions array with new - * BankTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactions The bankTransactions parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BankTransactions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankTransactions updateOrCreateBankTransactions( - String accessToken, - String xeroTenantId, - BankTransactions bankTransactions, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateBankTransactionsForHttpResponse( - accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateBankTransactions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("BankTransactions", object.getMessage(), e); - } - handler.validationError("BankTransactions", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates one or more spent or received money transaction - * - *

200 - Success - return response of type BankTransactions array with new - * BankTransaction - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankTransactions The bankTransactions parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateBankTransactionsForHttpResponse( - String accessToken, - String xeroTenantId, - BankTransactions bankTransactions, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateOrCreateBankTransactions"); - } // verify the required parameter 'bankTransactions' is set - if (bankTransactions == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankTransactions' when calling" - + " updateOrCreateBankTransactions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateOrCreateBankTransactions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankTransactions"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(bankTransactions); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates one or more contacts in a Xero organisation - * - *

200 - Success - return response of type Contacts array with newly created Contact - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contacts The contacts parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Contacts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Contacts updateOrCreateContacts( - String accessToken, - String xeroTenantId, - Contacts contacts, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateContactsForHttpResponse( - accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateContacts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Contacts", object.getMessage(), e); - } - handler.validationError("Contacts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates one or more contacts in a Xero organisation - * - *

200 - Success - return response of type Contacts array with newly created Contact - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param contacts The contacts parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateContactsForHttpResponse( - String accessToken, - String xeroTenantId, - Contacts contacts, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateOrCreateContacts"); - } // verify the required parameter 'contacts' is set - if (contacts == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'contacts' when calling updateOrCreateContacts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreateContacts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(contacts); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates one or more credit notes - * - *

200 - Success - return response of type Credit Notes array of newly created - * CreditNote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNotes an array of Credit Notes with a single CreditNote object. - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return CreditNotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CreditNotes updateOrCreateCreditNotes( - String accessToken, - String xeroTenantId, - CreditNotes creditNotes, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateCreditNotesForHttpResponse( - accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateCreditNotes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("CreditNotes", object.getMessage(), e); - } - handler.validationError("CreditNotes", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates one or more credit notes - * - *

200 - Success - return response of type Credit Notes array of newly created - * CreditNote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param creditNotes an array of Credit Notes with a single CreditNote object. - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateCreditNotesForHttpResponse( - String accessToken, - String xeroTenantId, - CreditNotes creditNotes, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateOrCreateCreditNotes"); - } // verify the required parameter 'creditNotes' is set - if (creditNotes == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'creditNotes' when calling updateOrCreateCreditNotes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreateCreditNotes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(creditNotes); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a single new employees used in Xero payrun - * - *

200 - Success - return response of type Employees array with new Employee - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param employees Employees with array of Employee object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees updateOrCreateEmployees( - String accessToken, - String xeroTenantId, - Employees employees, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateEmployeesForHttpResponse( - accessToken, xeroTenantId, employees, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateEmployees -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Employees", object.getMessage(), e); - } - handler.validationError("Employees", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a single new employees used in Xero payrun - * - *

200 - Success - return response of type Employees array with new Employee - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param employees Employees with array of Employee object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateEmployeesForHttpResponse( - String accessToken, - String xeroTenantId, - Employees employees, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateOrCreateEmployees"); - } // verify the required parameter 'employees' is set - if (employees == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employees' when calling updateOrCreateEmployees"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreateEmployees"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employees); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates one or more sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with newly created Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoices The invoices parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Invoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Invoices updateOrCreateInvoices( - String accessToken, - String xeroTenantId, - Invoices invoices, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateInvoicesForHttpResponse( - accessToken, xeroTenantId, invoices, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateInvoices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Invoices", object.getMessage(), e); - } - handler.validationError("Invoices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates one or more sales invoices or purchase bills - * - *

200 - Success - return response of type Invoices array with newly created Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param invoices The invoices parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateInvoicesForHttpResponse( - String accessToken, - String xeroTenantId, - Invoices invoices, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateOrCreateInvoices"); - } // verify the required parameter 'invoices' is set - if (invoices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'invoices' when calling updateOrCreateInvoices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreateInvoices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Invoices"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(invoices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates one or more items - * - *

200 - Success - return response of type Items array with newly created Item - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param items The items parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Items - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Items updateOrCreateItems( - String accessToken, - String xeroTenantId, - Items items, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateItemsForHttpResponse( - accessToken, xeroTenantId, items, summarizeErrors, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateItems -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Items", object.getMessage(), e); - } - handler.validationError("Items", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates one or more items - * - *

200 - Success - return response of type Items array with newly created Item - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param items The items parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateItemsForHttpResponse( - String accessToken, - String xeroTenantId, - Items items, - Boolean summarizeErrors, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateOrCreateItems"); - } // verify the required parameter 'items' is set - if (items == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'items' when calling updateOrCreateItems"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreateItems"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Items"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(items); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates a single manual journal - * - *

200 - Success - return response of type ManualJournals array with newly created - * ManualJournal - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournals ManualJournals array with ManualJournal object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ManualJournals - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ManualJournals updateOrCreateManualJournals( - String accessToken, - String xeroTenantId, - ManualJournals manualJournals, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateManualJournalsForHttpResponse( - accessToken, xeroTenantId, manualJournals, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateManualJournals -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("ManualJournals", object.getMessage(), e); - } - handler.validationError("ManualJournals", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates a single manual journal - * - *

200 - Success - return response of type ManualJournals array with newly created - * ManualJournal - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param manualJournals ManualJournals array with ManualJournal object in body of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateManualJournalsForHttpResponse( - String accessToken, - String xeroTenantId, - ManualJournals manualJournals, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateOrCreateManualJournals"); - } // verify the required parameter 'manualJournals' is set - if (manualJournals == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'manualJournals' when calling" - + " updateOrCreateManualJournals"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreateManualJournals"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ManualJournals"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(manualJournals); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates one or more purchase orders - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrders The purchaseOrders parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PurchaseOrders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PurchaseOrders updateOrCreatePurchaseOrders( - String accessToken, - String xeroTenantId, - PurchaseOrders purchaseOrders, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreatePurchaseOrdersForHttpResponse( - accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreatePurchaseOrders -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("PurchaseOrders", object.getMessage(), e); - } - handler.validationError("PurchaseOrders", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates one or more purchase orders - * - *

200 - Success - return response of type PurchaseOrder array for specified - * PurchaseOrder - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrders The purchaseOrders parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreatePurchaseOrdersForHttpResponse( - String accessToken, - String xeroTenantId, - PurchaseOrders purchaseOrders, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateOrCreatePurchaseOrders"); - } // verify the required parameter 'purchaseOrders' is set - if (purchaseOrders == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrders' when calling" - + " updateOrCreatePurchaseOrders"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreatePurchaseOrders"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(purchaseOrders); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates or creates one or more quotes - * - *

200 - Success - return response of type Quotes array with updated or created Quote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quotes The quotes parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Quotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Quotes updateOrCreateQuotes( - String accessToken, - String xeroTenantId, - Quotes quotes, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateQuotesForHttpResponse( - accessToken, xeroTenantId, quotes, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateQuotes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Quotes", object.getMessage(), e); - } - handler.validationError("Quotes", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates or creates one or more quotes - * - *

200 - Success - return response of type Quotes array with updated or created Quote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quotes The quotes parameter - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateQuotesForHttpResponse( - String accessToken, - String xeroTenantId, - Quotes quotes, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateOrCreateQuotes"); - } // verify the required parameter 'quotes' is set - if (quotes == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quotes' when calling updateOrCreateQuotes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateOrCreateQuotes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(quotes); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates or deletes one or more repeating invoice templates - * - *

200 - Success - return response of type RepeatingInvoices array with newly created - * RepeatingInvoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body - * of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return RepeatingInvoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public RepeatingInvoices updateOrCreateRepeatingInvoices( - String accessToken, - String xeroTenantId, - RepeatingInvoices repeatingInvoices, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateOrCreateRepeatingInvoicesForHttpResponse( - accessToken, xeroTenantId, repeatingInvoices, summarizeErrors, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateOrCreateRepeatingInvoices -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("RepeatingInvoices", object.getMessage(), e); - } - handler.validationError("RepeatingInvoices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates or deletes one or more repeating invoice templates - * - *

200 - Success - return response of type RepeatingInvoices array with newly created - * RepeatingInvoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoices RepeatingInvoices with an array of repeating invoice objects in body - * of request - * @param summarizeErrors If false return 200 OK and mix of successfully created objects and any - * with validation errors - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateOrCreateRepeatingInvoicesForHttpResponse( - String accessToken, - String xeroTenantId, - RepeatingInvoices repeatingInvoices, - Boolean summarizeErrors, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateOrCreateRepeatingInvoices"); - } // verify the required parameter 'repeatingInvoices' is set - if (repeatingInvoices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoices' when calling" - + " updateOrCreateRepeatingInvoices"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateOrCreateRepeatingInvoices"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices"); - if (summarizeErrors != null) { - String key = "summarizeErrors"; - Object value = summarizeErrors; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(repeatingInvoices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific purchase order - * - *

200 - Success - return response of type PurchaseOrder array for updated PurchaseOrder - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param purchaseOrders The purchaseOrders parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PurchaseOrders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PurchaseOrders updatePurchaseOrder( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - PurchaseOrders purchaseOrders, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePurchaseOrderForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, purchaseOrders, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePurchaseOrder -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("PurchaseOrders", object.getMessage(), e); - } - handler.validationError("PurchaseOrders", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific purchase order - * - *

200 - Success - return response of type PurchaseOrder array for updated PurchaseOrder - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param purchaseOrders The purchaseOrders parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updatePurchaseOrderForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - PurchaseOrders purchaseOrders, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updatePurchaseOrder"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling updatePurchaseOrder"); - } // verify the required parameter 'purchaseOrders' is set - if (purchaseOrders == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrders' when calling updatePurchaseOrder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updatePurchaseOrder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(purchaseOrders); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updatePurchaseOrderAttachmentByFileName to allow byte[] or File type to be - // passed as body - /** - * Updates a specific attachment for a specific purchase order by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updatePurchaseOrderAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePurchaseOrderAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePurchaseOrderAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment for a specific purchase order by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updatePurchaseOrderAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific attachment for a specific purchase order by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updatePurchaseOrderAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePurchaseOrderAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePurchaseOrderAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment for a specific purchase order by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param purchaseOrderID Unique identifier for an Purchase Order - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updatePurchaseOrderAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID purchaseOrderID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'purchaseOrderID' is set - if (purchaseOrderID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'purchaseOrderID' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updatePurchaseOrderAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PurchaseOrderID", purchaseOrderID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific quote - * - *

200 - Success - return response of type Quotes array with updated Quote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param quotes The quotes parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Quotes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Quotes updateQuote( - String accessToken, String xeroTenantId, UUID quoteID, Quotes quotes, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateQuoteForHttpResponse(accessToken, xeroTenantId, quoteID, quotes, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateQuote -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Quotes", object.getMessage(), e); - } - handler.validationError("Quotes", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific quote - * - *

200 - Success - return response of type Quotes array with updated Quote - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param quotes The quotes parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateQuoteForHttpResponse( - String accessToken, String xeroTenantId, UUID quoteID, Quotes quotes, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateQuote"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling updateQuote"); - } // verify the required parameter 'quotes' is set - if (quotes == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quotes' when calling updateQuote"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateQuote"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(quotes); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateQuoteAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Updates a specific attachment from a specific quote by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateQuoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateQuoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateQuoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific quote by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateQuoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateQuoteAttachmentByFileName"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling updateQuoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling updateQuoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateQuoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateQuoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific attachment from a specific quote by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateQuoteAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateQuoteAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateQuoteAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific quote by filename - * - *

200 - Success - return response of type Attachments array of Attachment - * - *

400 - Validation Error - some data was incorrect returns response of type Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param quoteID Unique identifier for an Quote - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateQuoteAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID quoteID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateQuoteAttachmentByFileName"); - } // verify the required parameter 'quoteID' is set - if (quoteID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'quoteID' when calling updateQuoteAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling updateQuoteAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateQuoteAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateQuoteAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("QuoteID", quoteID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Quotes/{QuoteID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific draft expense claim receipts - * - *

200 - Success - return response of type Receipts array for updated Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param receipts The receipts parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Receipts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Receipts updateReceipt( - String accessToken, - String xeroTenantId, - UUID receiptID, - Receipts receipts, - Integer unitdp, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateReceiptForHttpResponse( - accessToken, xeroTenantId, receiptID, receipts, unitdp, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateReceipt -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Receipts", object.getMessage(), e); - } - handler.validationError("Receipts", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific draft expense claim receipts - * - *

200 - Success - return response of type Receipts array for updated Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param receipts The receipts parameter - * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal - * places for unit amounts - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateReceiptForHttpResponse( - String accessToken, - String xeroTenantId, - UUID receiptID, - Receipts receipts, - Integer unitdp, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateReceipt"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling updateReceipt"); - } // verify the required parameter 'receipts' is set - if (receipts == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receipts' when calling updateReceipt"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateReceipt"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Receipts/{ReceiptID}"); - if (unitdp != null) { - String key = "unitdp"; - Object value = unitdp; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(receipts); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateReceiptAttachmentByFileName to allow byte[] or File type to be passed - // as body - /** - * Updates a specific attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateReceiptAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateReceiptAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateReceiptAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateReceiptAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateReceiptAttachmentByFileName"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling" - + " updateReceiptAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateReceiptAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateReceiptAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateReceiptAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateReceiptAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateReceiptAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateReceiptAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment on a specific expense claim receipts by file name - * - *

200 - Success - return response of type Attachments array with updated Attachment for - * a specified Receipt - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param receiptID Unique identifier for a Receipt - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateReceiptAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID receiptID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateReceiptAttachmentByFileName"); - } // verify the required parameter 'receiptID' is set - if (receiptID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'receiptID' when calling" - + " updateReceiptAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateReceiptAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling updateReceiptAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateReceiptAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReceiptID", receiptID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Receipts/{ReceiptID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific repeating invoice template - * - *

200 - Success - return response of type RepeatingInvoices array with deleted Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param repeatingInvoices The repeatingInvoices parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return RepeatingInvoices - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public RepeatingInvoices updateRepeatingInvoice( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - RepeatingInvoices repeatingInvoices, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateRepeatingInvoiceForHttpResponse( - accessToken, xeroTenantId, repeatingInvoiceID, repeatingInvoices, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateRepeatingInvoice -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("RepeatingInvoices", object.getMessage(), e); - } - handler.validationError("RepeatingInvoices", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a specific repeating invoice template - * - *

200 - Success - return response of type RepeatingInvoices array with deleted Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param repeatingInvoices The repeatingInvoices parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateRepeatingInvoiceForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - RepeatingInvoices repeatingInvoices, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateRepeatingInvoice"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " updateRepeatingInvoice"); - } // verify the required parameter 'repeatingInvoices' is set - if (repeatingInvoices == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoices' when calling updateRepeatingInvoice"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateRepeatingInvoice"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/RepeatingInvoices/{RepeatingInvoiceID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(repeatingInvoices); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - // Overload params for updateRepeatingInvoiceAttachmentByFileName to allow byte[] or File type to - // be passed as body - /** - * Updates a specific attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with specified Attachment - * for a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API - */ - public Attachments updateRepeatingInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateRepeatingInvoiceAttachmentByFileNameForHttpResponse( - accessToken, - xeroTenantId, - repeatingInvoiceID, - fileName, - body, - idempotencyKey, - mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateRepeatingInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with specified Attachment - * for a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The type of file being attached - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public HttpResponse updateRepeatingInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - byte[] body, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - ByteArrayContent content = null; - - content = new ByteArrayContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with specified Attachment - * for a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Attachments - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Attachments updateRepeatingInvoiceAttachmentByFileName( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateRepeatingInvoiceAttachmentByFileNameForHttpResponse( - accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateRepeatingInvoiceAttachmentByFileName -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("Attachments", object.getMessage(), e); - } - handler.validationError("Attachments", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific attachment from a specific repeating invoices by file name - * - *

200 - Success - return response of type Attachments array with specified Attachment - * for a specified Repeating Invoice - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param repeatingInvoiceID Unique identifier for a Repeating Invoice - * @param fileName Name of the attachment - * @param body Byte array of file in body of request - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateRepeatingInvoiceAttachmentByFileNameForHttpResponse( - String accessToken, - String xeroTenantId, - UUID repeatingInvoiceID, - String fileName, - File body, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'repeatingInvoiceID' is set - if (repeatingInvoiceID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'repeatingInvoiceID' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileName' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateRepeatingInvoiceAttachmentByFileName"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("RepeatingInvoiceID", repeatingInvoiceID); - uriVariables.put("FileName", fileName); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - java.nio.file.Path bodyPath = body.toPath(); - String mimeType = java.nio.file.Files.probeContentType(bodyPath); - HttpContent content = null; - content = new FileContent(mimeType, body); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates tax rates - * - *

200 - Success - return response of type TaxRates array updated TaxRate - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param taxRates The taxRates parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TaxRates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TaxRates updateTaxRate( - String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateTaxRateForHttpResponse(accessToken, xeroTenantId, taxRates, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTaxRate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("TaxRates", object.getMessage(), e); - } - handler.validationError("TaxRates", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates tax rates - * - *

200 - Success - return response of type TaxRates array updated TaxRate - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param taxRates The taxRates parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTaxRateForHttpResponse( - String accessToken, String xeroTenantId, TaxRates taxRates, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTaxRate"); - } // verify the required parameter 'taxRates' is set - if (taxRates == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taxRates' when calling updateTaxRate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTaxRate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/TaxRates"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(taxRates); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific tracking category - * - *

200 - Success - return response of type TrackingCategories array of updated - * TrackingCategory - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingCategory The trackingCategory parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TrackingCategories - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingCategories updateTrackingCategory( - String accessToken, - String xeroTenantId, - UUID trackingCategoryID, - TrackingCategory trackingCategory, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateTrackingCategoryForHttpResponse( - accessToken, xeroTenantId, trackingCategoryID, trackingCategory, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTrackingCategory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("TrackingCategories", object.getMessage(), e); - } - handler.validationError("TrackingCategories", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific tracking category - * - *

200 - Success - return response of type TrackingCategories array of updated - * TrackingCategory - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingCategory The trackingCategory parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTrackingCategoryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID trackingCategoryID, - TrackingCategory trackingCategory, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTrackingCategory"); - } // verify the required parameter 'trackingCategoryID' is set - if (trackingCategoryID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategoryID' when calling" - + " updateTrackingCategory"); - } // verify the required parameter 'trackingCategory' is set - if (trackingCategory == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategory' when calling updateTrackingCategory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTrackingCategory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TrackingCategoryID", trackingCategoryID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/TrackingCategories/{TrackingCategoryID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(trackingCategory); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific option for a specific tracking category - * - *

200 - Success - return response of type TrackingOptions array of options for a - * specified category - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingOptionID Unique identifier for a Tracking Option - * @param trackingOption The trackingOption parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TrackingOptions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingOptions updateTrackingOptions( - String accessToken, - String xeroTenantId, - UUID trackingCategoryID, - UUID trackingOptionID, - TrackingOption trackingOption, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateTrackingOptionsForHttpResponse( - accessToken, - xeroTenantId, - trackingCategoryID, - trackingOptionID, - trackingOption, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTrackingOptions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - if (object.getElements() == null || object.getElements().isEmpty()) { - handler.validationError("TrackingOptions", object.getMessage(), e); - } - handler.validationError("TrackingOptions", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific option for a specific tracking category - * - *

200 - Success - return response of type TrackingOptions array of options for a - * specified category - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param trackingCategoryID Unique identifier for a TrackingCategory - * @param trackingOptionID Unique identifier for a Tracking Option - * @param trackingOption The trackingOption parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTrackingOptionsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID trackingCategoryID, - UUID trackingOptionID, - TrackingOption trackingOption, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTrackingOptions"); - } // verify the required parameter 'trackingCategoryID' is set - if (trackingCategoryID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingCategoryID' when calling updateTrackingOptions"); - } // verify the required parameter 'trackingOptionID' is set - if (trackingOptionID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingOptionID' when calling updateTrackingOptions"); - } // verify the required parameter 'trackingOption' is set - if (trackingOption == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'trackingOption' when calling updateTrackingOptions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTrackingOptions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TrackingCategoryID", trackingCategoryID); - uriVariables.put("TrackingOptionID", trackingOptionID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(trackingOption); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); - } - } } diff --git a/src/main/java/com/xero/api/client/AppStoreApi.java b/src/main/java/com/xero/api/client/AppStoreApi.java index aed19449b..b4e6f3635 100644 --- a/src/main/java/com/xero/api/client/AppStoreApi.java +++ b/src/main/java/com/xero/api/client/AppStoreApi.java @@ -9,548 +9,437 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; +import com.xero.api.ApiClient; + +import com.xero.models.appstore.CreateUsageRecord; +import com.xero.models.appstore.ProblemDetails; +import com.xero.models.appstore.Subscription; +import java.util.UUID; +import com.xero.models.appstore.UpdateUsageRecord; +import com.xero.models.appstore.UsageRecord; +import com.xero.models.appstore.UsageRecordsList; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; +import com.google.api.client.http.ByteArrayContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpResponseException; import com.google.api.client.http.HttpTransport; -import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; -import com.xero.models.appstore.CreateUsageRecord; -import com.xero.models.appstore.Subscription; -import com.xero.models.appstore.UpdateUsageRecord; -import com.xero.models.appstore.UsageRecord; -import com.xero.models.appstore.UsageRecordsList; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.Map; -import java.util.UUID; +import java.util.List; + import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; + import org.slf4j.LoggerFactory; +import org.slf4j.Logger; -/** AppStoreApi has methods for interacting with all endpoints in the API set */ -public class AppStoreApi { - private ApiClient apiClient; - private static AppStoreApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(AppStoreApi.class); - /** AppStoreApi */ - public AppStoreApi() { - this(new ApiClient()); - } +/** AppStoreApi has methods for interacting with all endpoints in the API set */ +public class AppStoreApi { + private ApiClient apiClient; + private static AppStoreApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(AppStoreApi.class); - /** - * AppStoreApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static AppStoreApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new AppStoreApi(apiClient); + /** AppStoreApi */ + public AppStoreApi() { + this(new ApiClient()); } - return instance; - } - - /** - * AppStoreApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public AppStoreApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Retrieves a subscription for a given subscriptionId - * - *

200 - Success - return response of unique Subscription object - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param accessToken Authorization token for user set in header of each request - * @return Subscription - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Subscription getSubscription(String accessToken, UUID subscriptionId) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getSubscriptionForHttpResponse(accessToken, subscriptionId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSubscription -------------------"); - logger.debug(e.toString()); + /** AppStoreApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static AppStoreApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new AppStoreApi(apiClient); } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + return instance; } - return null; - } - /** - * Retrieves a subscription for a given subscriptionId - * - *

200 - Success - return response of unique Subscription object - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSubscriptionForHttpResponse(String accessToken, UUID subscriptionId) - throws IOException { - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'subscriptionId' when calling getSubscription"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSubscription"); + /** AppStoreApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public AppStoreApi(ApiClient apiClient) { + this.apiClient = apiClient; } - HttpHeaders headers = new HttpHeaders(); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("subscriptionId", subscriptionId); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/subscriptions/{subscriptionId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Gets all usage records related to the subscription - * - *

200 - Success - return a list of all usage record submitted against this subscription - * for this subscription period - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param accessToken Authorization token for user set in header of each request - * @return UsageRecordsList - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public UsageRecordsList getUsageRecords(String accessToken, UUID subscriptionId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getUsageRecordsForHttpResponse(accessToken, subscriptionId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getUsageRecords -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; } - return null; - } - /** - * Gets all usage records related to the subscription - * - *

200 - Success - return a list of all usage record submitted against this subscription - * for this subscription period - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getUsageRecordsForHttpResponse(String accessToken, UUID subscriptionId) - throws IOException { - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'subscriptionId' when calling getUsageRecords"); + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getUsageRecords"); + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; } - HttpHeaders headers = new HttpHeaders(); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("subscriptionId", subscriptionId); - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/subscriptions/{subscriptionId}/usage-records"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + + /** + * Retrieves a subscription for a given subscriptionId + *

200 - Success - return response of unique Subscription object + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param accessToken Authorization token for user set in header of each request + * @return Subscription + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Subscription getSubscription(String accessToken, UUID subscriptionId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSubscriptionForHttpResponse(accessToken, subscriptionId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSubscription -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } + /** + * Retrieves a subscription for a given subscriptionId + *

200 - Success - return response of unique Subscription object + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSubscriptionForHttpResponse(String accessToken, UUID subscriptionId) throws IOException { + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'subscriptionId' when calling getSubscription"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSubscription"); + } + HttpHeaders headers = new HttpHeaders(); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("subscriptionId", subscriptionId); - /** - * Send metered usage belonging to this subscription and subscription item - * - *

200 - Success - return response of the record submitted - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param subscriptionItemId The unique identifier of the subscriptionItem - * @param createUsageRecord Contains the quantity for the usage record to create - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return UsageRecord - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public UsageRecord postUsageRecords( - String accessToken, - UUID subscriptionId, - UUID subscriptionItemId, - CreateUsageRecord createUsageRecord, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - postUsageRecordsForHttpResponse( - accessToken, subscriptionId, subscriptionItemId, createUsageRecord, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : postUsageRecords -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/subscriptions/{subscriptionId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - return null; - } - /** - * Send metered usage belonging to this subscription and subscription item - * - *

200 - Success - return response of the record submitted - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param subscriptionItemId The unique identifier of the subscriptionItem - * @param createUsageRecord Contains the quantity for the usage record to create - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse postUsageRecordsForHttpResponse( - String accessToken, - UUID subscriptionId, - UUID subscriptionItemId, - CreateUsageRecord createUsageRecord, - String idempotencyKey) - throws IOException { - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'subscriptionId' when calling postUsageRecords"); - } // verify the required parameter 'subscriptionItemId' is set - if (subscriptionItemId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'subscriptionItemId' when calling postUsageRecords"); - } // verify the required parameter 'createUsageRecord' is set - if (createUsageRecord == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'createUsageRecord' when calling postUsageRecords"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling postUsageRecords"); + + /** + * Gets all usage records related to the subscription + *

200 - Success - return a list of all usage record submitted against this subscription for this subscription period + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param accessToken Authorization token for user set in header of each request + * @return UsageRecordsList + * @throws IOException if an error occurs while attempting to invoke the API **/ + public UsageRecordsList getUsageRecords(String accessToken, UUID subscriptionId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getUsageRecordsForHttpResponse(accessToken, subscriptionId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getUsageRecords -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - HttpHeaders headers = new HttpHeaders(); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("subscriptionId", subscriptionId); - uriVariables.put("subscriptionItemId", subscriptionItemId); - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); + /** + * Gets all usage records related to the subscription + *

200 - Success - return a list of all usage record submitted against this subscription for this subscription period + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getUsageRecordsForHttpResponse(String accessToken, UUID subscriptionId) throws IOException { + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'subscriptionId' when calling getUsageRecords"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getUsageRecords"); + } + HttpHeaders headers = new HttpHeaders(); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("subscriptionId", subscriptionId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/subscriptions/{subscriptionId}/usage-records"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(createUsageRecord); + + /** + * Send metered usage belonging to this subscription and subscription item + *

200 - Success - return response of the record submitted + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param subscriptionItemId The unique identifier of the subscriptionItem + * @param createUsageRecord Contains the quantity for the usage record to create + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return UsageRecord + * @throws IOException if an error occurs while attempting to invoke the API **/ + public UsageRecord postUsageRecords(String accessToken, UUID subscriptionId, UUID subscriptionItemId, CreateUsageRecord createUsageRecord, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = postUsageRecordsForHttpResponse(accessToken, subscriptionId, subscriptionItemId, createUsageRecord, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : postUsageRecords -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } + /** + * Send metered usage belonging to this subscription and subscription item + *

200 - Success - return response of the record submitted + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param subscriptionItemId The unique identifier of the subscriptionItem + * @param createUsageRecord Contains the quantity for the usage record to create + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse postUsageRecordsForHttpResponse(String accessToken, UUID subscriptionId, UUID subscriptionItemId, CreateUsageRecord createUsageRecord, String idempotencyKey) throws IOException { + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'subscriptionId' when calling postUsageRecords"); + }// verify the required parameter 'subscriptionItemId' is set + if (subscriptionItemId == null) { + throw new IllegalArgumentException("Missing the required parameter 'subscriptionItemId' when calling postUsageRecords"); + }// verify the required parameter 'createUsageRecord' is set + if (createUsageRecord == null) { + throw new IllegalArgumentException("Missing the required parameter 'createUsageRecord' when calling postUsageRecords"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling postUsageRecords"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("subscriptionId", subscriptionId); + uriVariables.put("subscriptionItemId", subscriptionItemId); - /** - * Update and existing metered usage belonging to this subscription and subscription item - * - *

200 - Success - return response of the modified record - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param subscriptionItemId The unique identifier of the subscriptionItem - * @param usageRecordId The unique identifier of the usage record - * @param updateUsageRecord Contains the quantity for the usage record to update - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return UsageRecord - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public UsageRecord putUsageRecords( - String accessToken, - UUID subscriptionId, - UUID subscriptionItemId, - UUID usageRecordId, - UpdateUsageRecord updateUsageRecord, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - putUsageRecordsForHttpResponse( - accessToken, - subscriptionId, - subscriptionItemId, - usageRecordId, - updateUsageRecord, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : putUsageRecords -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(createUsageRecord); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - return null; - } - /** - * Update and existing metered usage belonging to this subscription and subscription item - * - *

200 - Success - return response of the modified record - * - *

404 - When a failure occurs in the endpoint - * - * @param subscriptionId Unique identifier for Subscription object - * @param subscriptionItemId The unique identifier of the subscriptionItem - * @param usageRecordId The unique identifier of the usage record - * @param updateUsageRecord Contains the quantity for the usage record to update - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse putUsageRecordsForHttpResponse( - String accessToken, - UUID subscriptionId, - UUID subscriptionItemId, - UUID usageRecordId, - UpdateUsageRecord updateUsageRecord, - String idempotencyKey) - throws IOException { - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'subscriptionId' when calling putUsageRecords"); - } // verify the required parameter 'subscriptionItemId' is set - if (subscriptionItemId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'subscriptionItemId' when calling putUsageRecords"); - } // verify the required parameter 'usageRecordId' is set - if (usageRecordId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'usageRecordId' when calling putUsageRecords"); - } // verify the required parameter 'updateUsageRecord' is set - if (updateUsageRecord == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'updateUsageRecord' when calling putUsageRecords"); + + /** + * Update and existing metered usage belonging to this subscription and subscription item + *

200 - Success - return response of the modified record + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param subscriptionItemId The unique identifier of the subscriptionItem + * @param usageRecordId The unique identifier of the usage record + * @param updateUsageRecord Contains the quantity for the usage record to update + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return UsageRecord + * @throws IOException if an error occurs while attempting to invoke the API **/ + public UsageRecord putUsageRecords(String accessToken, UUID subscriptionId, UUID subscriptionItemId, UUID usageRecordId, UpdateUsageRecord updateUsageRecord, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = putUsageRecordsForHttpResponse(accessToken, subscriptionId, subscriptionItemId, usageRecordId, updateUsageRecord, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : putUsageRecords -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling putUsageRecords"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("subscriptionId", subscriptionId); - uriVariables.put("subscriptionItemId", subscriptionItemId); - uriVariables.put("usageRecordId", usageRecordId); - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } + /** + * Update and existing metered usage belonging to this subscription and subscription item + *

200 - Success - return response of the modified record + *

404 - When a failure occurs in the endpoint + * @param subscriptionId Unique identifier for Subscription object + * @param subscriptionItemId The unique identifier of the subscriptionItem + * @param usageRecordId The unique identifier of the usage record + * @param updateUsageRecord Contains the quantity for the usage record to update + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse putUsageRecordsForHttpResponse(String accessToken, UUID subscriptionId, UUID subscriptionItemId, UUID usageRecordId, UpdateUsageRecord updateUsageRecord, String idempotencyKey) throws IOException { + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'subscriptionId' when calling putUsageRecords"); + }// verify the required parameter 'subscriptionItemId' is set + if (subscriptionItemId == null) { + throw new IllegalArgumentException("Missing the required parameter 'subscriptionItemId' when calling putUsageRecords"); + }// verify the required parameter 'usageRecordId' is set + if (usageRecordId == null) { + throw new IllegalArgumentException("Missing the required parameter 'usageRecordId' when calling putUsageRecords"); + }// verify the required parameter 'updateUsageRecord' is set + if (updateUsageRecord == null) { + throw new IllegalArgumentException("Missing the required parameter 'updateUsageRecord' when calling putUsageRecords"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling putUsageRecords"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("subscriptionId", subscriptionId); + uriVariables.put("subscriptionItemId", subscriptionItemId); + uriVariables.put("usageRecordId", usageRecordId); - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(updateUsageRecord); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(updateUsageRecord); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - } } diff --git a/src/main/java/com/xero/api/client/AssetApi.java b/src/main/java/com/xero/api/client/AssetApi.java index 24e96ee8f..081d1497a 100644 --- a/src/main/java/com/xero/api/client/AssetApi.java +++ b/src/main/java/com/xero/api/client/AssetApi.java @@ -9,846 +9,711 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; +import com.xero.api.ApiClient; + +import com.xero.models.assets.Asset; +import com.xero.models.assets.AssetStatusQueryParam; +import com.xero.models.assets.AssetType; +import com.xero.models.assets.Assets; +import com.xero.models.assets.Setting; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; +import com.google.api.client.http.ByteArrayContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpResponseException; import com.google.api.client.http.HttpTransport; -import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; -import com.xero.models.assets.Asset; -import com.xero.models.assets.AssetStatusQueryParam; -import com.xero.models.assets.AssetType; -import com.xero.models.assets.Assets; -import com.xero.models.assets.Setting; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** AssetApi has methods for interacting with all endpoints in the API set */ -public class AssetApi { - private ApiClient apiClient; - private static AssetApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(AssetApi.class); - - /** AssetApi */ - public AssetApi() { - this(new ApiClient()); - } - - /** - * AssetApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static AssetApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new AssetApi(apiClient); - } - return instance; - } - - /** - * AssetApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public AssetApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * adds a fixed asset Adds an asset to the system - * - *

200 - return single object - create new asset - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param asset Fixed asset you are creating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Asset - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Asset createAsset( - String accessToken, String xeroTenantId, Asset asset, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createAssetForHttpResponse(accessToken, xeroTenantId, asset, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createAsset -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.assets.Error assetError = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Asset", assetError, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * adds a fixed asset Adds an asset to the system - * - *

200 - return single object - create new asset - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param asset Fixed asset you are creating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createAssetForHttpResponse( - String accessToken, String xeroTenantId, Asset asset, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createAsset"); - } // verify the required parameter 'asset' is set - if (asset == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'asset' when calling createAsset"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createAsset"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Assets"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(asset); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * adds a fixed asset type Adds an fixed asset type to the system - * - *

200 - results single object - created fixed type - * - *

400 - invalid input, object invalid - * - *

409 - a type already exists - * - * @param xeroTenantId Xero identifier for Tenant - * @param assetType Asset type to add - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return AssetType - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public AssetType createAssetType( - String accessToken, String xeroTenantId, AssetType assetType, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createAssetTypeForHttpResponse(accessToken, xeroTenantId, assetType, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createAssetType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.assets.Error assetError = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("AssetType", assetError, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * adds a fixed asset type Adds an fixed asset type to the system - * - *

200 - results single object - created fixed type - * - *

400 - invalid input, object invalid - * - *

409 - a type already exists - * - * @param xeroTenantId Xero identifier for Tenant - * @param assetType Asset type to add - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createAssetTypeForHttpResponse( - String accessToken, String xeroTenantId, AssetType assetType, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createAssetType"); - } // verify the required parameter 'assetType' is set - if (assetType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'assetType' when calling createAssetType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createAssetType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AssetTypes"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(assetType); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves fixed asset by id By passing in the appropriate asset id, you can search for a - * specific fixed asset in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param id fixed asset id for single object - * @param accessToken Authorization token for user set in header of each request - * @return Asset - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Asset getAssetById(String accessToken, String xeroTenantId, UUID id) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getAssetByIdForHttpResponse(accessToken, xeroTenantId, id); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAssetById -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves fixed asset by id By passing in the appropriate asset id, you can search for a - * specific fixed asset in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param id fixed asset id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAssetByIdForHttpResponse(String accessToken, String xeroTenantId, UUID id) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAssetById"); - } // verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'id' when calling getAssetById"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAssetById"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("id", id); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Assets/{id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * searches fixed asset settings By passing in the appropriate options, you can search for - * available fixed asset types in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return Setting - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Setting getAssetSettings(String accessToken, String xeroTenantId) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getAssetSettingsForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAssetSettings -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * searches fixed asset settings By passing in the appropriate options, you can search for - * available fixed asset types in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAssetSettingsForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAssetSettings"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAssetSettings"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } +import java.util.List; - /** - * searches fixed asset types By passing in the appropriate options, you can search for available - * fixed asset types in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return List<AssetType> - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public List getAssetTypes(String accessToken, String xeroTenantId) throws IOException { - try { - TypeReference> typeRef = new TypeReference>() {}; - HttpResponse response = getAssetTypesForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAssetTypes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } +import org.apache.commons.io.IOUtils; - /** - * searches fixed asset types By passing in the appropriate options, you can search for available - * fixed asset types in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAssetTypesForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAssetTypes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAssetTypes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AssetTypes"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } +import org.slf4j.LoggerFactory; +import org.slf4j.Logger; - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - /** - * searches fixed asset By passing in the appropriate options, you can search for available fixed - * asset in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param status Required when retrieving a collection of assets. See Asset Status Codes - * @param page Results are paged. This specifies which page of the results to return. The default - * page is 1. - * @param pageSize The number of records returned per page. By default the number of records - * returned is 10. - * @param orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and - * PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and - * DisposalPrice. - * @param sortDirection ASC or DESC - * @param filterBy A string that can be used to filter the list to only return assets containing - * the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName - * fields. - * @param accessToken Authorization token for user set in header of each request - * @return Assets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Assets getAssets( - String accessToken, - String xeroTenantId, - AssetStatusQueryParam status, - Integer page, - Integer pageSize, - String orderBy, - String sortDirection, - String filterBy) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAssetsForHttpResponse( - accessToken, xeroTenantId, status, page, pageSize, orderBy, sortDirection, filterBy); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAssets -------------------"); - logger.debug(e.toString()); +/** AssetApi has methods for interacting with all endpoints in the API set */ +public class AssetApi { + private ApiClient apiClient; + private static AssetApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(AssetApi.class); + + /** AssetApi */ + public AssetApi() { + this(new ApiClient()); + } + + /** AssetApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static AssetApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new AssetApi(apiClient); } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * searches fixed asset By passing in the appropriate options, you can search for available fixed - * asset in the system - * - *

200 - search results matching criteria - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param status Required when retrieving a collection of assets. See Asset Status Codes - * @param page Results are paged. This specifies which page of the results to return. The default - * page is 1. - * @param pageSize The number of records returned per page. By default the number of records - * returned is 10. - * @param orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and - * PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and - * DisposalPrice. - * @param sortDirection ASC or DESC - * @param filterBy A string that can be used to filter the list to only return assets containing - * the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName - * fields. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAssetsForHttpResponse( - String accessToken, - String xeroTenantId, - AssetStatusQueryParam status, - Integer page, - Integer pageSize, - String orderBy, - String sortDirection, - String filterBy) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAssets"); - } // verify the required parameter 'status' is set - if (status == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'status' when calling getAssets"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAssets"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Assets"); - if (status != null) { - String key = "status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + return instance; + } + + /** AssetApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public AssetApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * adds a fixed asset + * Adds an asset to the system + *

200 - return single object - create new asset + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param asset Fixed asset you are creating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Asset + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Asset createAsset(String accessToken, String xeroTenantId, Asset asset, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createAssetForHttpResponse(accessToken, xeroTenantId, asset, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createAsset -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.assets.Error assetError = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Asset",assetError, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + return null; + } + + /** + * adds a fixed asset + * Adds an asset to the system + *

200 - return single object - create new asset + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param asset Fixed asset you are creating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createAssetForHttpResponse(String accessToken, String xeroTenantId, Asset asset, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createAsset"); + }// verify the required parameter 'asset' is set + if (asset == null) { + throw new IllegalArgumentException("Missing the required parameter 'asset' when calling createAsset"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createAsset"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (orderBy != null) { - String key = "orderBy"; - Object value = orderBy; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Assets"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (sortDirection != null) { - String key = "sortDirection"; - Object value = sortDirection; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(asset); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * adds a fixed asset type + * Adds an fixed asset type to the system + *

200 - results single object - created fixed type + *

400 - invalid input, object invalid + *

409 - a type already exists + * @param xeroTenantId Xero identifier for Tenant + * @param assetType Asset type to add + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return AssetType + * @throws IOException if an error occurs while attempting to invoke the API **/ + public AssetType createAssetType(String accessToken, String xeroTenantId, AssetType assetType, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createAssetTypeForHttpResponse(accessToken, xeroTenantId, assetType, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createAssetType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.assets.Error assetError = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("AssetType",assetError, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (filterBy != null) { - String key = "filterBy"; - Object value = filterBy; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + return null; + } + + /** + * adds a fixed asset type + * Adds an fixed asset type to the system + *

200 - results single object - created fixed type + *

400 - invalid input, object invalid + *

409 - a type already exists + * @param xeroTenantId Xero identifier for Tenant + * @param assetType Asset type to add + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createAssetTypeForHttpResponse(String accessToken, String xeroTenantId, AssetType assetType, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createAssetType"); + }// verify the required parameter 'assetType' is set + if (assetType == null) { + throw new IllegalArgumentException("Missing the required parameter 'assetType' when calling createAssetType"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createAssetType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AssetTypes"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(assetType); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves fixed asset by id + * By passing in the appropriate asset id, you can search for a specific fixed asset in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param id fixed asset id for single object + * @param accessToken Authorization token for user set in header of each request + * @return Asset + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Asset getAssetById(String accessToken, String xeroTenantId, UUID id) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAssetByIdForHttpResponse(accessToken, xeroTenantId, id); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAssetById -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves fixed asset by id + * By passing in the appropriate asset id, you can search for a specific fixed asset in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param id fixed asset id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAssetByIdForHttpResponse(String accessToken, String xeroTenantId, UUID id) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAssetById"); + }// verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling getAssetById"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAssetById"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("id", id); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Assets/{id}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * searches fixed asset settings + * By passing in the appropriate options, you can search for available fixed asset types in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return Setting + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Setting getAssetSettings(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAssetSettingsForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAssetSettings -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * searches fixed asset settings + * By passing in the appropriate options, you can search for available fixed asset types in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAssetSettingsForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAssetSettings"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAssetSettings"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * searches fixed asset types + * By passing in the appropriate options, you can search for available fixed asset types in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return List<AssetType> + * @throws IOException if an error occurs while attempting to invoke the API **/ + public List getAssetTypes(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference> typeRef = new TypeReference>() {}; + HttpResponse response = getAssetTypesForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAssetTypes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * searches fixed asset types + * By passing in the appropriate options, you can search for available fixed asset types in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAssetTypesForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAssetTypes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAssetTypes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AssetTypes"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * searches fixed asset + * By passing in the appropriate options, you can search for available fixed asset in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param status Required when retrieving a collection of assets. See Asset Status Codes + * @param page Results are paged. This specifies which page of the results to return. The default page is 1. + * @param pageSize The number of records returned per page. By default the number of records returned is 10. + * @param orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + * @param sortDirection ASC or DESC + * @param filterBy A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. + * @param accessToken Authorization token for user set in header of each request + * @return Assets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Assets getAssets(String accessToken, String xeroTenantId, AssetStatusQueryParam status, Integer page, Integer pageSize, String orderBy, String sortDirection, String filterBy) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAssetsForHttpResponse(accessToken, xeroTenantId, status, page, pageSize, orderBy, sortDirection, filterBy); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAssets -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * searches fixed asset + * By passing in the appropriate options, you can search for available fixed asset in the system + *

200 - search results matching criteria + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param status Required when retrieving a collection of assets. See Asset Status Codes + * @param page Results are paged. This specifies which page of the results to return. The default page is 1. + * @param pageSize The number of records returned per page. By default the number of records returned is 10. + * @param orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + * @param sortDirection ASC or DESC + * @param filterBy A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAssetsForHttpResponse(String accessToken, String xeroTenantId, AssetStatusQueryParam status, Integer page, Integer pageSize, String orderBy, String sortDirection, String filterBy) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAssets"); + }// verify the required parameter 'status' is set + if (status == null) { + throw new IllegalArgumentException("Missing the required parameter 'status' when calling getAssets"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAssets"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Assets"); + if (status != null) { + String key = "status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (orderBy != null) { + String key = "orderBy"; + Object value = orderBy; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (sortDirection != null) { + String key = "sortDirection"; + Object value = sortDirection; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (filterBy != null) { + String key = "filterBy"; + Object value = filterBy; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - } } diff --git a/src/main/java/com/xero/api/client/BankFeedsApi.java b/src/main/java/com/xero/api/client/BankFeedsApi.java index a76d9b62b..c0179749f 100644 --- a/src/main/java/com/xero/api/client/BankFeedsApi.java +++ b/src/main/java/com/xero/api/client/BankFeedsApi.java @@ -9,946 +9,760 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; +import com.xero.api.ApiClient; + +import com.xero.models.bankfeeds.Error; +import com.xero.models.bankfeeds.FeedConnection; +import com.xero.models.bankfeeds.FeedConnections; +import com.xero.models.bankfeeds.Statement; +import com.xero.models.bankfeeds.Statements; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; +import com.google.api.client.http.ByteArrayContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpResponseException; import com.google.api.client.http.HttpTransport; -import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; -import com.xero.models.bankfeeds.FeedConnection; -import com.xero.models.bankfeeds.FeedConnections; -import com.xero.models.bankfeeds.Statement; -import com.xero.models.bankfeeds.Statements; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** BankFeedsApi has methods for interacting with all endpoints in the API set */ -public class BankFeedsApi { - private ApiClient apiClient; - private static BankFeedsApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(BankFeedsApi.class); - - /** BankFeedsApi */ - public BankFeedsApi() { - this(new ApiClient()); - } - - /** - * BankFeedsApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static BankFeedsApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new BankFeedsApi(apiClient); - } - return instance; - } - - /** - * BankFeedsApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public BankFeedsApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Create one or more new feed connection By passing in the FeedConnections array object in the - * body, you can create one or more new feed connections - * - *

202 - success new feed connection(s)response - * - *

400 - failed to create new feed connection(s)response - * - * @param xeroTenantId Xero identifier for Tenant - * @param feedConnections Feed Connection(s) array object in the body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return FeedConnections - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FeedConnections createFeedConnections( - String accessToken, - String xeroTenantId, - FeedConnections feedConnections, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createFeedConnectionsForHttpResponse( - accessToken, xeroTenantId, feedConnections, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createFeedConnections -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = new TypeReference() {}; - FeedConnections bankFeedError = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("FeedConnections", bankFeedError, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Create one or more new feed connection By passing in the FeedConnections array object in the - * body, you can create one or more new feed connections - * - *

202 - success new feed connection(s)response - * - *

400 - failed to create new feed connection(s)response - * - * @param xeroTenantId Xero identifier for Tenant - * @param feedConnections Feed Connection(s) array object in the body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createFeedConnectionsForHttpResponse( - String accessToken, - String xeroTenantId, - FeedConnections feedConnections, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createFeedConnections"); - } // verify the required parameter 'feedConnections' is set - if (feedConnections == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'feedConnections' when calling createFeedConnections"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createFeedConnections"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } +import java.util.List; - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(feedConnections); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates one or more new statements - * - *

202 - Success returns Statements array of objects in response - * - *

400 - Statement failed validation - * - *

403 - Invalid application or feed connection - * - *

409 - Duplicate statement received - * - *

413 - Statement exceeds size limit - * - *

422 - Unprocessable Entity - * - *

500 - Intermittent Xero Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param statements Statements array of objects in the body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Statements - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Statements createStatements( - String accessToken, String xeroTenantId, Statements statements, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createStatementsForHttpResponse(accessToken, xeroTenantId, statements, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createStatements -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400) { - TypeReference errorTypeRef = new TypeReference() {}; - Statements bankFeedError = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Statements", bankFeedError, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates one or more new statements - * - *

202 - Success returns Statements array of objects in response - * - *

400 - Statement failed validation - * - *

403 - Invalid application or feed connection - * - *

409 - Duplicate statement received - * - *

413 - Statement exceeds size limit - * - *

422 - Unprocessable Entity - * - *

500 - Intermittent Xero Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param statements Statements array of objects in the body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createStatementsForHttpResponse( - String accessToken, String xeroTenantId, Statements statements, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createStatements"); - } // verify the required parameter 'statements' is set - if (statements == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'statements' when calling createStatements"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createStatements"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/jsonapplication/problem+json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Statements"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } +import org.apache.commons.io.IOUtils; - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(statements); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Delete an existing feed connection By passing in FeedConnections array object in the body, you - * can delete a feed connection. - * - *

202 - Success response for deleted feed connection - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param feedConnections Feed Connections array object in the body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return FeedConnections - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FeedConnections deleteFeedConnections( - String accessToken, - String xeroTenantId, - FeedConnections feedConnections, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteFeedConnectionsForHttpResponse( - accessToken, xeroTenantId, feedConnections, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteFeedConnections -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Delete an existing feed connection By passing in FeedConnections array object in the body, you - * can delete a feed connection. - * - *

202 - Success response for deleted feed connection - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param feedConnections Feed Connections array object in the body - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteFeedConnectionsForHttpResponse( - String accessToken, - String xeroTenantId, - FeedConnections feedConnections, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteFeedConnections"); - } // verify the required parameter 'feedConnections' is set - if (feedConnections == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'feedConnections' when calling deleteFeedConnections"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteFeedConnections"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/DeleteRequests"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } +import org.slf4j.LoggerFactory; +import org.slf4j.Logger; - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(feedConnections); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieve single feed connection based on a unique id provided By passing in a FeedConnection Id - * options, you can search for matching feed connections - * - *

200 - success returns a FeedConnection object matching the id in response - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Unique identifier for retrieving single object - * @param accessToken Authorization token for user set in header of each request - * @return FeedConnection - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FeedConnection getFeedConnection(String accessToken, String xeroTenantId, UUID id) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getFeedConnectionForHttpResponse(accessToken, xeroTenantId, id); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFeedConnection -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieve single feed connection based on a unique id provided By passing in a FeedConnection Id - * options, you can search for matching feed connections - * - *

200 - success returns a FeedConnection object matching the id in response - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Unique identifier for retrieving single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFeedConnectionForHttpResponse( - String accessToken, String xeroTenantId, UUID id) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFeedConnection"); - } // verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'id' when calling getFeedConnection"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFeedConnection"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("id", id); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/{id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Searches for feed connections By passing in the appropriate options, you can search for - * available feed connections in the system. - * - *

202 - search results matching criteria returned with pagination and items array - * - *

400 - validation error response - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 10. Example - - * https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of - * the records. When page value is not a number or a negative number, by default, the first - * set of records is returned. - * @param pageSize Page size which specifies how many records per page will be returned (default - * 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to - * specify page size of 100. - * @param accessToken Authorization token for user set in header of each request - * @return FeedConnections - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FeedConnections getFeedConnections( - String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getFeedConnectionsForHttpResponse(accessToken, xeroTenantId, page, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFeedConnections -------------------"); - logger.debug(e.toString()); +/** BankFeedsApi has methods for interacting with all endpoints in the API set */ +public class BankFeedsApi { + private ApiClient apiClient; + private static BankFeedsApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(BankFeedsApi.class); + + /** BankFeedsApi */ + public BankFeedsApi() { + this(new ApiClient()); + } + + /** BankFeedsApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static BankFeedsApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new BankFeedsApi(apiClient); } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Searches for feed connections By passing in the appropriate options, you can search for - * available feed connections in the system. - * - *

202 - search results matching criteria returned with pagination and items array - * - *

400 - validation error response - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 10. Example - - * https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of - * the records. When page value is not a number or a negative number, by default, the first - * set of records is returned. - * @param pageSize Page size which specifies how many records per page will be returned (default - * 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to - * specify page size of 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFeedConnectionsForHttpResponse( - String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFeedConnections"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFeedConnections"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + return instance; + } + + /** BankFeedsApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public BankFeedsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * Create one or more new feed connection + * By passing in the FeedConnections array object in the body, you can create one or more new feed connections + *

202 - success new feed connection(s)response + *

400 - failed to create new feed connection(s)response + * @param xeroTenantId Xero identifier for Tenant + * @param feedConnections Feed Connection(s) array object in the body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return FeedConnections + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FeedConnections createFeedConnections(String accessToken, String xeroTenantId, FeedConnections feedConnections, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createFeedConnectionsForHttpResponse(accessToken, xeroTenantId, feedConnections, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createFeedConnections -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + FeedConnections bankFeedError = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("FeedConnections",bankFeedError, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + return null; + } + + /** + * Create one or more new feed connection + * By passing in the FeedConnections array object in the body, you can create one or more new feed connections + *

202 - success new feed connection(s)response + *

400 - failed to create new feed connection(s)response + * @param xeroTenantId Xero identifier for Tenant + * @param feedConnections Feed Connection(s) array object in the body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createFeedConnectionsForHttpResponse(String accessToken, String xeroTenantId, FeedConnections feedConnections, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createFeedConnections"); + }// verify the required parameter 'feedConnections' is set + if (feedConnections == null) { + throw new IllegalArgumentException("Missing the required parameter 'feedConnections' when calling createFeedConnections"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieve single statement based on unique id provided By passing in a statement id, you can - * search for matching statements - * - *

200 - search results matching id for single statement - * - *

404 - Statement not found - * - * @param xeroTenantId Xero identifier for Tenant - * @param statementId statement id for single object - * @param accessToken Authorization token for user set in header of each request - * @return Statement - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Statement getStatement(String accessToken, String xeroTenantId, UUID statementId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getStatementForHttpResponse(accessToken, xeroTenantId, statementId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getStatement -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieve single statement based on unique id provided By passing in a statement id, you can - * search for matching statements - * - *

200 - search results matching id for single statement - * - *

404 - Statement not found - * - * @param xeroTenantId Xero identifier for Tenant - * @param statementId statement id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getStatementForHttpResponse( - String accessToken, String xeroTenantId, UUID statementId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getStatement"); - } // verify the required parameter 'statementId' is set - if (statementId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'statementId' when calling getStatement"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getStatement"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("statementId", statementId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Statements/{statementId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieve all statements By passing in parameters, you can search for matching statements - * - *

200 - success returns Statements array of objects response - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param page unique id for single object - * @param pageSize Page size which specifies how many records per page will be returned (default - * 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to - * specify page size of 100. - * @param xeroApplicationId The xeroApplicationId parameter - * @param xeroUserId The xeroUserId parameter - * @param accessToken Authorization token for user set in header of each request - * @return Statements - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Statements getStatements( - String accessToken, - String xeroTenantId, - Integer page, - Integer pageSize, - String xeroApplicationId, - String xeroUserId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getStatementsForHttpResponse( - accessToken, xeroTenantId, page, pageSize, xeroApplicationId, xeroUserId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getStatements -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieve all statements By passing in parameters, you can search for matching statements - * - *

200 - success returns Statements array of objects response - * - *

400 - bad input parameter - * - * @param xeroTenantId Xero identifier for Tenant - * @param page unique id for single object - * @param pageSize Page size which specifies how many records per page will be returned (default - * 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to - * specify page size of 100. - * @param xeroApplicationId The xeroApplicationId parameter - * @param xeroUserId The xeroUserId parameter - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getStatementsForHttpResponse( - String accessToken, - String xeroTenantId, - Integer page, - Integer pageSize, - String xeroApplicationId, - String xeroUserId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getStatements"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getStatements"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Xero-Application-Id", xeroApplicationId); - headers.set("Xero-User-Id", xeroUserId); - headers.setAccept("application/jsonapplication/problem+json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Statements"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createFeedConnections"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(feedConnections); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates one or more new statements + *

202 - Success returns Statements array of objects in response + *

400 - Statement failed validation + *

403 - Invalid application or feed connection + *

409 - Duplicate statement received + *

413 - Statement exceeds size limit + *

422 - Unprocessable Entity + *

500 - Intermittent Xero Error + * @param xeroTenantId Xero identifier for Tenant + * @param statements Statements array of objects in the body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Statements + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Statements createStatements(String accessToken, String xeroTenantId, Statements statements, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createStatementsForHttpResponse(accessToken, xeroTenantId, statements, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createStatements -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400) { + TypeReference errorTypeRef = new TypeReference() {}; + Statements bankFeedError = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Statements",bankFeedError, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates one or more new statements + *

202 - Success returns Statements array of objects in response + *

400 - Statement failed validation + *

403 - Invalid application or feed connection + *

409 - Duplicate statement received + *

413 - Statement exceeds size limit + *

422 - Unprocessable Entity + *

500 - Intermittent Xero Error + * @param xeroTenantId Xero identifier for Tenant + * @param statements Statements array of objects in the body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createStatementsForHttpResponse(String accessToken, String xeroTenantId, Statements statements, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createStatements"); + }// verify the required parameter 'statements' is set + if (statements == null) { + throw new IllegalArgumentException("Missing the required parameter 'statements' when calling createStatements"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createStatements"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/jsonapplication/problem+json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Statements"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(statements); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Delete an existing feed connection + * By passing in FeedConnections array object in the body, you can delete a feed connection. + *

202 - Success response for deleted feed connection + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param feedConnections Feed Connections array object in the body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return FeedConnections + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FeedConnections deleteFeedConnections(String accessToken, String xeroTenantId, FeedConnections feedConnections, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteFeedConnectionsForHttpResponse(accessToken, xeroTenantId, feedConnections, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteFeedConnections -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Delete an existing feed connection + * By passing in FeedConnections array object in the body, you can delete a feed connection. + *

202 - Success response for deleted feed connection + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param feedConnections Feed Connections array object in the body + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteFeedConnectionsForHttpResponse(String accessToken, String xeroTenantId, FeedConnections feedConnections, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteFeedConnections"); + }// verify the required parameter 'feedConnections' is set + if (feedConnections == null) { + throw new IllegalArgumentException("Missing the required parameter 'feedConnections' when calling deleteFeedConnections"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteFeedConnections"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/DeleteRequests"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(feedConnections); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieve single feed connection based on a unique id provided + * By passing in a FeedConnection Id options, you can search for matching feed connections + *

200 - success returns a FeedConnection object matching the id in response + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param id Unique identifier for retrieving single object + * @param accessToken Authorization token for user set in header of each request + * @return FeedConnection + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FeedConnection getFeedConnection(String accessToken, String xeroTenantId, UUID id) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFeedConnectionForHttpResponse(accessToken, xeroTenantId, id); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFeedConnection -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieve single feed connection based on a unique id provided + * By passing in a FeedConnection Id options, you can search for matching feed connections + *

200 - success returns a FeedConnection object matching the id in response + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param id Unique identifier for retrieving single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFeedConnectionForHttpResponse(String accessToken, String xeroTenantId, UUID id) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFeedConnection"); + }// verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling getFeedConnection"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFeedConnection"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("id", id); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/{id}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Searches for feed connections + * By passing in the appropriate options, you can search for available feed connections in the system. + *

202 - search results matching criteria returned with pagination and items array + *

400 - validation error response + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * @param pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. + * @param accessToken Authorization token for user set in header of each request + * @return FeedConnections + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FeedConnections getFeedConnections(String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFeedConnectionsForHttpResponse(accessToken, xeroTenantId, page, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFeedConnections -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Searches for feed connections + * By passing in the appropriate options, you can search for available feed connections in the system. + *

202 - search results matching criteria returned with pagination and items array + *

400 - validation error response + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * @param pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFeedConnectionsForHttpResponse(String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFeedConnections"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFeedConnections"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieve single statement based on unique id provided + * By passing in a statement id, you can search for matching statements + *

200 - search results matching id for single statement + *

404 - Statement not found + * @param xeroTenantId Xero identifier for Tenant + * @param statementId statement id for single object + * @param accessToken Authorization token for user set in header of each request + * @return Statement + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Statement getStatement(String accessToken, String xeroTenantId, UUID statementId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getStatementForHttpResponse(accessToken, xeroTenantId, statementId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getStatement -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieve single statement based on unique id provided + * By passing in a statement id, you can search for matching statements + *

200 - search results matching id for single statement + *

404 - Statement not found + * @param xeroTenantId Xero identifier for Tenant + * @param statementId statement id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getStatementForHttpResponse(String accessToken, String xeroTenantId, UUID statementId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getStatement"); + }// verify the required parameter 'statementId' is set + if (statementId == null) { + throw new IllegalArgumentException("Missing the required parameter 'statementId' when calling getStatement"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getStatement"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("statementId", statementId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Statements/{statementId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieve all statements + * By passing in parameters, you can search for matching statements + *

200 - success returns Statements array of objects response + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param page unique id for single object + * @param pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * @param xeroApplicationId The xeroApplicationId parameter + * @param xeroUserId The xeroUserId parameter + * @param accessToken Authorization token for user set in header of each request + * @return Statements + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Statements getStatements(String accessToken, String xeroTenantId, Integer page, Integer pageSize, String xeroApplicationId, String xeroUserId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getStatementsForHttpResponse(accessToken, xeroTenantId, page, pageSize, xeroApplicationId, xeroUserId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getStatements -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieve all statements + * By passing in parameters, you can search for matching statements + *

200 - success returns Statements array of objects response + *

400 - bad input parameter + * @param xeroTenantId Xero identifier for Tenant + * @param page unique id for single object + * @param pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * @param xeroApplicationId The xeroApplicationId parameter + * @param xeroUserId The xeroUserId parameter + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getStatementsForHttpResponse(String accessToken, String xeroTenantId, Integer page, Integer pageSize, String xeroApplicationId, String xeroUserId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getStatements"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getStatements"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Xero-Application-Id", xeroApplicationId); + headers.set("Xero-User-Id", xeroUserId); + headers.setAccept("application/jsonapplication/problem+json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Statements"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - } } diff --git a/src/main/java/com/xero/api/client/FilesApi.java b/src/main/java/com/xero/api/client/FilesApi.java index d3b6f777c..cf20b4133 100644 --- a/src/main/java/com/xero/api/client/FilesApi.java +++ b/src/main/java/com/xero/api/client/FilesApi.java @@ -9,2116 +9,1733 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; +import com.xero.api.ApiClient; + +import com.xero.models.file.Association; +import java.io.File; +import com.xero.models.file.FileObject; +import com.xero.models.file.Files; +import com.xero.models.file.Folder; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.http.ByteArrayContent; -import com.google.api.client.http.FileContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMediaType; import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpResponseException; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.util.Maps; -import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; -import com.xero.models.file.Association; -import com.xero.models.file.FileObject; -import com.xero.models.file.Files; -import com.xero.models.file.Folder; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; -import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** FilesApi has methods for interacting with all endpoints in the API set */ -public class FilesApi { - private ApiClient apiClient; - private static FilesApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(FilesApi.class); - - /** FilesApi */ - public FilesApi() { - this(new ApiClient()); - } - - /** - * FilesApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static FilesApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new FilesApi(apiClient); - } - return instance; - } - - /** - * FilesApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public FilesApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Creates a new file association By passing in the appropriate options, you can create a new - * folder - * - *

201 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param association The association parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Association - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Association createFileAssociation( - String accessToken, - String xeroTenantId, - UUID fileId, - Association association, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createFileAssociationForHttpResponse( - accessToken, xeroTenantId, fileId, association, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createFileAssociation -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new file association By passing in the appropriate options, you can create a new - * folder - * - *

201 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param association The association parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createFileAssociationForHttpResponse( - String accessToken, - String xeroTenantId, - UUID fileId, - Association association, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createFileAssociation"); - } // verify the required parameter 'fileId' is set - if (fileId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileId' when calling createFileAssociation"); - } // verify the required parameter 'association' is set - if (association == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'association' when calling createFileAssociation"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createFileAssociation"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FileId", fileId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Associations"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(association); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new folder By passing in the appropriate properties, you can create a new folder - * - *

200 - search results matching criteria - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param folder The folder parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Folder - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Folder createFolder( - String accessToken, String xeroTenantId, Folder folder, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createFolderForHttpResponse(accessToken, xeroTenantId, folder, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createFolder -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new folder By passing in the appropriate properties, you can create a new folder - * - *

200 - search results matching criteria - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param folder The folder parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createFolderForHttpResponse( - String accessToken, String xeroTenantId, Folder folder, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createFolder"); - } // verify the required parameter 'folder' is set - if (folder == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'folder' when calling createFolder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createFolder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(folder); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific file Delete a specific file - * - *

204 - Successful deletion - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteFile(String accessToken, String xeroTenantId, UUID fileId) throws IOException { - try { - deleteFileForHttpResponse(accessToken, xeroTenantId, fileId); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteFile -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a specific file Delete a specific file - * - *

204 - Successful deletion - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteFileForHttpResponse( - String accessToken, String xeroTenantId, UUID fileId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteFile"); - } // verify the required parameter 'fileId' is set - if (fileId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileId' when calling deleteFile"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteFile"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept(""); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FileId", fileId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes an existing file association By passing in the appropriate options, you can create a - * new folder - * - *

204 - Successful deletion - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param objectId Object id for single object - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteFileAssociation( - String accessToken, String xeroTenantId, UUID fileId, UUID objectId) throws IOException { - try { - deleteFileAssociationForHttpResponse(accessToken, xeroTenantId, fileId, objectId); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteFileAssociation -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes an existing file association By passing in the appropriate options, you can create a - * new folder - * - *

204 - Successful deletion - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param objectId Object id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteFileAssociationForHttpResponse( - String accessToken, String xeroTenantId, UUID fileId, UUID objectId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteFileAssociation"); - } // verify the required parameter 'fileId' is set - if (fileId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileId' when calling deleteFileAssociation"); - } // verify the required parameter 'objectId' is set - if (objectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'objectId' when calling deleteFileAssociation"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteFileAssociation"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept(""); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FileId", fileId); - uriVariables.put("ObjectId", objectId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Associations/{ObjectId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a folder By passing in the appropriate ID, you can delete a folder - * - *

204 - Successful deletion - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId Folder id for single object - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteFolder(String accessToken, String xeroTenantId, UUID folderId) - throws IOException { - try { - deleteFolderForHttpResponse(accessToken, xeroTenantId, folderId); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteFolder -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a folder By passing in the appropriate ID, you can delete a folder - * - *

204 - Successful deletion - return response 204 no content - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId Folder id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteFolderForHttpResponse( - String accessToken, String xeroTenantId, UUID folderId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteFolder"); - } // verify the required parameter 'folderId' is set - if (folderId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'folderId' when calling deleteFolder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteFolder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept(""); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FolderId", folderId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders/{FolderId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves an association object using a unique object ID By passing in the appropriate options, - * you can retrieve an association - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param objectId Object id for single object - * @param pagesize pass an optional page size value - * @param page number of records to skip for pagination - * @param sort values to sort by - * @param direction direction to sort by - * @param accessToken Authorization token for user set in header of each request - * @return List<Association> - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public List getAssociationsByObject( - String accessToken, - String xeroTenantId, - UUID objectId, - Integer pagesize, - Integer page, - String sort, - String direction) - throws IOException { - try { - TypeReference> typeRef = new TypeReference>() {}; - HttpResponse response = - getAssociationsByObjectForHttpResponse( - accessToken, xeroTenantId, objectId, pagesize, page, sort, direction); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAssociationsByObject -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves an association object using a unique object ID By passing in the appropriate options, - * you can retrieve an association - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param objectId Object id for single object - * @param pagesize pass an optional page size value - * @param page number of records to skip for pagination - * @param sort values to sort by - * @param direction direction to sort by - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAssociationsByObjectForHttpResponse( - String accessToken, - String xeroTenantId, - UUID objectId, - Integer pagesize, - Integer page, - String sort, - String direction) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAssociationsByObject"); - } // verify the required parameter 'objectId' is set - if (objectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'objectId' when calling getAssociationsByObject"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAssociationsByObject"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ObjectId", objectId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Associations/{ObjectId}"); - if (pagesize != null) { - String key = "pagesize"; - Object value = pagesize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (sort != null) { - String key = "sort"; - Object value = sort; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (direction != null) { - String key = "direction"; - Object value = direction; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a count of associations for a list of objects. By passing in the appropriate options, - * you can retrieve the association count for objects - * - *

200 - A dictionary of the object Ids and associations count - * - * @param xeroTenantId Xero identifier for Tenant - * @param objectIds A comma-separated list of object ids - * @param accessToken Authorization token for user set in header of each request - * @return Object - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Object getAssociationsCount(String accessToken, String xeroTenantId, List objectIds) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAssociationsCountForHttpResponse(accessToken, xeroTenantId, objectIds); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAssociationsCount -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a count of associations for a list of objects. By passing in the appropriate options, - * you can retrieve the association count for objects - * - *

200 - A dictionary of the object Ids and associations count - * - * @param xeroTenantId Xero identifier for Tenant - * @param objectIds A comma-separated list of object ids - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAssociationsCountForHttpResponse( - String accessToken, String xeroTenantId, List objectIds) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getAssociationsCount"); - } // verify the required parameter 'objectIds' is set - if (objectIds == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'objectIds' when calling getAssociationsCount"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getAssociationsCount"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Associations/Count"); - if (objectIds != null) { - String key = "ObjectIds"; - Object value = objectIds; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a file by a unique file ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @return FileObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FileObject getFile(String accessToken, String xeroTenantId, UUID fileId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getFileForHttpResponse(accessToken, xeroTenantId, fileId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFile -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a file by a unique file ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFile"); - } // verify the required parameter 'fileId' is set - if (fileId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileId' when calling getFile"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFile"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FileId", fileId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific file associations By passing in the appropriate options, - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @return List<Association> - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public List getFileAssociations(String accessToken, String xeroTenantId, UUID fileId) - throws IOException { - try { - TypeReference> typeRef = new TypeReference>() {}; - HttpResponse response = getFileAssociationsForHttpResponse(accessToken, xeroTenantId, fileId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFileAssociations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific file associations By passing in the appropriate options, - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFileAssociationsForHttpResponse( - String accessToken, String xeroTenantId, UUID fileId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFileAssociations"); - } // verify the required parameter 'fileId' is set - if (fileId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileId' when calling getFileAssociations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFileAssociations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FileId", fileId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Associations"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves the content of a specific file By passing in the appropriate options, retrieve data - * for specific file - * - *

200 - returns the byte array of the specific file based on id - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @return ByteArrayInputStream - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ByteArrayInputStream getFileContent(String accessToken, String xeroTenantId, UUID fileId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getFileContentForHttpResponse(accessToken, xeroTenantId, fileId); - InputStream is = response.getContent(); - return convertInputToByteArray(is); - - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFileContent -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves the content of a specific file By passing in the appropriate options, retrieve data - * for specific file - * - *

200 - returns the byte array of the specific file based on id - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFileContentForHttpResponse( - String accessToken, String xeroTenantId, UUID fileId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFileContent"); - } // verify the required parameter 'fileId' is set - if (fileId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileId' when calling getFileContent"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFileContent"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/octet-stream"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FileId", fileId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Content"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves files - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param pagesize pass an optional page size value - * @param page number of records to skip for pagination - * @param sort values to sort by - * @param accessToken Authorization token for user set in header of each request - * @return Files - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Files getFiles( - String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getFilesForHttpResponse(accessToken, xeroTenantId, pagesize, page, sort); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFiles -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves files - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param pagesize pass an optional page size value - * @param page number of records to skip for pagination - * @param sort values to sort by - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFilesForHttpResponse( - String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFiles"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFiles"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files"); - if (pagesize != null) { - String key = "pagesize"; - Object value = pagesize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (sort != null) { - String key = "sort"; - Object value = sort; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can - * search for specific folder - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId Folder id for single object - * @param accessToken Authorization token for user set in header of each request - * @return Folder - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Folder getFolder(String accessToken, String xeroTenantId, UUID folderId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getFolderForHttpResponse(accessToken, xeroTenantId, folderId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFolder -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can - * search for specific folder - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId Folder id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFolderForHttpResponse( - String accessToken, String xeroTenantId, UUID folderId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFolder"); - } // verify the required parameter 'folderId' is set - if (folderId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'folderId' when calling getFolder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFolder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FolderId", folderId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders/{FolderId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves folders By passing in the appropriate options, you can search for available folders - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param sort values to sort by - * @param accessToken Authorization token for user set in header of each request - * @return List<Folder> - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public List getFolders(String accessToken, String xeroTenantId, String sort) - throws IOException { - try { - TypeReference> typeRef = new TypeReference>() {}; - HttpResponse response = getFoldersForHttpResponse(accessToken, xeroTenantId, sort); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFolders -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves folders By passing in the appropriate options, you can search for available folders - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param sort values to sort by - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFoldersForHttpResponse( - String accessToken, String xeroTenantId, String sort) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getFolders"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getFolders"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders"); - if (sort != null) { - String key = "sort"; - Object value = sort; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves inbox folder Search for the user inbox - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return Folder - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Folder getInbox(String accessToken, String xeroTenantId) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getInboxForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getInbox -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves inbox folder Search for the user inbox - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getInboxForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getInbox"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getInbox"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Inbox"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Update a file Updates file properties of a single file - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param fileObject The fileObject parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return FileObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FileObject updateFile( - String accessToken, - String xeroTenantId, - UUID fileId, - FileObject fileObject, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateFileForHttpResponse(accessToken, xeroTenantId, fileId, fileObject, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateFile -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Update a file Updates file properties of a single file - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param fileId File id for single object - * @param fileObject The fileObject parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateFileForHttpResponse( - String accessToken, - String xeroTenantId, - UUID fileId, - FileObject fileObject, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateFile"); - } // verify the required parameter 'fileId' is set - if (fileId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileId' when calling updateFile"); - } // verify the required parameter 'fileObject' is set - if (fileObject == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fileObject' when calling updateFile"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateFile"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FileId", fileId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } +import java.util.List; - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(fileObject); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates an existing folder By passing in the appropriate ID and properties, you can update a - * folder - * - *

200 - return the updated object - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId Folder id for single object - * @param folder The folder parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Folder - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Folder updateFolder( - String accessToken, String xeroTenantId, UUID folderId, Folder folder, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateFolderForHttpResponse(accessToken, xeroTenantId, folderId, folder, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateFolder -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates an existing folder By passing in the appropriate ID and properties, you can update a - * folder - * - *

200 - return the updated object - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId Folder id for single object - * @param folder The folder parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateFolderForHttpResponse( - String accessToken, String xeroTenantId, UUID folderId, Folder folder, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateFolder"); - } // verify the required parameter 'folderId' is set - if (folderId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'folderId' when calling updateFolder"); - } // verify the required parameter 'folder' is set - if (folder == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'folder' when calling updateFolder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateFolder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FolderId", folderId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders/{FolderId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } +import org.apache.commons.io.IOUtils; - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(folder); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Uploads a File to the inbox - * - *

201 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param body The body parameter - * @param name exact name of the file you are uploading - * @param filename The filename parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The mimeType parameter - * @param accessToken Authorization token for user set in header of each request - * @return FileObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FileObject uploadFile( - String accessToken, - String xeroTenantId, - File body, - String name, - String filename, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - uploadFileForHttpResponse( - accessToken, xeroTenantId, body, name, filename, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : uploadFile -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Uploads a File to the inbox - * - *

201 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param body The body parameter - * @param name exact name of the file you are uploading - * @param filename The filename parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The mimeType parameter - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse uploadFileForHttpResponse( - String accessToken, - String xeroTenantId, - File body, - String name, - String filename, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling uploadFile"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling uploadFile"); - } // verify the required parameter 'name' is set - if (name == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'name' when calling uploadFile"); - } // verify the required parameter 'filename' is set - if (filename == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'filename' when calling uploadFile"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling uploadFile"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } +import org.slf4j.LoggerFactory; +import org.slf4j.Logger; - Map parameters = Maps.newHashMap(); - parameters.put("name", name); - parameters.put("filename", filename); - - // Add parameters - MultipartContent content = - new MultipartContent() - .setMediaType( - new HttpMediaType("multipart/form-data") - .setParameter("boundary", "__END_OF_PART__")); - - for (String key : parameters.keySet()) { - MultipartContent.Part part = - new MultipartContent.Part(new ByteArrayContent(null, parameters.get(key).getBytes())); - part.setHeaders( - new HttpHeaders() - .set("Content-Disposition", String.format("form-data; name=\"%s\"", key))); - content.addPart(part); - } - FileContent fileContent = new FileContent(mimeType, body); - MultipartContent.Part part = new MultipartContent.Part(fileContent); - part.setHeaders( - new HttpHeaders() - .set( - "Content-Disposition", - String.format("form-data; name=\"content\"; filename=\"%s\"", filename))); - content.addPart(part); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Uploads a File to a specific folder - * - *

201 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId pass required folder id to save file to specific folder - * @param body The body parameter - * @param name exact name of the file you are uploading - * @param filename The filename parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The mimeType parameter - * @param accessToken Authorization token for user set in header of each request - * @return FileObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public FileObject uploadFileToFolder( - String accessToken, - String xeroTenantId, - UUID folderId, - File body, - String name, - String filename, - String idempotencyKey, - String mimeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - uploadFileToFolderForHttpResponse( - accessToken, xeroTenantId, folderId, body, name, filename, idempotencyKey, mimeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : uploadFileToFolder -------------------"); - logger.debug(e.toString()); +/** FilesApi has methods for interacting with all endpoints in the API set */ +public class FilesApi { + private ApiClient apiClient; + private static FilesApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(FilesApi.class); + + /** FilesApi */ + public FilesApi() { + this(new ApiClient()); + } + + /** FilesApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static FilesApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new FilesApi(apiClient); } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Uploads a File to a specific folder - * - *

201 - A successful request - * - *

400 - invalid input, object invalid - * - * @param xeroTenantId Xero identifier for Tenant - * @param folderId pass required folder id to save file to specific folder - * @param body The body parameter - * @param name exact name of the file you are uploading - * @param filename The filename parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param mimeType The mimeType parameter - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse uploadFileToFolderForHttpResponse( - String accessToken, - String xeroTenantId, - UUID folderId, - File body, - String name, - String filename, - String idempotencyKey, - String mimeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling uploadFileToFolder"); - } // verify the required parameter 'folderId' is set - if (folderId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'folderId' when calling uploadFileToFolder"); - } // verify the required parameter 'body' is set - if (body == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'body' when calling uploadFileToFolder"); - } // verify the required parameter 'name' is set - if (name == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'name' when calling uploadFileToFolder"); - } // verify the required parameter 'filename' is set - if (filename == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'filename' when calling uploadFileToFolder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling uploadFileToFolder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("FolderId", folderId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FolderId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - Map parameters = Maps.newHashMap(); - parameters.put("name", name); - parameters.put("filename", filename); - - // Add parameters - MultipartContent content = - new MultipartContent() - .setMediaType( - new HttpMediaType("multipart/form-data") - .setParameter("boundary", "__END_OF_PART__")); - - for (String key : parameters.keySet()) { - MultipartContent.Part part = - new MultipartContent.Part(new ByteArrayContent(null, parameters.get(key).getBytes())); - part.setHeaders( - new HttpHeaders() - .set("Content-Disposition", String.format("form-data; name=\"%s\"", key))); - content.addPart(part); - } - - FileContent fileContent = new FileContent(mimeType, body); - MultipartContent.Part part = new MultipartContent.Part(fileContent); - part.setHeaders( - new HttpHeaders() - .set( - "Content-Disposition", - String.format("form-data; name=\"content\"; filename=\"%s\"", filename))); - content.addPart(part); - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); + return instance; + } + + /** FilesApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public FilesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * Creates a new file association + * By passing in the appropriate options, you can create a new folder + *

201 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param association The association parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Association + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Association createFileAssociation(String accessToken, String xeroTenantId, UUID fileId, Association association, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createFileAssociationForHttpResponse(accessToken, xeroTenantId, fileId, association, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createFileAssociation -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new file association + * By passing in the appropriate options, you can create a new folder + *

201 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param association The association parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createFileAssociationForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, Association association, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createFileAssociation"); + }// verify the required parameter 'fileId' is set + if (fileId == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileId' when calling createFileAssociation"); + }// verify the required parameter 'association' is set + if (association == null) { + throw new IllegalArgumentException("Missing the required parameter 'association' when calling createFileAssociation"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createFileAssociation"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FileId", fileId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Associations"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(association); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new folder + * By passing in the appropriate properties, you can create a new folder + *

200 - search results matching criteria + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param folder The folder parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Folder + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Folder createFolder(String accessToken, String xeroTenantId, Folder folder, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createFolderForHttpResponse(accessToken, xeroTenantId, folder, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createFolder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new folder + * By passing in the appropriate properties, you can create a new folder + *

200 - search results matching criteria + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param folder The folder parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createFolderForHttpResponse(String accessToken, String xeroTenantId, Folder folder, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createFolder"); + }// verify the required parameter 'folder' is set + if (folder == null) { + throw new IllegalArgumentException("Missing the required parameter 'folder' when calling createFolder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createFolder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(folder); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific file + * Delete a specific file + *

204 - Successful deletion - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteFile(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + try { + deleteFileForHttpResponse(accessToken, xeroTenantId, fileId); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteFile -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a specific file + * Delete a specific file + *

204 - Successful deletion - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteFile"); + }// verify the required parameter 'fileId' is set + if (fileId == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileId' when calling deleteFile"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteFile"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept(""); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FileId", fileId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes an existing file association + * By passing in the appropriate options, you can create a new folder + *

204 - Successful deletion - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param objectId Object id for single object + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteFileAssociation(String accessToken, String xeroTenantId, UUID fileId, UUID objectId) throws IOException { + try { + deleteFileAssociationForHttpResponse(accessToken, xeroTenantId, fileId, objectId); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteFileAssociation -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes an existing file association + * By passing in the appropriate options, you can create a new folder + *

204 - Successful deletion - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param objectId Object id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteFileAssociationForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, UUID objectId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteFileAssociation"); + }// verify the required parameter 'fileId' is set + if (fileId == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileId' when calling deleteFileAssociation"); + }// verify the required parameter 'objectId' is set + if (objectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'objectId' when calling deleteFileAssociation"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteFileAssociation"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept(""); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FileId", fileId); + uriVariables.put("ObjectId", objectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Associations/{ObjectId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a folder + * By passing in the appropriate ID, you can delete a folder + *

204 - Successful deletion - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param folderId Folder id for single object + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteFolder(String accessToken, String xeroTenantId, UUID folderId) throws IOException { + try { + deleteFolderForHttpResponse(accessToken, xeroTenantId, folderId); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteFolder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a folder + * By passing in the appropriate ID, you can delete a folder + *

204 - Successful deletion - return response 204 no content + * @param xeroTenantId Xero identifier for Tenant + * @param folderId Folder id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteFolder"); + }// verify the required parameter 'folderId' is set + if (folderId == null) { + throw new IllegalArgumentException("Missing the required parameter 'folderId' when calling deleteFolder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteFolder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept(""); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FolderId", folderId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders/{FolderId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves an association object using a unique object ID + * By passing in the appropriate options, you can retrieve an association + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param objectId Object id for single object + * @param pagesize pass an optional page size value + * @param page number of records to skip for pagination + * @param sort values to sort by + * @param direction direction to sort by + * @param accessToken Authorization token for user set in header of each request + * @return List<Association> + * @throws IOException if an error occurs while attempting to invoke the API **/ + public List getAssociationsByObject(String accessToken, String xeroTenantId, UUID objectId, Integer pagesize, Integer page, String sort, String direction) throws IOException { + try { + TypeReference> typeRef = new TypeReference>() {}; + HttpResponse response = getAssociationsByObjectForHttpResponse(accessToken, xeroTenantId, objectId, pagesize, page, sort, direction); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAssociationsByObject -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves an association object using a unique object ID + * By passing in the appropriate options, you can retrieve an association + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param objectId Object id for single object + * @param pagesize pass an optional page size value + * @param page number of records to skip for pagination + * @param sort values to sort by + * @param direction direction to sort by + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAssociationsByObjectForHttpResponse(String accessToken, String xeroTenantId, UUID objectId, Integer pagesize, Integer page, String sort, String direction) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAssociationsByObject"); + }// verify the required parameter 'objectId' is set + if (objectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'objectId' when calling getAssociationsByObject"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAssociationsByObject"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ObjectId", objectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Associations/{ObjectId}"); + if (pagesize != null) { + String key = "pagesize"; + Object value = pagesize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (sort != null) { + String key = "sort"; + Object value = sort; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (direction != null) { + String key = "direction"; + Object value = direction; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a count of associations for a list of objects. + * By passing in the appropriate options, you can retrieve the association count for objects + *

200 - A dictionary of the object Ids and associations count + * @param xeroTenantId Xero identifier for Tenant + * @param objectIds A comma-separated list of object ids + * @param accessToken Authorization token for user set in header of each request + * @return Object + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Object getAssociationsCount(String accessToken, String xeroTenantId, List objectIds) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAssociationsCountForHttpResponse(accessToken, xeroTenantId, objectIds); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAssociationsCount -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a count of associations for a list of objects. + * By passing in the appropriate options, you can retrieve the association count for objects + *

200 - A dictionary of the object Ids and associations count + * @param xeroTenantId Xero identifier for Tenant + * @param objectIds A comma-separated list of object ids + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAssociationsCountForHttpResponse(String accessToken, String xeroTenantId, List objectIds) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAssociationsCount"); + }// verify the required parameter 'objectIds' is set + if (objectIds == null) { + throw new IllegalArgumentException("Missing the required parameter 'objectIds' when calling getAssociationsCount"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAssociationsCount"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Associations/Count"); + if (objectIds != null) { + String key = "ObjectIds"; + Object value = objectIds; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a file by a unique file ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @return FileObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FileObject getFile(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFileForHttpResponse(accessToken, xeroTenantId, fileId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFile -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a file by a unique file ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFile"); + }// verify the required parameter 'fileId' is set + if (fileId == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileId' when calling getFile"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFile"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FileId", fileId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific file associations + * By passing in the appropriate options, + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @return List<Association> + * @throws IOException if an error occurs while attempting to invoke the API **/ + public List getFileAssociations(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + try { + TypeReference> typeRef = new TypeReference>() {}; + HttpResponse response = getFileAssociationsForHttpResponse(accessToken, xeroTenantId, fileId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFileAssociations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific file associations + * By passing in the appropriate options, + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFileAssociationsForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFileAssociations"); + }// verify the required parameter 'fileId' is set + if (fileId == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileId' when calling getFileAssociations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFileAssociations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FileId", fileId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Associations"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves the content of a specific file + * By passing in the appropriate options, retrieve data for specific file + *

200 - returns the byte array of the specific file based on id + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @return ByteArrayInputStream + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ByteArrayInputStream getFileContent(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFileContentForHttpResponse(accessToken, xeroTenantId, fileId); + InputStream is = response.getContent(); + return convertInputToByteArray(is); + + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFileContent -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves the content of a specific file + * By passing in the appropriate options, retrieve data for specific file + *

200 - returns the byte array of the specific file based on id + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFileContentForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFileContent"); + }// verify the required parameter 'fileId' is set + if (fileId == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileId' when calling getFileContent"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFileContent"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/octet-stream"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FileId", fileId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}/Content"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves files + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param pagesize pass an optional page size value + * @param page number of records to skip for pagination + * @param sort values to sort by + * @param accessToken Authorization token for user set in header of each request + * @return Files + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Files getFiles(String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFilesForHttpResponse(accessToken, xeroTenantId, pagesize, page, sort); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFiles -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves files + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param pagesize pass an optional page size value + * @param page number of records to skip for pagination + * @param sort values to sort by + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFilesForHttpResponse(String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFiles"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFiles"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files"); + if (pagesize != null) { + String key = "pagesize"; + Object value = pagesize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (sort != null) { + String key = "sort"; + Object value = sort; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves specific folder by using a unique folder ID + * By passing in the appropriate ID, you can search for specific folder + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param folderId Folder id for single object + * @param accessToken Authorization token for user set in header of each request + * @return Folder + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Folder getFolder(String accessToken, String xeroTenantId, UUID folderId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFolderForHttpResponse(accessToken, xeroTenantId, folderId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFolder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves specific folder by using a unique folder ID + * By passing in the appropriate ID, you can search for specific folder + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param folderId Folder id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFolder"); + }// verify the required parameter 'folderId' is set + if (folderId == null) { + throw new IllegalArgumentException("Missing the required parameter 'folderId' when calling getFolder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFolder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FolderId", folderId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders/{FolderId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves folders + * By passing in the appropriate options, you can search for available folders + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param sort values to sort by + * @param accessToken Authorization token for user set in header of each request + * @return List<Folder> + * @throws IOException if an error occurs while attempting to invoke the API **/ + public List getFolders(String accessToken, String xeroTenantId, String sort) throws IOException { + try { + TypeReference> typeRef = new TypeReference>() {}; + HttpResponse response = getFoldersForHttpResponse(accessToken, xeroTenantId, sort); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFolders -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves folders + * By passing in the appropriate options, you can search for available folders + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param sort values to sort by + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFoldersForHttpResponse(String accessToken, String xeroTenantId, String sort) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFolders"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFolders"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders"); + if (sort != null) { + String key = "sort"; + Object value = sort; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves inbox folder + * Search for the user inbox + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return Folder + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Folder getInbox(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getInboxForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getInbox -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves inbox folder + * Search for the user inbox + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getInboxForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getInbox"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getInbox"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Inbox"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Update a file + * Updates file properties of a single file + *

200 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param fileObject The fileObject parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return FileObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FileObject updateFile(String accessToken, String xeroTenantId, UUID fileId, FileObject fileObject, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateFileForHttpResponse(accessToken, xeroTenantId, fileId, fileObject, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateFile -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Update a file + * Updates file properties of a single file + *

200 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param fileId File id for single object + * @param fileObject The fileObject parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, FileObject fileObject, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateFile"); + }// verify the required parameter 'fileId' is set + if (fileId == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileId' when calling updateFile"); + }// verify the required parameter 'fileObject' is set + if (fileObject == null) { + throw new IllegalArgumentException("Missing the required parameter 'fileObject' when calling updateFile"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateFile"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FileId", fileId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FileId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(fileObject); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates an existing folder + * By passing in the appropriate ID and properties, you can update a folder + *

200 - return the updated object + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param folderId Folder id for single object + * @param folder The folder parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Folder + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Folder updateFolder(String accessToken, String xeroTenantId, UUID folderId, Folder folder, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateFolderForHttpResponse(accessToken, xeroTenantId, folderId, folder, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateFolder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates an existing folder + * By passing in the appropriate ID and properties, you can update a folder + *

200 - return the updated object + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param folderId Folder id for single object + * @param folder The folder parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId, Folder folder, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateFolder"); + }// verify the required parameter 'folderId' is set + if (folderId == null) { + throw new IllegalArgumentException("Missing the required parameter 'folderId' when calling updateFolder"); + }// verify the required parameter 'folder' is set + if (folder == null) { + throw new IllegalArgumentException("Missing the required parameter 'folder' when calling updateFolder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateFolder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FolderId", folderId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Folders/{FolderId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(folder); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Uploads a File to the inbox + *

201 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param body The body parameter + * @param name exact name of the file you are uploading + * @param filename The filename parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The mimeType parameter + * @param accessToken Authorization token for user set in header of each request + * @return FileObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FileObject uploadFile(String accessToken, String xeroTenantId, File body, String name, String filename, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = uploadFileForHttpResponse(accessToken, xeroTenantId, body, name, filename, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : uploadFile -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Uploads a File to the inbox + *

201 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param body The body parameter + * @param name exact name of the file you are uploading + * @param filename The filename parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The mimeType parameter + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse uploadFileForHttpResponse(String accessToken, String xeroTenantId, File body, String name, String filename, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling uploadFile"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling uploadFile"); + }// verify the required parameter 'name' is set + if (name == null) { + throw new IllegalArgumentException("Missing the required parameter 'name' when calling uploadFile"); + }// verify the required parameter 'filename' is set + if (filename == null) { + throw new IllegalArgumentException("Missing the required parameter 'filename' when calling uploadFile"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling uploadFile"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + Map parameters = Maps.newHashMap(); + parameters.put("name", name); + parameters.put("filename", filename); + + // Add parameters + MultipartContent content = new MultipartContent().setMediaType( + new HttpMediaType("multipart/form-data") + .setParameter("boundary", "__END_OF_PART__")); + + for (String key : parameters.keySet()) { + MultipartContent.Part part = new MultipartContent.Part( + new ByteArrayContent(null, parameters.get(key).getBytes())); + part.setHeaders(new HttpHeaders().set( + "Content-Disposition", String.format("form-data; name=\"%s\"", key))); + content.addPart(part); + } + + FileContent fileContent = new FileContent( + mimeType, body); + MultipartContent.Part part = new MultipartContent.Part(fileContent); + part.setHeaders(new HttpHeaders().set( + "Content-Disposition", + String.format("form-data; name=\"content\"; filename=\"%s\"", filename))); + content.addPart(part); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Uploads a File to a specific folder + *

201 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param folderId pass required folder id to save file to specific folder + * @param body The body parameter + * @param name exact name of the file you are uploading + * @param filename The filename parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The mimeType parameter + * @param accessToken Authorization token for user set in header of each request + * @return FileObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public FileObject uploadFileToFolder(String accessToken, String xeroTenantId, UUID folderId, File body, String name, String filename, String idempotencyKey, String mimeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = uploadFileToFolderForHttpResponse(accessToken, xeroTenantId, folderId, body, name, filename, idempotencyKey, mimeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : uploadFileToFolder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Uploads a File to a specific folder + *

201 - A successful request + *

400 - invalid input, object invalid + * @param xeroTenantId Xero identifier for Tenant + * @param folderId pass required folder id to save file to specific folder + * @param body The body parameter + * @param name exact name of the file you are uploading + * @param filename The filename parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param mimeType The mimeType parameter + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse uploadFileToFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId, File body, String name, String filename, String idempotencyKey, String mimeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling uploadFileToFolder"); + }// verify the required parameter 'folderId' is set + if (folderId == null) { + throw new IllegalArgumentException("Missing the required parameter 'folderId' when calling uploadFileToFolder"); + }// verify the required parameter 'body' is set + if (body == null) { + throw new IllegalArgumentException("Missing the required parameter 'body' when calling uploadFileToFolder"); + }// verify the required parameter 'name' is set + if (name == null) { + throw new IllegalArgumentException("Missing the required parameter 'name' when calling uploadFileToFolder"); + }// verify the required parameter 'filename' is set + if (filename == null) { + throw new IllegalArgumentException("Missing the required parameter 'filename' when calling uploadFileToFolder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling uploadFileToFolder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("FolderId", folderId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Files/{FolderId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + Map parameters = Maps.newHashMap(); + parameters.put("name", name); + parameters.put("filename", filename); + + // Add parameters + MultipartContent content = new MultipartContent().setMediaType( + new HttpMediaType("multipart/form-data") + .setParameter("boundary", "__END_OF_PART__")); + + for (String key : parameters.keySet()) { + MultipartContent.Part part = new MultipartContent.Part( + new ByteArrayContent(null, parameters.get(key).getBytes())); + part.setHeaders(new HttpHeaders().set( + "Content-Disposition", String.format("form-data; name=\"%s\"", key))); + content.addPart(part); + } + + FileContent fileContent = new FileContent( + mimeType, body); + MultipartContent.Part part = new MultipartContent.Part(fileContent); + part.setHeaders(new HttpHeaders().set( + "Content-Disposition", + String.format("form-data; name=\"content\"; filename=\"%s\"", filename))); + content.addPart(part); + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - } } diff --git a/src/main/java/com/xero/api/client/FinanceApi.java b/src/main/java/com/xero/api/client/FinanceApi.java index e331eba45..3eafaddd6 100644 --- a/src/main/java/com/xero/api/client/FinanceApi.java +++ b/src/main/java/com/xero/api/client/FinanceApi.java @@ -9,22 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpTransport; import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; + import com.xero.models.finance.AccountUsageResponse; import com.xero.models.finance.BalanceSheetResponse; import com.xero.models.finance.BankStatementAccountingResponse; @@ -32,1943 +21,1540 @@ import com.xero.models.finance.CashflowResponse; import com.xero.models.finance.IncomeByContactResponse; import com.xero.models.finance.LockHistoryResponse; +import com.xero.models.finance.Problem; import com.xero.models.finance.ProfitAndLossResponse; import com.xero.models.finance.ReportHistoryResponse; import com.xero.models.finance.TrialBalanceResponse; +import java.util.UUID; import com.xero.models.finance.UserActivitiesResponse; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.ByteArrayContent; +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpContent; +import com.google.api.client.http.HttpMethods; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpResponseException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; +import java.util.Map; import java.util.List; -import java.util.UUID; + import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; + import org.slf4j.LoggerFactory; +import org.slf4j.Logger; -/** FinanceApi has methods for interacting with all endpoints in the API set */ -public class FinanceApi { - private ApiClient apiClient; - private static FinanceApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(FinanceApi.class); - /** FinanceApi */ - public FinanceApi() { - this(new ApiClient()); - } +/** FinanceApi has methods for interacting with all endpoints in the API set */ +public class FinanceApi { + private ApiClient apiClient; + private static FinanceApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(FinanceApi.class); - /** - * FinanceApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static FinanceApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new FinanceApi(apiClient); + /** FinanceApi */ + public FinanceApi() { + this(new ApiClient()); } - return instance; - } - - /** - * FinanceApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public FinanceApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } + /** FinanceApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static FinanceApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new FinanceApi(apiClient); + } + return instance; + } - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } + /** FinanceApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public FinanceApi(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * Get account usage A summary of how each account is being transacted on exposing the level of - * detail and amounts attributable to manual adjustments. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param startMonth date, yyyy-MM If no parameter is provided, the month 12 months prior to the - * end month will be used. Account usage for up to 12 months from this date will be returned. - * @param endMonth date, yyyy-MM If no parameter is provided, the current month will be used. - * Account usage for up to 12 months prior to this date will be returned. - * @param accessToken Authorization token for user set in header of each request - * @return AccountUsageResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public AccountUsageResponse getAccountingActivityAccountUsage( - String accessToken, String xeroTenantId, String startMonth, String endMonth) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAccountingActivityAccountUsageForHttpResponse( - accessToken, xeroTenantId, startMonth, endMonth); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccountingActivityAccountUsage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; } - return null; - } - /** - * Get account usage A summary of how each account is being transacted on exposing the level of - * detail and amounts attributable to manual adjustments. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param startMonth date, yyyy-MM If no parameter is provided, the month 12 months prior to the - * end month will be used. Account usage for up to 12 months from this date will be returned. - * @param endMonth date, yyyy-MM If no parameter is provided, the current month will be used. - * Account usage for up to 12 months prior to this date will be returned. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountingActivityAccountUsageForHttpResponse( - String accessToken, String xeroTenantId, String startMonth, String endMonth) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getAccountingActivityAccountUsage"); + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getAccountingActivityAccountUsage"); + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/AccountUsage"); - if (startMonth != null) { - String key = "startMonth"; - Object value = startMonth; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + + + /** + * Get account usage + * A summary of how each account is being transacted on exposing the level of detail and amounts attributable to manual adjustments. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param startMonth date, yyyy-MM If no parameter is provided, the month 12 months prior to the end month will be used. Account usage for up to 12 months from this date will be returned. + * @param endMonth date, yyyy-MM If no parameter is provided, the current month will be used. Account usage for up to 12 months prior to this date will be returned. + * @param accessToken Authorization token for user set in header of each request + * @return AccountUsageResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public AccountUsageResponse getAccountingActivityAccountUsage(String accessToken, String xeroTenantId, String startMonth, String endMonth) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountingActivityAccountUsageForHttpResponse(accessToken, xeroTenantId, startMonth, endMonth); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccountingActivityAccountUsage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } + return null; } - if (endMonth != null) { - String key = "endMonth"; - Object value = endMonth; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + + /** + * Get account usage + * A summary of how each account is being transacted on exposing the level of detail and amounts attributable to manual adjustments. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param startMonth date, yyyy-MM If no parameter is provided, the month 12 months prior to the end month will be used. Account usage for up to 12 months from this date will be returned. + * @param endMonth date, yyyy-MM If no parameter is provided, the current month will be used. Account usage for up to 12 months prior to this date will be returned. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountingActivityAccountUsageForHttpResponse(String accessToken, String xeroTenantId, String startMonth, String endMonth) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccountingActivityAccountUsage"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccountingActivityAccountUsage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/AccountUsage"); + if (startMonth != null) { + String key = "startMonth"; + Object value = startMonth; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endMonth != null) { + String key = "endMonth"; + Object value = endMonth; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get lock history Provides a history of locking of accounting books. Locking may be an indicator - * of good accounting practices that could reduce the risk of changes to accounting records in - * prior periods. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any - * changes to hard or soft lock dates that were made within the period up to 12 months before - * this date will be returned. Please be aware that there may be a delay of up to 3 days - * before a change is visible from this API. - * @param accessToken Authorization token for user set in header of each request - * @return LockHistoryResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LockHistoryResponse getAccountingActivityLockHistory( - String accessToken, String xeroTenantId, String endDate) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAccountingActivityLockHistoryForHttpResponse(accessToken, xeroTenantId, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccountingActivityLockHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get lock history + * Provides a history of locking of accounting books. Locking may be an indicator of good accounting practices that could reduce the risk of changes to accounting records in prior periods. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any changes to hard or soft lock dates that were made within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a change is visible from this API. + * @param accessToken Authorization token for user set in header of each request + * @return LockHistoryResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LockHistoryResponse getAccountingActivityLockHistory(String accessToken, String xeroTenantId, String endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountingActivityLockHistoryForHttpResponse(accessToken, xeroTenantId, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccountingActivityLockHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get lock history Provides a history of locking of accounting books. Locking may be an indicator - * of good accounting practices that could reduce the risk of changes to accounting records in - * prior periods. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any - * changes to hard or soft lock dates that were made within the period up to 12 months before - * this date will be returned. Please be aware that there may be a delay of up to 3 days - * before a change is visible from this API. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountingActivityLockHistoryForHttpResponse( - String accessToken, String xeroTenantId, String endDate) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getAccountingActivityLockHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getAccountingActivityLockHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/LockHistory"); - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get lock history + * Provides a history of locking of accounting books. Locking may be an indicator of good accounting practices that could reduce the risk of changes to accounting records in prior periods. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any changes to hard or soft lock dates that were made within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a change is visible from this API. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountingActivityLockHistoryForHttpResponse(String accessToken, String xeroTenantId, String endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccountingActivityLockHistory"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccountingActivityLockHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/LockHistory"); + if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get report history For a specified organisation, provides a summary of all the reports - * published within a given period, which may be an indicator for good business management and - * oversight. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any - * reports that were published within the period up to 12 months before this date will be - * returned. Please be aware that there may be a delay of up to 3 days before a published - * report is visible from this API. - * @param accessToken Authorization token for user set in header of each request - * @return ReportHistoryResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReportHistoryResponse getAccountingActivityReportHistory( - String accessToken, String xeroTenantId, String endDate) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getAccountingActivityReportHistoryForHttpResponse(accessToken, xeroTenantId, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccountingActivityReportHistory -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get report history + * For a specified organisation, provides a summary of all the reports published within a given period, which may be an indicator for good business management and oversight. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any reports that were published within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a published report is visible from this API. + * @param accessToken Authorization token for user set in header of each request + * @return ReportHistoryResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReportHistoryResponse getAccountingActivityReportHistory(String accessToken, String xeroTenantId, String endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountingActivityReportHistoryForHttpResponse(accessToken, xeroTenantId, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccountingActivityReportHistory -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get report history For a specified organisation, provides a summary of all the reports - * published within a given period, which may be an indicator for good business management and - * oversight. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any - * reports that were published within the period up to 12 months before this date will be - * returned. Please be aware that there may be a delay of up to 3 days before a published - * report is visible from this API. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountingActivityReportHistoryForHttpResponse( - String accessToken, String xeroTenantId, String endDate) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getAccountingActivityReportHistory"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getAccountingActivityReportHistory"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/ReportHistory"); - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get report history + * For a specified organisation, provides a summary of all the reports published within a given period, which may be an indicator for good business management and oversight. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param endDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. Any reports that were published within the period up to 12 months before this date will be returned. Please be aware that there may be a delay of up to 3 days before a published report is visible from this API. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountingActivityReportHistoryForHttpResponse(String accessToken, String xeroTenantId, String endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccountingActivityReportHistory"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccountingActivityReportHistory"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/ReportHistory"); + if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get user activities For a specified organisation, provides a list of all the users registered, - * and a history of their accounting transactions. Also identifies the existence of an external - * accounting advisor and the level of interaction. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param dataMonth date, yyyy-MM The specified month must be complete (in the past); The current - * month cannot be specified since it is not complete. If no parameter is provided, the month - * immediately previous to the current month will be used. Any user activities occurring - * within the specified month will be returned. Please be aware that there may be a delay of - * up to 3 days before a user activity is visible from this API. - * @param accessToken Authorization token for user set in header of each request - * @return UserActivitiesResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public UserActivitiesResponse getAccountingActivityUserActivities( - String accessToken, String xeroTenantId, String dataMonth) throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getAccountingActivityUserActivitiesForHttpResponse(accessToken, xeroTenantId, dataMonth); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getAccountingActivityUserActivities -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get user activities + * For a specified organisation, provides a list of all the users registered, and a history of their accounting transactions. Also identifies the existence of an external accounting advisor and the level of interaction. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param dataMonth date, yyyy-MM The specified month must be complete (in the past); The current month cannot be specified since it is not complete. If no parameter is provided, the month immediately previous to the current month will be used. Any user activities occurring within the specified month will be returned. Please be aware that there may be a delay of up to 3 days before a user activity is visible from this API. + * @param accessToken Authorization token for user set in header of each request + * @return UserActivitiesResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public UserActivitiesResponse getAccountingActivityUserActivities(String accessToken, String xeroTenantId, String dataMonth) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getAccountingActivityUserActivitiesForHttpResponse(accessToken, xeroTenantId, dataMonth); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getAccountingActivityUserActivities -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get user activities For a specified organisation, provides a list of all the users registered, - * and a history of their accounting transactions. Also identifies the existence of an external - * accounting advisor and the level of interaction. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param dataMonth date, yyyy-MM The specified month must be complete (in the past); The current - * month cannot be specified since it is not complete. If no parameter is provided, the month - * immediately previous to the current month will be used. Any user activities occurring - * within the specified month will be returned. Please be aware that there may be a delay of - * up to 3 days before a user activity is visible from this API. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getAccountingActivityUserActivitiesForHttpResponse( - String accessToken, String xeroTenantId, String dataMonth) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getAccountingActivityUserActivities"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getAccountingActivityUserActivities"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/UserActivities"); - if (dataMonth != null) { - String key = "dataMonth"; - Object value = dataMonth; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get user activities + * For a specified organisation, provides a list of all the users registered, and a history of their accounting transactions. Also identifies the existence of an external accounting advisor and the level of interaction. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param dataMonth date, yyyy-MM The specified month must be complete (in the past); The current month cannot be specified since it is not complete. If no parameter is provided, the month immediately previous to the current month will be used. Any user activities occurring within the specified month will be returned. Please be aware that there may be a delay of up to 3 days before a user activity is visible from this API. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getAccountingActivityUserActivitiesForHttpResponse(String accessToken, String xeroTenantId, String dataMonth) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getAccountingActivityUserActivities"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getAccountingActivityUserActivities"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/AccountingActivities/UserActivities"); + if (dataMonth != null) { + String key = "dataMonth"; + Object value = dataMonth; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get Bank Statement Accounting For lenders that prefer using bank statement data as the source - * of truth. We provide a data point that will allow access to customer bank statements, plus for - * reconciled bank transactions the matching accounting, invoice and billing data as well. As - * customers reconcile bank statements to invoices and bills, this transaction detail will provide - * valuable insight for lender's assessment measures. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankAccountID string, GUID Bank account Id - * @param fromDate date, yyyy-MM-dd Specifies the start date of the query period. The maximum - * range of the query period is 12 months. If the specified query period is more than 12 - * months the request will be rejected. - * @param toDate date, yyyy-MM-dd Specifies the end date of the query period. If the end date is a - * future date, the request will be rejected. - * @param summaryOnly boolean, true/false The default value is true if no parameter is provided. - * In summary mode, the response will exclude the computation-heavy LineItems fields from bank - * transaction, invoice, credit note, prepayment and overpayment data, making the API calls - * quicker and more efficient. - * @param accessToken Authorization token for user set in header of each request - * @return BankStatementAccountingResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BankStatementAccountingResponse getBankStatementAccounting( - String accessToken, - String xeroTenantId, - UUID bankAccountID, - String fromDate, - String toDate, - Boolean summaryOnly) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getBankStatementAccountingForHttpResponse( - accessToken, xeroTenantId, bankAccountID, fromDate, toDate, summaryOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBankStatementAccounting -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get Bank Statement Accounting + * For lenders that prefer using bank statement data as the source of truth. We provide a data point that will allow access to customer bank statements, plus for reconciled bank transactions the matching accounting, invoice and billing data as well. As customers reconcile bank statements to invoices and bills, this transaction detail will provide valuable insight for lender's assessment measures. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param bankAccountID string, GUID Bank account Id + * @param fromDate date, yyyy-MM-dd Specifies the start date of the query period. The maximum range of the query period is 12 months. If the specified query period is more than 12 months the request will be rejected. + * @param toDate date, yyyy-MM-dd Specifies the end date of the query period. If the end date is a future date, the request will be rejected. + * @param summaryOnly boolean, true/false The default value is true if no parameter is provided. In summary mode, the response will exclude the computation-heavy LineItems fields from bank transaction, invoice, credit note, prepayment and overpayment data, making the API calls quicker and more efficient. + * @param accessToken Authorization token for user set in header of each request + * @return BankStatementAccountingResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BankStatementAccountingResponse getBankStatementAccounting(String accessToken, String xeroTenantId, UUID bankAccountID, String fromDate, String toDate, Boolean summaryOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBankStatementAccountingForHttpResponse(accessToken, xeroTenantId, bankAccountID, fromDate, toDate, summaryOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBankStatementAccounting -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get Bank Statement Accounting For lenders that prefer using bank statement data as the source - * of truth. We provide a data point that will allow access to customer bank statements, plus for - * reconciled bank transactions the matching accounting, invoice and billing data as well. As - * customers reconcile bank statements to invoices and bills, this transaction detail will provide - * valuable insight for lender's assessment measures. - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param bankAccountID string, GUID Bank account Id - * @param fromDate date, yyyy-MM-dd Specifies the start date of the query period. The maximum - * range of the query period is 12 months. If the specified query period is more than 12 - * months the request will be rejected. - * @param toDate date, yyyy-MM-dd Specifies the end date of the query period. If the end date is a - * future date, the request will be rejected. - * @param summaryOnly boolean, true/false The default value is true if no parameter is provided. - * In summary mode, the response will exclude the computation-heavy LineItems fields from bank - * transaction, invoice, credit note, prepayment and overpayment data, making the API calls - * quicker and more efficient. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBankStatementAccountingForHttpResponse( - String accessToken, - String xeroTenantId, - UUID bankAccountID, - String fromDate, - String toDate, - Boolean summaryOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBankStatementAccounting"); - } // verify the required parameter 'bankAccountID' is set - if (bankAccountID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'bankAccountID' when calling getBankStatementAccounting"); - } // verify the required parameter 'fromDate' is set - if (fromDate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'fromDate' when calling getBankStatementAccounting"); - } // verify the required parameter 'toDate' is set - if (toDate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'toDate' when calling getBankStatementAccounting"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBankStatementAccounting"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/BankStatementsPlus/statements"); - if (bankAccountID != null) { - String key = "BankAccountID"; - Object value = bankAccountID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get Bank Statement Accounting + * For lenders that prefer using bank statement data as the source of truth. We provide a data point that will allow access to customer bank statements, plus for reconciled bank transactions the matching accounting, invoice and billing data as well. As customers reconcile bank statements to invoices and bills, this transaction detail will provide valuable insight for lender's assessment measures. + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param bankAccountID string, GUID Bank account Id + * @param fromDate date, yyyy-MM-dd Specifies the start date of the query period. The maximum range of the query period is 12 months. If the specified query period is more than 12 months the request will be rejected. + * @param toDate date, yyyy-MM-dd Specifies the end date of the query period. If the end date is a future date, the request will be rejected. + * @param summaryOnly boolean, true/false The default value is true if no parameter is provided. In summary mode, the response will exclude the computation-heavy LineItems fields from bank transaction, invoice, credit note, prepayment and overpayment data, making the API calls quicker and more efficient. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBankStatementAccountingForHttpResponse(String accessToken, String xeroTenantId, UUID bankAccountID, String fromDate, String toDate, Boolean summaryOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBankStatementAccounting"); + }// verify the required parameter 'bankAccountID' is set + if (bankAccountID == null) { + throw new IllegalArgumentException("Missing the required parameter 'bankAccountID' when calling getBankStatementAccounting"); + }// verify the required parameter 'fromDate' is set + if (fromDate == null) { + throw new IllegalArgumentException("Missing the required parameter 'fromDate' when calling getBankStatementAccounting"); + }// verify the required parameter 'toDate' is set + if (toDate == null) { + throw new IllegalArgumentException("Missing the required parameter 'toDate' when calling getBankStatementAccounting"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (fromDate != null) { - String key = "FromDate"; - Object value = fromDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBankStatementAccounting"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (toDate != null) { - String key = "ToDate"; - Object value = toDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/BankStatementsPlus/statements"); + if (bankAccountID != null) { + String key = "BankAccountID"; + Object value = bankAccountID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (fromDate != null) { + String key = "FromDate"; + Object value = fromDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (toDate != null) { + String key = "ToDate"; + Object value = toDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (summaryOnly != null) { + String key = "SummaryOnly"; + Object value = summaryOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (summaryOnly != null) { - String key = "SummaryOnly"; - Object value = summaryOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get cash validation Summarizes the total cash position for each account for an org - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param balanceDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. - * The ‘balance date’ will return transactions based on the accounting date entered by the - * user. Transactions before the balanceDate will be included. The user has discretion as to - * which accounting period the transaction relates to. The ‘balance date’ will control the - * latest maximum date of transactions included in the aggregate numbers. Balance date does - * not affect the CurrentStatement object, as this will always return the most recent - * statement before asAtSystemDate (if specified) - * @param asAtSystemDate date, yyyy-MM-dd If no parameter is provided, the current date will be - * used. The ‘as at’ date will return transactions based on the creation date. It reflects the - * date the transactions were entered into Xero, not the accounting date. The ‘as at’ date can - * not be overridden by the user. This can be used to estimate a ‘historical frequency of - * reconciliation’. The ‘as at’ date will affect the current statement in the response, as any - * candidate statements created after this date will be filtered out. Thus the current - * statement returned will be the most recent statement prior to the specified ‘as at’ date. - * Be aware that neither the begin date, nor the balance date, will affect the current - * statement. Note; information is only presented when system architecture allows, meaning - * historical cash validation information will be an estimate. In addition, delete events are - * not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted - * at the time the API is accessed will be considered to always have been deleted. - * @param beginDate date, yyyy-MM-dd If no parameter is provided, the aggregate results will be - * drawn from the user’s total history. The ‘begin date’ will return transactions based on the - * accounting date entered by the user. Transactions after the beginDate will be included. The - * user has discretion as to which accounting period the transaction relates to. - * @param accessToken Authorization token for user set in header of each request - * @return List<CashValidationResponse> - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public List getCashValidation( - String accessToken, - String xeroTenantId, - String balanceDate, - String asAtSystemDate, - String beginDate) - throws IOException { - try { - TypeReference> typeRef = - new TypeReference>() {}; - HttpResponse response = - getCashValidationForHttpResponse( - accessToken, xeroTenantId, balanceDate, asAtSystemDate, beginDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getCashValidation -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get cash validation + * Summarizes the total cash position for each account for an org + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param balanceDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘balance date’ will return transactions based on the accounting date entered by the user. Transactions before the balanceDate will be included. The user has discretion as to which accounting period the transaction relates to. The ‘balance date’ will control the latest maximum date of transactions included in the aggregate numbers. Balance date does not affect the CurrentStatement object, as this will always return the most recent statement before asAtSystemDate (if specified) + * @param asAtSystemDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘as at’ date will return transactions based on the creation date. It reflects the date the transactions were entered into Xero, not the accounting date. The ‘as at’ date can not be overridden by the user. This can be used to estimate a ‘historical frequency of reconciliation’. The ‘as at’ date will affect the current statement in the response, as any candidate statements created after this date will be filtered out. Thus the current statement returned will be the most recent statement prior to the specified ‘as at’ date. Be aware that neither the begin date, nor the balance date, will affect the current statement. Note; information is only presented when system architecture allows, meaning historical cash validation information will be an estimate. In addition, delete events are not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted at the time the API is accessed will be considered to always have been deleted. + * @param beginDate date, yyyy-MM-dd If no parameter is provided, the aggregate results will be drawn from the user’s total history. The ‘begin date’ will return transactions based on the accounting date entered by the user. Transactions after the beginDate will be included. The user has discretion as to which accounting period the transaction relates to. + * @param accessToken Authorization token for user set in header of each request + * @return List<CashValidationResponse> + * @throws IOException if an error occurs while attempting to invoke the API **/ + public List getCashValidation(String accessToken, String xeroTenantId, String balanceDate, String asAtSystemDate, String beginDate) throws IOException { + try { + TypeReference> typeRef = new TypeReference>() {}; + HttpResponse response = getCashValidationForHttpResponse(accessToken, xeroTenantId, balanceDate, asAtSystemDate, beginDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getCashValidation -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get cash validation Summarizes the total cash position for each account for an org - * - *

200 - Success - * - *

400 - BadRequest - * - * @param xeroTenantId Xero identifier for Tenant - * @param balanceDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. - * The ‘balance date’ will return transactions based on the accounting date entered by the - * user. Transactions before the balanceDate will be included. The user has discretion as to - * which accounting period the transaction relates to. The ‘balance date’ will control the - * latest maximum date of transactions included in the aggregate numbers. Balance date does - * not affect the CurrentStatement object, as this will always return the most recent - * statement before asAtSystemDate (if specified) - * @param asAtSystemDate date, yyyy-MM-dd If no parameter is provided, the current date will be - * used. The ‘as at’ date will return transactions based on the creation date. It reflects the - * date the transactions were entered into Xero, not the accounting date. The ‘as at’ date can - * not be overridden by the user. This can be used to estimate a ‘historical frequency of - * reconciliation’. The ‘as at’ date will affect the current statement in the response, as any - * candidate statements created after this date will be filtered out. Thus the current - * statement returned will be the most recent statement prior to the specified ‘as at’ date. - * Be aware that neither the begin date, nor the balance date, will affect the current - * statement. Note; information is only presented when system architecture allows, meaning - * historical cash validation information will be an estimate. In addition, delete events are - * not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted - * at the time the API is accessed will be considered to always have been deleted. - * @param beginDate date, yyyy-MM-dd If no parameter is provided, the aggregate results will be - * drawn from the user’s total history. The ‘begin date’ will return transactions based on the - * accounting date entered by the user. Transactions after the beginDate will be included. The - * user has discretion as to which accounting period the transaction relates to. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getCashValidationForHttpResponse( - String accessToken, - String xeroTenantId, - String balanceDate, - String asAtSystemDate, - String beginDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getCashValidation"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getCashValidation"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CashValidation"); - if (balanceDate != null) { - String key = "balanceDate"; - Object value = balanceDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get cash validation + * Summarizes the total cash position for each account for an org + *

200 - Success + *

400 - BadRequest + * @param xeroTenantId Xero identifier for Tenant + * @param balanceDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘balance date’ will return transactions based on the accounting date entered by the user. Transactions before the balanceDate will be included. The user has discretion as to which accounting period the transaction relates to. The ‘balance date’ will control the latest maximum date of transactions included in the aggregate numbers. Balance date does not affect the CurrentStatement object, as this will always return the most recent statement before asAtSystemDate (if specified) + * @param asAtSystemDate date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘as at’ date will return transactions based on the creation date. It reflects the date the transactions were entered into Xero, not the accounting date. The ‘as at’ date can not be overridden by the user. This can be used to estimate a ‘historical frequency of reconciliation’. The ‘as at’ date will affect the current statement in the response, as any candidate statements created after this date will be filtered out. Thus the current statement returned will be the most recent statement prior to the specified ‘as at’ date. Be aware that neither the begin date, nor the balance date, will affect the current statement. Note; information is only presented when system architecture allows, meaning historical cash validation information will be an estimate. In addition, delete events are not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted at the time the API is accessed will be considered to always have been deleted. + * @param beginDate date, yyyy-MM-dd If no parameter is provided, the aggregate results will be drawn from the user’s total history. The ‘begin date’ will return transactions based on the accounting date entered by the user. Transactions after the beginDate will be included. The user has discretion as to which accounting period the transaction relates to. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getCashValidationForHttpResponse(String accessToken, String xeroTenantId, String balanceDate, String asAtSystemDate, String beginDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getCashValidation"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (asAtSystemDate != null) { - String key = "asAtSystemDate"; - Object value = asAtSystemDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getCashValidation"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (beginDate != null) { - String key = "beginDate"; - Object value = beginDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CashValidation"); + if (balanceDate != null) { + String key = "balanceDate"; + Object value = balanceDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (asAtSystemDate != null) { + String key = "asAtSystemDate"; + Object value = asAtSystemDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (beginDate != null) { + String key = "beginDate"; + Object value = beginDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get Balance Sheet report The balance sheet report is a standard financial report which - * describes the financial position of an organisation at a point in time. - * - *

200 - Success - * - *

400 - Bad Request - * - *

503 - Server Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param balanceDate Specifies the date for balance sheet report. Format yyyy-MM-dd. If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return BalanceSheetResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BalanceSheetResponse getFinancialStatementBalanceSheet( - String accessToken, String xeroTenantId, String balanceDate) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getFinancialStatementBalanceSheetForHttpResponse(accessToken, xeroTenantId, balanceDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFinancialStatementBalanceSheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get Balance Sheet report + * The balance sheet report is a standard financial report which describes the financial position of an organisation at a point in time. + *

200 - Success + *

400 - Bad Request + *

503 - Server Error + * @param xeroTenantId Xero identifier for Tenant + * @param balanceDate Specifies the date for balance sheet report. Format yyyy-MM-dd. If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return BalanceSheetResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BalanceSheetResponse getFinancialStatementBalanceSheet(String accessToken, String xeroTenantId, String balanceDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFinancialStatementBalanceSheetForHttpResponse(accessToken, xeroTenantId, balanceDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFinancialStatementBalanceSheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get Balance Sheet report The balance sheet report is a standard financial report which - * describes the financial position of an organisation at a point in time. - * - *

200 - Success - * - *

400 - Bad Request - * - *

503 - Server Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param balanceDate Specifies the date for balance sheet report. Format yyyy-MM-dd. If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFinancialStatementBalanceSheetForHttpResponse( - String accessToken, String xeroTenantId, String balanceDate) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getFinancialStatementBalanceSheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getFinancialStatementBalanceSheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/BalanceSheet"); - if (balanceDate != null) { - String key = "balanceDate"; - Object value = balanceDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get Balance Sheet report + * The balance sheet report is a standard financial report which describes the financial position of an organisation at a point in time. + *

200 - Success + *

400 - Bad Request + *

503 - Server Error + * @param xeroTenantId Xero identifier for Tenant + * @param balanceDate Specifies the date for balance sheet report. Format yyyy-MM-dd. If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFinancialStatementBalanceSheetForHttpResponse(String accessToken, String xeroTenantId, String balanceDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFinancialStatementBalanceSheet"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFinancialStatementBalanceSheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/BalanceSheet"); + if (balanceDate != null) { + String key = "balanceDate"; + Object value = balanceDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get Cash flow report The statement of cash flows - direct method, provides the year to date - * changes in operating, financing and investing cash flow activities for an organisation. - * Cashflow statement is not available in US region at this stage. - * - *

200 - Success - * - *

400 - Bad Request - * - *

503 - Server Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for cash flow report. If no - * parameter is provided, the date of 12 months before the end date will be used. - * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for cash flow report. If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return CashflowResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public CashflowResponse getFinancialStatementCashflow( - String accessToken, String xeroTenantId, String startDate, String endDate) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getFinancialStatementCashflowForHttpResponse( - accessToken, xeroTenantId, startDate, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFinancialStatementCashflow -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get Cash flow report + * The statement of cash flows - direct method, provides the year to date changes in operating, financing and investing cash flow activities for an organisation. Cashflow statement is not available in US region at this stage. + *

200 - Success + *

400 - Bad Request + *

503 - Server Error + * @param xeroTenantId Xero identifier for Tenant + * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for cash flow report. If no parameter is provided, the date of 12 months before the end date will be used. + * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for cash flow report. If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return CashflowResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public CashflowResponse getFinancialStatementCashflow(String accessToken, String xeroTenantId, String startDate, String endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFinancialStatementCashflowForHttpResponse(accessToken, xeroTenantId, startDate, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFinancialStatementCashflow -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get Cash flow report The statement of cash flows - direct method, provides the year to date - * changes in operating, financing and investing cash flow activities for an organisation. - * Cashflow statement is not available in US region at this stage. - * - *

200 - Success - * - *

400 - Bad Request - * - *

503 - Server Error - * - * @param xeroTenantId Xero identifier for Tenant - * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for cash flow report. If no - * parameter is provided, the date of 12 months before the end date will be used. - * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for cash flow report. If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFinancialStatementCashflowForHttpResponse( - String accessToken, String xeroTenantId, String startDate, String endDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getFinancialStatementCashflow"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getFinancialStatementCashflow"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/Cashflow"); - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get Cash flow report + * The statement of cash flows - direct method, provides the year to date changes in operating, financing and investing cash flow activities for an organisation. Cashflow statement is not available in US region at this stage. + *

200 - Success + *

400 - Bad Request + *

503 - Server Error + * @param xeroTenantId Xero identifier for Tenant + * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for cash flow report. If no parameter is provided, the date of 12 months before the end date will be used. + * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for cash flow report. If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFinancialStatementCashflowForHttpResponse(String accessToken, String xeroTenantId, String startDate, String endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFinancialStatementCashflow"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFinancialStatementCashflow"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/Cashflow"); + if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get expense by contacts report The expense by contact report provides a year to date profit and - * loss for customers and suppliers for a given organisation, including detailed contact - * information. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactIds Specifies the customer contacts to be included in the report. If no parameter - * is provided, all customer contacts will be included - * @param includeManualJournals Specifies whether to include the manual journals in the report. If - * no parameter is provided, manual journals will not be included. - * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is - * provided, the date of 12 months before the end date will be used. It is recommended to - * always specify both a start date and end date; While the initial range may be set to 12 - * months, this may need to be reduced for high volume organisations in order to improve - * latency. - * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is - * provided, the current date will be used. It is recommended to always specify both a start - * date and end date; While the initial range may be set to 12 months, this may need to be - * reduced for high volume organisations in order to improve latency. - * @param accessToken Authorization token for user set in header of each request - * @return IncomeByContactResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public IncomeByContactResponse getFinancialStatementContactsExpense( - String accessToken, - String xeroTenantId, - List contactIds, - Boolean includeManualJournals, - String startDate, - String endDate) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getFinancialStatementContactsExpenseForHttpResponse( - accessToken, xeroTenantId, contactIds, includeManualJournals, startDate, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFinancialStatementContactsExpense -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get expense by contacts report + * The expense by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param contactIds Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included + * @param includeManualJournals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included. + * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param accessToken Authorization token for user set in header of each request + * @return IncomeByContactResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public IncomeByContactResponse getFinancialStatementContactsExpense(String accessToken, String xeroTenantId, List contactIds, Boolean includeManualJournals, String startDate, String endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFinancialStatementContactsExpenseForHttpResponse(accessToken, xeroTenantId, contactIds, includeManualJournals, startDate, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFinancialStatementContactsExpense -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get expense by contacts report The expense by contact report provides a year to date profit and - * loss for customers and suppliers for a given organisation, including detailed contact - * information. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactIds Specifies the customer contacts to be included in the report. If no parameter - * is provided, all customer contacts will be included - * @param includeManualJournals Specifies whether to include the manual journals in the report. If - * no parameter is provided, manual journals will not be included. - * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is - * provided, the date of 12 months before the end date will be used. It is recommended to - * always specify both a start date and end date; While the initial range may be set to 12 - * months, this may need to be reduced for high volume organisations in order to improve - * latency. - * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is - * provided, the current date will be used. It is recommended to always specify both a start - * date and end date; While the initial range may be set to 12 months, this may need to be - * reduced for high volume organisations in order to improve latency. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFinancialStatementContactsExpenseForHttpResponse( - String accessToken, - String xeroTenantId, - List contactIds, - Boolean includeManualJournals, - String startDate, - String endDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getFinancialStatementContactsExpense"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getFinancialStatementContactsExpense"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/contacts/expense"); - if (contactIds != null) { - String key = "contactIds"; - Object value = contactIds; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get expense by contacts report + * The expense by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param contactIds Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included + * @param includeManualJournals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included. + * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFinancialStatementContactsExpenseForHttpResponse(String accessToken, String xeroTenantId, List contactIds, Boolean includeManualJournals, String startDate, String endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFinancialStatementContactsExpense"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (includeManualJournals != null) { - String key = "includeManualJournals"; - Object value = includeManualJournals; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFinancialStatementContactsExpense"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/contacts/expense"); + if (contactIds != null) { + String key = "contactIds"; + Object value = contactIds; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (includeManualJournals != null) { + String key = "includeManualJournals"; + Object value = includeManualJournals; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get revenue by contacts report The revenue by contact report provides a year to date profit and - * loss for customers and suppliers for a given organisation, including detailed contact - * information. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactIds Specifies the customer contacts to be included in the report. If no parameter - * is provided, all customer contacts will be included - * @param includeManualJournals Specifies whether to include the manual journals in the report. If - * no parameter is provided, manual journals will not be included. - * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is - * provided, the date of 12 months before the end date will be used. It is recommended to - * always specify both a start date and end date; While the initial range may be set to 12 - * months, this may need to be reduced for high volume organisations in order to improve - * latency. - * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is - * provided, the current date will be used. It is recommended to always specify both a start - * date and end date; While the initial range may be set to 12 months, this may need to be - * reduced for high volume organisations in order to improve latency. - * @param accessToken Authorization token for user set in header of each request - * @return IncomeByContactResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public IncomeByContactResponse getFinancialStatementContactsRevenue( - String accessToken, - String xeroTenantId, - List contactIds, - Boolean includeManualJournals, - String startDate, - String endDate) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getFinancialStatementContactsRevenueForHttpResponse( - accessToken, xeroTenantId, contactIds, includeManualJournals, startDate, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFinancialStatementContactsRevenue -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get revenue by contacts report + * The revenue by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param contactIds Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included + * @param includeManualJournals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included. + * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param accessToken Authorization token for user set in header of each request + * @return IncomeByContactResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public IncomeByContactResponse getFinancialStatementContactsRevenue(String accessToken, String xeroTenantId, List contactIds, Boolean includeManualJournals, String startDate, String endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFinancialStatementContactsRevenueForHttpResponse(accessToken, xeroTenantId, contactIds, includeManualJournals, startDate, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFinancialStatementContactsRevenue -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get revenue by contacts report The revenue by contact report provides a year to date profit and - * loss for customers and suppliers for a given organisation, including detailed contact - * information. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param contactIds Specifies the customer contacts to be included in the report. If no parameter - * is provided, all customer contacts will be included - * @param includeManualJournals Specifies whether to include the manual journals in the report. If - * no parameter is provided, manual journals will not be included. - * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is - * provided, the date of 12 months before the end date will be used. It is recommended to - * always specify both a start date and end date; While the initial range may be set to 12 - * months, this may need to be reduced for high volume organisations in order to improve - * latency. - * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is - * provided, the current date will be used. It is recommended to always specify both a start - * date and end date; While the initial range may be set to 12 months, this may need to be - * reduced for high volume organisations in order to improve latency. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFinancialStatementContactsRevenueForHttpResponse( - String accessToken, - String xeroTenantId, - List contactIds, - Boolean includeManualJournals, - String startDate, - String endDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getFinancialStatementContactsRevenue"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getFinancialStatementContactsRevenue"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/contacts/revenue"); - if (contactIds != null) { - String key = "contactIds"; - Object value = contactIds; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get revenue by contacts report + * The revenue by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param contactIds Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included + * @param includeManualJournals Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included. + * @param startDate Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param endDate Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFinancialStatementContactsRevenueForHttpResponse(String accessToken, String xeroTenantId, List contactIds, Boolean includeManualJournals, String startDate, String endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFinancialStatementContactsRevenue"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (includeManualJournals != null) { - String key = "includeManualJournals"; - Object value = includeManualJournals; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFinancialStatementContactsRevenue"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/contacts/revenue"); + if (contactIds != null) { + String key = "contactIds"; + Object value = contactIds; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (includeManualJournals != null) { + String key = "includeManualJournals"; + Object value = includeManualJournals; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get Profit & Loss report The profit and loss statement is a standard financial report - * providing detailed year to date income and expense detail for an organisation. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for profit and loss report If no - * parameter is provided, the date of 12 months before the end date will be used. - * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for profit and loss report If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return ProfitAndLossResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ProfitAndLossResponse getFinancialStatementProfitAndLoss( - String accessToken, String xeroTenantId, String startDate, String endDate) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getFinancialStatementProfitAndLossForHttpResponse( - accessToken, xeroTenantId, startDate, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFinancialStatementProfitAndLoss -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get Profit & Loss report + * The profit and loss statement is a standard financial report providing detailed year to date income and expense detail for an organisation. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for profit and loss report If no parameter is provided, the date of 12 months before the end date will be used. + * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for profit and loss report If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return ProfitAndLossResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ProfitAndLossResponse getFinancialStatementProfitAndLoss(String accessToken, String xeroTenantId, String startDate, String endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFinancialStatementProfitAndLossForHttpResponse(accessToken, xeroTenantId, startDate, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFinancialStatementProfitAndLoss -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get Profit & Loss report The profit and loss statement is a standard financial report - * providing detailed year to date income and expense detail for an organisation. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for profit and loss report If no - * parameter is provided, the date of 12 months before the end date will be used. - * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for profit and loss report If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFinancialStatementProfitAndLossForHttpResponse( - String accessToken, String xeroTenantId, String startDate, String endDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getFinancialStatementProfitAndLoss"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getFinancialStatementProfitAndLoss"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/ProfitAndLoss"); - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get Profit & Loss report + * The profit and loss statement is a standard financial report providing detailed year to date income and expense detail for an organisation. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param startDate Date e.g. yyyy-MM-dd Specifies the start date for profit and loss report If no parameter is provided, the date of 12 months before the end date will be used. + * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for profit and loss report If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFinancialStatementProfitAndLossForHttpResponse(String accessToken, String xeroTenantId, String startDate, String endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFinancialStatementProfitAndLoss"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFinancialStatementProfitAndLoss"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/ProfitAndLoss"); + if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Get Trial Balance report The trial balance provides a detailed list of all accounts of an - * organisation at a point in time, with revenue and expense items being year to date. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for trial balance report If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return TrialBalanceResponse - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrialBalanceResponse getFinancialStatementTrialBalance( - String accessToken, String xeroTenantId, String endDate) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getFinancialStatementTrialBalanceForHttpResponse(accessToken, xeroTenantId, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getFinancialStatementTrialBalance -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Get Trial Balance report + * The trial balance provides a detailed list of all accounts of an organisation at a point in time, with revenue and expense items being year to date. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for trial balance report If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return TrialBalanceResponse + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrialBalanceResponse getFinancialStatementTrialBalance(String accessToken, String xeroTenantId, String endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getFinancialStatementTrialBalanceForHttpResponse(accessToken, xeroTenantId, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getFinancialStatementTrialBalance -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; } - return null; - } - /** - * Get Trial Balance report The trial balance provides a detailed list of all accounts of an - * organisation at a point in time, with revenue and expense items being year to date. - * - *

200 - Success - * - *

400 - Bad Request - * - * @param xeroTenantId Xero identifier for Tenant - * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for trial balance report If no - * parameter is provided, the current date will be used. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getFinancialStatementTrialBalanceForHttpResponse( - String accessToken, String xeroTenantId, String endDate) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getFinancialStatementTrialBalance"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getFinancialStatementTrialBalance"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("xero-tenant-id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/TrialBalance"); - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + /** + * Get Trial Balance report + * The trial balance provides a detailed list of all accounts of an organisation at a point in time, with revenue and expense items being year to date. + *

200 - Success + *

400 - Bad Request + * @param xeroTenantId Xero identifier for Tenant + * @param endDate Date e.g. yyyy-MM-dd Specifies the end date for trial balance report If no parameter is provided, the current date will be used. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getFinancialStatementTrialBalanceForHttpResponse(String accessToken, String xeroTenantId, String endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getFinancialStatementTrialBalance"); } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getFinancialStatementTrialBalance"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("xero-tenant-id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FinancialStatements/TrialBalance"); + if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - } } diff --git a/src/main/java/com/xero/api/client/IdentityApi.java b/src/main/java/com/xero/api/client/IdentityApi.java index 0c5547881..a956a746e 100644 --- a/src/main/java/com/xero/api/client/IdentityApi.java +++ b/src/main/java/com/xero/api/client/IdentityApi.java @@ -9,295 +9,274 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; +import com.xero.api.ApiClient; + +import com.xero.models.identity.Connection; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; +import com.google.api.client.http.ByteArrayContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpResponseException; import com.google.api.client.http.HttpTransport; -import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; -import com.xero.models.identity.Connection; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; +import java.util.List; + import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; + import org.slf4j.LoggerFactory; +import org.slf4j.Logger; -/** IdentityApi has methods for interacting with all endpoints in the API set */ -public class IdentityApi { - private ApiClient apiClient; - private static IdentityApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(IdentityApi.class); - /** IdentityApi */ - public IdentityApi() { - this(new ApiClient()); - } +/** IdentityApi has methods for interacting with all endpoints in the API set */ +public class IdentityApi { + private ApiClient apiClient; + private static IdentityApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(IdentityApi.class); - /** - * IdentityApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static IdentityApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new IdentityApi(apiClient); + /** IdentityApi */ + public IdentityApi() { + this(new ApiClient()); } - return instance; - } - - /** - * IdentityApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public IdentityApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Deletes a connection for this user (i.e. disconnect a tenant) Override the base server url that - * include version - * - *

204 - Success - connection has been deleted no content returned - * - *

404 - Resource not found - * - * @param id Unique identifier for retrieving single object - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteConnection(String accessToken, UUID id) throws IOException { - try { - deleteConnectionForHttpResponse(accessToken, id); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteConnection -------------------"); - logger.debug(e.toString()); + /** IdentityApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static IdentityApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new IdentityApi(apiClient); } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + return instance; } - } - /** - * Deletes a connection for this user (i.e. disconnect a tenant) Override the base server url that - * include version - * - *

204 - Success - connection has been deleted no content returned - * - *

404 - Resource not found - * - * @param id Unique identifier for retrieving single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteConnectionForHttpResponse(String accessToken, UUID id) - throws IOException { - // verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'id' when calling deleteConnection"); + /** IdentityApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public IdentityApi(ApiClient apiClient) { + this.apiClient = apiClient; } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteConnection"); + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; } - HttpHeaders headers = new HttpHeaders(); - headers.setAccept(""); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("id", id); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Connections/{id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } - /** - * Retrieves the connections for this user Override the base server url that include version - * - *

200 - Success - return response of type Connections array with 0 to n Connection - * - * @param authEventId Filter by authEventId - * @param accessToken Authorization token for user set in header of each request - * @return List<Connection> - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public List getConnections(String accessToken, UUID authEventId) throws IOException { - try { - TypeReference> typeRef = new TypeReference>() {}; - HttpResponse response = getConnectionsForHttpResponse(accessToken, authEventId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getConnections -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; + + /** + * Deletes a connection for this user (i.e. disconnect a tenant) + * Override the base server url that include version + *

204 - Success - connection has been deleted no content returned + *

404 - Resource not found + * @param id Unique identifier for retrieving single object + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteConnection(String accessToken, UUID id) throws IOException { + try { + deleteConnectionForHttpResponse(accessToken, id); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteConnection -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + } - return null; - } - /** - * Retrieves the connections for this user Override the base server url that include version - * - *

200 - Success - return response of type Connections array with 0 to n Connection - * - * @param authEventId Filter by authEventId - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getConnectionsForHttpResponse(String accessToken, UUID authEventId) - throws IOException { + /** + * Deletes a connection for this user (i.e. disconnect a tenant) + * Override the base server url that include version + *

204 - Success - connection has been deleted no content returned + *

404 - Resource not found + * @param id Unique identifier for retrieving single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteConnectionForHttpResponse(String accessToken, UUID id) throws IOException { + // verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling deleteConnection"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteConnection"); + } + HttpHeaders headers = new HttpHeaders(); + headers.setAccept(""); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("id", id); - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getConnections"); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Connections/{id}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpHeaders headers = new HttpHeaders(); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Connections"); - if (authEventId != null) { - String key = "authEventId"; - Object value = authEventId; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + + + /** + * Retrieves the connections for this user + * Override the base server url that include version + *

200 - Success - return response of type Connections array with 0 to n Connection + * @param authEventId Filter by authEventId + * @param accessToken Authorization token for user set in header of each request + * @return List<Connection> + * @throws IOException if an error occurs while attempting to invoke the API **/ + public List getConnections(String accessToken, UUID authEventId) throws IOException { + try { + TypeReference> typeRef = new TypeReference>() {}; + HttpResponse response = getConnectionsForHttpResponse(accessToken, authEventId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getConnections -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } + return null; } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); + + /** + * Retrieves the connections for this user + * Override the base server url that include version + *

200 - Success - return response of type Connections array with 0 to n Connection + * @param authEventId Filter by authEventId + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getConnectionsForHttpResponse(String accessToken, UUID authEventId) throws IOException { + + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getConnections"); + } + HttpHeaders headers = new HttpHeaders(); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Connections"); + if (authEventId != null) { + String key = "authEventId"; + Object value = authEventId; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); } - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - } } diff --git a/src/main/java/com/xero/api/client/PayrollAuApi.java b/src/main/java/com/xero/api/client/PayrollAuApi.java index b90c98117..14f181d15 100644 --- a/src/main/java/com/xero/api/client/PayrollAuApi.java +++ b/src/main/java/com/xero/api/client/PayrollAuApi.java @@ -9,26 +9,17 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpTransport; import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; + import com.xero.models.payrollau.Employee; import com.xero.models.payrollau.Employees; import com.xero.models.payrollau.LeaveApplication; import com.xero.models.payrollau.LeaveApplications; +import com.xero.models.payrollau.ModelAPIException; +import org.threeten.bp.OffsetDateTime; import com.xero.models.payrollau.PayItem; import com.xero.models.payrollau.PayItems; import com.xero.models.payrollau.PayRun; @@ -45,3921 +36,3144 @@ import com.xero.models.payrollau.Timesheet; import com.xero.models.payrollau.TimesheetObject; import com.xero.models.payrollau.Timesheets; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.ByteArrayContent; +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpContent; +import com.google.api.client.http.HttpMethods; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpResponseException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; +import java.util.List; + import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; + import org.slf4j.LoggerFactory; -import org.threeten.bp.OffsetDateTime; +import org.slf4j.Logger; + -/** PayrollAuApi has methods for interacting with all endpoints in the API set */ +/** PayrollAuApi has methods for interacting with all endpoints in the API set */ public class PayrollAuApi { - private ApiClient apiClient; - private static PayrollAuApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(PayrollAuApi.class); - - /** PayrollAuApi */ - public PayrollAuApi() { - this(new ApiClient()); - } - - /** - * PayrollAuApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static PayrollAuApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new PayrollAuApi(apiClient); - } - return instance; - } - - /** - * PayrollAuApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public PayrollAuApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Approve a requested leave application by a unique leave application id - * - *

200 - Application successfully approved - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveApplications - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveApplications approveLeaveApplication( - String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - approveLeaveApplicationForHttpResponse( - accessToken, xeroTenantId, leaveApplicationID, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : approveLeaveApplication -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Approve a requested leave application by a unique leave application id - * - *

200 - Application successfully approved - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse approveLeaveApplicationForHttpResponse( - String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling approveLeaveApplication"); - } // verify the required parameter 'leaveApplicationID' is set - if (leaveApplicationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveApplicationID' when calling" - + " approveLeaveApplication"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling approveLeaveApplication"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LeaveApplicationID", leaveApplicationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}/approve"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a payroll employee - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees createEmployee( - String accessToken, String xeroTenantId, List employee, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeeForHttpResponse(accessToken, xeroTenantId, employee, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference objectTypeRef = new TypeReference() {}; - Employees object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); - if (object.getEmployees() == null || object.getEmployees().isEmpty()) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error error = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Error", error.getMessage(), e); - } - handler.validationError("Employees", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a payroll employee - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeForHttpResponse( - String accessToken, String xeroTenantId, List employee, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployee"); - } // verify the required parameter 'employee' is set - if (employee == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employee' when calling createEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employee); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a leave application - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplication The leaveApplication parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveApplications - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveApplications createLeaveApplication( - String accessToken, - String xeroTenantId, - List leaveApplication, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createLeaveApplicationForHttpResponse( - accessToken, xeroTenantId, leaveApplication, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createLeaveApplication -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference objectTypeRef = new TypeReference() {}; - LeaveApplications object = - apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); - if (object.getLeaveApplications() == null || object.getLeaveApplications().isEmpty()) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error error = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Error", error.getMessage(), e); - } - handler.validationError("LeaveApplications", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a leave application - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplication The leaveApplication parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createLeaveApplicationForHttpResponse( - String accessToken, - String xeroTenantId, - List leaveApplication, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createLeaveApplication"); - } // verify the required parameter 'leaveApplication' is set - if (leaveApplication == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveApplication' when calling createLeaveApplication"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createLeaveApplication"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(leaveApplication); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a pay item - * - *

200 - A successful request - currently returns empty array for JSON - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param payItem The payItem parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayItems - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayItems createPayItem( - String accessToken, String xeroTenantId, PayItem payItem, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPayItemForHttpResponse(accessToken, xeroTenantId, payItem, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayItem -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a pay item - * - *

200 - A successful request - currently returns empty array for JSON - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param payItem The payItem parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPayItemForHttpResponse( - String accessToken, String xeroTenantId, PayItem payItem, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayItem"); - } // verify the required parameter 'payItem' is set - if (payItem == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payItem' when calling createPayItem"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayItem"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayItems"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payItem); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a pay run - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayRuns - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRuns createPayRun( - String accessToken, String xeroTenantId, List payRun, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPayRunForHttpResponse(accessToken, xeroTenantId, payRun, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference objectTypeRef = new TypeReference() {}; - PayRuns object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); - if (object.getPayRuns() == null || object.getPayRuns().isEmpty()) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error error = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Error", error.getMessage(), e); - } - handler.validationError("PayRuns", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a pay run - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPayRunForHttpResponse( - String accessToken, String xeroTenantId, List payRun, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayRun"); - } // verify the required parameter 'payRun' is set - if (payRun == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRun' when calling createPayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payRun); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a Payroll Calendar - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param payrollCalendar The payrollCalendar parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayrollCalendars - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayrollCalendars createPayrollCalendar( - String accessToken, - String xeroTenantId, - List payrollCalendar, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPayrollCalendarForHttpResponse( - accessToken, xeroTenantId, payrollCalendar, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayrollCalendar -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference objectTypeRef = new TypeReference() {}; - PayrollCalendars object = - apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); - if (object.getPayrollCalendars() == null || object.getPayrollCalendars().isEmpty()) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error error = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Error", error.getMessage(), e); - } - handler.validationError("PayrollCalendars", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a Payroll Calendar - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param payrollCalendar The payrollCalendar parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPayrollCalendarForHttpResponse( - String accessToken, - String xeroTenantId, - List payrollCalendar, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayrollCalendar"); - } // verify the required parameter 'payrollCalendar' is set - if (payrollCalendar == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payrollCalendar' when calling createPayrollCalendar"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayrollCalendar"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayrollCalendars"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payrollCalendar); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a superfund - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param superFund The superFund parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return SuperFunds - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SuperFunds createSuperfund( - String accessToken, String xeroTenantId, List superFund, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createSuperfundForHttpResponse(accessToken, xeroTenantId, superFund, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createSuperfund -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference objectTypeRef = new TypeReference() {}; - SuperFunds object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); - if (object.getSuperFunds() == null || object.getSuperFunds().isEmpty()) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error error = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Error", error.getMessage(), e); - } - handler.validationError("SuperFunds", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a superfund - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param superFund The superFund parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createSuperfundForHttpResponse( - String accessToken, String xeroTenantId, List superFund, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createSuperfund"); - } // verify the required parameter 'superFund' is set - if (superFund == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'superFund' when calling createSuperfund"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createSuperfund"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(superFund); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a timesheet - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Timesheets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Timesheets createTimesheet( - String accessToken, String xeroTenantId, List timesheet, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTimesheetForHttpResponse(accessToken, xeroTenantId, timesheet, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference objectTypeRef = new TypeReference() {}; - Timesheets object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); - if (object.getTimesheets() == null || object.getTimesheets().isEmpty()) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error error = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Error", error.getMessage(), e); - } - handler.validationError("Timesheets", object, e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a timesheet - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTimesheetForHttpResponse( - String accessToken, String xeroTenantId, List timesheet, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTimesheet"); - } // verify the required parameter 'timesheet' is set - if (timesheet == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheet' when calling createTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheet); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves an employee's detail by unique employee id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees getEmployee(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves an employee's detail by unique employee id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployee"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Searches payroll employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 employees will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees getEmployees( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeesForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployees -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Searches payroll employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 employees will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeesForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployees"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployees"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a leave application by a unique leave application id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param accessToken Authorization token for user set in header of each request - * @return LeaveApplications - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveApplications getLeaveApplication( - String accessToken, String xeroTenantId, UUID leaveApplicationID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getLeaveApplicationForHttpResponse(accessToken, xeroTenantId, leaveApplicationID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLeaveApplication -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a leave application by a unique leave application id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLeaveApplicationForHttpResponse( - String accessToken, String xeroTenantId, UUID leaveApplicationID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLeaveApplication"); - } // verify the required parameter 'leaveApplicationID' is set - if (leaveApplicationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveApplicationID' when calling getLeaveApplication"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLeaveApplication"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LeaveApplicationID", leaveApplicationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave applications - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return LeaveApplications - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveApplications getLeaveApplications( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getLeaveApplicationsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLeaveApplications -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave applications - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLeaveApplicationsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLeaveApplications"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLeaveApplications"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave applications including leave requests - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return LeaveApplications - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveApplications getLeaveApplicationsV2( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getLeaveApplicationsV2ForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLeaveApplicationsV2 -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave applications including leave requests - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLeaveApplicationsV2ForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLeaveApplicationsV2"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLeaveApplicationsV2"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/v2"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves pay items - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return PayItems - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayItems getPayItems( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPayItemsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayItems -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves pay items - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayItemsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayItems"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayItems"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayItems"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a pay run by using a unique pay run id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayRun id for single object - * @param accessToken Authorization token for user set in header of each request - * @return PayRuns - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRuns getPayRun(String accessToken, String xeroTenantId, UUID payRunID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayRunForHttpResponse(accessToken, xeroTenantId, payRunID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a pay run by using a unique pay run id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayRun id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRun"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling getPayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayRunID", payRunID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves pay runs - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return PayRuns - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRuns getPayRuns( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPayRunsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRuns -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves pay runs - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRuns"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRuns"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payroll calendar by using a unique payroll calendar ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payrollCalendarID Payroll Calendar id for single object - * @param accessToken Authorization token for user set in header of each request - * @return PayrollCalendars - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayrollCalendars getPayrollCalendar( - String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPayrollCalendarForHttpResponse(accessToken, xeroTenantId, payrollCalendarID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayrollCalendar -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payroll calendar by using a unique payroll calendar ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payrollCalendarID Payroll Calendar id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayrollCalendarForHttpResponse( - String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayrollCalendar"); - } // verify the required parameter 'payrollCalendarID' is set - if (payrollCalendarID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payrollCalendarID' when calling getPayrollCalendar"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayrollCalendar"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayrollCalendarID", payrollCalendarID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PayrollCalendars/{PayrollCalendarID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payroll calendars - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return PayrollCalendars - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayrollCalendars getPayrollCalendars( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPayrollCalendarsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayrollCalendars -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payroll calendars - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayrollCalendarsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayrollCalendars"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayrollCalendars"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayrollCalendars"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves for a payslip by a unique payslip id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payslipID Payslip id for single object - * @param accessToken Authorization token for user set in header of each request - * @return PayslipObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayslipObject getPayslip(String accessToken, String xeroTenantId, UUID payslipID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayslipForHttpResponse(accessToken, xeroTenantId, payslipID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayslip -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves for a payslip by a unique payslip id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payslipID Payslip id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayslipForHttpResponse( - String accessToken, String xeroTenantId, UUID payslipID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayslip"); - } // verify the required parameter 'payslipID' is set - if (payslipID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payslipID' when calling getPayslip"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayslip"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayslipID", payslipID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslip/{PayslipID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payroll settings - * - *

200 - payroll settings - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return SettingsObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SettingsObject getSettings(String accessToken, String xeroTenantId) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getSettingsForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSettings -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payroll settings - * - *

200 - payroll settings - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSettingsForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSettings"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSettings"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a superfund by using a unique superfund ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param superFundID Superfund id for single object - * @param accessToken Authorization token for user set in header of each request - * @return SuperFunds - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SuperFunds getSuperfund(String accessToken, String xeroTenantId, UUID superFundID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getSuperfundForHttpResponse(accessToken, xeroTenantId, superFundID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSuperfund -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a superfund by using a unique superfund ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param superFundID Superfund id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSuperfundForHttpResponse( - String accessToken, String xeroTenantId, UUID superFundID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSuperfund"); - } // verify the required parameter 'superFundID' is set - if (superFundID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'superFundID' when calling getSuperfund"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSuperfund"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("SuperFundID", superFundID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds/{SuperFundID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves superfund products - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ABN The ABN of the Regulated SuperFund - * @param USI The USI of the Regulated SuperFund - * @param accessToken Authorization token for user set in header of each request - * @return SuperFundProducts - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SuperFundProducts getSuperfundProducts( - String accessToken, String xeroTenantId, String ABN, String USI) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getSuperfundProductsForHttpResponse(accessToken, xeroTenantId, ABN, USI); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSuperfundProducts -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves superfund products - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ABN The ABN of the Regulated SuperFund - * @param USI The USI of the Regulated SuperFund - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSuperfundProductsForHttpResponse( - String accessToken, String xeroTenantId, String ABN, String USI) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSuperfundProducts"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSuperfundProducts"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/SuperfundProducts"); - if (ABN != null) { - String key = "ABN"; - Object value = ABN; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (USI != null) { - String key = "USI"; - Object value = USI; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves superfunds - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return SuperFunds - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SuperFunds getSuperfunds( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getSuperfundsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSuperfunds -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves superfunds - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSuperfundsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSuperfunds"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSuperfunds"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a timesheet by using a unique timesheet id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Timesheet id for single object - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject getTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a timesheet by using a unique timesheet id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Timesheet id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling getTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves timesheets - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 timesheets will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return Timesheets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Timesheets getTimesheets( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTimesheetsForHttpResponse( - accessToken, xeroTenantId, ifModifiedSince, where, order, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimesheets -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves timesheets - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param ifModifiedSince Only records created or modified since this timestamp will be returned - * @param where Filter by an any element - * @param order Order by an any element - * @param page e.g. page=1 – Up to 100 timesheets will be returned in a single API call - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimesheetsForHttpResponse( - String accessToken, - String xeroTenantId, - OffsetDateTime ifModifiedSince, - String where, - String order, - Integer page) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimesheets"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimesheets"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - if (ifModifiedSince != null) { - headers.setIfModifiedSince(ifModifiedSince.toString()); - } - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); - if (where != null) { - String key = "where"; - Object value = where; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (order != null) { - String key = "order"; - Object value = order; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } + private ApiClient apiClient; + private static PayrollAuApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(PayrollAuApi.class); + + /** PayrollAuApi */ + public PayrollAuApi() { + this(new ApiClient()); + } + + /** PayrollAuApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static PayrollAuApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new PayrollAuApi(apiClient); + } + return instance; + } + + /** PayrollAuApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public PayrollAuApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * Approve a requested leave application by a unique leave application id + *

200 - Application successfully approved + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveApplications + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveApplications approveLeaveApplication(String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = approveLeaveApplicationForHttpResponse(accessToken, xeroTenantId, leaveApplicationID, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : approveLeaveApplication -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Approve a requested leave application by a unique leave application id + *

200 - Application successfully approved + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse approveLeaveApplicationForHttpResponse(String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling approveLeaveApplication"); + }// verify the required parameter 'leaveApplicationID' is set + if (leaveApplicationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveApplicationID' when calling approveLeaveApplication"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling approveLeaveApplication"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LeaveApplicationID", leaveApplicationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}/approve"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a payroll employee + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees createEmployee(String accessToken, String xeroTenantId, List employee, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeForHttpResponse(accessToken, xeroTenantId, employee, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference objectTypeRef = new TypeReference() {}; + Employees object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); + if (object.getEmployees() == null || object.getEmployees().isEmpty()) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error error = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Error", error.getMessage(), e); + } + handler.validationError("Employees",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a payroll employee + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeForHttpResponse(String accessToken, String xeroTenantId, List employee, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployee"); + }// verify the required parameter 'employee' is set + if (employee == null) { + throw new IllegalArgumentException("Missing the required parameter 'employee' when calling createEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employee); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a leave application + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplication The leaveApplication parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveApplications + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveApplications createLeaveApplication(String accessToken, String xeroTenantId, List leaveApplication, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createLeaveApplicationForHttpResponse(accessToken, xeroTenantId, leaveApplication, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createLeaveApplication -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference objectTypeRef = new TypeReference() {}; + LeaveApplications object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); + if (object.getLeaveApplications() == null || object.getLeaveApplications().isEmpty()) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error error = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Error", error.getMessage(), e); + } + handler.validationError("LeaveApplications",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a leave application + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplication The leaveApplication parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createLeaveApplicationForHttpResponse(String accessToken, String xeroTenantId, List leaveApplication, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createLeaveApplication"); + }// verify the required parameter 'leaveApplication' is set + if (leaveApplication == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveApplication' when calling createLeaveApplication"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createLeaveApplication"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(leaveApplication); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a pay item + *

200 - A successful request - currently returns empty array for JSON + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param payItem The payItem parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayItems + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayItems createPayItem(String accessToken, String xeroTenantId, PayItem payItem, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPayItemForHttpResponse(accessToken, xeroTenantId, payItem, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayItem -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a pay item + *

200 - A successful request - currently returns empty array for JSON + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param payItem The payItem parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPayItemForHttpResponse(String accessToken, String xeroTenantId, PayItem payItem, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayItem"); + }// verify the required parameter 'payItem' is set + if (payItem == null) { + throw new IllegalArgumentException("Missing the required parameter 'payItem' when calling createPayItem"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayItem"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayItems"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payItem); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a pay run + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayRuns + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRuns createPayRun(String accessToken, String xeroTenantId, List payRun, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPayRunForHttpResponse(accessToken, xeroTenantId, payRun, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference objectTypeRef = new TypeReference() {}; + PayRuns object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); + if (object.getPayRuns() == null || object.getPayRuns().isEmpty()) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error error = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Error", error.getMessage(), e); + } + handler.validationError("PayRuns",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a pay run + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPayRunForHttpResponse(String accessToken, String xeroTenantId, List payRun, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayRun"); + }// verify the required parameter 'payRun' is set + if (payRun == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRun' when calling createPayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payRun); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a Payroll Calendar + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param payrollCalendar The payrollCalendar parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayrollCalendars + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayrollCalendars createPayrollCalendar(String accessToken, String xeroTenantId, List payrollCalendar, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPayrollCalendarForHttpResponse(accessToken, xeroTenantId, payrollCalendar, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayrollCalendar -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference objectTypeRef = new TypeReference() {}; + PayrollCalendars object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); + if (object.getPayrollCalendars() == null || object.getPayrollCalendars().isEmpty()) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error error = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Error", error.getMessage(), e); + } + handler.validationError("PayrollCalendars",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a Payroll Calendar + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param payrollCalendar The payrollCalendar parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPayrollCalendarForHttpResponse(String accessToken, String xeroTenantId, List payrollCalendar, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayrollCalendar"); + }// verify the required parameter 'payrollCalendar' is set + if (payrollCalendar == null) { + throw new IllegalArgumentException("Missing the required parameter 'payrollCalendar' when calling createPayrollCalendar"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayrollCalendar"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayrollCalendars"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payrollCalendar); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a superfund + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param superFund The superFund parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return SuperFunds + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SuperFunds createSuperfund(String accessToken, String xeroTenantId, List superFund, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createSuperfundForHttpResponse(accessToken, xeroTenantId, superFund, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createSuperfund -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference objectTypeRef = new TypeReference() {}; + SuperFunds object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); + if (object.getSuperFunds() == null || object.getSuperFunds().isEmpty()) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error error = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Error", error.getMessage(), e); + } + handler.validationError("SuperFunds",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a superfund + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param superFund The superFund parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createSuperfundForHttpResponse(String accessToken, String xeroTenantId, List superFund, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createSuperfund"); + }// verify the required parameter 'superFund' is set + if (superFund == null) { + throw new IllegalArgumentException("Missing the required parameter 'superFund' when calling createSuperfund"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createSuperfund"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(superFund); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a timesheet + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Timesheets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Timesheets createTimesheet(String accessToken, String xeroTenantId, List timesheet, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTimesheetForHttpResponse(accessToken, xeroTenantId, timesheet, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference objectTypeRef = new TypeReference() {}; + Timesheets object = apiClient.getObjectMapper().readValue(e.getContent(), objectTypeRef); + if (object.getTimesheets() == null || object.getTimesheets().isEmpty()) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error error = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Error", error.getMessage(), e); + } + handler.validationError("Timesheets",object, e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a timesheet + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTimesheetForHttpResponse(String accessToken, String xeroTenantId, List timesheet, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTimesheet"); + }// verify the required parameter 'timesheet' is set + if (timesheet == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheet' when calling createTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheet); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves an employee's detail by unique employee id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees getEmployee(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves an employee's detail by unique employee id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployee"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Searches payroll employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 employees will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees getEmployees(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeesForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployees -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Searches payroll employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 employees will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeesForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployees"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployees"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a leave application by a unique leave application id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param accessToken Authorization token for user set in header of each request + * @return LeaveApplications + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveApplications getLeaveApplication(String accessToken, String xeroTenantId, UUID leaveApplicationID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLeaveApplicationForHttpResponse(accessToken, xeroTenantId, leaveApplicationID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLeaveApplication -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a leave application by a unique leave application id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLeaveApplicationForHttpResponse(String accessToken, String xeroTenantId, UUID leaveApplicationID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLeaveApplication"); + }// verify the required parameter 'leaveApplicationID' is set + if (leaveApplicationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveApplicationID' when calling getLeaveApplication"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLeaveApplication"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LeaveApplicationID", leaveApplicationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave applications + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return LeaveApplications + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveApplications getLeaveApplications(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLeaveApplicationsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLeaveApplications -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave applications + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLeaveApplicationsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLeaveApplications"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLeaveApplications"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave applications including leave requests + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return LeaveApplications + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveApplications getLeaveApplicationsV2(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLeaveApplicationsV2ForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLeaveApplicationsV2 -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave applications including leave requests + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLeaveApplicationsV2ForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLeaveApplicationsV2"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLeaveApplicationsV2"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/v2"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves pay items + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return PayItems + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayItems getPayItems(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayItemsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayItems -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves pay items + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayItemsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayItems"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayItems"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayItems"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a pay run by using a unique pay run id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayRun id for single object + * @param accessToken Authorization token for user set in header of each request + * @return PayRuns + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRuns getPayRun(String accessToken, String xeroTenantId, UUID payRunID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunForHttpResponse(accessToken, xeroTenantId, payRunID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a pay run by using a unique pay run id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayRun id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRun"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling getPayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayRunID", payRunID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves pay runs + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return PayRuns + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRuns getPayRuns(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRuns -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves pay runs + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRuns"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRuns"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payroll calendar by using a unique payroll calendar ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payrollCalendarID Payroll Calendar id for single object + * @param accessToken Authorization token for user set in header of each request + * @return PayrollCalendars + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayrollCalendars getPayrollCalendar(String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayrollCalendarForHttpResponse(accessToken, xeroTenantId, payrollCalendarID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayrollCalendar -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payroll calendar by using a unique payroll calendar ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payrollCalendarID Payroll Calendar id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayrollCalendarForHttpResponse(String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayrollCalendar"); + }// verify the required parameter 'payrollCalendarID' is set + if (payrollCalendarID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payrollCalendarID' when calling getPayrollCalendar"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayrollCalendar"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayrollCalendarID", payrollCalendarID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayrollCalendars/{PayrollCalendarID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payroll calendars + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return PayrollCalendars + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayrollCalendars getPayrollCalendars(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayrollCalendarsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayrollCalendars -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payroll calendars + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 objects will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayrollCalendarsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayrollCalendars"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayrollCalendars"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayrollCalendars"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves for a payslip by a unique payslip id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payslipID Payslip id for single object + * @param accessToken Authorization token for user set in header of each request + * @return PayslipObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayslipObject getPayslip(String accessToken, String xeroTenantId, UUID payslipID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayslipForHttpResponse(accessToken, xeroTenantId, payslipID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayslip -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves for a payslip by a unique payslip id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payslipID Payslip id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayslipForHttpResponse(String accessToken, String xeroTenantId, UUID payslipID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayslip"); + }// verify the required parameter 'payslipID' is set + if (payslipID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payslipID' when calling getPayslip"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayslip"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayslipID", payslipID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslip/{PayslipID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payroll settings + *

200 - payroll settings + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return SettingsObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SettingsObject getSettings(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSettingsForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSettings -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payroll settings + *

200 - payroll settings + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSettingsForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSettings"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSettings"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a superfund by using a unique superfund ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param superFundID Superfund id for single object + * @param accessToken Authorization token for user set in header of each request + * @return SuperFunds + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SuperFunds getSuperfund(String accessToken, String xeroTenantId, UUID superFundID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSuperfundForHttpResponse(accessToken, xeroTenantId, superFundID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSuperfund -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a superfund by using a unique superfund ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param superFundID Superfund id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSuperfundForHttpResponse(String accessToken, String xeroTenantId, UUID superFundID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSuperfund"); + }// verify the required parameter 'superFundID' is set + if (superFundID == null) { + throw new IllegalArgumentException("Missing the required parameter 'superFundID' when calling getSuperfund"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSuperfund"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("SuperFundID", superFundID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds/{SuperFundID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves superfund products + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ABN The ABN of the Regulated SuperFund + * @param USI The USI of the Regulated SuperFund + * @param accessToken Authorization token for user set in header of each request + * @return SuperFundProducts + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SuperFundProducts getSuperfundProducts(String accessToken, String xeroTenantId, String ABN, String USI) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSuperfundProductsForHttpResponse(accessToken, xeroTenantId, ABN, USI); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSuperfundProducts -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves superfund products + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ABN The ABN of the Regulated SuperFund + * @param USI The USI of the Regulated SuperFund + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSuperfundProductsForHttpResponse(String accessToken, String xeroTenantId, String ABN, String USI) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSuperfundProducts"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSuperfundProducts"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/SuperfundProducts"); + if (ABN != null) { + String key = "ABN"; + Object value = ABN; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (USI != null) { + String key = "USI"; + Object value = USI; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves superfunds + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return SuperFunds + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SuperFunds getSuperfunds(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSuperfundsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSuperfunds -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves superfunds + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSuperfundsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSuperfunds"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSuperfunds"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a timesheet by using a unique timesheet id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Timesheet id for single object + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject getTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a timesheet by using a unique timesheet id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Timesheet id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling getTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves timesheets + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 timesheets will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return Timesheets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Timesheets getTimesheets(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimesheetsForHttpResponse(accessToken, xeroTenantId, ifModifiedSince, where, order, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimesheets -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves timesheets + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param ifModifiedSince Only records created or modified since this timestamp will be returned + * @param where Filter by an any element + * @param order Order by an any element + * @param page e.g. page=1 – Up to 100 timesheets will be returned in a single API call + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimesheetsForHttpResponse(String accessToken, String xeroTenantId, OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimesheets"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimesheets"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + if (ifModifiedSince != null) { + headers.setIfModifiedSince(ifModifiedSince.toString()); + } + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); + if (where != null) { + String key = "where"; + Object value = where; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (order != null) { + String key = "order"; + Object value = order; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Reject a leave application by a unique leave application id + *

200 - Application successfully rejected + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveApplications + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveApplications rejectLeaveApplication(String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = rejectLeaveApplicationForHttpResponse(accessToken, xeroTenantId, leaveApplicationID, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : rejectLeaveApplication -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Reject a leave application by a unique leave application id + *

200 - Application successfully rejected + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse rejectLeaveApplicationForHttpResponse(String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling rejectLeaveApplication"); + }// verify the required parameter 'leaveApplicationID' is set + if (leaveApplicationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveApplicationID' when calling rejectLeaveApplication"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling rejectLeaveApplication"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LeaveApplicationID", leaveApplicationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}/reject"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates an employee's detail + * Update properties on a single employee + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees updateEmployee(String accessToken, String xeroTenantId, UUID employeeID, List employee, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID, employee, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates an employee's detail + * Update properties on a single employee + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, List employee, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployee"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployee"); + }// verify the required parameter 'employee' is set + if (employee == null) { + throw new IllegalArgumentException("Missing the required parameter 'employee' when calling updateEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employee); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific leave application + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param leaveApplication The leaveApplication parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveApplications + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveApplications updateLeaveApplication(String accessToken, String xeroTenantId, UUID leaveApplicationID, List leaveApplication, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateLeaveApplicationForHttpResponse(accessToken, xeroTenantId, leaveApplicationID, leaveApplication, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateLeaveApplication -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific leave application + *

200 - A successful request + *

400 - invalid input, object invalid - TODO + * @param xeroTenantId Xero identifier for Tenant + * @param leaveApplicationID Leave Application id for single object + * @param leaveApplication The leaveApplication parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateLeaveApplicationForHttpResponse(String accessToken, String xeroTenantId, UUID leaveApplicationID, List leaveApplication, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateLeaveApplication"); + }// verify the required parameter 'leaveApplicationID' is set + if (leaveApplicationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveApplicationID' when calling updateLeaveApplication"); + }// verify the required parameter 'leaveApplication' is set + if (leaveApplication == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveApplication' when calling updateLeaveApplication"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateLeaveApplication"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LeaveApplicationID", leaveApplicationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(leaveApplication); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a pay run + * Update properties on a single PayRun + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayRun id for single object + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayRuns + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRuns updatePayRun(String accessToken, String xeroTenantId, UUID payRunID, List payRun, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePayRunForHttpResponse(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a pay run + * Update properties on a single PayRun + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayRun id for single object + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updatePayRunForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID, List payRun, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePayRun"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling updatePayRun"); + }// verify the required parameter 'payRun' is set + if (payRun == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRun' when calling updatePayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayRunID", payRunID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payRun); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a payslip + * Update lines on a single payslips + *

200 - A successful request - currently returns empty array for JSON + * @param xeroTenantId Xero identifier for Tenant + * @param payslipID Payslip id for single object + * @param payslipLines The payslipLines parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Payslips + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Payslips updatePayslip(String accessToken, String xeroTenantId, UUID payslipID, List payslipLines, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePayslipForHttpResponse(accessToken, xeroTenantId, payslipID, payslipLines, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePayslip -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + com.xero.models.accounting.Error error = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError("Error", error.getMessage(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a payslip + * Update lines on a single payslips + *

200 - A successful request - currently returns empty array for JSON + * @param xeroTenantId Xero identifier for Tenant + * @param payslipID Payslip id for single object + * @param payslipLines The payslipLines parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updatePayslipForHttpResponse(String accessToken, String xeroTenantId, UUID payslipID, List payslipLines, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePayslip"); + }// verify the required parameter 'payslipID' is set + if (payslipID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payslipID' when calling updatePayslip"); + }// verify the required parameter 'payslipLines' is set + if (payslipLines == null) { + throw new IllegalArgumentException("Missing the required parameter 'payslipLines' when calling updatePayslip"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePayslip"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayslipID", payslipID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslip/{PayslipID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payslipLines); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a superfund + * Update properties on a single Superfund + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param superFundID Superfund id for single object + * @param superFund The superFund parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return SuperFunds + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SuperFunds updateSuperfund(String accessToken, String xeroTenantId, UUID superFundID, List superFund, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateSuperfundForHttpResponse(accessToken, xeroTenantId, superFundID, superFund, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateSuperfund -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a superfund + * Update properties on a single Superfund + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param superFundID Superfund id for single object + * @param superFund The superFund parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateSuperfundForHttpResponse(String accessToken, String xeroTenantId, UUID superFundID, List superFund, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateSuperfund"); + }// verify the required parameter 'superFundID' is set + if (superFundID == null) { + throw new IllegalArgumentException("Missing the required parameter 'superFundID' when calling updateSuperfund"); + }// verify the required parameter 'superFund' is set + if (superFund == null) { + throw new IllegalArgumentException("Missing the required parameter 'superFund' when calling updateSuperfund"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateSuperfund"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("SuperFundID", superFundID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds/{SuperFundID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(superFund); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a timesheet + * Update properties on a single timesheet + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Timesheet id for single object + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Timesheets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Timesheets updateTimesheet(String accessToken, String xeroTenantId, UUID timesheetID, List timesheet, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, timesheet, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a timesheet + * Update properties on a single timesheet + *

200 - A successful request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Timesheet id for single object + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, List timesheet, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling updateTimesheet"); + }// verify the required parameter 'timesheet' is set + if (timesheet == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheet' when calling updateTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheet); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Reject a leave application by a unique leave application id - * - *

200 - Application successfully rejected - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveApplications - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveApplications rejectLeaveApplication( - String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - rejectLeaveApplicationForHttpResponse( - accessToken, xeroTenantId, leaveApplicationID, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : rejectLeaveApplication -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Reject a leave application by a unique leave application id - * - *

200 - Application successfully rejected - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse rejectLeaveApplicationForHttpResponse( - String accessToken, String xeroTenantId, UUID leaveApplicationID, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling rejectLeaveApplication"); - } // verify the required parameter 'leaveApplicationID' is set - if (leaveApplicationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveApplicationID' when calling" - + " rejectLeaveApplication"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling rejectLeaveApplication"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LeaveApplicationID", leaveApplicationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}/reject"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates an employee's detail Update properties on a single employee - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees updateEmployee( - String accessToken, - String xeroTenantId, - UUID employeeID, - List employee, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeForHttpResponse( - accessToken, xeroTenantId, employeeID, employee, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates an employee's detail Update properties on a single employee - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - List employee, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployee"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployee"); - } // verify the required parameter 'employee' is set - if (employee == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employee' when calling updateEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employee); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific leave application - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param leaveApplication The leaveApplication parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveApplications - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveApplications updateLeaveApplication( - String accessToken, - String xeroTenantId, - UUID leaveApplicationID, - List leaveApplication, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateLeaveApplicationForHttpResponse( - accessToken, xeroTenantId, leaveApplicationID, leaveApplication, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateLeaveApplication -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific leave application - * - *

200 - A successful request - * - *

400 - invalid input, object invalid - TODO - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveApplicationID Leave Application id for single object - * @param leaveApplication The leaveApplication parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateLeaveApplicationForHttpResponse( - String accessToken, - String xeroTenantId, - UUID leaveApplicationID, - List leaveApplication, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateLeaveApplication"); - } // verify the required parameter 'leaveApplicationID' is set - if (leaveApplicationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveApplicationID' when calling" - + " updateLeaveApplication"); - } // verify the required parameter 'leaveApplication' is set - if (leaveApplication == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveApplication' when calling updateLeaveApplication"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateLeaveApplication"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LeaveApplicationID", leaveApplicationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveApplications/{LeaveApplicationID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(leaveApplication); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a pay run Update properties on a single PayRun - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayRun id for single object - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayRuns - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRuns updatePayRun( - String accessToken, - String xeroTenantId, - UUID payRunID, - List payRun, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePayRunForHttpResponse(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a pay run Update properties on a single PayRun - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayRun id for single object - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updatePayRunForHttpResponse( - String accessToken, - String xeroTenantId, - UUID payRunID, - List payRun, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updatePayRun"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling updatePayRun"); - } // verify the required parameter 'payRun' is set - if (payRun == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRun' when calling updatePayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updatePayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayRunID", payRunID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payRun); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a payslip Update lines on a single payslips - * - *

200 - A successful request - currently returns empty array for JSON - * - * @param xeroTenantId Xero identifier for Tenant - * @param payslipID Payslip id for single object - * @param payslipLines The payslipLines parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Payslips - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Payslips updatePayslip( - String accessToken, - String xeroTenantId, - UUID payslipID, - List payslipLines, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePayslipForHttpResponse( - accessToken, xeroTenantId, payslipID, payslipLines, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePayslip -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - com.xero.models.accounting.Error error = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError("Error", error.getMessage(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a payslip Update lines on a single payslips - * - *

200 - A successful request - currently returns empty array for JSON - * - * @param xeroTenantId Xero identifier for Tenant - * @param payslipID Payslip id for single object - * @param payslipLines The payslipLines parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updatePayslipForHttpResponse( - String accessToken, - String xeroTenantId, - UUID payslipID, - List payslipLines, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updatePayslip"); - } // verify the required parameter 'payslipID' is set - if (payslipID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payslipID' when calling updatePayslip"); - } // verify the required parameter 'payslipLines' is set - if (payslipLines == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payslipLines' when calling updatePayslip"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updatePayslip"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayslipID", payslipID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslip/{PayslipID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payslipLines); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a superfund Update properties on a single Superfund - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param superFundID Superfund id for single object - * @param superFund The superFund parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return SuperFunds - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SuperFunds updateSuperfund( - String accessToken, - String xeroTenantId, - UUID superFundID, - List superFund, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateSuperfundForHttpResponse( - accessToken, xeroTenantId, superFundID, superFund, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateSuperfund -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a superfund Update properties on a single Superfund - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param superFundID Superfund id for single object - * @param superFund The superFund parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateSuperfundForHttpResponse( - String accessToken, - String xeroTenantId, - UUID superFundID, - List superFund, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateSuperfund"); - } // verify the required parameter 'superFundID' is set - if (superFundID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'superFundID' when calling updateSuperfund"); - } // verify the required parameter 'superFund' is set - if (superFund == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'superFund' when calling updateSuperfund"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateSuperfund"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("SuperFundID", superFundID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Superfunds/{SuperFundID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(superFund); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a timesheet Update properties on a single timesheet - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Timesheet id for single object - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Timesheets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Timesheets updateTimesheet( - String accessToken, - String xeroTenantId, - UUID timesheetID, - List timesheet, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateTimesheetForHttpResponse( - accessToken, xeroTenantId, timesheetID, timesheet, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a timesheet Update properties on a single timesheet - * - *

200 - A successful request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Timesheet id for single object - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTimesheetForHttpResponse( - String accessToken, - String xeroTenantId, - UUID timesheetID, - List timesheet, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling updateTimesheet"); - } // verify the required parameter 'timesheet' is set - if (timesheet == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheet' when calling updateTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheet); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); - } - } } diff --git a/src/main/java/com/xero/api/client/PayrollNzApi.java b/src/main/java/com/xero/api/client/PayrollNzApi.java index 5c47762fb..3768ec902 100644 --- a/src/main/java/com/xero/api/client/PayrollNzApi.java +++ b/src/main/java/com/xero/api/client/PayrollNzApi.java @@ -9,22 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpTransport; import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; + import com.xero.models.payrollnz.Benefit; import com.xero.models.payrollnz.Deduction; import com.xero.models.payrollnz.DeductionObject; @@ -61,6 +50,7 @@ import com.xero.models.payrollnz.LeaveType; import com.xero.models.payrollnz.LeaveTypeObject; import com.xero.models.payrollnz.LeaveTypes; +import org.threeten.bp.LocalDate; import com.xero.models.payrollnz.PayRun; import com.xero.models.payrollnz.PayRunCalendar; import com.xero.models.payrollnz.PayRunCalendarObject; @@ -72,6 +62,7 @@ import com.xero.models.payrollnz.PaySlips; import com.xero.models.payrollnz.PaymentMethod; import com.xero.models.payrollnz.PaymentMethodObject; +import com.xero.models.payrollnz.Problem; import com.xero.models.payrollnz.Reimbursement; import com.xero.models.payrollnz.ReimbursementObject; import com.xero.models.payrollnz.Reimbursements; @@ -89,8233 +80,6391 @@ import com.xero.models.payrollnz.TimesheetObject; import com.xero.models.payrollnz.Timesheets; import com.xero.models.payrollnz.TrackingCategories; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.ByteArrayContent; +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpContent; +import com.google.api.client.http.HttpMethods; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpResponseException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; +import java.util.List; + import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; + import org.slf4j.LoggerFactory; -import org.threeten.bp.LocalDate; +import org.slf4j.Logger; + -/** PayrollNzApi has methods for interacting with all endpoints in the API set */ +/** PayrollNzApi has methods for interacting with all endpoints in the API set */ public class PayrollNzApi { - private ApiClient apiClient; - private static PayrollNzApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(PayrollNzApi.class); - - /** PayrollNzApi */ - public PayrollNzApi() { - this(new ApiClient()); - } - - /** - * PayrollNzApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static PayrollNzApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new PayrollNzApi(apiClient); - } - return instance; - } - - /** - * PayrollNzApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public PayrollNzApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Approves a timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject approveTimesheet( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - approveTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : approveTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Approves a timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse approveTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling approveTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling approveTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling approveTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Approve"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new deduction for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param deduction The deduction parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return DeductionObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public DeductionObject createDeduction( - String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createDeductionForHttpResponse(accessToken, xeroTenantId, deduction, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createDeduction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - DeductionObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "DeductionObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new deduction for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param deduction The deduction parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createDeductionForHttpResponse( - String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createDeduction"); - } // verify the required parameter 'deduction' is set - if (deduction == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'deduction' when calling createDeduction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createDeduction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(deduction); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new earnings rate - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRate The earningsRate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsRateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsRateObject createEarningsRate( - String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEarningsRateForHttpResponse( - accessToken, xeroTenantId, earningsRate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEarningsRate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EarningsRateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsRateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new earnings rate - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRate The earningsRate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEarningsRateForHttpResponse( - String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEarningsRate"); - } // verify the required parameter 'earningsRate' is set - if (earningsRate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsRate' when calling createEarningsRate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEarningsRate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsRate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeObject createEmployee( - String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeeForHttpResponse(accessToken, xeroTenantId, employee, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeForHttpResponse( - String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployee"); - } // verify the required parameter 'employee' is set - if (employee == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employee' when calling createEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employee); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates earnings template records for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsTemplateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsTemplateObject createEmployeeEarningsTemplate( - String accessToken, - String xeroTenantId, - UUID employeeID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeEarningsTemplateForHttpResponse( - accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EarningsTemplateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EarningsTemplateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates earnings template records for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeEarningsTemplateForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " createEmployeeEarningsTemplate"); - } // verify the required parameter 'earningsTemplate' is set - if (earningsTemplate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsTemplate' when calling" - + " createEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/Earnings"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsTemplate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates leave records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject createEmployeeLeave( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeeLeaveForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeLeave, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates leave records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeLeaveForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeeLeave"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeLeave"); - } // verify the required parameter 'employeeLeave' is set - if (employeeLeave == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeLeave' when calling createEmployeeLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeLeave); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a leave set-up for a specific employee. This is required before viewing, configuring - * and requesting leave for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeaveSetup The employeeLeaveSetup parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveSetupObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveSetupObject createEmployeeLeaveSetup( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeaveSetup employeeLeaveSetup, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeLeaveSetupForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeLeaveSetup, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeLeaveSetup -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveSetupObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeLeaveSetupObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a leave set-up for a specific employee. This is required before viewing, configuring - * and requesting leave for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeaveSetup The employeeLeaveSetup parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeLeaveSetupForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeaveSetup employeeLeaveSetup, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeeLeaveSetup"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeLeaveSetup"); - } // verify the required parameter 'employeeLeaveSetup' is set - if (employeeLeaveSetup == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeLeaveSetup' when calling" - + " createEmployeeLeaveSetup"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeLeaveSetup"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveSetup"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeLeaveSetup); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates leave type records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeaveType The employeeLeaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveTypeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveTypeObject createEmployeeLeaveType( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeaveType employeeLeaveType, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeLeaveTypeForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeLeaveType, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeLeaveType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveTypeObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeLeaveTypeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates leave type records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeaveType The employeeLeaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeLeaveTypeForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeaveType employeeLeaveType, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeeLeaveType"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeLeaveType"); - } // verify the required parameter 'employeeLeaveType' is set - if (employeeLeaveType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeLeaveType' when calling" - + " createEmployeeLeaveType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeLeaveType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeLeaveType); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates opening balances for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeOpeningBalance The employeeOpeningBalance parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeOpeningBalancesObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeOpeningBalancesObject createEmployeeOpeningBalances( - String accessToken, - String xeroTenantId, - UUID employeeID, - List employeeOpeningBalance, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeOpeningBalancesForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeOpeningBalance, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeOpeningBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeOpeningBalancesObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeOpeningBalancesObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates opening balances for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeOpeningBalance The employeeOpeningBalance parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeOpeningBalancesForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - List employeeOpeningBalance, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createEmployeeOpeningBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeOpeningBalances"); - } // verify the required parameter 'employeeOpeningBalance' is set - if (employeeOpeningBalance == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeOpeningBalance' when calling" - + " createEmployeeOpeningBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createEmployeeOpeningBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/OpeningBalances"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeOpeningBalance); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a payment method for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param paymentMethod The paymentMethod parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PaymentMethodObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentMethodObject createEmployeePaymentMethod( - String accessToken, - String xeroTenantId, - UUID employeeID, - PaymentMethod paymentMethod, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeePaymentMethodForHttpResponse( - accessToken, xeroTenantId, employeeID, paymentMethod, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeePaymentMethod -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PaymentMethodObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PaymentMethodObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a payment method for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param paymentMethod The paymentMethod parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeePaymentMethodForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - PaymentMethod paymentMethod, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeePaymentMethod"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeePaymentMethod"); - } // verify the required parameter 'paymentMethod' is set - if (paymentMethod == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentMethod' when calling" - + " createEmployeePaymentMethod"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeePaymentMethod"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(paymentMethod); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an employee salary and wage record - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWageObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWageObject createEmployeeSalaryAndWage( - String accessToken, - String xeroTenantId, - UUID employeeID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeeSalaryAndWageForHttpResponse( - accessToken, xeroTenantId, employeeID, salaryAndWage, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - SalaryAndWageObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWageObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an employee salary and wage record - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeSalaryAndWageForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWage' is set - if (salaryAndWage == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWage' when calling" - + " createEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(salaryAndWage); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an employee working pattern - * - *

200 - employee working pattern correctly added - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeWorkingPatternWithWorkingWeeksRequest The - * employeeWorkingPatternWithWorkingWeeksRequest parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeWorkingPatternWithWorkingWeeksObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeWorkingPatternWithWorkingWeeksObject createEmployeeWorkingPattern( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeWorkingPatternWithWorkingWeeksRequest employeeWorkingPatternWithWorkingWeeksRequest, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeWorkingPatternForHttpResponse( - accessToken, - xeroTenantId, - employeeID, - employeeWorkingPatternWithWorkingWeeksRequest, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeWorkingPattern -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeWorkingPatternWithWorkingWeeksObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), - "EmployeeWorkingPatternWithWorkingWeeksObject", - object.getProblem(), - e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an employee working pattern - * - *

200 - employee working pattern correctly added - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeWorkingPatternWithWorkingWeeksRequest The - * employeeWorkingPatternWithWorkingWeeksRequest parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeWorkingPatternForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeWorkingPatternWithWorkingWeeksRequest employeeWorkingPatternWithWorkingWeeksRequest, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createEmployeeWorkingPattern"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeWorkingPattern"); - } // verify the required parameter 'employeeWorkingPatternWithWorkingWeeksRequest' is set - if (employeeWorkingPatternWithWorkingWeeksRequest == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeWorkingPatternWithWorkingWeeksRequest' when" - + " calling createEmployeeWorkingPattern"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeWorkingPattern"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Working-Patterns"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeWorkingPatternWithWorkingWeeksRequest); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an employment detail for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employment The employment parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmploymentObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmploymentObject createEmployment( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employment employment, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmploymentForHttpResponse( - accessToken, xeroTenantId, employeeID, employment, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmploymentObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmploymentObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an employment detail for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employment The employment parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmploymentForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employment employment, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployment"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployment"); - } // verify the required parameter 'employment' is set - if (employment == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employment' when calling createEmployment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Employment"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employment); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new leave type - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveType The leaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveTypeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveTypeObject createLeaveType( - String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveType, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createLeaveType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeaveTypeObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeaveTypeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new leave type - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveType The leaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createLeaveTypeForHttpResponse( - String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createLeaveType"); - } // verify the required parameter 'leaveType' is set - if (leaveType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveType' when calling createLeaveType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createLeaveType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(leaveType); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates multiple employee earnings template records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeEarningsTemplates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeEarningsTemplates createMultipleEmployeeEarningsTemplate( - String accessToken, - String xeroTenantId, - UUID employeeID, - List earningsTemplate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createMultipleEmployeeEarningsTemplateForHttpResponse( - accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createMultipleEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeEarningsTemplates object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeEarningsTemplates", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates multiple employee earnings template records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createMultipleEmployeeEarningsTemplateForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - List earningsTemplate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } // verify the required parameter 'earningsTemplate' is set - if (earningsTemplate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsTemplate' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplateEarnings"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsTemplate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a pay run - * - *

200 - created payrun results - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayRunObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunObject createPayRun( - String accessToken, String xeroTenantId, PayRun payRun, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPayRunForHttpResponse(accessToken, xeroTenantId, payRun, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a pay run - * - *

200 - created payrun results - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPayRunForHttpResponse( - String accessToken, String xeroTenantId, PayRun payRun, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayRun"); - } // verify the required parameter 'payRun' is set - if (payRun == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRun' when calling createPayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payRun); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new payrun calendar - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunCalendar The payRunCalendar parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayRunCalendarObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunCalendarObject createPayRunCalendar( - String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPayRunCalendarForHttpResponse( - accessToken, xeroTenantId, payRunCalendar, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayRunCalendar -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PayRunCalendarObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunCalendarObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new payrun calendar - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunCalendar The payRunCalendar parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPayRunCalendarForHttpResponse( - String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayRunCalendar"); - } // verify the required parameter 'payRunCalendar' is set - if (payRunCalendar == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunCalendar' when calling createPayRunCalendar"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayRunCalendar"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payRunCalendar); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new reimbursement - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursement The reimbursement parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ReimbursementObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReimbursementObject createReimbursement( - String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createReimbursementForHttpResponse( - accessToken, xeroTenantId, reimbursement, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createReimbursement -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - ReimbursementObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "ReimbursementObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new reimbursement - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursement The reimbursement parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createReimbursementForHttpResponse( - String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createReimbursement"); - } // verify the required parameter 'reimbursement' is set - if (reimbursement == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'reimbursement' when calling createReimbursement"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createReimbursement"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(reimbursement); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new superannuation - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param benefit The benefit parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return SuperannuationObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SuperannuationObject createSuperannuation( - String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createSuperannuationForHttpResponse(accessToken, xeroTenantId, benefit, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createSuperannuation -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - SuperannuationObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SuperannuationObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new superannuation - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param benefit The benefit parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createSuperannuationForHttpResponse( - String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createSuperannuation"); - } // verify the required parameter 'benefit' is set - if (benefit == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'benefit' when calling createSuperannuation"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createSuperannuation"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superannuations"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(benefit); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject createTimesheet( - String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTimesheetForHttpResponse(accessToken, xeroTenantId, timesheet, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTimesheetForHttpResponse( - String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTimesheet"); - } // verify the required parameter 'timesheet' is set - if (timesheet == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheet' when calling createTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheet); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Create a new timesheet line for a specific time sheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLineObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLineObject createTimesheetLine( - String accessToken, - String xeroTenantId, - UUID timesheetID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTimesheetLineForHttpResponse( - accessToken, xeroTenantId, timesheetID, timesheetLine, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTimesheetLine -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - TimesheetLineObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetLineObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Create a new timesheet line for a specific time sheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTimesheetLineForHttpResponse( - String accessToken, - String xeroTenantId, - UUID timesheetID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTimesheetLine"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling createTimesheetLine"); - } // verify the required parameter 'timesheetLine' is set - if (timesheetLine == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLine' when calling createTimesheetLine"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTimesheetLine"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheetLine); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes an employee's earnings template record - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @return EarningsTemplateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsTemplateObject deleteEmployeeEarningsTemplate( - String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - deleteEmployeeEarningsTemplateForHttpResponse( - accessToken, xeroTenantId, employeeID, payTemplateEarningID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes an employee's earnings template record - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteEmployeeEarningsTemplateForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " deleteEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " deleteEmployeeEarningsTemplate"); - } // verify the required parameter 'payTemplateEarningID' is set - if (payTemplateEarningID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payTemplateEarningID' when calling" - + " deleteEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " deleteEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("PayTemplateEarningID", payTemplateEarningID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a leave record for a specific employee - * - *

200 - successful response - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject deleteEmployeeLeave( - String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteEmployeeLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a leave record for a specific employee - * - *

200 - successful response - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteEmployeeLeaveForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteEmployeeLeave"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling deleteEmployeeLeave"); - } // verify the required parameter 'leaveID' is set - if (leaveID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveID' when calling deleteEmployeeLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteEmployeeLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("LeaveID", leaveID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes an employee's salary and wages record - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single salary and wages object - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWageObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWageObject deleteEmployeeSalaryAndWage( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteEmployeeSalaryAndWageForHttpResponse( - accessToken, xeroTenantId, employeeID, salaryAndWagesID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes an employee's salary and wages record - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single salary and wages object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteEmployeeSalaryAndWageForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling deleteEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWagesID' is set - if (salaryAndWagesID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWagesID' when calling" - + " deleteEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("SalaryAndWagesID", salaryAndWagesID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * deletes employee's working patterns - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeWorkingPatternID Employee working pattern id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject deleteEmployeeWorkingPattern( - String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteEmployeeWorkingPatternForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeWorkingPatternID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteEmployeeWorkingPattern -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * deletes employee's working patterns - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeWorkingPatternID Employee working pattern id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteEmployeeWorkingPatternForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " deleteEmployeeWorkingPattern"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling deleteEmployeeWorkingPattern"); - } // verify the required parameter 'employeeWorkingPatternID' is set - if (employeeWorkingPatternID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeWorkingPatternID' when calling" - + " deleteEmployeeWorkingPattern"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteEmployeeWorkingPattern"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("EmployeeWorkingPatternID", employeeWorkingPatternID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLine - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLine deleteTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling deleteTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a timesheet line for a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLine - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLine deleteTimesheetLine( - String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteTimesheetLineForHttpResponse( - accessToken, xeroTenantId, timesheetID, timesheetLineID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTimesheetLine -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a timesheet line for a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTimesheetLineForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTimesheetLine"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling deleteTimesheetLine"); - } // verify the required parameter 'timesheetLineID' is set - if (timesheetLineID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLineID' when calling deleteTimesheetLine"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTimesheetLine"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - uriVariables.put("TimesheetLineID", timesheetLineID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a single deduction by using a unique deduction ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param deductionId Identifier for the deduction - * @param accessToken Authorization token for user set in header of each request - * @return DeductionObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public DeductionObject getDeduction(String accessToken, String xeroTenantId, UUID deductionId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getDeductionForHttpResponse(accessToken, xeroTenantId, deductionId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getDeduction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - DeductionObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "DeductionObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a single deduction by using a unique deduction ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param deductionId Identifier for the deduction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getDeductionForHttpResponse( - String accessToken, String xeroTenantId, UUID deductionId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getDeduction"); - } // verify the required parameter 'deductionId' is set - if (deductionId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'deductionId' when calling getDeduction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getDeduction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("deductionId", deductionId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions/{deductionId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves deductions for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Deductions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Deductions getDeductions(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getDeductionsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getDeductions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Deductions object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Deductions", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves deductions for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getDeductionsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getDeductions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getDeductions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific earnings rates by using a unique earnings rate id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRateID Identifier for the earnings rate - * @param accessToken Authorization token for user set in header of each request - * @return EarningsRateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsRateObject getEarningsRate( - String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEarningsRateForHttpResponse(accessToken, xeroTenantId, earningsRateID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEarningsRate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EarningsRateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsRateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific earnings rates by using a unique earnings rate id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRateID Identifier for the earnings rate - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEarningsRateForHttpResponse( - String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEarningsRate"); - } // verify the required parameter 'earningsRateID' is set - if (earningsRateID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsRateID' when calling getEarningsRate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEarningsRate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EarningsRateID", earningsRateID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates/{EarningsRateID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves earnings rates - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsRates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsRates getEarningsRates(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEarningsRatesForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEarningsRates -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EarningsRates object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsRates", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves earnings rates - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEarningsRatesForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEarningsRates"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEarningsRates"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves an employees using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeObject getEmployee(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves an employees using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployee"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave balances for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveBalances - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveBalances getEmployeeLeaveBalances( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeaveBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeaveBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveBalances object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveBalances", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave balances for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeaveBalancesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeaveBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeaveBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveBalances"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave periods for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param startDate Filter by start date - * @param endDate Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return LeavePeriods - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeavePeriods getEmployeeLeavePeriods( - String accessToken, - String xeroTenantId, - UUID employeeID, - LocalDate startDate, - LocalDate endDate) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeavePeriodsForHttpResponse( - accessToken, xeroTenantId, employeeID, startDate, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeavePeriods -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeavePeriods object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeavePeriods", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave periods for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param startDate Filter by start date - * @param endDate Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeavePeriodsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - LocalDate startDate, - LocalDate endDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeavePeriods"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeavePeriods"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeavePeriods"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeavePeriods"); - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave types for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveTypes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveTypes getEmployeeLeaveTypes( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeaveTypesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeaveTypes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeLeaveTypes object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveTypes", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave types for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeaveTypesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveTypes"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeaveTypes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeaveTypes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave records for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaves - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaves getEmployeeLeaves(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeavesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeaves -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeLeaves object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaves", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave records for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeavesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaves"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeaves"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeaves"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves the opening balance for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeOpeningBalancesObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeOpeningBalancesObject getEmployeeOpeningBalances( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getEmployeeOpeningBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeOpeningBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeOpeningBalancesObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeOpeningBalancesObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves the opening balance for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeOpeningBalancesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeOpeningBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeOpeningBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeOpeningBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/OpeningBalances"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves pay templates for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeePayTemplates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeePayTemplates getEmployeePayTemplates( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeePayTemplatesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeePayTemplates -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeePayTemplates object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeePayTemplates", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves pay templates for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeePayTemplatesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeePayTemplates"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeePayTemplates"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeePayTemplates"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves available payment methods for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return PaymentMethodObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentMethodObject getEmployeePaymentMethod( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeePaymentMethodForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeePaymentMethod -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PaymentMethodObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PaymentMethodObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves available payment methods for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeePaymentMethodForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeePaymentMethod"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeePaymentMethod"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeePaymentMethod"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves an employee's salary and wages record by using a unique salary and wage ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWages - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWages getEmployeeSalaryAndWage( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeSalaryAndWageForHttpResponse( - accessToken, xeroTenantId, employeeID, salaryAndWagesID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWages", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves an employee's salary and wages record by using a unique salary and wage ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeSalaryAndWageForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWagesID' is set - if (salaryAndWagesID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWagesID' when calling" - + " getEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("SalaryAndWagesID", salaryAndWagesID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves an employee's salary and wages - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWages - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWages getEmployeeSalaryAndWages( - String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeSalaryAndWagesForHttpResponse(accessToken, xeroTenantId, employeeID, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeSalaryAndWages -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWages", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves an employee's salary and wages - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeSalaryAndWagesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWages"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWages"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWages"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves tax records for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeTaxObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeTaxObject getEmployeeTax(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeeTaxForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeTax -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeTaxObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeTaxObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves tax records for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeTaxForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeTax"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeTax"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeTax"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Tax"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves employee's working patterns - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeWorkingPatternID Employee working pattern id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeWorkingPatternWithWorkingWeeksObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeWorkingPatternWithWorkingWeeksObject getEmployeeWorkingPattern( - String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getEmployeeWorkingPatternForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeWorkingPatternID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeWorkingPattern -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeWorkingPatternWithWorkingWeeksObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), - "EmployeeWorkingPatternWithWorkingWeeksObject", - object.getProblem(), - e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves employee's working patterns - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeWorkingPatternID Employee working pattern id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeWorkingPatternForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeWorkingPattern"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeWorkingPattern"); - } // verify the required parameter 'employeeWorkingPatternID' is set - if (employeeWorkingPatternID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeWorkingPatternID' when calling" - + " getEmployeeWorkingPattern"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeWorkingPattern"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("EmployeeWorkingPatternID", employeeWorkingPatternID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves employee's working patterns - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeWorkingPatternsObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeWorkingPatternsObject getEmployeeWorkingPatterns( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getEmployeeWorkingPatternsForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeWorkingPatterns -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeWorkingPatternsObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeWorkingPatternsObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves employee's working patterns - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeWorkingPatternsForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeWorkingPatterns"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeWorkingPatterns"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeWorkingPatterns"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Working-Patterns"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param filter Filter by first name and/or lastname - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees getEmployees( - String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeesForHttpResponse(accessToken, xeroTenantId, filter, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployees -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Employees object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Employees", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param filter Filter by first name and/or lastname - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeesForHttpResponse( - String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployees"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployees"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - if (filter != null) { - String key = "filter"; - Object value = filter; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific leave type by using a unique leave type ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveTypeID Identifier for the leave type - * @param accessToken Authorization token for user set in header of each request - * @return LeaveTypeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveTypeObject getLeaveType(String accessToken, String xeroTenantId, UUID leaveTypeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveTypeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLeaveType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeaveTypeObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeaveTypeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific leave type by using a unique leave type ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveTypeID Identifier for the leave type - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLeaveTypeForHttpResponse( - String accessToken, String xeroTenantId, UUID leaveTypeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLeaveType"); - } // verify the required parameter 'leaveTypeID' is set - if (leaveTypeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveTypeID' when calling getLeaveType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLeaveType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LeaveTypeID", leaveTypeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes/{LeaveTypeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave types - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param activeOnly Filters leave types by active status. By default the API returns all leave - * types. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveTypes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveTypes getLeaveTypes( - String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getLeaveTypesForHttpResponse(accessToken, xeroTenantId, page, activeOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLeaveTypes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeaveTypes object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeaveTypes", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave types - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param activeOnly Filters leave types by active status. By default the API returns all leave - * types. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLeaveTypesForHttpResponse( - String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLeaveTypes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLeaveTypes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (activeOnly != null) { - String key = "ActiveOnly"; - Object value = activeOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific pay run by using a unique pay run ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param accessToken Authorization token for user set in header of each request - * @return PayRunObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunObject getPayRun(String accessToken, String xeroTenantId, UUID payRunID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayRunForHttpResponse(accessToken, xeroTenantId, payRunID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific pay run by using a unique pay run ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRun"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling getPayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayRunID", payRunID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific payrun calendar by using a unique payroll calendar ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payrollCalendarID Identifier for the payrun calendars - * @param accessToken Authorization token for user set in header of each request - * @return PayRunCalendarObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunCalendarObject getPayRunCalendar( - String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPayRunCalendarForHttpResponse(accessToken, xeroTenantId, payrollCalendarID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRunCalendar -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PayRunCalendarObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunCalendarObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific payrun calendar by using a unique payroll calendar ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payrollCalendarID Identifier for the payrun calendars - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunCalendarForHttpResponse( - String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRunCalendar"); - } // verify the required parameter 'payrollCalendarID' is set - if (payrollCalendarID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payrollCalendarID' when calling getPayRunCalendar"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRunCalendar"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayrollCalendarID", payrollCalendarID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars/{PayrollCalendarID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payrun calendars - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return PayRunCalendars - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunCalendars getPayRunCalendars(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayRunCalendarsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRunCalendars -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRunCalendars object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunCalendars", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payrun calendars - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunCalendarsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRunCalendars"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRunCalendars"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves pay runs - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param status By default get payruns will return all the payruns for an organization. You can - * add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter - * the payruns by status. - * @param accessToken Authorization token for user set in header of each request - * @return PayRuns - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRuns getPayRuns(String accessToken, String xeroTenantId, Integer page, String status) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayRunsForHttpResponse(accessToken, xeroTenantId, page, status); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRuns -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRuns object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRuns", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves pay runs - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param status By default get payruns will return all the payruns for an organization. You can - * add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter - * the payruns by status. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunsForHttpResponse( - String accessToken, String xeroTenantId, Integer page, String status) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRuns"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRuns"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (status != null) { - String key = "status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific payslip by a unique pay slip ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param paySlipID Identifier for the payslip - * @param accessToken Authorization token for user set in header of each request - * @return PaySlipObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaySlipObject getPaySlip(String accessToken, String xeroTenantId, UUID paySlipID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPaySlipForHttpResponse(accessToken, xeroTenantId, paySlipID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPaySlip -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PaySlipObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PaySlipObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific payslip by a unique pay slip ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param paySlipID Identifier for the payslip - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaySlipForHttpResponse( - String accessToken, String xeroTenantId, UUID paySlipID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPaySlip"); - } // verify the required parameter 'paySlipID' is set - if (paySlipID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paySlipID' when calling getPaySlip"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPaySlip"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PaySlipID", paySlipID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaySlips/{PaySlipID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payslips - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By - * default, the API does not group payslips by payrun. - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return PaySlips - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaySlips getPaySlips(String accessToken, String xeroTenantId, UUID payRunID, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPaySlipsForHttpResponse(accessToken, xeroTenantId, payRunID, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPaySlips -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PaySlips object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PaySlips", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payslips - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By - * default, the API does not group payslips by payrun. - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaySlipsForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunID, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPaySlips"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling getPaySlips"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPaySlips"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaySlips"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (payRunID != null) { - String key = "PayRunID"; - Object value = payRunID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific reimbursement by using a unique reimbursement ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursementID Identifier for the reimbursement - * @param accessToken Authorization token for user set in header of each request - * @return ReimbursementObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReimbursementObject getReimbursement( - String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReimbursementForHttpResponse(accessToken, xeroTenantId, reimbursementID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReimbursement -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - ReimbursementObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "ReimbursementObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific reimbursement by using a unique reimbursement ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursementID Identifier for the reimbursement - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReimbursementForHttpResponse( - String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReimbursement"); - } // verify the required parameter 'reimbursementID' is set - if (reimbursementID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'reimbursementID' when calling getReimbursement"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReimbursement"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReimbursementID", reimbursementID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements/{ReimbursementID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves reimbursements - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Reimbursements - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Reimbursements getReimbursements(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getReimbursementsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReimbursements -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Reimbursements object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Reimbursements", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves reimbursements - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReimbursementsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReimbursements"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReimbursements"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves settings - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return Settings - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Settings getSettings(String accessToken, String xeroTenantId) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getSettingsForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSettings -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Settings object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Settings", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves settings - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSettingsForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSettings"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSettings"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific statutory deduction by using a unique statutory deductions id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Identifier for the statutory deduction - * @param accessToken Authorization token for user set in header of each request - * @return StatutoryDeductionObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public StatutoryDeductionObject getStatutoryDeduction( - String accessToken, String xeroTenantId, UUID id) throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = getStatutoryDeductionForHttpResponse(accessToken, xeroTenantId, id); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getStatutoryDeduction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific statutory deduction by using a unique statutory deductions id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Identifier for the statutory deduction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getStatutoryDeductionForHttpResponse( - String accessToken, String xeroTenantId, UUID id) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getStatutoryDeduction"); - } // verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'id' when calling getStatutoryDeduction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getStatutoryDeduction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("id", id); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryDeductions/{id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves statutory deductions - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return StatutoryDeductions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public StatutoryDeductions getStatutoryDeductions( - String accessToken, String xeroTenantId, Integer page) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getStatutoryDeductionsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getStatutoryDeductions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves statutory deductions - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getStatutoryDeductionsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getStatutoryDeductions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getStatutoryDeductions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryDeductions"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific superannuation using a unique superannuation ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param superannuationID Identifier for the superannuation - * @param accessToken Authorization token for user set in header of each request - * @return SuperannuationObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SuperannuationObject getSuperannuation( - String accessToken, String xeroTenantId, UUID superannuationID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getSuperannuationForHttpResponse(accessToken, xeroTenantId, superannuationID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSuperannuation -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific superannuation using a unique superannuation ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param superannuationID Identifier for the superannuation - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSuperannuationForHttpResponse( - String accessToken, String xeroTenantId, UUID superannuationID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSuperannuation"); - } // verify the required parameter 'superannuationID' is set - if (superannuationID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'superannuationID' when calling getSuperannuation"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSuperannuation"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("SuperannuationID", superannuationID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Superannuations/{SuperannuationID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves superannuations - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Superannuations - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Superannuations getSuperannuations(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getSuperannuationsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSuperannuations -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves superannuations - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSuperannuationsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSuperannuations"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSuperannuations"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superannuations"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific timesheet by using a unique timesheet ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject getTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific timesheet by using a unique timesheet ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling getTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves timesheets - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param filter Filter by employeeId and/or payrollCalendarId - * @param status filter results by any timesheets with a matching timesheet status - * @param startDate filter results by any timesheets with a startDate on or after the provided - * date - * @param endDate filter results by any timesheets with a endDate on or before the provided date - * @param sort sort the order of timesheets returned. The default is based on the timesheets - * createdDate, sorted oldest to newest. Currently, the only other option is to reverse the - * order based on the timesheets startDate, sorted newest to oldest. - * @param accessToken Authorization token for user set in header of each request - * @return Timesheets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Timesheets getTimesheets( - String accessToken, - String xeroTenantId, - Integer page, - String filter, - String status, - String startDate, - String endDate, - String sort) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTimesheetsForHttpResponse( - accessToken, xeroTenantId, page, filter, status, startDate, endDate, sort); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimesheets -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Timesheets object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Timesheets", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves timesheets - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param filter Filter by employeeId and/or payrollCalendarId - * @param status filter results by any timesheets with a matching timesheet status - * @param startDate filter results by any timesheets with a startDate on or after the provided - * date - * @param endDate filter results by any timesheets with a endDate on or before the provided date - * @param sort sort the order of timesheets returned. The default is based on the timesheets - * createdDate, sorted oldest to newest. Currently, the only other option is to reverse the - * order based on the timesheets startDate, sorted newest to oldest. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimesheetsForHttpResponse( - String accessToken, - String xeroTenantId, - Integer page, - String filter, - String status, - String startDate, - String endDate, - String sort) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimesheets"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimesheets"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (filter != null) { - String key = "filter"; - Object value = filter; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (status != null) { - String key = "status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (sort != null) { - String key = "sort"; - Object value = sort; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves tracking categories - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return TrackingCategories - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingCategories getTrackingCategories(String accessToken, String xeroTenantId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getTrackingCategoriesForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTrackingCategories -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TrackingCategories object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TrackingCategories", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves tracking categories - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTrackingCategoriesForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTrackingCategories"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTrackingCategories"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Settings/TrackingCategories"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Reverts a timesheet to draft - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject revertTimesheet( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - revertTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : revertTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Reverts a timesheet to draft - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse revertTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling revertTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling revertTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling revertTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/RevertToDraft"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates an existing employee - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeObject updateEmployee( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employee employee, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeForHttpResponse( - accessToken, xeroTenantId, employeeID, employee, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates an existing employee - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employee employee, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployee"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployee"); - } // verify the required parameter 'employee' is set - if (employee == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employee' when calling updateEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employee); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates an earnings template records for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsTemplateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsTemplateObject updateEmployeeEarningsTemplate( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID payTemplateEarningID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - updateEmployeeEarningsTemplateForHttpResponse( - accessToken, - xeroTenantId, - employeeID, - payTemplateEarningID, - earningsTemplate, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EarningsTemplateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EarningsTemplateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates an earnings template records for an employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeEarningsTemplateForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID payTemplateEarningID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " updateEmployeeEarningsTemplate"); - } // verify the required parameter 'payTemplateEarningID' is set - if (payTemplateEarningID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payTemplateEarningID' when calling" - + " updateEmployeeEarningsTemplate"); - } // verify the required parameter 'earningsTemplate' is set - if (earningsTemplate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsTemplate' when calling" - + " updateEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("PayTemplateEarningID", payTemplateEarningID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsTemplate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates leave records for a specific employee - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject updateEmployeeLeave( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID leaveID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeLeaveForHttpResponse( - accessToken, xeroTenantId, employeeID, leaveID, employeeLeave, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates leave records for a specific employee - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeLeaveForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID leaveID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployeeLeave"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployeeLeave"); - } // verify the required parameter 'leaveID' is set - if (leaveID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveID' when calling updateEmployeeLeave"); - } // verify the required parameter 'employeeLeave' is set - if (employeeLeave == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeLeave' when calling updateEmployeeLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployeeLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("LeaveID", leaveID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeLeave); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates an employee's salary and wages record - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWageObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWageObject updateEmployeeSalaryAndWage( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID salaryAndWagesID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeSalaryAndWageForHttpResponse( - accessToken, - xeroTenantId, - employeeID, - salaryAndWagesID, - salaryAndWage, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - SalaryAndWageObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWageObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates an employee's salary and wages record - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeSalaryAndWageForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID salaryAndWagesID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWagesID' is set - if (salaryAndWagesID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWagesID' when calling" - + " updateEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWage' is set - if (salaryAndWage == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWage' when calling" - + " updateEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("SalaryAndWagesID", salaryAndWagesID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(salaryAndWage); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates the tax records for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeTax The employeeTax parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeTaxObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeTaxObject updateEmployeeTax( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeTax employeeTax, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeTaxForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeTax, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeTax -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeTaxObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeTaxObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates the tax records for a specific employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeTax The employeeTax parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeTaxForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeTax employeeTax, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployeeTax"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployeeTax"); - } // verify the required parameter 'employeeTax' is set - if (employeeTax == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeTax' when calling updateEmployeeTax"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployeeTax"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Tax"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeTax); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a pay run - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayRunObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunObject updatePayRun( - String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePayRunForHttpResponse(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a pay run - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updatePayRunForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updatePayRun"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling updatePayRun"); - } // verify the required parameter 'payRun' is set - if (payRun == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRun' when calling updatePayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updatePayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayRunID", payRunID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payRun); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an employee pay slip - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param paySlipID Identifier for the payslip - * @param paySlip The paySlip parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PaySlipObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaySlipObject updatePaySlipLineItems( - String accessToken, - String xeroTenantId, - UUID paySlipID, - PaySlip paySlip, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePaySlipLineItemsForHttpResponse( - accessToken, xeroTenantId, paySlipID, paySlip, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePaySlipLineItems -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PaySlipObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PaySlipObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an employee pay slip - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param paySlipID Identifier for the payslip - * @param paySlip The paySlip parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updatePaySlipLineItemsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID paySlipID, - PaySlip paySlip, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updatePaySlipLineItems"); - } // verify the required parameter 'paySlipID' is set - if (paySlipID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paySlipID' when calling updatePaySlipLineItems"); - } // verify the required parameter 'paySlip' is set - if (paySlip == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paySlip' when calling updatePaySlipLineItems"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updatePaySlipLineItems"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PaySlipID", paySlipID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaySlips/{PaySlipID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(paySlip); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a timesheet line for a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLineObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLineObject updateTimesheetLine( - String accessToken, - String xeroTenantId, - UUID timesheetID, - UUID timesheetLineID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateTimesheetLineForHttpResponse( - accessToken, - xeroTenantId, - timesheetID, - timesheetLineID, - timesheetLine, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTimesheetLine -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - TimesheetLineObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetLineObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a timesheet line for a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTimesheetLineForHttpResponse( - String accessToken, - String xeroTenantId, - UUID timesheetID, - UUID timesheetLineID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTimesheetLine"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling updateTimesheetLine"); - } // verify the required parameter 'timesheetLineID' is set - if (timesheetLineID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLineID' when calling updateTimesheetLine"); - } // verify the required parameter 'timesheetLine' is set - if (timesheetLine == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLine' when calling updateTimesheetLine"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTimesheetLine"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - uriVariables.put("TimesheetLineID", timesheetLineID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheetLine); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); - } - } + private ApiClient apiClient; + private static PayrollNzApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(PayrollNzApi.class); + + /** PayrollNzApi */ + public PayrollNzApi() { + this(new ApiClient()); + } + + /** PayrollNzApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static PayrollNzApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new PayrollNzApi(apiClient); + } + return instance; + } + + /** PayrollNzApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public PayrollNzApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * Approves a timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject approveTimesheet(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = approveTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : approveTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Approves a timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse approveTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling approveTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling approveTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling approveTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Approve"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new deduction for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param deduction The deduction parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return DeductionObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public DeductionObject createDeduction(String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createDeductionForHttpResponse(accessToken, xeroTenantId, deduction, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createDeduction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + DeductionObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"DeductionObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new deduction for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param deduction The deduction parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createDeductionForHttpResponse(String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createDeduction"); + }// verify the required parameter 'deduction' is set + if (deduction == null) { + throw new IllegalArgumentException("Missing the required parameter 'deduction' when calling createDeduction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createDeduction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(deduction); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new earnings rate + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRate The earningsRate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsRateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsRateObject createEarningsRate(String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEarningsRateForHttpResponse(accessToken, xeroTenantId, earningsRate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEarningsRate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsRateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsRateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new earnings rate + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRate The earningsRate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEarningsRateForHttpResponse(String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEarningsRate"); + }// verify the required parameter 'earningsRate' is set + if (earningsRate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsRate' when calling createEarningsRate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEarningsRate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsRate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeObject createEmployee(String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeForHttpResponse(accessToken, xeroTenantId, employee, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeForHttpResponse(String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployee"); + }// verify the required parameter 'employee' is set + if (employee == null) { + throw new IllegalArgumentException("Missing the required parameter 'employee' when calling createEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employee); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates earnings template records for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsTemplateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsTemplateObject createEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsTemplateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsTemplateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates earnings template records for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeEarningsTemplate"); + }// verify the required parameter 'earningsTemplate' is set + if (earningsTemplate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsTemplate' when calling createEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/Earnings"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsTemplate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates leave records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject createEmployeeLeave(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, employeeLeave, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates leave records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeLeave"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeLeave"); + }// verify the required parameter 'employeeLeave' is set + if (employeeLeave == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeLeave' when calling createEmployeeLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeLeave); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a leave set-up for a specific employee. This is required before viewing, configuring and requesting leave for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeaveSetup The employeeLeaveSetup parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveSetupObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveSetupObject createEmployeeLeaveSetup(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeaveSetup employeeLeaveSetup, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeLeaveSetupForHttpResponse(accessToken, xeroTenantId, employeeID, employeeLeaveSetup, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeLeaveSetup -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveSetupObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveSetupObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a leave set-up for a specific employee. This is required before viewing, configuring and requesting leave for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeaveSetup The employeeLeaveSetup parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeLeaveSetupForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeaveSetup employeeLeaveSetup, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeLeaveSetup"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeLeaveSetup"); + }// verify the required parameter 'employeeLeaveSetup' is set + if (employeeLeaveSetup == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeLeaveSetup' when calling createEmployeeLeaveSetup"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeLeaveSetup"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveSetup"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeLeaveSetup); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates leave type records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeaveType The employeeLeaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveTypeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveTypeObject createEmployeeLeaveType(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeaveType employeeLeaveType, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeLeaveTypeForHttpResponse(accessToken, xeroTenantId, employeeID, employeeLeaveType, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeLeaveType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveTypeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveTypeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates leave type records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeaveType The employeeLeaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeLeaveTypeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeaveType employeeLeaveType, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeLeaveType"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeLeaveType"); + }// verify the required parameter 'employeeLeaveType' is set + if (employeeLeaveType == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeLeaveType' when calling createEmployeeLeaveType"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeLeaveType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeLeaveType); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates opening balances for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeOpeningBalance The employeeOpeningBalance parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeOpeningBalancesObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeOpeningBalancesObject createEmployeeOpeningBalances(String accessToken, String xeroTenantId, UUID employeeID, List employeeOpeningBalance, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeOpeningBalancesForHttpResponse(accessToken, xeroTenantId, employeeID, employeeOpeningBalance, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeOpeningBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeOpeningBalancesObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeOpeningBalancesObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates opening balances for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeOpeningBalance The employeeOpeningBalance parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeOpeningBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, List employeeOpeningBalance, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeOpeningBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeOpeningBalances"); + }// verify the required parameter 'employeeOpeningBalance' is set + if (employeeOpeningBalance == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeOpeningBalance' when calling createEmployeeOpeningBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeOpeningBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/OpeningBalances"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeOpeningBalance); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a payment method for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param paymentMethod The paymentMethod parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PaymentMethodObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentMethodObject createEmployeePaymentMethod(String accessToken, String xeroTenantId, UUID employeeID, PaymentMethod paymentMethod, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeePaymentMethodForHttpResponse(accessToken, xeroTenantId, employeeID, paymentMethod, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeePaymentMethod -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PaymentMethodObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PaymentMethodObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a payment method for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param paymentMethod The paymentMethod parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeePaymentMethodForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, PaymentMethod paymentMethod, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeePaymentMethod"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeePaymentMethod"); + }// verify the required parameter 'paymentMethod' is set + if (paymentMethod == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentMethod' when calling createEmployeePaymentMethod"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeePaymentMethod"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(paymentMethod); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an employee salary and wage record + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWageObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWageObject createEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWage, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWageObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWageObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an employee salary and wage record + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWage' is set + if (salaryAndWage == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWage' when calling createEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(salaryAndWage); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an employee working pattern + *

200 - employee working pattern correctly added + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeWorkingPatternWithWorkingWeeksRequest The employeeWorkingPatternWithWorkingWeeksRequest parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeWorkingPatternWithWorkingWeeksObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeWorkingPatternWithWorkingWeeksObject createEmployeeWorkingPattern(String accessToken, String xeroTenantId, UUID employeeID, EmployeeWorkingPatternWithWorkingWeeksRequest employeeWorkingPatternWithWorkingWeeksRequest, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeWorkingPatternForHttpResponse(accessToken, xeroTenantId, employeeID, employeeWorkingPatternWithWorkingWeeksRequest, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeWorkingPattern -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeWorkingPatternWithWorkingWeeksObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeWorkingPatternWithWorkingWeeksObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an employee working pattern + *

200 - employee working pattern correctly added + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeWorkingPatternWithWorkingWeeksRequest The employeeWorkingPatternWithWorkingWeeksRequest parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeWorkingPatternForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeWorkingPatternWithWorkingWeeksRequest employeeWorkingPatternWithWorkingWeeksRequest, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeWorkingPattern"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeWorkingPattern"); + }// verify the required parameter 'employeeWorkingPatternWithWorkingWeeksRequest' is set + if (employeeWorkingPatternWithWorkingWeeksRequest == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeWorkingPatternWithWorkingWeeksRequest' when calling createEmployeeWorkingPattern"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeWorkingPattern"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Working-Patterns"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeWorkingPatternWithWorkingWeeksRequest); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an employment detail for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employment The employment parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmploymentObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmploymentObject createEmployment(String accessToken, String xeroTenantId, UUID employeeID, Employment employment, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmploymentForHttpResponse(accessToken, xeroTenantId, employeeID, employment, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmploymentObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmploymentObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an employment detail for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employment The employment parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmploymentForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, Employment employment, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployment"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployment"); + }// verify the required parameter 'employment' is set + if (employment == null) { + throw new IllegalArgumentException("Missing the required parameter 'employment' when calling createEmployment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Employment"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employment); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new leave type + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveType The leaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveTypeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveTypeObject createLeaveType(String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveType, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createLeaveType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeaveTypeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeaveTypeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new leave type + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveType The leaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createLeaveTypeForHttpResponse(String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createLeaveType"); + }// verify the required parameter 'leaveType' is set + if (leaveType == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveType' when calling createLeaveType"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createLeaveType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(leaveType); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates multiple employee earnings template records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeEarningsTemplates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeEarningsTemplates createMultipleEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, List earningsTemplate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createMultipleEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createMultipleEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeEarningsTemplates object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeEarningsTemplates",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates multiple employee earnings template records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createMultipleEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, List earningsTemplate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createMultipleEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createMultipleEmployeeEarningsTemplate"); + }// verify the required parameter 'earningsTemplate' is set + if (earningsTemplate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsTemplate' when calling createMultipleEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createMultipleEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplateEarnings"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsTemplate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a pay run + *

200 - created payrun results + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayRunObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunObject createPayRun(String accessToken, String xeroTenantId, PayRun payRun, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPayRunForHttpResponse(accessToken, xeroTenantId, payRun, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a pay run + *

200 - created payrun results + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPayRunForHttpResponse(String accessToken, String xeroTenantId, PayRun payRun, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayRun"); + }// verify the required parameter 'payRun' is set + if (payRun == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRun' when calling createPayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payRun); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new payrun calendar + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunCalendar The payRunCalendar parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayRunCalendarObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunCalendarObject createPayRunCalendar(String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPayRunCalendarForHttpResponse(accessToken, xeroTenantId, payRunCalendar, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayRunCalendar -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunCalendarObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunCalendarObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new payrun calendar + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunCalendar The payRunCalendar parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPayRunCalendarForHttpResponse(String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayRunCalendar"); + }// verify the required parameter 'payRunCalendar' is set + if (payRunCalendar == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunCalendar' when calling createPayRunCalendar"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayRunCalendar"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payRunCalendar); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new reimbursement + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursement The reimbursement parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ReimbursementObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReimbursementObject createReimbursement(String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createReimbursementForHttpResponse(accessToken, xeroTenantId, reimbursement, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createReimbursement -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + ReimbursementObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"ReimbursementObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new reimbursement + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursement The reimbursement parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createReimbursementForHttpResponse(String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createReimbursement"); + }// verify the required parameter 'reimbursement' is set + if (reimbursement == null) { + throw new IllegalArgumentException("Missing the required parameter 'reimbursement' when calling createReimbursement"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createReimbursement"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(reimbursement); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new superannuation + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param benefit The benefit parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return SuperannuationObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SuperannuationObject createSuperannuation(String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createSuperannuationForHttpResponse(accessToken, xeroTenantId, benefit, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createSuperannuation -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SuperannuationObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SuperannuationObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new superannuation + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param benefit The benefit parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createSuperannuationForHttpResponse(String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createSuperannuation"); + }// verify the required parameter 'benefit' is set + if (benefit == null) { + throw new IllegalArgumentException("Missing the required parameter 'benefit' when calling createSuperannuation"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createSuperannuation"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superannuations"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(benefit); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject createTimesheet(String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTimesheetForHttpResponse(accessToken, xeroTenantId, timesheet, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTimesheetForHttpResponse(String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTimesheet"); + }// verify the required parameter 'timesheet' is set + if (timesheet == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheet' when calling createTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheet); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Create a new timesheet line for a specific time sheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLineObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLineObject createTimesheetLine(String accessToken, String xeroTenantId, UUID timesheetID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTimesheetLineForHttpResponse(accessToken, xeroTenantId, timesheetID, timesheetLine, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTimesheetLine -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetLineObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetLineObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Create a new timesheet line for a specific time sheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTimesheetLineForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTimesheetLine"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling createTimesheetLine"); + }// verify the required parameter 'timesheetLine' is set + if (timesheetLine == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLine' when calling createTimesheetLine"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTimesheetLine"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheetLine); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes an employee's earnings template record + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @return EarningsTemplateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsTemplateObject deleteEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, payTemplateEarningID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes an employee's earnings template record + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling deleteEmployeeEarningsTemplate"); + }// verify the required parameter 'payTemplateEarningID' is set + if (payTemplateEarningID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payTemplateEarningID' when calling deleteEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("PayTemplateEarningID", payTemplateEarningID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a leave record for a specific employee + *

200 - successful response + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject deleteEmployeeLeave(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteEmployeeLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a leave record for a specific employee + *

200 - successful response + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteEmployeeLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteEmployeeLeave"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling deleteEmployeeLeave"); + }// verify the required parameter 'leaveID' is set + if (leaveID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveID' when calling deleteEmployeeLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteEmployeeLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("LeaveID", leaveID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes an employee's salary and wages record + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single salary and wages object + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWageObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWageObject deleteEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWagesID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes an employee's salary and wages record + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single salary and wages object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling deleteEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWagesID' is set + if (salaryAndWagesID == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWagesID' when calling deleteEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("SalaryAndWagesID", salaryAndWagesID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * deletes employee's working patterns + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeWorkingPatternID Employee working pattern id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject deleteEmployeeWorkingPattern(String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteEmployeeWorkingPatternForHttpResponse(accessToken, xeroTenantId, employeeID, employeeWorkingPatternID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteEmployeeWorkingPattern -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * deletes employee's working patterns + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeWorkingPatternID Employee working pattern id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteEmployeeWorkingPatternForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteEmployeeWorkingPattern"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling deleteEmployeeWorkingPattern"); + }// verify the required parameter 'employeeWorkingPatternID' is set + if (employeeWorkingPatternID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeWorkingPatternID' when calling deleteEmployeeWorkingPattern"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteEmployeeWorkingPattern"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("EmployeeWorkingPatternID", employeeWorkingPatternID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLine + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLine deleteTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling deleteTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a timesheet line for a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLine + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLine deleteTimesheetLine(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteTimesheetLineForHttpResponse(accessToken, xeroTenantId, timesheetID, timesheetLineID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTimesheetLine -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a timesheet line for a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTimesheetLineForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTimesheetLine"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling deleteTimesheetLine"); + }// verify the required parameter 'timesheetLineID' is set + if (timesheetLineID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLineID' when calling deleteTimesheetLine"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTimesheetLine"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + uriVariables.put("TimesheetLineID", timesheetLineID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a single deduction by using a unique deduction ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param deductionId Identifier for the deduction + * @param accessToken Authorization token for user set in header of each request + * @return DeductionObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public DeductionObject getDeduction(String accessToken, String xeroTenantId, UUID deductionId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getDeductionForHttpResponse(accessToken, xeroTenantId, deductionId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getDeduction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + DeductionObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"DeductionObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a single deduction by using a unique deduction ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param deductionId Identifier for the deduction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getDeductionForHttpResponse(String accessToken, String xeroTenantId, UUID deductionId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getDeduction"); + }// verify the required parameter 'deductionId' is set + if (deductionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'deductionId' when calling getDeduction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getDeduction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("deductionId", deductionId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions/{deductionId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves deductions for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Deductions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Deductions getDeductions(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getDeductionsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getDeductions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Deductions object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Deductions",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves deductions for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getDeductionsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getDeductions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getDeductions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific earnings rates by using a unique earnings rate id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRateID Identifier for the earnings rate + * @param accessToken Authorization token for user set in header of each request + * @return EarningsRateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsRateObject getEarningsRate(String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEarningsRateForHttpResponse(accessToken, xeroTenantId, earningsRateID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEarningsRate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsRateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsRateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific earnings rates by using a unique earnings rate id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRateID Identifier for the earnings rate + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEarningsRateForHttpResponse(String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEarningsRate"); + }// verify the required parameter 'earningsRateID' is set + if (earningsRateID == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsRateID' when calling getEarningsRate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEarningsRate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EarningsRateID", earningsRateID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates/{EarningsRateID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves earnings rates + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsRates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsRates getEarningsRates(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEarningsRatesForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEarningsRates -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsRates object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsRates",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves earnings rates + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEarningsRatesForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEarningsRates"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEarningsRates"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves an employees using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeObject getEmployee(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves an employees using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployee"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave balances for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveBalances + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveBalances getEmployeeLeaveBalances(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeaveBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeaveBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveBalances object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveBalances",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave balances for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeaveBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeaveBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeaveBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveBalances"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave periods for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param startDate Filter by start date + * @param endDate Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return LeavePeriods + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeavePeriods getEmployeeLeavePeriods(String accessToken, String xeroTenantId, UUID employeeID, LocalDate startDate, LocalDate endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeavePeriodsForHttpResponse(accessToken, xeroTenantId, employeeID, startDate, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeavePeriods -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeavePeriods object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeavePeriods",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave periods for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param startDate Filter by start date + * @param endDate Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeavePeriodsForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, LocalDate startDate, LocalDate endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeavePeriods"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeavePeriods"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeavePeriods"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeavePeriods"); + if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave types for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveTypes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveTypes getEmployeeLeaveTypes(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeaveTypesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeaveTypes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveTypes object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveTypes",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave types for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeaveTypesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveTypes"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeaveTypes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeaveTypes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave records for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaves + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaves getEmployeeLeaves(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeavesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeaves -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaves object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaves",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave records for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeavesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaves"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeaves"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeaves"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves the opening balance for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeOpeningBalancesObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeOpeningBalancesObject getEmployeeOpeningBalances(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeOpeningBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeOpeningBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeOpeningBalancesObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeOpeningBalancesObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves the opening balance for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeOpeningBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeOpeningBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeOpeningBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeOpeningBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/OpeningBalances"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves pay templates for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeePayTemplates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeePayTemplates getEmployeePayTemplates(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeePayTemplatesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeePayTemplates -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeePayTemplates object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeePayTemplates",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves pay templates for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeePayTemplatesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeePayTemplates"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeePayTemplates"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeePayTemplates"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves available payment methods for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return PaymentMethodObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentMethodObject getEmployeePaymentMethod(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeePaymentMethodForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeePaymentMethod -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PaymentMethodObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PaymentMethodObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves available payment methods for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeePaymentMethodForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeePaymentMethod"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeePaymentMethod"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeePaymentMethod"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves an employee's salary and wages record by using a unique salary and wage ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWages + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWages getEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWagesID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWages",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves an employee's salary and wages record by using a unique salary and wage ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWagesID' is set + if (salaryAndWagesID == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWagesID' when calling getEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("SalaryAndWagesID", salaryAndWagesID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves an employee's salary and wages + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWages + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWages getEmployeeSalaryAndWages(String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeSalaryAndWagesForHttpResponse(accessToken, xeroTenantId, employeeID, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeSalaryAndWages -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWages",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves an employee's salary and wages + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeSalaryAndWagesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWages"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWages"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWages"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves tax records for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeTaxObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeTaxObject getEmployeeTax(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeTaxForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeTax -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeTaxObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeTaxObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves tax records for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeTaxForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeTax"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeTax"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeTax"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Tax"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves employee's working patterns + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeWorkingPatternID Employee working pattern id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeWorkingPatternWithWorkingWeeksObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeWorkingPatternWithWorkingWeeksObject getEmployeeWorkingPattern(String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeWorkingPatternForHttpResponse(accessToken, xeroTenantId, employeeID, employeeWorkingPatternID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeWorkingPattern -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeWorkingPatternWithWorkingWeeksObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeWorkingPatternWithWorkingWeeksObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves employee's working patterns + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeWorkingPatternID Employee working pattern id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeWorkingPatternForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID employeeWorkingPatternID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeWorkingPattern"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeWorkingPattern"); + }// verify the required parameter 'employeeWorkingPatternID' is set + if (employeeWorkingPatternID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeWorkingPatternID' when calling getEmployeeWorkingPattern"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeWorkingPattern"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("EmployeeWorkingPatternID", employeeWorkingPatternID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves employee's working patterns + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeWorkingPatternsObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeWorkingPatternsObject getEmployeeWorkingPatterns(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeWorkingPatternsForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeWorkingPatterns -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeWorkingPatternsObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeWorkingPatternsObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves employee's working patterns + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeWorkingPatternsForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeWorkingPatterns"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeWorkingPatterns"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeWorkingPatterns"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Working-Patterns"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param filter Filter by first name and/or lastname + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees getEmployees(String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeesForHttpResponse(accessToken, xeroTenantId, filter, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployees -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Employees object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Employees",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param filter Filter by first name and/or lastname + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeesForHttpResponse(String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployees"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployees"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + if (filter != null) { + String key = "filter"; + Object value = filter; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific leave type by using a unique leave type ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param leaveTypeID Identifier for the leave type + * @param accessToken Authorization token for user set in header of each request + * @return LeaveTypeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveTypeObject getLeaveType(String accessToken, String xeroTenantId, UUID leaveTypeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveTypeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLeaveType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeaveTypeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeaveTypeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific leave type by using a unique leave type ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param leaveTypeID Identifier for the leave type + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLeaveTypeForHttpResponse(String accessToken, String xeroTenantId, UUID leaveTypeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLeaveType"); + }// verify the required parameter 'leaveTypeID' is set + if (leaveTypeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveTypeID' when calling getLeaveType"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLeaveType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LeaveTypeID", leaveTypeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes/{LeaveTypeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave types + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param activeOnly Filters leave types by active status. By default the API returns all leave types. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveTypes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveTypes getLeaveTypes(String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLeaveTypesForHttpResponse(accessToken, xeroTenantId, page, activeOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLeaveTypes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeaveTypes object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeaveTypes",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave types + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param activeOnly Filters leave types by active status. By default the API returns all leave types. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLeaveTypesForHttpResponse(String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLeaveTypes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLeaveTypes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (activeOnly != null) { + String key = "ActiveOnly"; + Object value = activeOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific pay run by using a unique pay run ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param accessToken Authorization token for user set in header of each request + * @return PayRunObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunObject getPayRun(String accessToken, String xeroTenantId, UUID payRunID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunForHttpResponse(accessToken, xeroTenantId, payRunID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific pay run by using a unique pay run ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRun"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling getPayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayRunID", payRunID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific payrun calendar by using a unique payroll calendar ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payrollCalendarID Identifier for the payrun calendars + * @param accessToken Authorization token for user set in header of each request + * @return PayRunCalendarObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunCalendarObject getPayRunCalendar(String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunCalendarForHttpResponse(accessToken, xeroTenantId, payrollCalendarID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRunCalendar -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunCalendarObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunCalendarObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific payrun calendar by using a unique payroll calendar ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payrollCalendarID Identifier for the payrun calendars + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunCalendarForHttpResponse(String accessToken, String xeroTenantId, UUID payrollCalendarID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRunCalendar"); + }// verify the required parameter 'payrollCalendarID' is set + if (payrollCalendarID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payrollCalendarID' when calling getPayRunCalendar"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRunCalendar"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayrollCalendarID", payrollCalendarID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars/{PayrollCalendarID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payrun calendars + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return PayRunCalendars + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunCalendars getPayRunCalendars(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunCalendarsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRunCalendars -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunCalendars object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunCalendars",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payrun calendars + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunCalendarsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRunCalendars"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRunCalendars"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves pay runs + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + * @param accessToken Authorization token for user set in header of each request + * @return PayRuns + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRuns getPayRuns(String accessToken, String xeroTenantId, Integer page, String status) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunsForHttpResponse(accessToken, xeroTenantId, page, status); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRuns -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRuns object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRuns",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves pay runs + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunsForHttpResponse(String accessToken, String xeroTenantId, Integer page, String status) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRuns"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRuns"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (status != null) { + String key = "status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific payslip by a unique pay slip ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param paySlipID Identifier for the payslip + * @param accessToken Authorization token for user set in header of each request + * @return PaySlipObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaySlipObject getPaySlip(String accessToken, String xeroTenantId, UUID paySlipID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaySlipForHttpResponse(accessToken, xeroTenantId, paySlipID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPaySlip -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PaySlipObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PaySlipObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific payslip by a unique pay slip ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param paySlipID Identifier for the payslip + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaySlipForHttpResponse(String accessToken, String xeroTenantId, UUID paySlipID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPaySlip"); + }// verify the required parameter 'paySlipID' is set + if (paySlipID == null) { + throw new IllegalArgumentException("Missing the required parameter 'paySlipID' when calling getPaySlip"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPaySlip"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PaySlipID", paySlipID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaySlips/{PaySlipID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payslips + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return PaySlips + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaySlips getPaySlips(String accessToken, String xeroTenantId, UUID payRunID, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaySlipsForHttpResponse(accessToken, xeroTenantId, payRunID, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPaySlips -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PaySlips object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PaySlips",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payslips + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaySlipsForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPaySlips"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling getPaySlips"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPaySlips"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaySlips"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (payRunID != null) { + String key = "PayRunID"; + Object value = payRunID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific reimbursement by using a unique reimbursement ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursementID Identifier for the reimbursement + * @param accessToken Authorization token for user set in header of each request + * @return ReimbursementObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReimbursementObject getReimbursement(String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReimbursementForHttpResponse(accessToken, xeroTenantId, reimbursementID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReimbursement -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + ReimbursementObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"ReimbursementObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific reimbursement by using a unique reimbursement ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursementID Identifier for the reimbursement + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReimbursementForHttpResponse(String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReimbursement"); + }// verify the required parameter 'reimbursementID' is set + if (reimbursementID == null) { + throw new IllegalArgumentException("Missing the required parameter 'reimbursementID' when calling getReimbursement"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReimbursement"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReimbursementID", reimbursementID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements/{ReimbursementID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves reimbursements + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Reimbursements + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Reimbursements getReimbursements(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReimbursementsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReimbursements -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Reimbursements object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Reimbursements",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves reimbursements + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReimbursementsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReimbursements"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReimbursements"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves settings + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return Settings + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Settings getSettings(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSettingsForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSettings -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Settings object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Settings",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves settings + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSettingsForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSettings"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSettings"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific statutory deduction by using a unique statutory deductions id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param id Identifier for the statutory deduction + * @param accessToken Authorization token for user set in header of each request + * @return StatutoryDeductionObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public StatutoryDeductionObject getStatutoryDeduction(String accessToken, String xeroTenantId, UUID id) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getStatutoryDeductionForHttpResponse(accessToken, xeroTenantId, id); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getStatutoryDeduction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific statutory deduction by using a unique statutory deductions id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param id Identifier for the statutory deduction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getStatutoryDeductionForHttpResponse(String accessToken, String xeroTenantId, UUID id) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getStatutoryDeduction"); + }// verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling getStatutoryDeduction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getStatutoryDeduction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("id", id); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryDeductions/{id}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves statutory deductions + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return StatutoryDeductions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public StatutoryDeductions getStatutoryDeductions(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getStatutoryDeductionsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getStatutoryDeductions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves statutory deductions + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getStatutoryDeductionsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getStatutoryDeductions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getStatutoryDeductions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryDeductions"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific superannuation using a unique superannuation ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param superannuationID Identifier for the superannuation + * @param accessToken Authorization token for user set in header of each request + * @return SuperannuationObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SuperannuationObject getSuperannuation(String accessToken, String xeroTenantId, UUID superannuationID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSuperannuationForHttpResponse(accessToken, xeroTenantId, superannuationID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSuperannuation -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific superannuation using a unique superannuation ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param superannuationID Identifier for the superannuation + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSuperannuationForHttpResponse(String accessToken, String xeroTenantId, UUID superannuationID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSuperannuation"); + }// verify the required parameter 'superannuationID' is set + if (superannuationID == null) { + throw new IllegalArgumentException("Missing the required parameter 'superannuationID' when calling getSuperannuation"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSuperannuation"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("SuperannuationID", superannuationID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superannuations/{SuperannuationID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves superannuations + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Superannuations + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Superannuations getSuperannuations(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSuperannuationsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSuperannuations -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves superannuations + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSuperannuationsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSuperannuations"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSuperannuations"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Superannuations"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific timesheet by using a unique timesheet ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject getTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific timesheet by using a unique timesheet ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling getTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves timesheets + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param filter Filter by employeeId and/or payrollCalendarId + * @param status filter results by any timesheets with a matching timesheet status + * @param startDate filter results by any timesheets with a startDate on or after the provided date + * @param endDate filter results by any timesheets with a endDate on or before the provided date + * @param sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest. + * @param accessToken Authorization token for user set in header of each request + * @return Timesheets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Timesheets getTimesheets(String accessToken, String xeroTenantId, Integer page, String filter, String status, String startDate, String endDate, String sort) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimesheetsForHttpResponse(accessToken, xeroTenantId, page, filter, status, startDate, endDate, sort); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimesheets -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Timesheets object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Timesheets",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves timesheets + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param filter Filter by employeeId and/or payrollCalendarId + * @param status filter results by any timesheets with a matching timesheet status + * @param startDate filter results by any timesheets with a startDate on or after the provided date + * @param endDate filter results by any timesheets with a endDate on or before the provided date + * @param sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimesheetsForHttpResponse(String accessToken, String xeroTenantId, Integer page, String filter, String status, String startDate, String endDate, String sort) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimesheets"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimesheets"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (filter != null) { + String key = "filter"; + Object value = filter; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (status != null) { + String key = "status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (sort != null) { + String key = "sort"; + Object value = sort; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves tracking categories + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return TrackingCategories + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingCategories getTrackingCategories(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTrackingCategoriesForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTrackingCategories -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TrackingCategories object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TrackingCategories",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves tracking categories + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTrackingCategoriesForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTrackingCategories"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTrackingCategories"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings/TrackingCategories"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Reverts a timesheet to draft + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject revertTimesheet(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = revertTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : revertTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Reverts a timesheet to draft + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse revertTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling revertTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling revertTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling revertTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/RevertToDraft"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates an existing employee + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeObject updateEmployee(String accessToken, String xeroTenantId, UUID employeeID, Employee employee, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID, employee, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates an existing employee + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, Employee employee, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployee"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployee"); + }// verify the required parameter 'employee' is set + if (employee == null) { + throw new IllegalArgumentException("Missing the required parameter 'employee' when calling updateEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employee); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates an earnings template records for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsTemplateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsTemplateObject updateEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, payTemplateEarningID, earningsTemplate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsTemplateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsTemplateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates an earnings template records for an employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeEarningsTemplate"); + }// verify the required parameter 'payTemplateEarningID' is set + if (payTemplateEarningID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payTemplateEarningID' when calling updateEmployeeEarningsTemplate"); + }// verify the required parameter 'earningsTemplate' is set + if (earningsTemplate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsTemplate' when calling updateEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("PayTemplateEarningID", payTemplateEarningID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsTemplate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates leave records for a specific employee + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject updateEmployeeLeave(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID, employeeLeave, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates leave records for a specific employee + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeLeave"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeLeave"); + }// verify the required parameter 'leaveID' is set + if (leaveID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveID' when calling updateEmployeeLeave"); + }// verify the required parameter 'employeeLeave' is set + if (employeeLeave == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeLeave' when calling updateEmployeeLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("LeaveID", leaveID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeLeave); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates an employee's salary and wages record + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWageObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWageObject updateEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWagesID, salaryAndWage, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWageObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWageObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates an employee's salary and wages record + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWagesID' is set + if (salaryAndWagesID == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWagesID' when calling updateEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWage' is set + if (salaryAndWage == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWage' when calling updateEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("SalaryAndWagesID", salaryAndWagesID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(salaryAndWage); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates the tax records for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeTax The employeeTax parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeTaxObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeTaxObject updateEmployeeTax(String accessToken, String xeroTenantId, UUID employeeID, EmployeeTax employeeTax, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeTaxForHttpResponse(accessToken, xeroTenantId, employeeID, employeeTax, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeTax -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeTaxObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeTaxObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates the tax records for a specific employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeTax The employeeTax parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeTaxForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeTax employeeTax, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeTax"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeTax"); + }// verify the required parameter 'employeeTax' is set + if (employeeTax == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeTax' when calling updateEmployeeTax"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeTax"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Tax"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeTax); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a pay run + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayRunObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunObject updatePayRun(String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePayRunForHttpResponse(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a pay run + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updatePayRunForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePayRun"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling updatePayRun"); + }// verify the required parameter 'payRun' is set + if (payRun == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRun' when calling updatePayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayRunID", payRunID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payRun); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an employee pay slip + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param paySlipID Identifier for the payslip + * @param paySlip The paySlip parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PaySlipObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaySlipObject updatePaySlipLineItems(String accessToken, String xeroTenantId, UUID paySlipID, PaySlip paySlip, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePaySlipLineItemsForHttpResponse(accessToken, xeroTenantId, paySlipID, paySlip, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePaySlipLineItems -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PaySlipObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PaySlipObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an employee pay slip + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param paySlipID Identifier for the payslip + * @param paySlip The paySlip parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updatePaySlipLineItemsForHttpResponse(String accessToken, String xeroTenantId, UUID paySlipID, PaySlip paySlip, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePaySlipLineItems"); + }// verify the required parameter 'paySlipID' is set + if (paySlipID == null) { + throw new IllegalArgumentException("Missing the required parameter 'paySlipID' when calling updatePaySlipLineItems"); + }// verify the required parameter 'paySlip' is set + if (paySlip == null) { + throw new IllegalArgumentException("Missing the required parameter 'paySlip' when calling updatePaySlipLineItems"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePaySlipLineItems"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PaySlipID", paySlipID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PaySlips/{PaySlipID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(paySlip); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a timesheet line for a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLineObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLineObject updateTimesheetLine(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateTimesheetLineForHttpResponse(accessToken, xeroTenantId, timesheetID, timesheetLineID, timesheetLine, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTimesheetLine -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetLineObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetLineObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a timesheet line for a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTimesheetLineForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTimesheetLine"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling updateTimesheetLine"); + }// verify the required parameter 'timesheetLineID' is set + if (timesheetLineID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLineID' when calling updateTimesheetLine"); + }// verify the required parameter 'timesheetLine' is set + if (timesheetLine == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLine' when calling updateTimesheetLine"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTimesheetLine"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + uriVariables.put("TimesheetLineID", timesheetLineID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheetLine); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + + } } diff --git a/src/main/java/com/xero/api/client/PayrollUkApi.java b/src/main/java/com/xero/api/client/PayrollUkApi.java index 2715e9bdd..be568023e 100644 --- a/src/main/java/com/xero/api/client/PayrollUkApi.java +++ b/src/main/java/com/xero/api/client/PayrollUkApi.java @@ -9,22 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpTransport; import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; + import com.xero.models.payrolluk.Benefit; import com.xero.models.payrolluk.BenefitObject; import com.xero.models.payrolluk.Benefits; @@ -63,6 +52,7 @@ import com.xero.models.payrolluk.LeaveType; import com.xero.models.payrolluk.LeaveTypeObject; import com.xero.models.payrolluk.LeaveTypes; +import org.threeten.bp.LocalDate; import com.xero.models.payrolluk.PayRun; import com.xero.models.payrolluk.PayRunCalendar; import com.xero.models.payrolluk.PayRunCalendarObject; @@ -73,6 +63,7 @@ import com.xero.models.payrolluk.PaymentMethodObject; import com.xero.models.payrolluk.PayslipObject; import com.xero.models.payrolluk.Payslips; +import com.xero.models.payrolluk.Problem; import com.xero.models.payrolluk.Reimbursement; import com.xero.models.payrolluk.ReimbursementObject; import com.xero.models.payrolluk.Reimbursements; @@ -86,8042 +77,6284 @@ import com.xero.models.payrolluk.TimesheetObject; import com.xero.models.payrolluk.Timesheets; import com.xero.models.payrolluk.TrackingCategories; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.ByteArrayContent; +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpContent; +import com.google.api.client.http.HttpMethods; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpResponseException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; +import java.util.List; + import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; + import org.slf4j.LoggerFactory; -import org.threeten.bp.LocalDate; +import org.slf4j.Logger; + -/** PayrollUkApi has methods for interacting with all endpoints in the API set */ +/** PayrollUkApi has methods for interacting with all endpoints in the API set */ public class PayrollUkApi { - private ApiClient apiClient; - private static PayrollUkApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(PayrollUkApi.class); - - /** PayrollUkApi */ - public PayrollUkApi() { - this(new ApiClient()); - } - - /** - * PayrollUkApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static PayrollUkApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new PayrollUkApi(apiClient); - } - return instance; - } - - /** - * PayrollUkApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public PayrollUkApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Approves a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject approveTimesheet( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - approveTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : approveTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Approves a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse approveTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling approveTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling approveTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling approveTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Approve"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new employee benefit - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param benefit The benefit parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return BenefitObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BenefitObject createBenefit( - String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createBenefitForHttpResponse(accessToken, xeroTenantId, benefit, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createBenefit -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - BenefitObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "BenefitObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new employee benefit - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param benefit The benefit parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createBenefitForHttpResponse( - String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createBenefit"); - } // verify the required parameter 'benefit' is set - if (benefit == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'benefit' when calling createBenefit"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createBenefit"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Benefits"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(benefit); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new deduction - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param deduction The deduction parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return DeductionObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public DeductionObject createDeduction( - String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createDeductionForHttpResponse(accessToken, xeroTenantId, deduction, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createDeduction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - DeductionObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "DeductionObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new deduction - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param deduction The deduction parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createDeductionForHttpResponse( - String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createDeduction"); - } // verify the required parameter 'deduction' is set - if (deduction == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'deduction' when calling createDeduction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createDeduction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(deduction); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new earnings rate - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRate The earningsRate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsRateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsRateObject createEarningsRate( - String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEarningsRateForHttpResponse( - accessToken, xeroTenantId, earningsRate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEarningsRate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EarningsRateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsRateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new earnings rate - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRate The earningsRate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEarningsRateForHttpResponse( - String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEarningsRate"); - } // verify the required parameter 'earningsRate' is set - if (earningsRate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsRate' when calling createEarningsRate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEarningsRate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsRate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeObject createEmployee( - String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeeForHttpResponse(accessToken, xeroTenantId, employee, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeForHttpResponse( - String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployee"); - } // verify the required parameter 'employee' is set - if (employee == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employee' when calling createEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employee); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an earnings template records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsTemplateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsTemplateObject createEmployeeEarningsTemplate( - String accessToken, - String xeroTenantId, - UUID employeeID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeEarningsTemplateForHttpResponse( - accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EarningsTemplateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EarningsTemplateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an earnings template records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeEarningsTemplateForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " createEmployeeEarningsTemplate"); - } // verify the required parameter 'earningsTemplate' is set - if (earningsTemplate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsTemplate' when calling" - + " createEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/earnings"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsTemplate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates leave records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject createEmployeeLeave( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeeLeaveForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeLeave, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates leave records for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeLeaveForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeeLeave"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeLeave"); - } // verify the required parameter 'employeeLeave' is set - if (employeeLeave == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeLeave' when calling createEmployeeLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeLeave); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates employee leave type records - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeaveType The employeeLeaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveTypeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveTypeObject createEmployeeLeaveType( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeaveType employeeLeaveType, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeLeaveTypeForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeLeaveType, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeLeaveType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveTypeObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeLeaveTypeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates employee leave type records - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeLeaveType The employeeLeaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeLeaveTypeForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeLeaveType employeeLeaveType, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeeLeaveType"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeLeaveType"); - } // verify the required parameter 'employeeLeaveType' is set - if (employeeLeaveType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeLeaveType' when calling" - + " createEmployeeLeaveType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeLeaveType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeLeaveType); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an opening balance for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeOpeningBalances The employeeOpeningBalances parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeOpeningBalancesObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeOpeningBalancesObject createEmployeeOpeningBalances( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeOpeningBalances employeeOpeningBalances, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeOpeningBalancesForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeOpeningBalances, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeOpeningBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeOpeningBalancesObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeOpeningBalancesObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an opening balance for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeOpeningBalances The employeeOpeningBalances parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeOpeningBalancesForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeOpeningBalances employeeOpeningBalances, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createEmployeeOpeningBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeOpeningBalances"); - } // verify the required parameter 'employeeOpeningBalances' is set - if (employeeOpeningBalances == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeOpeningBalances' when calling" - + " createEmployeeOpeningBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createEmployeeOpeningBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/ukopeningbalances"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeOpeningBalances); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates an employee payment method - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param paymentMethod The paymentMethod parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PaymentMethodObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentMethodObject createEmployeePaymentMethod( - String accessToken, - String xeroTenantId, - UUID employeeID, - PaymentMethod paymentMethod, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeePaymentMethodForHttpResponse( - accessToken, xeroTenantId, employeeID, paymentMethod, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeePaymentMethod -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PaymentMethodObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PaymentMethodObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates an employee payment method - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param paymentMethod The paymentMethod parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeePaymentMethodForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - PaymentMethod paymentMethod, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeePaymentMethod"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeePaymentMethod"); - } // verify the required parameter 'paymentMethod' is set - if (paymentMethod == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'paymentMethod' when calling" - + " createEmployeePaymentMethod"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeePaymentMethod"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(paymentMethod); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a salary and wage record for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWageObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWageObject createEmployeeSalaryAndWage( - String accessToken, - String xeroTenantId, - UUID employeeID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmployeeSalaryAndWageForHttpResponse( - accessToken, xeroTenantId, employeeID, salaryAndWage, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - SalaryAndWageObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWageObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a salary and wage record for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeSalaryAndWageForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWage' is set - if (salaryAndWage == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWage' when calling" - + " createEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(salaryAndWage); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates statutory sick leave records - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeStatutorySickLeave The employeeStatutorySickLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeStatutorySickLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeStatutorySickLeaveObject createEmployeeStatutorySickLeave( - String accessToken, - String xeroTenantId, - EmployeeStatutorySickLeave employeeStatutorySickLeave, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - createEmployeeStatutorySickLeaveForHttpResponse( - accessToken, xeroTenantId, employeeStatutorySickLeave, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployeeStatutorySickLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeStatutorySickLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeStatutorySickLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates statutory sick leave records - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeStatutorySickLeave The employeeStatutorySickLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmployeeStatutorySickLeaveForHttpResponse( - String accessToken, - String xeroTenantId, - EmployeeStatutorySickLeave employeeStatutorySickLeave, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createEmployeeStatutorySickLeave"); - } // verify the required parameter 'employeeStatutorySickLeave' is set - if (employeeStatutorySickLeave == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeStatutorySickLeave' when calling" - + " createEmployeeStatutorySickLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createEmployeeStatutorySickLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryLeaves/Sick"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeStatutorySickLeave); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates employment detail for a specific employee using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employment The employment parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmploymentObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmploymentObject createEmployment( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employment employment, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createEmploymentForHttpResponse( - accessToken, xeroTenantId, employeeID, employment, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createEmployment -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmploymentObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmploymentObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates employment detail for a specific employee using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employment The employment parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createEmploymentForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employment employment, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createEmployment"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling createEmployment"); - } // verify the required parameter 'employment' is set - if (employment == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employment' when calling createEmployment"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createEmployment"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Employment"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employment); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new leave type - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveType The leaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveTypeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveTypeObject createLeaveType( - String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveType, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createLeaveType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeaveTypeObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeaveTypeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new leave type - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveType The leaveType parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createLeaveTypeForHttpResponse( - String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createLeaveType"); - } // verify the required parameter 'leaveType' is set - if (leaveType == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveType' when calling createLeaveType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createLeaveType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(leaveType); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates multiple earnings template records for a specific employee using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeePayTemplates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeePayTemplates createMultipleEmployeeEarningsTemplate( - String accessToken, - String xeroTenantId, - UUID employeeID, - List earningsTemplate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createMultipleEmployeeEarningsTemplateForHttpResponse( - accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createMultipleEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeePayTemplates object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeePayTemplates", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates multiple earnings template records for a specific employee using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createMultipleEmployeeEarningsTemplateForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - List earningsTemplate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } // verify the required parameter 'earningsTemplate' is set - if (earningsTemplate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsTemplate' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " createMultipleEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/paytemplateearnings"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsTemplate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new payrun calendar - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunCalendar The payRunCalendar parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayRunCalendarObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunCalendarObject createPayRunCalendar( - String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createPayRunCalendarForHttpResponse( - accessToken, xeroTenantId, payRunCalendar, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createPayRunCalendar -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PayRunCalendarObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunCalendarObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new payrun calendar - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunCalendar The payRunCalendar parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createPayRunCalendarForHttpResponse( - String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createPayRunCalendar"); - } // verify the required parameter 'payRunCalendar' is set - if (payRunCalendar == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunCalendar' when calling createPayRunCalendar"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createPayRunCalendar"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payRunCalendar); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new reimbursement - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursement The reimbursement parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return ReimbursementObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReimbursementObject createReimbursement( - String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createReimbursementForHttpResponse( - accessToken, xeroTenantId, reimbursement, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createReimbursement -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - ReimbursementObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "ReimbursementObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new reimbursement - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursement The reimbursement parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createReimbursementForHttpResponse( - String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createReimbursement"); - } // verify the required parameter 'reimbursement' is set - if (reimbursement == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'reimbursement' when calling createReimbursement"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createReimbursement"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(reimbursement); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject createTimesheet( - String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTimesheetForHttpResponse(accessToken, xeroTenantId, timesheet, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheet The timesheet parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTimesheetForHttpResponse( - String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTimesheet"); - } // verify the required parameter 'timesheet' is set - if (timesheet == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheet' when calling createTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheet); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a new timesheet line for a specific timesheet using a unique timesheet ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLineObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLineObject createTimesheetLine( - String accessToken, - String xeroTenantId, - UUID timesheetID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTimesheetLineForHttpResponse( - accessToken, xeroTenantId, timesheetID, timesheetLine, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTimesheetLine -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - TimesheetLineObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetLineObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a new timesheet line for a specific timesheet using a unique timesheet ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTimesheetLineForHttpResponse( - String accessToken, - String xeroTenantId, - UUID timesheetID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTimesheetLine"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling createTimesheetLine"); - } // verify the required parameter 'timesheetLine' is set - if (timesheetLine == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLine' when calling createTimesheetLine"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTimesheetLine"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheetLine); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific employee's earnings template record - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteEmployeeEarningsTemplate( - String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) - throws IOException { - try { - deleteEmployeeEarningsTemplateForHttpResponse( - accessToken, xeroTenantId, employeeID, payTemplateEarningID); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a specific employee's earnings template record - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteEmployeeEarningsTemplateForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " deleteEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " deleteEmployeeEarningsTemplate"); - } // verify the required parameter 'payTemplateEarningID' is set - if (payTemplateEarningID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payTemplateEarningID' when calling" - + " deleteEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " deleteEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept(""); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("PayTemplateEarningID", payTemplateEarningID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific employee's leave record - * - *

200 - successful response - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject deleteEmployeeLeave( - String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteEmployeeLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a specific employee's leave record - * - *

200 - successful response - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteEmployeeLeaveForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteEmployeeLeave"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling deleteEmployeeLeave"); - } // verify the required parameter 'leaveID' is set - if (leaveID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveID' when calling deleteEmployeeLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteEmployeeLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("LeaveID", leaveID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a salary and wages record for a specific employee - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single salary and wages object - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteEmployeeSalaryAndWage( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - try { - deleteEmployeeSalaryAndWageForHttpResponse( - accessToken, xeroTenantId, employeeID, salaryAndWagesID); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a salary and wages record for a specific employee - * - *

200 - deletion successful - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single salary and wages object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteEmployeeSalaryAndWageForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling deleteEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWagesID' is set - if (salaryAndWagesID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWagesID' when calling" - + " deleteEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept(""); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("SalaryAndWagesID", salaryAndWagesID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLine - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLine deleteTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling deleteTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a specific timesheet line - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLine - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLine deleteTimesheetLine( - String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - deleteTimesheetLineForHttpResponse( - accessToken, xeroTenantId, timesheetID, timesheetLineID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTimesheetLine -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Deletes a specific timesheet line - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTimesheetLineForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTimesheetLine"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling deleteTimesheetLine"); - } // verify the required parameter 'timesheetLineID' is set - if (timesheetLineID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLineID' when calling deleteTimesheetLine"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTimesheetLine"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - uriVariables.put("TimesheetLineID", timesheetLineID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific benefit by using a unique benefit ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Identifier for the benefit - * @param accessToken Authorization token for user set in header of each request - * @return BenefitObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public BenefitObject getBenefit(String accessToken, String xeroTenantId, UUID id) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getBenefitForHttpResponse(accessToken, xeroTenantId, id); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBenefit -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - BenefitObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "BenefitObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific benefit by using a unique benefit ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Identifier for the benefit - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBenefitForHttpResponse(String accessToken, String xeroTenantId, UUID id) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBenefit"); - } // verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'id' when calling getBenefit"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBenefit"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("id", id); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Benefits/{id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves employee benefits - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Benefits - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Benefits getBenefits(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getBenefitsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getBenefits -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Benefits object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Benefits", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves employee benefits - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getBenefitsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getBenefits"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getBenefits"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Benefits"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific deduction by using a unique deduction ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param deductionId Identifier for the deduction - * @param accessToken Authorization token for user set in header of each request - * @return DeductionObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public DeductionObject getDeduction(String accessToken, String xeroTenantId, UUID deductionId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getDeductionForHttpResponse(accessToken, xeroTenantId, deductionId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getDeduction -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - DeductionObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "DeductionObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific deduction by using a unique deduction ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param deductionId Identifier for the deduction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getDeductionForHttpResponse( - String accessToken, String xeroTenantId, UUID deductionId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getDeduction"); - } // verify the required parameter 'deductionId' is set - if (deductionId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'deductionId' when calling getDeduction"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getDeduction"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("deductionId", deductionId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions/{deductionId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves deductions - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Deductions - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Deductions getDeductions(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getDeductionsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getDeductions -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Deductions object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Deductions", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves deductions - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getDeductionsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getDeductions"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getDeductions"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific earnings orders by using a unique earnings orders id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Identifier for the deduction - * @param accessToken Authorization token for user set in header of each request - * @return EarningsOrderObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsOrderObject getEarningsOrder(String accessToken, String xeroTenantId, UUID id) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEarningsOrderForHttpResponse(accessToken, xeroTenantId, id); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEarningsOrder -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EarningsOrderObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsOrderObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific earnings orders by using a unique earnings orders id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param id Identifier for the deduction - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEarningsOrderForHttpResponse( - String accessToken, String xeroTenantId, UUID id) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEarningsOrder"); - } // verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'id' when calling getEarningsOrder"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEarningsOrder"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("id", id); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsOrders/{id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves earnings orders - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsOrders - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsOrders getEarningsOrders(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEarningsOrdersForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEarningsOrders -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EarningsOrders object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsOrders", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves earnings orders - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEarningsOrdersForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEarningsOrders"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEarningsOrders"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsOrders"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific earnings rates by using a unique earnings rate id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRateID Identifier for the earnings rate - * @param accessToken Authorization token for user set in header of each request - * @return EarningsRateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsRateObject getEarningsRate( - String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEarningsRateForHttpResponse(accessToken, xeroTenantId, earningsRateID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEarningsRate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EarningsRateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsRateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific earnings rates by using a unique earnings rate id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param earningsRateID Identifier for the earnings rate - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEarningsRateForHttpResponse( - String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEarningsRate"); - } // verify the required parameter 'earningsRateID' is set - if (earningsRateID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsRateID' when calling getEarningsRate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEarningsRate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EarningsRateID", earningsRateID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates/{EarningsRateID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves earnings rates - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsRates - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsRates getEarningsRates(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEarningsRatesForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEarningsRates -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EarningsRates object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EarningsRates", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves earnings rates - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEarningsRatesForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEarningsRates"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEarningsRates"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves specific employees by using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeObject getEmployee(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves specific employees by using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployee"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's leave record using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject getEmployeeLeave( - String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's leave record using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeaveForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeave"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeave"); - } // verify the required parameter 'leaveID' is set - if (leaveID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveID' when calling getEmployeeLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("LeaveID", leaveID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's leave balances using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveBalances - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveBalances getEmployeeLeaveBalances( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeaveBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeaveBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveBalances object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveBalances", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's leave balances using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeaveBalancesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeaveBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeaveBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveBalances"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's leave periods using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param startDate Filter by start date - * @param endDate Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return LeavePeriods - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeavePeriods getEmployeeLeavePeriods( - String accessToken, - String xeroTenantId, - UUID employeeID, - LocalDate startDate, - LocalDate endDate) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeavePeriodsForHttpResponse( - accessToken, xeroTenantId, employeeID, startDate, endDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeavePeriods -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeavePeriods object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeavePeriods", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's leave periods using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param startDate Filter by start date - * @param endDate Filter by end date - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeavePeriodsForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - LocalDate startDate, - LocalDate endDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeavePeriods"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeavePeriods"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeavePeriods"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeavePeriods"); - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's leave types using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveTypes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveTypes getEmployeeLeaveTypes( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeaveTypesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeaveTypes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeLeaveTypes object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveTypes", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's leave types using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeaveTypesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveTypes"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeaveTypes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeaveTypes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's leave records using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaves - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaves getEmployeeLeaves(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeLeavesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeLeaves -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeLeaves object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaves", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's leave records using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeLeavesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaves"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeLeaves"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeLeaves"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's openingbalances using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeOpeningBalancesObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeOpeningBalancesObject getEmployeeOpeningBalances( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getEmployeeOpeningBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeOpeningBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeOpeningBalancesObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeOpeningBalancesObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's openingbalances using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeOpeningBalancesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeOpeningBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeOpeningBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeOpeningBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/ukopeningbalances"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee pay templates using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeePayTemplateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeePayTemplateObject getEmployeePayTemplate( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getEmployeePayTemplateForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeePayTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeePayTemplateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeePayTemplateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee pay templates using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeePayTemplateForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeePayTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeePayTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeePayTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's payment method using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return PaymentMethodObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PaymentMethodObject getEmployeePaymentMethod( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeePaymentMethodForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeePaymentMethod -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PaymentMethodObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PaymentMethodObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's payment method using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeePaymentMethodForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeePaymentMethod"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeePaymentMethod"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeePaymentMethod"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific salary and wages record for a specific employee using a unique salary and - * wage id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWages - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWages getEmployeeSalaryAndWage( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeSalaryAndWageForHttpResponse( - accessToken, xeroTenantId, employeeID, salaryAndWagesID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWages", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific salary and wages record for a specific employee using a unique salary and - * wage id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeSalaryAndWageForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWagesID' is set - if (salaryAndWagesID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWagesID' when calling" - + " getEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("SalaryAndWagesID", salaryAndWagesID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's salary and wages by using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWages - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWages getEmployeeSalaryAndWages( - String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getEmployeeSalaryAndWagesForHttpResponse(accessToken, xeroTenantId, employeeID, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeSalaryAndWages -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWages", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's salary and wages by using a unique employee ID - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeSalaryAndWagesForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWages"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWages"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWages"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's leave balances using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveType Filter by the type of statutory leave - * @param asOfDate The date from which to calculate balance remaining. If not specified, current - * date UTC is used. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeStatutoryLeaveBalanceObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeStatutoryLeaveBalanceObject getEmployeeStatutoryLeaveBalances( - String accessToken, - String xeroTenantId, - UUID employeeID, - String leaveType, - LocalDate asOfDate) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getEmployeeStatutoryLeaveBalancesForHttpResponse( - accessToken, xeroTenantId, employeeID, leaveType, asOfDate); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeStatutoryLeaveBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeStatutoryLeaveBalanceObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeStatutoryLeaveBalanceObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's leave balances using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveType Filter by the type of statutory leave - * @param asOfDate The date from which to calculate balance remaining. If not specified, current - * date UTC is used. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeStatutoryLeaveBalancesForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - String leaveType, - LocalDate asOfDate) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getEmployeeStatutoryLeaveBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " getEmployeeStatutoryLeaveBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getEmployeeStatutoryLeaveBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/StatutoryLeaveBalance"); - if (leaveType != null) { - String key = "LeaveType"; - Object value = leaveType; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (asOfDate != null) { - String key = "AsOfDate"; - Object value = asOfDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a statutory sick leave for an employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param statutorySickLeaveID Statutory sick leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeStatutorySickLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeStatutorySickLeaveObject getEmployeeStatutorySickLeave( - String accessToken, String xeroTenantId, UUID statutorySickLeaveID) throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getEmployeeStatutorySickLeaveForHttpResponse( - accessToken, xeroTenantId, statutorySickLeaveID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeStatutorySickLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeStatutorySickLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeStatutorySickLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a statutory sick leave for an employee - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param statutorySickLeaveID Statutory sick leave id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeStatutorySickLeaveForHttpResponse( - String accessToken, String xeroTenantId, UUID statutorySickLeaveID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " getEmployeeStatutorySickLeave"); - } // verify the required parameter 'statutorySickLeaveID' is set - if (statutorySickLeaveID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'statutorySickLeaveID' when calling" - + " getEmployeeStatutorySickLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " getEmployeeStatutorySickLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("StatutorySickLeaveID", statutorySickLeaveID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/StatutoryLeaves/Sick/{StatutorySickLeaveID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves tax records for a specific employee using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeTaxObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeTaxObject getEmployeeTax(String accessToken, String xeroTenantId, UUID employeeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeeTaxForHttpResponse(accessToken, xeroTenantId, employeeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployeeTax -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeTaxObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeTaxObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves tax records for a specific employee using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeeTaxForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployeeTax"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getEmployeeTax"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployeeTax"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Tax"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param filter Filter by first name, lastname, and/or whether they are an off-payroll worker - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Employees - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Employees getEmployees( - String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getEmployeesForHttpResponse(accessToken, xeroTenantId, filter, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getEmployees -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Employees object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Employees", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves employees - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param filter Filter by first name, lastname, and/or whether they are an off-payroll worker - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getEmployeesForHttpResponse( - String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getEmployees"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getEmployees"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); - if (filter != null) { - String key = "filter"; - Object value = filter; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific leave type by using a unique leave type ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveTypeID Identifier for the leave type - * @param accessToken Authorization token for user set in header of each request - * @return LeaveTypeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveTypeObject getLeaveType(String accessToken, String xeroTenantId, UUID leaveTypeID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveTypeID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLeaveType -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeaveTypeObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeaveTypeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific leave type by using a unique leave type ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param leaveTypeID Identifier for the leave type - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLeaveTypeForHttpResponse( - String accessToken, String xeroTenantId, UUID leaveTypeID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLeaveType"); - } // verify the required parameter 'leaveTypeID' is set - if (leaveTypeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveTypeID' when calling getLeaveType"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLeaveType"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("LeaveTypeID", leaveTypeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes/{LeaveTypeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves leave types - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param activeOnly Filters leave types by active status. By default the API returns all leave - * types. - * @param accessToken Authorization token for user set in header of each request - * @return LeaveTypes - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public LeaveTypes getLeaveTypes( - String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getLeaveTypesForHttpResponse(accessToken, xeroTenantId, page, activeOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getLeaveTypes -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - LeaveTypes object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "LeaveTypes", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves leave types - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param activeOnly Filters leave types by active status. By default the API returns all leave - * types. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getLeaveTypesForHttpResponse( - String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getLeaveTypes"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getLeaveTypes"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (activeOnly != null) { - String key = "ActiveOnly"; - Object value = activeOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific pay run by using a unique pay run ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param accessToken Authorization token for user set in header of each request - * @return PayRunObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunObject getPayRun(String accessToken, String xeroTenantId, UUID payRunID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayRunForHttpResponse(accessToken, xeroTenantId, payRunID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific pay run by using a unique pay run ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRun"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling getPayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayRunID", payRunID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific payrun calendar by using a unique payrun calendar ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunCalendarID Identifier for the payrun calendars - * @param accessToken Authorization token for user set in header of each request - * @return PayRunCalendarObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunCalendarObject getPayRunCalendar( - String accessToken, String xeroTenantId, UUID payRunCalendarID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getPayRunCalendarForHttpResponse(accessToken, xeroTenantId, payRunCalendarID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRunCalendar -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - PayRunCalendarObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunCalendarObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific payrun calendar by using a unique payrun calendar ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunCalendarID Identifier for the payrun calendars - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunCalendarForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunCalendarID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRunCalendar"); - } // verify the required parameter 'payRunCalendarID' is set - if (payRunCalendarID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunCalendarID' when calling getPayRunCalendar"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRunCalendar"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayRunCalendarID", payRunCalendarID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars/{PayRunCalendarID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payrun calendars - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return PayRunCalendars - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunCalendars getPayRunCalendars(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayRunCalendarsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRunCalendars -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRunCalendars object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunCalendars", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payrun calendars - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunCalendarsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRunCalendars"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRunCalendars"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves pay runs - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param status By default get payruns will return all the payruns for an organization. You can - * add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter - * the payruns by status. - * @param accessToken Authorization token for user set in header of each request - * @return PayRuns - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRuns getPayRuns(String accessToken, String xeroTenantId, Integer page, String status) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPayRunsForHttpResponse(accessToken, xeroTenantId, page, status); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPayRuns -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRuns object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRuns", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves pay runs - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param status By default get payruns will return all the payruns for an organization. You can - * add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter - * the payruns by status. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPayRunsForHttpResponse( - String accessToken, String xeroTenantId, Integer page, String status) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPayRuns"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPayRuns"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (status != null) { - String key = "status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific payslip by using a unique payslip ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payslipID Identifier for the payslip - * @param accessToken Authorization token for user set in header of each request - * @return PayslipObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayslipObject getPaySlip(String accessToken, String xeroTenantId, UUID payslipID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPaySlipForHttpResponse(accessToken, xeroTenantId, payslipID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPaySlip -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayslipObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayslipObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific payslip by using a unique payslip ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payslipID Identifier for the payslip - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaySlipForHttpResponse( - String accessToken, String xeroTenantId, UUID payslipID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPaySlip"); - } // verify the required parameter 'payslipID' is set - if (payslipID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payslipID' when calling getPaySlip"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPaySlip"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayslipID", payslipID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslips/{PayslipID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payslips - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By - * default, the API does not group payslips by payrun. - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Payslips - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Payslips getPaySlips(String accessToken, String xeroTenantId, UUID payRunID, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getPaySlipsForHttpResponse(accessToken, xeroTenantId, payRunID, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getPaySlips -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Payslips object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Payslips", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payslips - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By - * default, the API does not group payslips by payrun. - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getPaySlipsForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunID, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getPaySlips"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling getPaySlips"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getPaySlips"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslips"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (payRunID != null) { - String key = "PayRunID"; - Object value = payRunID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific reimbursement by using a unique reimbursement id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursementID Identifier for the reimbursement - * @param accessToken Authorization token for user set in header of each request - * @return ReimbursementObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ReimbursementObject getReimbursement( - String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getReimbursementForHttpResponse(accessToken, xeroTenantId, reimbursementID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReimbursement -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - ReimbursementObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "ReimbursementObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific reimbursement by using a unique reimbursement id - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param reimbursementID Identifier for the reimbursement - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReimbursementForHttpResponse( - String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReimbursement"); - } // verify the required parameter 'reimbursementID' is set - if (reimbursementID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'reimbursementID' when calling getReimbursement"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReimbursement"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("ReimbursementID", reimbursementID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements/{ReimbursementID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves reimbursements - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return Reimbursements - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Reimbursements getReimbursements(String accessToken, String xeroTenantId, Integer page) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getReimbursementsForHttpResponse(accessToken, xeroTenantId, page); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getReimbursements -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Reimbursements object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Reimbursements", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves reimbursements - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getReimbursementsForHttpResponse( - String accessToken, String xeroTenantId, Integer page) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getReimbursements"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getReimbursements"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves payroll settings - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return Settings - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Settings getSettings(String accessToken, String xeroTenantId) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getSettingsForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getSettings -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Settings object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Settings", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves payroll settings - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getSettingsForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getSettings"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getSettings"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a specific employee's summary of statutory leaves using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param activeOnly Filter response with leaves that are currently active or yet to be taken. If - * not specified, all leaves (past, current, and future scheduled) are returned - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeStatutoryLeavesSummaries - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeStatutoryLeavesSummaries getStatutoryLeaveSummary( - String accessToken, String xeroTenantId, UUID employeeID, Boolean activeOnly) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - getStatutoryLeaveSummaryForHttpResponse( - accessToken, xeroTenantId, employeeID, activeOnly); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getStatutoryLeaveSummary -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeStatutoryLeavesSummaries object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeStatutoryLeavesSummaries", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a specific employee's summary of statutory leaves using a unique employee ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param activeOnly Filter response with leaves that are currently active or yet to be taken. If - * not specified, all leaves (past, current, and future scheduled) are returned - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getStatutoryLeaveSummaryForHttpResponse( - String accessToken, String xeroTenantId, UUID employeeID, Boolean activeOnly) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getStatutoryLeaveSummary"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling getStatutoryLeaveSummary"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getStatutoryLeaveSummary"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryLeaves/Summary/{EmployeeID}"); - if (activeOnly != null) { - String key = "activeOnly"; - Object value = activeOnly; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieve a specific timesheet by using a unique timesheet ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject getTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieve a specific timesheet by using a unique timesheet ID - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling getTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves timesheets - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param filter Filter by employeeId and/or payrollCalendarId - * @param status filter results by any timesheets with a matching timesheet status - * @param startDate filter results by any timesheets with a startDate on or after the provided - * date - * @param endDate filter results by any timesheets with a endDate on or before the provided date - * @param sort sort the order of timesheets returned. The default is based on the timesheets - * createdDate, sorted oldest to newest. Currently, the only other option is to reverse the - * order based on the timesheets startDate, sorted newest to oldest. - * @param accessToken Authorization token for user set in header of each request - * @return Timesheets - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Timesheets getTimesheets( - String accessToken, - String xeroTenantId, - Integer page, - String filter, - String status, - String startDate, - String endDate, - String sort) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTimesheetsForHttpResponse( - accessToken, xeroTenantId, page, filter, status, startDate, endDate, sort); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimesheets -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - Timesheets object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "Timesheets", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves timesheets - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param page Page number which specifies the set of records to retrieve. By default the number - * of the records per set is 100. - * @param filter Filter by employeeId and/or payrollCalendarId - * @param status filter results by any timesheets with a matching timesheet status - * @param startDate filter results by any timesheets with a startDate on or after the provided - * date - * @param endDate filter results by any timesheets with a endDate on or before the provided date - * @param sort sort the order of timesheets returned. The default is based on the timesheets - * createdDate, sorted oldest to newest. Currently, the only other option is to reverse the - * order based on the timesheets startDate, sorted newest to oldest. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimesheetsForHttpResponse( - String accessToken, - String xeroTenantId, - Integer page, - String filter, - String status, - String startDate, - String endDate, - String sort) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimesheets"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimesheets"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (filter != null) { - String key = "filter"; - Object value = filter; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (status != null) { - String key = "status"; - Object value = status; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (startDate != null) { - String key = "startDate"; - Object value = startDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (endDate != null) { - String key = "endDate"; - Object value = endDate; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (sort != null) { - String key = "sort"; - Object value = sort; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves tracking categories - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return TrackingCategories - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TrackingCategories getTrackingCategories(String accessToken, String xeroTenantId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getTrackingCategoriesForHttpResponse(accessToken, xeroTenantId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTrackingCategories -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TrackingCategories object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TrackingCategories", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves tracking categories - * - *

200 - search results matching criteria - * - * @param xeroTenantId Xero identifier for Tenant - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTrackingCategoriesForHttpResponse(String accessToken, String xeroTenantId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTrackingCategories"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTrackingCategories"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Settings/trackingCategories"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Reverts a specific timesheet to draft - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetObject revertTimesheet( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - revertTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : revertTimesheet -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - TimesheetObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Reverts a specific timesheet to draft - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse revertTimesheetForHttpResponse( - String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling revertTimesheet"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling revertTimesheet"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling revertTimesheet"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/RevertToDraft"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific employee's detail - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeObject updateEmployee( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employee employee, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeForHttpResponse( - accessToken, xeroTenantId, employeeID, employee, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployee -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific employee's detail - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employee The employee parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - Employee employee, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployee"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployee"); - } // verify the required parameter 'employee' is set - if (employee == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employee' when calling updateEmployee"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployee"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employee); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific employee's earnings template records - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EarningsTemplateObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EarningsTemplateObject updateEmployeeEarningsTemplate( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID payTemplateEarningID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - updateEmployeeEarningsTemplateForHttpResponse( - accessToken, - xeroTenantId, - employeeID, - payTemplateEarningID, - earningsTemplate, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeEarningsTemplate -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EarningsTemplateObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EarningsTemplateObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific employee's earnings template records - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param payTemplateEarningID Id for single pay template earnings object - * @param earningsTemplate The earningsTemplate parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeEarningsTemplateForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID payTemplateEarningID, - EarningsTemplate earningsTemplate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateEmployeeEarningsTemplate"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling" - + " updateEmployeeEarningsTemplate"); - } // verify the required parameter 'payTemplateEarningID' is set - if (payTemplateEarningID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payTemplateEarningID' when calling" - + " updateEmployeeEarningsTemplate"); - } // verify the required parameter 'earningsTemplate' is set - if (earningsTemplate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'earningsTemplate' when calling" - + " updateEmployeeEarningsTemplate"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateEmployeeEarningsTemplate"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("PayTemplateEarningID", payTemplateEarningID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() - + "/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(earningsTemplate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific employee's leave records - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeLeaveObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeLeaveObject updateEmployeeLeave( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID leaveID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeLeaveForHttpResponse( - accessToken, xeroTenantId, employeeID, leaveID, employeeLeave, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeLeave -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeLeaveObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "EmployeeLeaveObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific employee's leave records - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param leaveID Leave id for single object - * @param employeeLeave The employeeLeave parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeLeaveForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID leaveID, - EmployeeLeave employeeLeave, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployeeLeave"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployeeLeave"); - } // verify the required parameter 'leaveID' is set - if (leaveID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'leaveID' when calling updateEmployeeLeave"); - } // verify the required parameter 'employeeLeave' is set - if (employeeLeave == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeLeave' when calling updateEmployeeLeave"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployeeLeave"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("LeaveID", leaveID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeLeave); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific employee's opening balances - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeOpeningBalances The employeeOpeningBalances parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return EmployeeOpeningBalancesObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public EmployeeOpeningBalancesObject updateEmployeeOpeningBalances( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeOpeningBalances employeeOpeningBalances, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = - new TypeReference() {}; - HttpResponse response = - updateEmployeeOpeningBalancesForHttpResponse( - accessToken, xeroTenantId, employeeID, employeeOpeningBalances, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeOpeningBalances -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - EmployeeOpeningBalancesObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError( - e.getStatusCode(), "EmployeeOpeningBalancesObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific employee's opening balances - * - *

200 - successful response - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param employeeOpeningBalances The employeeOpeningBalances parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeOpeningBalancesForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - EmployeeOpeningBalances employeeOpeningBalances, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling" - + " updateEmployeeOpeningBalances"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployeeOpeningBalances"); - } // verify the required parameter 'employeeOpeningBalances' is set - if (employeeOpeningBalances == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeOpeningBalances' when calling" - + " updateEmployeeOpeningBalances"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling" - + " updateEmployeeOpeningBalances"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/ukopeningbalances"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(employeeOpeningBalances); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates salary and wages record for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return SalaryAndWageObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public SalaryAndWageObject updateEmployeeSalaryAndWage( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID salaryAndWagesID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateEmployeeSalaryAndWageForHttpResponse( - accessToken, - xeroTenantId, - employeeID, - salaryAndWagesID, - salaryAndWage, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateEmployeeSalaryAndWage -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - SalaryAndWageObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "SalaryAndWageObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates salary and wages record for a specific employee - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param employeeID Employee id for single object - * @param salaryAndWagesID Id for single pay template earnings object - * @param salaryAndWage The salaryAndWage parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateEmployeeSalaryAndWageForHttpResponse( - String accessToken, - String xeroTenantId, - UUID employeeID, - UUID salaryAndWagesID, - SalaryAndWage salaryAndWage, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateEmployeeSalaryAndWage"); - } // verify the required parameter 'employeeID' is set - if (employeeID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'employeeID' when calling updateEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWagesID' is set - if (salaryAndWagesID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWagesID' when calling" - + " updateEmployeeSalaryAndWage"); - } // verify the required parameter 'salaryAndWage' is set - if (salaryAndWage == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'salaryAndWage' when calling" - + " updateEmployeeSalaryAndWage"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateEmployeeSalaryAndWage"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("EmployeeID", employeeID); - uriVariables.put("SalaryAndWagesID", salaryAndWagesID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(salaryAndWage); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific pay run - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return PayRunObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public PayRunObject updatePayRun( - String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updatePayRunForHttpResponse(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updatePayRun -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = new TypeReference() {}; - PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "PayRunObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific pay run - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param payRunID Identifier for the pay run - * @param payRun The payRun parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updatePayRunForHttpResponse( - String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updatePayRun"); - } // verify the required parameter 'payRunID' is set - if (payRunID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRunID' when calling updatePayRun"); - } // verify the required parameter 'payRun' is set - if (payRun == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'payRun' when calling updatePayRun"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updatePayRun"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("PayRunID", payRunID); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(payRun); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific timesheet line for a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimesheetLineObject - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimesheetLineObject updateTimesheetLine( - String accessToken, - String xeroTenantId, - UUID timesheetID, - UUID timesheetLineID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - updateTimesheetLineForHttpResponse( - accessToken, - xeroTenantId, - timesheetID, - timesheetLineID, - timesheetLine, - idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTimesheetLine -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { - TypeReference errorTypeRef = - new TypeReference() {}; - TimesheetLineObject object = - apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); - handler.validationError(e.getStatusCode(), "TimesheetLineObject", object.getProblem(), e); - } else { - handler.execute(e); - } - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Updates a specific timesheet line for a specific timesheet - * - *

200 - search results matching criteria - * - *

400 - validation error for a bad request - * - * @param xeroTenantId Xero identifier for Tenant - * @param timesheetID Identifier for the timesheet - * @param timesheetLineID Identifier for the timesheet line - * @param timesheetLine The timesheetLine parameter - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTimesheetLineForHttpResponse( - String accessToken, - String xeroTenantId, - UUID timesheetID, - UUID timesheetLineID, - TimesheetLine timesheetLine, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTimesheetLine"); - } // verify the required parameter 'timesheetID' is set - if (timesheetID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetID' when calling updateTimesheetLine"); - } // verify the required parameter 'timesheetLineID' is set - if (timesheetLineID == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLineID' when calling updateTimesheetLine"); - } // verify the required parameter 'timesheetLine' is set - if (timesheetLine == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timesheetLine' when calling updateTimesheetLine"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTimesheetLine"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("TimesheetID", timesheetID); - uriVariables.put("TimesheetLineID", timesheetLineID); - - UriBuilder uriBuilder = - UriBuilder.fromUri( - apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timesheetLine); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); - } - } + private ApiClient apiClient; + private static PayrollUkApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(PayrollUkApi.class); + + /** PayrollUkApi */ + public PayrollUkApi() { + this(new ApiClient()); + } + + /** PayrollUkApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static PayrollUkApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new PayrollUkApi(apiClient); + } + return instance; + } + + /** PayrollUkApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public PayrollUkApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * Approves a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject approveTimesheet(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = approveTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : approveTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Approves a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse approveTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling approveTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling approveTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling approveTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Approve"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new employee benefit + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param benefit The benefit parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return BenefitObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BenefitObject createBenefit(String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createBenefitForHttpResponse(accessToken, xeroTenantId, benefit, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createBenefit -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + BenefitObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"BenefitObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new employee benefit + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param benefit The benefit parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createBenefitForHttpResponse(String accessToken, String xeroTenantId, Benefit benefit, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createBenefit"); + }// verify the required parameter 'benefit' is set + if (benefit == null) { + throw new IllegalArgumentException("Missing the required parameter 'benefit' when calling createBenefit"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createBenefit"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Benefits"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(benefit); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new deduction + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param deduction The deduction parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return DeductionObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public DeductionObject createDeduction(String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createDeductionForHttpResponse(accessToken, xeroTenantId, deduction, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createDeduction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + DeductionObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"DeductionObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new deduction + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param deduction The deduction parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createDeductionForHttpResponse(String accessToken, String xeroTenantId, Deduction deduction, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createDeduction"); + }// verify the required parameter 'deduction' is set + if (deduction == null) { + throw new IllegalArgumentException("Missing the required parameter 'deduction' when calling createDeduction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createDeduction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(deduction); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new earnings rate + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRate The earningsRate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsRateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsRateObject createEarningsRate(String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEarningsRateForHttpResponse(accessToken, xeroTenantId, earningsRate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEarningsRate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsRateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsRateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new earnings rate + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRate The earningsRate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEarningsRateForHttpResponse(String accessToken, String xeroTenantId, EarningsRate earningsRate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEarningsRate"); + }// verify the required parameter 'earningsRate' is set + if (earningsRate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsRate' when calling createEarningsRate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEarningsRate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsRate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeObject createEmployee(String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeForHttpResponse(accessToken, xeroTenantId, employee, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeForHttpResponse(String accessToken, String xeroTenantId, Employee employee, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployee"); + }// verify the required parameter 'employee' is set + if (employee == null) { + throw new IllegalArgumentException("Missing the required parameter 'employee' when calling createEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employee); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an earnings template records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsTemplateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsTemplateObject createEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsTemplateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsTemplateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an earnings template records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeEarningsTemplate"); + }// verify the required parameter 'earningsTemplate' is set + if (earningsTemplate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsTemplate' when calling createEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/earnings"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsTemplate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates leave records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject createEmployeeLeave(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, employeeLeave, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates leave records for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeLeave"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeLeave"); + }// verify the required parameter 'employeeLeave' is set + if (employeeLeave == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeLeave' when calling createEmployeeLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeLeave); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates employee leave type records + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeaveType The employeeLeaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveTypeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveTypeObject createEmployeeLeaveType(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeaveType employeeLeaveType, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeLeaveTypeForHttpResponse(accessToken, xeroTenantId, employeeID, employeeLeaveType, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeLeaveType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveTypeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveTypeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates employee leave type records + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeLeaveType The employeeLeaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeLeaveTypeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeLeaveType employeeLeaveType, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeLeaveType"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeLeaveType"); + }// verify the required parameter 'employeeLeaveType' is set + if (employeeLeaveType == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeLeaveType' when calling createEmployeeLeaveType"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeLeaveType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeLeaveType); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an opening balance for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeOpeningBalances The employeeOpeningBalances parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeOpeningBalancesObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeOpeningBalancesObject createEmployeeOpeningBalances(String accessToken, String xeroTenantId, UUID employeeID, EmployeeOpeningBalances employeeOpeningBalances, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeOpeningBalancesForHttpResponse(accessToken, xeroTenantId, employeeID, employeeOpeningBalances, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeOpeningBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeOpeningBalancesObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeOpeningBalancesObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an opening balance for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeOpeningBalances The employeeOpeningBalances parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeOpeningBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeOpeningBalances employeeOpeningBalances, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeOpeningBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeOpeningBalances"); + }// verify the required parameter 'employeeOpeningBalances' is set + if (employeeOpeningBalances == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeOpeningBalances' when calling createEmployeeOpeningBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeOpeningBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/ukopeningbalances"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeOpeningBalances); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates an employee payment method + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param paymentMethod The paymentMethod parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PaymentMethodObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentMethodObject createEmployeePaymentMethod(String accessToken, String xeroTenantId, UUID employeeID, PaymentMethod paymentMethod, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeePaymentMethodForHttpResponse(accessToken, xeroTenantId, employeeID, paymentMethod, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeePaymentMethod -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PaymentMethodObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PaymentMethodObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates an employee payment method + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param paymentMethod The paymentMethod parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeePaymentMethodForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, PaymentMethod paymentMethod, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeePaymentMethod"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeePaymentMethod"); + }// verify the required parameter 'paymentMethod' is set + if (paymentMethod == null) { + throw new IllegalArgumentException("Missing the required parameter 'paymentMethod' when calling createEmployeePaymentMethod"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeePaymentMethod"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(paymentMethod); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a salary and wage record for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWageObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWageObject createEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWage, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWageObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWageObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a salary and wage record for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWage' is set + if (salaryAndWage == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWage' when calling createEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(salaryAndWage); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates statutory sick leave records + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeStatutorySickLeave The employeeStatutorySickLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeStatutorySickLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeStatutorySickLeaveObject createEmployeeStatutorySickLeave(String accessToken, String xeroTenantId, EmployeeStatutorySickLeave employeeStatutorySickLeave, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmployeeStatutorySickLeaveForHttpResponse(accessToken, xeroTenantId, employeeStatutorySickLeave, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployeeStatutorySickLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeStatutorySickLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeStatutorySickLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates statutory sick leave records + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeStatutorySickLeave The employeeStatutorySickLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmployeeStatutorySickLeaveForHttpResponse(String accessToken, String xeroTenantId, EmployeeStatutorySickLeave employeeStatutorySickLeave, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployeeStatutorySickLeave"); + }// verify the required parameter 'employeeStatutorySickLeave' is set + if (employeeStatutorySickLeave == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeStatutorySickLeave' when calling createEmployeeStatutorySickLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployeeStatutorySickLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryLeaves/Sick"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeStatutorySickLeave); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates employment detail for a specific employee using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employment The employment parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmploymentObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmploymentObject createEmployment(String accessToken, String xeroTenantId, UUID employeeID, Employment employment, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createEmploymentForHttpResponse(accessToken, xeroTenantId, employeeID, employment, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createEmployment -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmploymentObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmploymentObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates employment detail for a specific employee using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employment The employment parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createEmploymentForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, Employment employment, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createEmployment"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createEmployment"); + }// verify the required parameter 'employment' is set + if (employment == null) { + throw new IllegalArgumentException("Missing the required parameter 'employment' when calling createEmployment"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createEmployment"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Employment"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employment); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new leave type + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveType The leaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveTypeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveTypeObject createLeaveType(String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveType, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createLeaveType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeaveTypeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeaveTypeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new leave type + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param leaveType The leaveType parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createLeaveTypeForHttpResponse(String accessToken, String xeroTenantId, LeaveType leaveType, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createLeaveType"); + }// verify the required parameter 'leaveType' is set + if (leaveType == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveType' when calling createLeaveType"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createLeaveType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(leaveType); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates multiple earnings template records for a specific employee using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeePayTemplates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeePayTemplates createMultipleEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, List earningsTemplate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createMultipleEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, earningsTemplate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createMultipleEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeePayTemplates object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeePayTemplates",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates multiple earnings template records for a specific employee using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createMultipleEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, List earningsTemplate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createMultipleEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling createMultipleEmployeeEarningsTemplate"); + }// verify the required parameter 'earningsTemplate' is set + if (earningsTemplate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsTemplate' when calling createMultipleEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createMultipleEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/paytemplateearnings"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsTemplate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new payrun calendar + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunCalendar The payRunCalendar parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayRunCalendarObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunCalendarObject createPayRunCalendar(String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createPayRunCalendarForHttpResponse(accessToken, xeroTenantId, payRunCalendar, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createPayRunCalendar -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunCalendarObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunCalendarObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new payrun calendar + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunCalendar The payRunCalendar parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createPayRunCalendarForHttpResponse(String accessToken, String xeroTenantId, PayRunCalendar payRunCalendar, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createPayRunCalendar"); + }// verify the required parameter 'payRunCalendar' is set + if (payRunCalendar == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunCalendar' when calling createPayRunCalendar"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createPayRunCalendar"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payRunCalendar); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new reimbursement + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursement The reimbursement parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return ReimbursementObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReimbursementObject createReimbursement(String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createReimbursementForHttpResponse(accessToken, xeroTenantId, reimbursement, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createReimbursement -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + ReimbursementObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"ReimbursementObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new reimbursement + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursement The reimbursement parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createReimbursementForHttpResponse(String accessToken, String xeroTenantId, Reimbursement reimbursement, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createReimbursement"); + }// verify the required parameter 'reimbursement' is set + if (reimbursement == null) { + throw new IllegalArgumentException("Missing the required parameter 'reimbursement' when calling createReimbursement"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createReimbursement"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(reimbursement); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject createTimesheet(String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTimesheetForHttpResponse(accessToken, xeroTenantId, timesheet, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheet The timesheet parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTimesheetForHttpResponse(String accessToken, String xeroTenantId, Timesheet timesheet, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTimesheet"); + }// verify the required parameter 'timesheet' is set + if (timesheet == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheet' when calling createTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheet); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a new timesheet line for a specific timesheet using a unique timesheet ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLineObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLineObject createTimesheetLine(String accessToken, String xeroTenantId, UUID timesheetID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTimesheetLineForHttpResponse(accessToken, xeroTenantId, timesheetID, timesheetLine, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTimesheetLine -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetLineObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetLineObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a new timesheet line for a specific timesheet using a unique timesheet ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTimesheetLineForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTimesheetLine"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling createTimesheetLine"); + }// verify the required parameter 'timesheetLine' is set + if (timesheetLine == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLine' when calling createTimesheetLine"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTimesheetLine"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheetLine); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific employee's earnings template record + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) throws IOException { + try { + deleteEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, payTemplateEarningID); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a specific employee's earnings template record + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling deleteEmployeeEarningsTemplate"); + }// verify the required parameter 'payTemplateEarningID' is set + if (payTemplateEarningID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payTemplateEarningID' when calling deleteEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept(""); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("PayTemplateEarningID", payTemplateEarningID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific employee's leave record + *

200 - successful response + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject deleteEmployeeLeave(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteEmployeeLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a specific employee's leave record + *

200 - successful response + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteEmployeeLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteEmployeeLeave"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling deleteEmployeeLeave"); + }// verify the required parameter 'leaveID' is set + if (leaveID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveID' when calling deleteEmployeeLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteEmployeeLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("LeaveID", leaveID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a salary and wages record for a specific employee + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single salary and wages object + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + try { + deleteEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWagesID); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a salary and wages record for a specific employee + *

200 - deletion successful + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single salary and wages object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling deleteEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWagesID' is set + if (salaryAndWagesID == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWagesID' when calling deleteEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept(""); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("SalaryAndWagesID", salaryAndWagesID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLine + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLine deleteTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling deleteTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a specific timesheet line + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLine + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLine deleteTimesheetLine(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = deleteTimesheetLineForHttpResponse(accessToken, xeroTenantId, timesheetID, timesheetLineID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTimesheetLine -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Deletes a specific timesheet line + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTimesheetLineForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTimesheetLine"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling deleteTimesheetLine"); + }// verify the required parameter 'timesheetLineID' is set + if (timesheetLineID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLineID' when calling deleteTimesheetLine"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTimesheetLine"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + uriVariables.put("TimesheetLineID", timesheetLineID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific benefit by using a unique benefit ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param id Identifier for the benefit + * @param accessToken Authorization token for user set in header of each request + * @return BenefitObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public BenefitObject getBenefit(String accessToken, String xeroTenantId, UUID id) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBenefitForHttpResponse(accessToken, xeroTenantId, id); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBenefit -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + BenefitObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"BenefitObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific benefit by using a unique benefit ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param id Identifier for the benefit + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBenefitForHttpResponse(String accessToken, String xeroTenantId, UUID id) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBenefit"); + }// verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling getBenefit"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBenefit"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("id", id); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Benefits/{id}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves employee benefits + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Benefits + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Benefits getBenefits(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getBenefitsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getBenefits -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Benefits object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Benefits",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves employee benefits + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getBenefitsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getBenefits"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getBenefits"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Benefits"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific deduction by using a unique deduction ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param deductionId Identifier for the deduction + * @param accessToken Authorization token for user set in header of each request + * @return DeductionObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public DeductionObject getDeduction(String accessToken, String xeroTenantId, UUID deductionId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getDeductionForHttpResponse(accessToken, xeroTenantId, deductionId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getDeduction -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + DeductionObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"DeductionObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific deduction by using a unique deduction ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param deductionId Identifier for the deduction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getDeductionForHttpResponse(String accessToken, String xeroTenantId, UUID deductionId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getDeduction"); + }// verify the required parameter 'deductionId' is set + if (deductionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'deductionId' when calling getDeduction"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getDeduction"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("deductionId", deductionId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions/{deductionId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves deductions + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Deductions + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Deductions getDeductions(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getDeductionsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getDeductions -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Deductions object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Deductions",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves deductions + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getDeductionsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getDeductions"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getDeductions"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Deductions"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific earnings orders by using a unique earnings orders id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param id Identifier for the deduction + * @param accessToken Authorization token for user set in header of each request + * @return EarningsOrderObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsOrderObject getEarningsOrder(String accessToken, String xeroTenantId, UUID id) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEarningsOrderForHttpResponse(accessToken, xeroTenantId, id); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEarningsOrder -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsOrderObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsOrderObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific earnings orders by using a unique earnings orders id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param id Identifier for the deduction + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEarningsOrderForHttpResponse(String accessToken, String xeroTenantId, UUID id) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEarningsOrder"); + }// verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling getEarningsOrder"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEarningsOrder"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("id", id); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsOrders/{id}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves earnings orders + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsOrders + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsOrders getEarningsOrders(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEarningsOrdersForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEarningsOrders -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsOrders object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsOrders",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves earnings orders + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEarningsOrdersForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEarningsOrders"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEarningsOrders"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsOrders"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific earnings rates by using a unique earnings rate id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRateID Identifier for the earnings rate + * @param accessToken Authorization token for user set in header of each request + * @return EarningsRateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsRateObject getEarningsRate(String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEarningsRateForHttpResponse(accessToken, xeroTenantId, earningsRateID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEarningsRate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsRateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsRateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific earnings rates by using a unique earnings rate id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param earningsRateID Identifier for the earnings rate + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEarningsRateForHttpResponse(String accessToken, String xeroTenantId, UUID earningsRateID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEarningsRate"); + }// verify the required parameter 'earningsRateID' is set + if (earningsRateID == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsRateID' when calling getEarningsRate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEarningsRate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EarningsRateID", earningsRateID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates/{EarningsRateID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves earnings rates + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsRates + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsRates getEarningsRates(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEarningsRatesForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEarningsRates -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsRates object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsRates",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves earnings rates + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEarningsRatesForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEarningsRates"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEarningsRates"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/EarningsRates"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves specific employees by using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeObject getEmployee(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves specific employees by using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployee"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's leave record using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject getEmployeeLeave(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's leave record using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeave"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeave"); + }// verify the required parameter 'leaveID' is set + if (leaveID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveID' when calling getEmployeeLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("LeaveID", leaveID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's leave balances using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveBalances + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveBalances getEmployeeLeaveBalances(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeaveBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeaveBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveBalances object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveBalances",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's leave balances using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeaveBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeaveBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeaveBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveBalances"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's leave periods using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param startDate Filter by start date + * @param endDate Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return LeavePeriods + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeavePeriods getEmployeeLeavePeriods(String accessToken, String xeroTenantId, UUID employeeID, LocalDate startDate, LocalDate endDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeavePeriodsForHttpResponse(accessToken, xeroTenantId, employeeID, startDate, endDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeavePeriods -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeavePeriods object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeavePeriods",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's leave periods using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param startDate Filter by start date + * @param endDate Filter by end date + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeavePeriodsForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, LocalDate startDate, LocalDate endDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeavePeriods"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeavePeriods"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeavePeriods"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeavePeriods"); + if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's leave types using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveTypes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveTypes getEmployeeLeaveTypes(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeaveTypesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeaveTypes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveTypes object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveTypes",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's leave types using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeaveTypesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaveTypes"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeaveTypes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeaveTypes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/LeaveTypes"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's leave records using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaves + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaves getEmployeeLeaves(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeLeavesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeLeaves -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaves object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaves",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's leave records using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeLeavesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeLeaves"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeLeaves"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeLeaves"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's openingbalances using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeOpeningBalancesObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeOpeningBalancesObject getEmployeeOpeningBalances(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeOpeningBalancesForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeOpeningBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeOpeningBalancesObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeOpeningBalancesObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's openingbalances using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeOpeningBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeOpeningBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeOpeningBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeOpeningBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/ukopeningbalances"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee pay templates using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeePayTemplateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeePayTemplateObject getEmployeePayTemplate(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeePayTemplateForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeePayTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeePayTemplateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeePayTemplateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee pay templates using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeePayTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeePayTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeePayTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeePayTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's payment method using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return PaymentMethodObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PaymentMethodObject getEmployeePaymentMethod(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeePaymentMethodForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeePaymentMethod -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PaymentMethodObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PaymentMethodObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's payment method using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeePaymentMethodForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeePaymentMethod"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeePaymentMethod"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeePaymentMethod"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PaymentMethods"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific salary and wages record for a specific employee using a unique salary and wage id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWages + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWages getEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWagesID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWages",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific salary and wages record for a specific employee using a unique salary and wage id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWagesID' is set + if (salaryAndWagesID == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWagesID' when calling getEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("SalaryAndWagesID", salaryAndWagesID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's salary and wages by using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWages + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWages getEmployeeSalaryAndWages(String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeSalaryAndWagesForHttpResponse(accessToken, xeroTenantId, employeeID, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeSalaryAndWages -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWages object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWages",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's salary and wages by using a unique employee ID + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeSalaryAndWagesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeSalaryAndWages"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeSalaryAndWages"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeSalaryAndWages"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's leave balances using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveType Filter by the type of statutory leave + * @param asOfDate The date from which to calculate balance remaining. If not specified, current date UTC is used. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeStatutoryLeaveBalanceObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeStatutoryLeaveBalanceObject getEmployeeStatutoryLeaveBalances(String accessToken, String xeroTenantId, UUID employeeID, String leaveType, LocalDate asOfDate) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeStatutoryLeaveBalancesForHttpResponse(accessToken, xeroTenantId, employeeID, leaveType, asOfDate); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeStatutoryLeaveBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeStatutoryLeaveBalanceObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeStatutoryLeaveBalanceObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's leave balances using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveType Filter by the type of statutory leave + * @param asOfDate The date from which to calculate balance remaining. If not specified, current date UTC is used. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeStatutoryLeaveBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, String leaveType, LocalDate asOfDate) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeStatutoryLeaveBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeStatutoryLeaveBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeStatutoryLeaveBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/StatutoryLeaveBalance"); + if (leaveType != null) { + String key = "LeaveType"; + Object value = leaveType; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (asOfDate != null) { + String key = "AsOfDate"; + Object value = asOfDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a statutory sick leave for an employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param statutorySickLeaveID Statutory sick leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeStatutorySickLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeStatutorySickLeaveObject getEmployeeStatutorySickLeave(String accessToken, String xeroTenantId, UUID statutorySickLeaveID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeStatutorySickLeaveForHttpResponse(accessToken, xeroTenantId, statutorySickLeaveID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeStatutorySickLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeStatutorySickLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeStatutorySickLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a statutory sick leave for an employee + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param statutorySickLeaveID Statutory sick leave id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeStatutorySickLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID statutorySickLeaveID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeStatutorySickLeave"); + }// verify the required parameter 'statutorySickLeaveID' is set + if (statutorySickLeaveID == null) { + throw new IllegalArgumentException("Missing the required parameter 'statutorySickLeaveID' when calling getEmployeeStatutorySickLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeStatutorySickLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("StatutorySickLeaveID", statutorySickLeaveID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryLeaves/Sick/{StatutorySickLeaveID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves tax records for a specific employee using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeTaxObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeTaxObject getEmployeeTax(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeeTaxForHttpResponse(accessToken, xeroTenantId, employeeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployeeTax -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeTaxObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeTaxObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves tax records for a specific employee using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeeTaxForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployeeTax"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getEmployeeTax"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployeeTax"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Tax"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param filter Filter by first name, lastname, and/or whether they are an off-payroll worker + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Employees + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Employees getEmployees(String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getEmployeesForHttpResponse(accessToken, xeroTenantId, filter, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getEmployees -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Employees object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Employees",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves employees + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param filter Filter by first name, lastname, and/or whether they are an off-payroll worker + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getEmployeesForHttpResponse(String accessToken, String xeroTenantId, String filter, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getEmployees"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getEmployees"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees"); + if (filter != null) { + String key = "filter"; + Object value = filter; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific leave type by using a unique leave type ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param leaveTypeID Identifier for the leave type + * @param accessToken Authorization token for user set in header of each request + * @return LeaveTypeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveTypeObject getLeaveType(String accessToken, String xeroTenantId, UUID leaveTypeID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLeaveTypeForHttpResponse(accessToken, xeroTenantId, leaveTypeID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLeaveType -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeaveTypeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeaveTypeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific leave type by using a unique leave type ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param leaveTypeID Identifier for the leave type + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLeaveTypeForHttpResponse(String accessToken, String xeroTenantId, UUID leaveTypeID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLeaveType"); + }// verify the required parameter 'leaveTypeID' is set + if (leaveTypeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveTypeID' when calling getLeaveType"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLeaveType"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("LeaveTypeID", leaveTypeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes/{LeaveTypeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves leave types + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param activeOnly Filters leave types by active status. By default the API returns all leave types. + * @param accessToken Authorization token for user set in header of each request + * @return LeaveTypes + * @throws IOException if an error occurs while attempting to invoke the API **/ + public LeaveTypes getLeaveTypes(String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getLeaveTypesForHttpResponse(accessToken, xeroTenantId, page, activeOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getLeaveTypes -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + LeaveTypes object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"LeaveTypes",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves leave types + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param activeOnly Filters leave types by active status. By default the API returns all leave types. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getLeaveTypesForHttpResponse(String accessToken, String xeroTenantId, Integer page, Boolean activeOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getLeaveTypes"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getLeaveTypes"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/LeaveTypes"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (activeOnly != null) { + String key = "ActiveOnly"; + Object value = activeOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific pay run by using a unique pay run ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param accessToken Authorization token for user set in header of each request + * @return PayRunObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunObject getPayRun(String accessToken, String xeroTenantId, UUID payRunID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunForHttpResponse(accessToken, xeroTenantId, payRunID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific pay run by using a unique pay run ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRun"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling getPayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayRunID", payRunID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific payrun calendar by using a unique payrun calendar ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunCalendarID Identifier for the payrun calendars + * @param accessToken Authorization token for user set in header of each request + * @return PayRunCalendarObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunCalendarObject getPayRunCalendar(String accessToken, String xeroTenantId, UUID payRunCalendarID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunCalendarForHttpResponse(accessToken, xeroTenantId, payRunCalendarID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRunCalendar -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunCalendarObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunCalendarObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific payrun calendar by using a unique payrun calendar ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunCalendarID Identifier for the payrun calendars + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunCalendarForHttpResponse(String accessToken, String xeroTenantId, UUID payRunCalendarID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRunCalendar"); + }// verify the required parameter 'payRunCalendarID' is set + if (payRunCalendarID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunCalendarID' when calling getPayRunCalendar"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRunCalendar"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayRunCalendarID", payRunCalendarID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars/{PayRunCalendarID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payrun calendars + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return PayRunCalendars + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunCalendars getPayRunCalendars(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunCalendarsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRunCalendars -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunCalendars object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunCalendars",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payrun calendars + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunCalendarsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRunCalendars"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRunCalendars"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRunCalendars"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves pay runs + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + * @param accessToken Authorization token for user set in header of each request + * @return PayRuns + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRuns getPayRuns(String accessToken, String xeroTenantId, Integer page, String status) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPayRunsForHttpResponse(accessToken, xeroTenantId, page, status); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPayRuns -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRuns object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRuns",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves pay runs + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPayRunsForHttpResponse(String accessToken, String xeroTenantId, Integer page, String status) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPayRuns"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPayRuns"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (status != null) { + String key = "status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific payslip by using a unique payslip ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payslipID Identifier for the payslip + * @param accessToken Authorization token for user set in header of each request + * @return PayslipObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayslipObject getPaySlip(String accessToken, String xeroTenantId, UUID payslipID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaySlipForHttpResponse(accessToken, xeroTenantId, payslipID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPaySlip -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayslipObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayslipObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific payslip by using a unique payslip ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payslipID Identifier for the payslip + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaySlipForHttpResponse(String accessToken, String xeroTenantId, UUID payslipID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPaySlip"); + }// verify the required parameter 'payslipID' is set + if (payslipID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payslipID' when calling getPaySlip"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPaySlip"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayslipID", payslipID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslips/{PayslipID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payslips + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Payslips + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Payslips getPaySlips(String accessToken, String xeroTenantId, UUID payRunID, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getPaySlipsForHttpResponse(accessToken, xeroTenantId, payRunID, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPaySlips -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Payslips object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Payslips",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payslips + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getPaySlipsForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPaySlips"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling getPaySlips"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPaySlips"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Payslips"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (payRunID != null) { + String key = "PayRunID"; + Object value = payRunID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific reimbursement by using a unique reimbursement id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursementID Identifier for the reimbursement + * @param accessToken Authorization token for user set in header of each request + * @return ReimbursementObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ReimbursementObject getReimbursement(String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReimbursementForHttpResponse(accessToken, xeroTenantId, reimbursementID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReimbursement -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + ReimbursementObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"ReimbursementObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific reimbursement by using a unique reimbursement id + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param reimbursementID Identifier for the reimbursement + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReimbursementForHttpResponse(String accessToken, String xeroTenantId, UUID reimbursementID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReimbursement"); + }// verify the required parameter 'reimbursementID' is set + if (reimbursementID == null) { + throw new IllegalArgumentException("Missing the required parameter 'reimbursementID' when calling getReimbursement"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReimbursement"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("ReimbursementID", reimbursementID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements/{ReimbursementID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves reimbursements + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return Reimbursements + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Reimbursements getReimbursements(String accessToken, String xeroTenantId, Integer page) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getReimbursementsForHttpResponse(accessToken, xeroTenantId, page); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getReimbursements -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Reimbursements object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Reimbursements",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves reimbursements + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getReimbursementsForHttpResponse(String accessToken, String xeroTenantId, Integer page) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getReimbursements"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getReimbursements"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Reimbursements"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves payroll settings + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return Settings + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Settings getSettings(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getSettingsForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getSettings -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Settings object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Settings",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves payroll settings + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getSettingsForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getSettings"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getSettings"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a specific employee's summary of statutory leaves using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param activeOnly Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeStatutoryLeavesSummaries + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeStatutoryLeavesSummaries getStatutoryLeaveSummary(String accessToken, String xeroTenantId, UUID employeeID, Boolean activeOnly) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getStatutoryLeaveSummaryForHttpResponse(accessToken, xeroTenantId, employeeID, activeOnly); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getStatutoryLeaveSummary -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeStatutoryLeavesSummaries object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeStatutoryLeavesSummaries",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a specific employee's summary of statutory leaves using a unique employee ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param activeOnly Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getStatutoryLeaveSummaryForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, Boolean activeOnly) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getStatutoryLeaveSummary"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling getStatutoryLeaveSummary"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getStatutoryLeaveSummary"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/StatutoryLeaves/Summary/{EmployeeID}"); + if (activeOnly != null) { + String key = "activeOnly"; + Object value = activeOnly; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieve a specific timesheet by using a unique timesheet ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject getTimesheet(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieve a specific timesheet by using a unique timesheet ID + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling getTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves timesheets + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param filter Filter by employeeId and/or payrollCalendarId + * @param status filter results by any timesheets with a matching timesheet status + * @param startDate filter results by any timesheets with a startDate on or after the provided date + * @param endDate filter results by any timesheets with a endDate on or before the provided date + * @param sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest. + * @param accessToken Authorization token for user set in header of each request + * @return Timesheets + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Timesheets getTimesheets(String accessToken, String xeroTenantId, Integer page, String filter, String status, String startDate, String endDate, String sort) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimesheetsForHttpResponse(accessToken, xeroTenantId, page, filter, status, startDate, endDate, sort); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimesheets -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + Timesheets object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"Timesheets",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves timesheets + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * @param filter Filter by employeeId and/or payrollCalendarId + * @param status filter results by any timesheets with a matching timesheet status + * @param startDate filter results by any timesheets with a startDate on or after the provided date + * @param endDate filter results by any timesheets with a endDate on or before the provided date + * @param sort sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimesheetsForHttpResponse(String accessToken, String xeroTenantId, Integer page, String filter, String status, String startDate, String endDate, String sort) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimesheets"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimesheets"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (filter != null) { + String key = "filter"; + Object value = filter; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (status != null) { + String key = "status"; + Object value = status; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (startDate != null) { + String key = "startDate"; + Object value = startDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (endDate != null) { + String key = "endDate"; + Object value = endDate; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (sort != null) { + String key = "sort"; + Object value = sort; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves tracking categories + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return TrackingCategories + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TrackingCategories getTrackingCategories(String accessToken, String xeroTenantId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTrackingCategoriesForHttpResponse(accessToken, xeroTenantId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTrackingCategories -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TrackingCategories object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TrackingCategories",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves tracking categories + *

200 - search results matching criteria + * @param xeroTenantId Xero identifier for Tenant + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTrackingCategoriesForHttpResponse(String accessToken, String xeroTenantId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTrackingCategories"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTrackingCategories"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Settings/trackingCategories"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Reverts a specific timesheet to draft + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetObject revertTimesheet(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = revertTimesheetForHttpResponse(accessToken, xeroTenantId, timesheetID, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : revertTimesheet -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Reverts a specific timesheet to draft + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse revertTimesheetForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling revertTimesheet"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling revertTimesheet"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling revertTimesheet"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/RevertToDraft"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific employee's detail + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeObject updateEmployee(String accessToken, String xeroTenantId, UUID employeeID, Employee employee, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeForHttpResponse(accessToken, xeroTenantId, employeeID, employee, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployee -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific employee's detail + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employee The employee parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, Employee employee, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployee"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployee"); + }// verify the required parameter 'employee' is set + if (employee == null) { + throw new IllegalArgumentException("Missing the required parameter 'employee' when calling updateEmployee"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployee"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employee); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific employee's earnings template records + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EarningsTemplateObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EarningsTemplateObject updateEmployeeEarningsTemplate(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeEarningsTemplateForHttpResponse(accessToken, xeroTenantId, employeeID, payTemplateEarningID, earningsTemplate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeEarningsTemplate -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EarningsTemplateObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EarningsTemplateObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific employee's earnings template records + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param payTemplateEarningID Id for single pay template earnings object + * @param earningsTemplate The earningsTemplate parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeEarningsTemplateForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID payTemplateEarningID, EarningsTemplate earningsTemplate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeEarningsTemplate"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeEarningsTemplate"); + }// verify the required parameter 'payTemplateEarningID' is set + if (payTemplateEarningID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payTemplateEarningID' when calling updateEmployeeEarningsTemplate"); + }// verify the required parameter 'earningsTemplate' is set + if (earningsTemplate == null) { + throw new IllegalArgumentException("Missing the required parameter 'earningsTemplate' when calling updateEmployeeEarningsTemplate"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeEarningsTemplate"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("PayTemplateEarningID", payTemplateEarningID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(earningsTemplate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific employee's leave records + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeLeaveObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeLeaveObject updateEmployeeLeave(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeLeaveForHttpResponse(accessToken, xeroTenantId, employeeID, leaveID, employeeLeave, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeLeave -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeLeaveObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeLeaveObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific employee's leave records + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param leaveID Leave id for single object + * @param employeeLeave The employeeLeave parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeLeaveForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID leaveID, EmployeeLeave employeeLeave, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeLeave"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeLeave"); + }// verify the required parameter 'leaveID' is set + if (leaveID == null) { + throw new IllegalArgumentException("Missing the required parameter 'leaveID' when calling updateEmployeeLeave"); + }// verify the required parameter 'employeeLeave' is set + if (employeeLeave == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeLeave' when calling updateEmployeeLeave"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeLeave"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("LeaveID", leaveID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/Leave/{LeaveID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeLeave); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific employee's opening balances + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeOpeningBalances The employeeOpeningBalances parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return EmployeeOpeningBalancesObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public EmployeeOpeningBalancesObject updateEmployeeOpeningBalances(String accessToken, String xeroTenantId, UUID employeeID, EmployeeOpeningBalances employeeOpeningBalances, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeOpeningBalancesForHttpResponse(accessToken, xeroTenantId, employeeID, employeeOpeningBalances, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeOpeningBalances -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + EmployeeOpeningBalancesObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"EmployeeOpeningBalancesObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific employee's opening balances + *

200 - successful response + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param employeeOpeningBalances The employeeOpeningBalances parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeOpeningBalancesForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, EmployeeOpeningBalances employeeOpeningBalances, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeOpeningBalances"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeOpeningBalances"); + }// verify the required parameter 'employeeOpeningBalances' is set + if (employeeOpeningBalances == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeOpeningBalances' when calling updateEmployeeOpeningBalances"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeOpeningBalances"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/ukopeningbalances"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(employeeOpeningBalances); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates salary and wages record for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return SalaryAndWageObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public SalaryAndWageObject updateEmployeeSalaryAndWage(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateEmployeeSalaryAndWageForHttpResponse(accessToken, xeroTenantId, employeeID, salaryAndWagesID, salaryAndWage, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateEmployeeSalaryAndWage -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + SalaryAndWageObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"SalaryAndWageObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates salary and wages record for a specific employee + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param employeeID Employee id for single object + * @param salaryAndWagesID Id for single pay template earnings object + * @param salaryAndWage The salaryAndWage parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateEmployeeSalaryAndWageForHttpResponse(String accessToken, String xeroTenantId, UUID employeeID, UUID salaryAndWagesID, SalaryAndWage salaryAndWage, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateEmployeeSalaryAndWage"); + }// verify the required parameter 'employeeID' is set + if (employeeID == null) { + throw new IllegalArgumentException("Missing the required parameter 'employeeID' when calling updateEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWagesID' is set + if (salaryAndWagesID == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWagesID' when calling updateEmployeeSalaryAndWage"); + }// verify the required parameter 'salaryAndWage' is set + if (salaryAndWage == null) { + throw new IllegalArgumentException("Missing the required parameter 'salaryAndWage' when calling updateEmployeeSalaryAndWage"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateEmployeeSalaryAndWage"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("EmployeeID", employeeID); + uriVariables.put("SalaryAndWagesID", salaryAndWagesID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(salaryAndWage); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific pay run + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return PayRunObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public PayRunObject updatePayRun(String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updatePayRunForHttpResponse(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updatePayRun -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + PayRunObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"PayRunObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific pay run + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param payRunID Identifier for the pay run + * @param payRun The payRun parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updatePayRunForHttpResponse(String accessToken, String xeroTenantId, UUID payRunID, PayRun payRun, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updatePayRun"); + }// verify the required parameter 'payRunID' is set + if (payRunID == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRunID' when calling updatePayRun"); + }// verify the required parameter 'payRun' is set + if (payRun == null) { + throw new IllegalArgumentException("Missing the required parameter 'payRun' when calling updatePayRun"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updatePayRun"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("PayRunID", payRunID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/PayRuns/{PayRunID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(payRun); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific timesheet line for a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimesheetLineObject + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimesheetLineObject updateTimesheetLine(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = updateTimesheetLineForHttpResponse(accessToken, xeroTenantId, timesheetID, timesheetLineID, timesheetLine, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTimesheetLine -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + if (e.getStatusCode() == 400 || e.getStatusCode() == 405) { + TypeReference errorTypeRef = new TypeReference() {}; + TimesheetLineObject object = apiClient.getObjectMapper().readValue(e.getContent(), errorTypeRef); + handler.validationError(e.getStatusCode(),"TimesheetLineObject",object.getProblem(), e); + } else { + handler.execute(e); + } + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Updates a specific timesheet line for a specific timesheet + *

200 - search results matching criteria + *

400 - validation error for a bad request + * @param xeroTenantId Xero identifier for Tenant + * @param timesheetID Identifier for the timesheet + * @param timesheetLineID Identifier for the timesheet line + * @param timesheetLine The timesheetLine parameter + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTimesheetLineForHttpResponse(String accessToken, String xeroTenantId, UUID timesheetID, UUID timesheetLineID, TimesheetLine timesheetLine, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTimesheetLine"); + }// verify the required parameter 'timesheetID' is set + if (timesheetID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetID' when calling updateTimesheetLine"); + }// verify the required parameter 'timesheetLineID' is set + if (timesheetLineID == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLineID' when calling updateTimesheetLine"); + }// verify the required parameter 'timesheetLine' is set + if (timesheetLine == null) { + throw new IllegalArgumentException("Missing the required parameter 'timesheetLine' when calling updateTimesheetLine"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTimesheetLine"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("TimesheetID", timesheetID); + uriVariables.put("TimesheetLineID", timesheetLineID); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timesheetLine); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + + } } diff --git a/src/main/java/com/xero/api/client/ProjectApi.java b/src/main/java/com/xero/api/client/ProjectApi.java index 76e9b82bd..226f98bc9 100644 --- a/src/main/java/com/xero/api/client/ProjectApi.java +++ b/src/main/java/com/xero/api/client/ProjectApi.java @@ -9,23 +9,14 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - + package com.xero.api.client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpTransport; import com.xero.api.ApiClient; -import com.xero.api.XeroApiExceptionHandler; + import com.xero.models.project.ChargeType; +import com.xero.models.project.Error; +import org.threeten.bp.OffsetDateTime; import com.xero.models.project.Project; import com.xero.models.project.ProjectCreateOrUpdate; import com.xero.models.project.ProjectPatch; @@ -37,2335 +28,1866 @@ import com.xero.models.project.TimeEntries; import com.xero.models.project.TimeEntry; import com.xero.models.project.TimeEntryCreateOrUpdate; +import java.util.UUID; +import com.xero.api.XeroApiException; +import com.xero.api.XeroApiExceptionHandler; +import com.xero.models.bankfeeds.Statements; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.ByteArrayContent; +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpContent; +import com.google.api.client.http.HttpMethods; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpMediaType; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpResponseException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.MultipartContent; +import com.google.api.client.http.FileContent; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.util.Maps; +import com.google.api.client.auth.oauth2.BearerToken; +import com.google.api.client.auth.oauth2.Credential; + import jakarta.ws.rs.core.UriBuilder; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ByteArrayInputStream; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.threeten.bp.OffsetDateTime; - -/** ProjectApi has methods for interacting with all endpoints in the API set */ -public class ProjectApi { - private ApiClient apiClient; - private static ProjectApi instance = null; - private String userAgent = "Default"; - private String version = "10.1.0"; - static final Logger logger = LoggerFactory.getLogger(ProjectApi.class); - - /** ProjectApi */ - public ProjectApi() { - this(new ApiClient()); - } - - /** - * ProjectApi getInstance - * - * @param apiClient ApiClient pass into the new instance of this class - * @return instance of this class - */ - public static ProjectApi getInstance(ApiClient apiClient) { - if (instance == null) { - instance = new ProjectApi(apiClient); - } - return instance; - } - - /** - * ProjectApi - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public ProjectApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * get ApiClient - * - * @return apiClient the current ApiClient - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * set ApiClient - * - * @param apiClient ApiClient pass into the new instance of this class - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * set user agent - * - * @param userAgent string to override the user agent - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - /** - * get user agent - * - * @return String of user agent - */ - public String getUserAgent() { - return this.userAgent + " [Xero-Java-" + this.version + "]"; - } - - /** - * Create one or more new projects - * - *

201 - OK/success, returns the new project object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectCreateOrUpdate Create a new project with ProjectCreateOrUpdate object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Project - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Project createProject( - String accessToken, - String xeroTenantId, - ProjectCreateOrUpdate projectCreateOrUpdate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createProjectForHttpResponse( - accessToken, xeroTenantId, projectCreateOrUpdate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createProject -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Create one or more new projects - * - *

201 - OK/success, returns the new project object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectCreateOrUpdate Create a new project with ProjectCreateOrUpdate object - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createProjectForHttpResponse( - String accessToken, - String xeroTenantId, - ProjectCreateOrUpdate projectCreateOrUpdate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createProject"); - } // verify the required parameter 'projectCreateOrUpdate' is set - if (projectCreateOrUpdate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectCreateOrUpdate' when calling createProject"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createProject"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(projectCreateOrUpdate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Allows you to create a task Allows you to create a specific task - * - *

201 - OK/success, returns the new task object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can create a task on a specified projectId - * @param taskCreateOrUpdate The task object you are creating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return Task - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Task createTask( - String accessToken, - String xeroTenantId, - UUID projectId, - TaskCreateOrUpdate taskCreateOrUpdate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTaskForHttpResponse( - accessToken, xeroTenantId, projectId, taskCreateOrUpdate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTask -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Allows you to create a task Allows you to create a specific task - * - *

201 - OK/success, returns the new task object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can create a task on a specified projectId - * @param taskCreateOrUpdate The task object you are creating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTaskForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - TaskCreateOrUpdate taskCreateOrUpdate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTask"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling createTask"); - } // verify the required parameter 'taskCreateOrUpdate' is set - if (taskCreateOrUpdate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taskCreateOrUpdate' when calling createTask"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTask"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(taskCreateOrUpdate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Creates a time entry for a specific project Allows you to create a specific task - * - *

200 - OK/success, returns the newly created time entry - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryCreateOrUpdate The time entry object you are creating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return TimeEntry - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimeEntry createTimeEntry( - String accessToken, - String xeroTenantId, - UUID projectId, - TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, - String idempotencyKey) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - createTimeEntryForHttpResponse( - accessToken, xeroTenantId, projectId, timeEntryCreateOrUpdate, idempotencyKey); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : createTimeEntry -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Creates a time entry for a specific project Allows you to create a specific task - * - *

200 - OK/success, returns the newly created time entry - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryCreateOrUpdate The time entry object you are creating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse createTimeEntryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling createTimeEntry"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling createTimeEntry"); - } // verify the required parameter 'timeEntryCreateOrUpdate' is set - if (timeEntryCreateOrUpdate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timeEntryCreateOrUpdate' when calling createTimeEntry"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling createTimeEntry"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("POST " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timeEntryCreateOrUpdate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.POST, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Allows you to delete a task Allows you to delete a specific task - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param taskId You can specify an individual task by appending the id to the endpoint - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteTask(String accessToken, String xeroTenantId, UUID projectId, UUID taskId) - throws IOException { - try { - deleteTaskForHttpResponse(accessToken, xeroTenantId, projectId, taskId); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTask -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Allows you to delete a task Allows you to delete a specific task - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param taskId You can specify an individual task by appending the id to the endpoint - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTaskForHttpResponse( - String accessToken, String xeroTenantId, UUID projectId, UUID taskId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTask"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling deleteTask"); - } // verify the required parameter 'taskId' is set - if (taskId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taskId' when calling deleteTask"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTask"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - uriVariables.put("taskId", taskId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks/{taskId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Deletes a time entry for a specific project Allows you to delete a specific time entry - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryId You can specify an individual task by appending the id to the endpoint - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void deleteTimeEntry( - String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) - throws IOException { - try { - deleteTimeEntryForHttpResponse(accessToken, xeroTenantId, projectId, timeEntryId); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : deleteTimeEntry -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Deletes a time entry for a specific project Allows you to delete a specific time entry - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryId You can specify an individual task by appending the id to the endpoint - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse deleteTimeEntryForHttpResponse( - String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling deleteTimeEntry"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling deleteTimeEntry"); - } // verify the required parameter 'timeEntryId' is set - if (timeEntryId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timeEntryId' when calling deleteTimeEntry"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling deleteTimeEntry"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - uriVariables.put("timeEntryId", timeEntryId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time/{timeEntryId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("DELETE " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.DELETE, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a single project Allows you to retrieve a specific project using the projectId - * - *

200 - OK/success, returns the specified project object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param accessToken Authorization token for user set in header of each request - * @return Project - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Project getProject(String accessToken, String xeroTenantId, UUID projectId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getProjectForHttpResponse(accessToken, xeroTenantId, projectId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getProject -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a single project Allows you to retrieve a specific project using the projectId - * - *

200 - OK/success, returns the specified project object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getProjectForHttpResponse( - String accessToken, String xeroTenantId, UUID projectId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getProject"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling getProject"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getProject"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a list of all project users Allows you to retrieve the users on a projects. - * - *

200 - OK/success, returns a list of project users - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param page set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param accessToken Authorization token for user set in header of each request - * @return ProjectUsers - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public ProjectUsers getProjectUsers( - String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getProjectUsersForHttpResponse(accessToken, xeroTenantId, page, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getProjectUsers -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a list of all project users Allows you to retrieve the users on a projects. - * - *

200 - OK/success, returns a list of project users - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param page set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getProjectUsersForHttpResponse( - String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getProjectUsers"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getProjectUsers"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ProjectsUsers"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves all projects Allows you to retrieve, create and update projects. - * - *

200 - OK/success, returns a list of project objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectIds Search for all projects that match a comma separated list of projectIds - * @param contactID Filter for projects for a specific contact - * @param states Filter for projects in a particular state (INPROGRESS or CLOSED) - * @param page set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param accessToken Authorization token for user set in header of each request - * @return Projects - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Projects getProjects( - String accessToken, - String xeroTenantId, - List projectIds, - UUID contactID, - String states, - Integer page, - Integer pageSize) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getProjectsForHttpResponse( - accessToken, xeroTenantId, projectIds, contactID, states, page, pageSize); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getProjects -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves all projects Allows you to retrieve, create and update projects. - * - *

200 - OK/success, returns a list of project objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectIds Search for all projects that match a comma separated list of projectIds - * @param contactID Filter for projects for a specific contact - * @param states Filter for projects in a particular state (INPROGRESS or CLOSED) - * @param page set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getProjectsForHttpResponse( - String accessToken, - String xeroTenantId, - List projectIds, - UUID contactID, - String states, - Integer page, - Integer pageSize) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getProjects"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getProjects"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects"); - if (projectIds != null) { - String key = "projectIds"; - Object value = projectIds; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (contactID != null) { - String key = "contactID"; - Object value = contactID; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (states != null) { - String key = "states"; - Object value = states; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a single project task Allows you to retrieve a specific project - * - *

200 - OK/success, returns the specified task object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param taskId You can specify an individual task by appending the taskId to the endpoint, i.e. - * GET https://.../tasks/{taskID} - * @param accessToken Authorization token for user set in header of each request - * @return Task - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Task getTask(String accessToken, String xeroTenantId, UUID projectId, UUID taskId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = getTaskForHttpResponse(accessToken, xeroTenantId, projectId, taskId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTask -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a single project task Allows you to retrieve a specific project - * - *

200 - OK/success, returns the specified task object - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param taskId You can specify an individual task by appending the taskId to the endpoint, i.e. - * GET https://.../tasks/{taskID} - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTaskForHttpResponse( - String accessToken, String xeroTenantId, UUID projectId, UUID taskId) throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTask"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling getTask"); - } // verify the required parameter 'taskId' is set - if (taskId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taskId' when calling getTask"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTask"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - uriVariables.put("taskId", taskId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks/{taskId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves all project tasks Allows you to retrieve a specific project - * - *

200 - OK/success, returns a list of task objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param page Set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param taskIds Search for all tasks that match a comma separated list of taskIds, i.e. GET - * https://.../tasks?taskIds={taskID},{taskID} - * @param chargeType The chargeType parameter - * @param accessToken Authorization token for user set in header of each request - * @return Tasks - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public Tasks getTasks( - String accessToken, - String xeroTenantId, - UUID projectId, - Integer page, - Integer pageSize, - String taskIds, - ChargeType chargeType) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTasksForHttpResponse( - accessToken, xeroTenantId, projectId, page, pageSize, taskIds, chargeType); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTasks -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves all project tasks Allows you to retrieve a specific project - * - *

200 - OK/success, returns a list of task objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param page Set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param taskIds Search for all tasks that match a comma separated list of taskIds, i.e. GET - * https://.../tasks?taskIds={taskID},{taskID} - * @param chargeType The chargeType parameter - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTasksForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - Integer page, - Integer pageSize, - String taskIds, - ChargeType chargeType) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTasks"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling getTasks"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTasks"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks"); - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (taskIds != null) { - String key = "taskIds"; - Object value = taskIds; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (chargeType != null) { - String key = "chargeType"; - Object value = chargeType; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves all time entries associated with a specific project Allows you to retrieve the time - * entries associated with a specific project - * - *

200 - OK/success, returns a list of time entry objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId Identifier of the project, that the task (which the time entry is logged - * against) belongs to. - * @param userId The xero user identifier of the person who logged time. - * @param taskId Identifier of the task that time entry is logged against. - * @param invoiceId Finds all time entries for this invoice. - * @param contactId Finds all time entries for this contact identifier. - * @param page Set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param states Comma-separated list of states to find. Will find all time entries that are in - * the status of whatever is specified. - * @param isChargeable Finds all time entries which relate to tasks with the charge type - * `TIME` or `FIXED`. - * @param dateAfterUtc ISO 8601 UTC date. Finds all time entries on or after this date filtered on - * the `dateUtc` field. - * @param dateBeforeUtc ISO 8601 UTC date. Finds all time entries on or before this date filtered - * on the `dateUtc` field. - * @param accessToken Authorization token for user set in header of each request - * @return TimeEntries - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimeEntries getTimeEntries( - String accessToken, - String xeroTenantId, - UUID projectId, - UUID userId, - UUID taskId, - UUID invoiceId, - UUID contactId, - Integer page, - Integer pageSize, - List states, - Boolean isChargeable, - OffsetDateTime dateAfterUtc, - OffsetDateTime dateBeforeUtc) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTimeEntriesForHttpResponse( - accessToken, - xeroTenantId, - projectId, - userId, - taskId, - invoiceId, - contactId, - page, - pageSize, - states, - isChargeable, - dateAfterUtc, - dateBeforeUtc); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimeEntries -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves all time entries associated with a specific project Allows you to retrieve the time - * entries associated with a specific project - * - *

200 - OK/success, returns a list of time entry objects - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId Identifier of the project, that the task (which the time entry is logged - * against) belongs to. - * @param userId The xero user identifier of the person who logged time. - * @param taskId Identifier of the task that time entry is logged against. - * @param invoiceId Finds all time entries for this invoice. - * @param contactId Finds all time entries for this contact identifier. - * @param page Set to 1 by default. The requested number of the page in paged response - Must be a - * number greater than 0. - * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in - * a paged response - Must be a number between 1 and 500. - * @param states Comma-separated list of states to find. Will find all time entries that are in - * the status of whatever is specified. - * @param isChargeable Finds all time entries which relate to tasks with the charge type - * `TIME` or `FIXED`. - * @param dateAfterUtc ISO 8601 UTC date. Finds all time entries on or after this date filtered on - * the `dateUtc` field. - * @param dateBeforeUtc ISO 8601 UTC date. Finds all time entries on or before this date filtered - * on the `dateUtc` field. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimeEntriesForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - UUID userId, - UUID taskId, - UUID invoiceId, - UUID contactId, - Integer page, - Integer pageSize, - List states, - Boolean isChargeable, - OffsetDateTime dateAfterUtc, - OffsetDateTime dateBeforeUtc) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimeEntries"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling getTimeEntries"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimeEntries"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time"); - if (userId != null) { - String key = "userId"; - Object value = userId; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (taskId != null) { - String key = "taskId"; - Object value = taskId; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (invoiceId != null) { - String key = "invoiceId"; - Object value = invoiceId; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (contactId != null) { - String key = "contactId"; - Object value = contactId; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (page != null) { - String key = "page"; - Object value = page; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (pageSize != null) { - String key = "pageSize"; - Object value = pageSize; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (states != null) { - String key = "states"; - Object value = states; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (isChargeable != null) { - String key = "isChargeable"; - Object value = isChargeable; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateAfterUtc != null) { - String key = "dateAfterUtc"; - Object value = dateAfterUtc; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - if (dateBeforeUtc != null) { - String key = "dateBeforeUtc"; - Object value = dateBeforeUtc; - if (value instanceof Collection) { - List valueList = new ArrayList<>((Collection) value); - if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) { - List list = new ArrayList(); - for (int i = 0; i < valueList.size(); i++) { - list.add(valueList.get(i).toString()); - } - uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); - } else { - uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); - } - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Retrieves a single time entry for a specific project Allows you to get a single time entry in a - * project - * - *

200 - OK/success, returns the specified time entry - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint - * @param accessToken Authorization token for user set in header of each request - * @return TimeEntry - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public TimeEntry getTimeEntry( - String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) - throws IOException { - try { - TypeReference typeRef = new TypeReference() {}; - HttpResponse response = - getTimeEntryForHttpResponse(accessToken, xeroTenantId, projectId, timeEntryId); - return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : getTimeEntry -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - return null; - } - - /** - * Retrieves a single time entry for a specific project Allows you to get a single time entry in a - * project - * - *

200 - OK/success, returns the specified time entry - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse getTimeEntryForHttpResponse( - String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling getTimeEntry"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling getTimeEntry"); - } // verify the required parameter 'timeEntryId' is set - if (timeEntryId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timeEntryId' when calling getTimeEntry"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling getTimeEntry"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - uriVariables.put("timeEntryId", timeEntryId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time/{timeEntryId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("GET " + genericUrl.toString()); - } - - HttpContent content = null; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.GET, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * creates a project for the specified contact Allows you to update a specific projects. - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param projectPatch Update the status of an existing Project - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void patchProject( - String accessToken, - String xeroTenantId, - UUID projectId, - ProjectPatch projectPatch, - String idempotencyKey) - throws IOException { - try { - patchProjectForHttpResponse( - accessToken, xeroTenantId, projectId, projectPatch, idempotencyKey); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : patchProject -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * creates a project for the specified contact Allows you to update a specific projects. - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param projectPatch Update the status of an existing Project - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse patchProjectForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - ProjectPatch projectPatch, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling patchProject"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling patchProject"); - } // verify the required parameter 'projectPatch' is set - if (projectPatch == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectPatch' when calling patchProject"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling patchProject"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PATCH " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(projectPatch); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PATCH, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Updates a specific project Allows you to update a specific projects. - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param projectCreateOrUpdate Request of type ProjectCreateOrUpdate - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void updateProject( - String accessToken, - String xeroTenantId, - UUID projectId, - ProjectCreateOrUpdate projectCreateOrUpdate, - String idempotencyKey) - throws IOException { - try { - updateProjectForHttpResponse( - accessToken, xeroTenantId, projectId, projectCreateOrUpdate, idempotencyKey); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateProject -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Updates a specific project Allows you to update a specific projects. - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param projectCreateOrUpdate Request of type ProjectCreateOrUpdate - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateProjectForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - ProjectCreateOrUpdate projectCreateOrUpdate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateProject"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling updateProject"); - } // verify the required parameter 'projectCreateOrUpdate' is set - if (projectCreateOrUpdate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectCreateOrUpdate' when calling updateProject"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateProject"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(projectCreateOrUpdate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * Allows you to update a task Allows you to update a specific task - * - *

204 - OK/Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param taskId You can specify an individual task by appending the id to the endpoint - * @param taskCreateOrUpdate The task object you are updating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void updateTask( - String accessToken, - String xeroTenantId, - UUID projectId, - UUID taskId, - TaskCreateOrUpdate taskCreateOrUpdate, - String idempotencyKey) - throws IOException { - try { - updateTaskForHttpResponse( - accessToken, xeroTenantId, projectId, taskId, taskCreateOrUpdate, idempotencyKey); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTask -------------------"); - logger.debug(e.toString()); - } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Allows you to update a task Allows you to update a specific task - * - *

204 - OK/Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param taskId You can specify an individual task by appending the id to the endpoint - * @param taskCreateOrUpdate The task object you are updating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTaskForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - UUID taskId, - TaskCreateOrUpdate taskCreateOrUpdate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTask"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling updateTask"); - } // verify the required parameter 'taskId' is set - if (taskId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taskId' when calling updateTask"); - } // verify the required parameter 'taskCreateOrUpdate' is set - if (taskCreateOrUpdate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'taskCreateOrUpdate' when calling updateTask"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTask"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - uriVariables.put("taskId", taskId); +import java.util.List; - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks/{taskId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } +import org.apache.commons.io.IOUtils; - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(taskCreateOrUpdate); +import org.slf4j.LoggerFactory; +import org.slf4j.Logger; - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - /** - * Updates a time entry for a specific project Allows you to update time entry in a project - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint - * @param timeEntryCreateOrUpdate The time entry object you are updating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @throws IOException if an error occurs while attempting to invoke the API * - */ - public void updateTimeEntry( - String accessToken, - String xeroTenantId, - UUID projectId, - UUID timeEntryId, - TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, - String idempotencyKey) - throws IOException { - try { - updateTimeEntryForHttpResponse( - accessToken, - xeroTenantId, - projectId, - timeEntryId, - timeEntryCreateOrUpdate, - idempotencyKey); - } catch (HttpResponseException e) { - if (logger.isDebugEnabled()) { - logger.debug( - "------------------ HttpResponseException " - + e.getStatusCode() - + " : updateTimeEntry -------------------"); - logger.debug(e.toString()); +/** ProjectApi has methods for interacting with all endpoints in the API set */ +public class ProjectApi { + private ApiClient apiClient; + private static ProjectApi instance = null; + private String userAgent = "Default"; + private String version = "10.1.0"; + final static Logger logger = LoggerFactory.getLogger(ProjectApi.class); + + /** ProjectApi */ + public ProjectApi() { + this(new ApiClient()); + } + + /** ProjectApi getInstance + * @param apiClient ApiClient pass into the new instance of this class + * @return instance of this class + */ + public static ProjectApi getInstance(ApiClient apiClient) { + if (instance == null) { + instance = new ProjectApi(apiClient); } - XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); - handler.execute(e); - } catch (IOException ioe) { - throw ioe; - } - } - - /** - * Updates a time entry for a specific project Allows you to update time entry in a project - * - *

204 - Success - return response 204 no content - * - *

400 - A failed request due to validation error - * - * @param xeroTenantId Xero identifier for Tenant - * @param projectId You can specify an individual project by appending the projectId to the - * endpoint - * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint - * @param timeEntryCreateOrUpdate The time entry object you are updating - * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate - * processing. 128 character max. - * @param accessToken Authorization token for user set in header of each request - * @return HttpResponse - * @throws IOException if an error occurs while attempting to invoke the API - */ - public HttpResponse updateTimeEntryForHttpResponse( - String accessToken, - String xeroTenantId, - UUID projectId, - UUID timeEntryId, - TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, - String idempotencyKey) - throws IOException { - // verify the required parameter 'xeroTenantId' is set - if (xeroTenantId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'xeroTenantId' when calling updateTimeEntry"); - } // verify the required parameter 'projectId' is set - if (projectId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'projectId' when calling updateTimeEntry"); - } // verify the required parameter 'timeEntryId' is set - if (timeEntryId == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timeEntryId' when calling updateTimeEntry"); - } // verify the required parameter 'timeEntryCreateOrUpdate' is set - if (timeEntryCreateOrUpdate == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'timeEntryCreateOrUpdate' when calling updateTimeEntry"); - } - if (accessToken == null) { - throw new IllegalArgumentException( - "Missing the required parameter 'accessToken' when calling updateTimeEntry"); - } - HttpHeaders headers = new HttpHeaders(); - headers.set("Xero-Tenant-Id", xeroTenantId); - headers.set("Idempotency-Key", idempotencyKey); - headers.setAccept("application/json"); - headers.setUserAgent(this.getUserAgent()); - // create a map of path variables - final Map uriVariables = new HashMap(); - uriVariables.put("projectId", projectId); - uriVariables.put("timeEntryId", timeEntryId); - - UriBuilder uriBuilder = - UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time/{timeEntryId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); - if (logger.isDebugEnabled()) { - logger.debug("PUT " + genericUrl.toString()); - } - - HttpContent content = null; - content = apiClient.new JacksonJsonHttpContent(timeEntryCreateOrUpdate); - - Credential credential = - new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); - HttpTransport transport = apiClient.getHttpTransport(); - HttpRequestFactory requestFactory = transport.createRequestFactory(credential); - return requestFactory - .buildRequest(HttpMethods.PUT, genericUrl, content) - .setHeaders(headers) - .setConnectTimeout(apiClient.getConnectionTimeout()) - .setReadTimeout(apiClient.getReadTimeout()) - .execute(); - } - - /** - * convert intput to byte array - * - * @param is InputStream the server status code returned - * @return byteArrayInputStream a ByteArrayInputStream - * @throws IOException for failed or interrupted I/O operations - */ - public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { - byte[] bytes = IOUtils.toByteArray(is); - try { - // Process the input stream.. - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); - return byteArrayInputStream; - } finally { - is.close(); + return instance; + } + + /** ProjectApi + * @param apiClient ApiClient pass into the new instance of this class + */ + public ProjectApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** get ApiClient + * @return apiClient the current ApiClient + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** set ApiClient + * @param apiClient ApiClient pass into the new instance of this class + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** set user agent + * @param userAgent string to override the user agent + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** get user agent + * @return String of user agent + */ + public String getUserAgent() { + return this.userAgent + " [Xero-Java-" + this.version + "]"; + } + + + /** + * Create one or more new projects + *

201 - OK/success, returns the new project object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectCreateOrUpdate Create a new project with ProjectCreateOrUpdate object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Project + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Project createProject(String accessToken, String xeroTenantId, ProjectCreateOrUpdate projectCreateOrUpdate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createProjectForHttpResponse(accessToken, xeroTenantId, projectCreateOrUpdate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createProject -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Create one or more new projects + *

201 - OK/success, returns the new project object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectCreateOrUpdate Create a new project with ProjectCreateOrUpdate object + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createProjectForHttpResponse(String accessToken, String xeroTenantId, ProjectCreateOrUpdate projectCreateOrUpdate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createProject"); + }// verify the required parameter 'projectCreateOrUpdate' is set + if (projectCreateOrUpdate == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectCreateOrUpdate' when calling createProject"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createProject"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects"); + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(projectCreateOrUpdate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Allows you to create a task + * Allows you to create a specific task + *

201 - OK/success, returns the new task object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can create a task on a specified projectId + * @param taskCreateOrUpdate The task object you are creating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return Task + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Task createTask(String accessToken, String xeroTenantId, UUID projectId, TaskCreateOrUpdate taskCreateOrUpdate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTaskForHttpResponse(accessToken, xeroTenantId, projectId, taskCreateOrUpdate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTask -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Allows you to create a task + * Allows you to create a specific task + *

201 - OK/success, returns the new task object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can create a task on a specified projectId + * @param taskCreateOrUpdate The task object you are creating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTaskForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, TaskCreateOrUpdate taskCreateOrUpdate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTask"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling createTask"); + }// verify the required parameter 'taskCreateOrUpdate' is set + if (taskCreateOrUpdate == null) { + throw new IllegalArgumentException("Missing the required parameter 'taskCreateOrUpdate' when calling createTask"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTask"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(taskCreateOrUpdate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Creates a time entry for a specific project + * Allows you to create a specific task + *

200 - OK/success, returns the newly created time entry + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryCreateOrUpdate The time entry object you are creating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return TimeEntry + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimeEntry createTimeEntry(String accessToken, String xeroTenantId, UUID projectId, TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, String idempotencyKey) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = createTimeEntryForHttpResponse(accessToken, xeroTenantId, projectId, timeEntryCreateOrUpdate, idempotencyKey); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : createTimeEntry -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Creates a time entry for a specific project + * Allows you to create a specific task + *

200 - OK/success, returns the newly created time entry + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryCreateOrUpdate The time entry object you are creating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse createTimeEntryForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createTimeEntry"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling createTimeEntry"); + }// verify the required parameter 'timeEntryCreateOrUpdate' is set + if (timeEntryCreateOrUpdate == null) { + throw new IllegalArgumentException("Missing the required parameter 'timeEntryCreateOrUpdate' when calling createTimeEntry"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling createTimeEntry"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("POST " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timeEntryCreateOrUpdate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.POST, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Allows you to delete a task + * Allows you to delete a specific task + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param taskId You can specify an individual task by appending the id to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteTask(String accessToken, String xeroTenantId, UUID projectId, UUID taskId) throws IOException { + try { + deleteTaskForHttpResponse(accessToken, xeroTenantId, projectId, taskId); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTask -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Allows you to delete a task + * Allows you to delete a specific task + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param taskId You can specify an individual task by appending the id to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTaskForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, UUID taskId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTask"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling deleteTask"); + }// verify the required parameter 'taskId' is set + if (taskId == null) { + throw new IllegalArgumentException("Missing the required parameter 'taskId' when calling deleteTask"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTask"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + uriVariables.put("taskId", taskId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks/{taskId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Deletes a time entry for a specific project + * Allows you to delete a specific time entry + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryId You can specify an individual task by appending the id to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void deleteTimeEntry(String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) throws IOException { + try { + deleteTimeEntryForHttpResponse(accessToken, xeroTenantId, projectId, timeEntryId); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : deleteTimeEntry -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Deletes a time entry for a specific project + * Allows you to delete a specific time entry + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryId You can specify an individual task by appending the id to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse deleteTimeEntryForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling deleteTimeEntry"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling deleteTimeEntry"); + }// verify the required parameter 'timeEntryId' is set + if (timeEntryId == null) { + throw new IllegalArgumentException("Missing the required parameter 'timeEntryId' when calling deleteTimeEntry"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling deleteTimeEntry"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + uriVariables.put("timeEntryId", timeEntryId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time/{timeEntryId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("DELETE " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.DELETE, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a single project + * Allows you to retrieve a specific project using the projectId + *

200 - OK/success, returns the specified project object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @return Project + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Project getProject(String accessToken, String xeroTenantId, UUID projectId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getProjectForHttpResponse(accessToken, xeroTenantId, projectId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getProject -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a single project + * Allows you to retrieve a specific project using the projectId + *

200 - OK/success, returns the specified project object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getProjectForHttpResponse(String accessToken, String xeroTenantId, UUID projectId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getProject"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling getProject"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getProject"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a list of all project users + * Allows you to retrieve the users on a projects. + *

200 - OK/success, returns a list of project users + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param accessToken Authorization token for user set in header of each request + * @return ProjectUsers + * @throws IOException if an error occurs while attempting to invoke the API **/ + public ProjectUsers getProjectUsers(String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getProjectUsersForHttpResponse(accessToken, xeroTenantId, page, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getProjectUsers -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a list of all project users + * Allows you to retrieve the users on a projects. + *

200 - OK/success, returns a list of project users + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getProjectUsersForHttpResponse(String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getProjectUsers"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getProjectUsers"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/ProjectsUsers"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves all projects + * Allows you to retrieve, create and update projects. + *

200 - OK/success, returns a list of project objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectIds Search for all projects that match a comma separated list of projectIds + * @param contactID Filter for projects for a specific contact + * @param states Filter for projects in a particular state (INPROGRESS or CLOSED) + * @param page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param accessToken Authorization token for user set in header of each request + * @return Projects + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Projects getProjects(String accessToken, String xeroTenantId, List projectIds, UUID contactID, String states, Integer page, Integer pageSize) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getProjectsForHttpResponse(accessToken, xeroTenantId, projectIds, contactID, states, page, pageSize); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getProjects -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves all projects + * Allows you to retrieve, create and update projects. + *

200 - OK/success, returns a list of project objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectIds Search for all projects that match a comma separated list of projectIds + * @param contactID Filter for projects for a specific contact + * @param states Filter for projects in a particular state (INPROGRESS or CLOSED) + * @param page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getProjectsForHttpResponse(String accessToken, String xeroTenantId, List projectIds, UUID contactID, String states, Integer page, Integer pageSize) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getProjects"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getProjects"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects"); + if (projectIds != null) { + String key = "projectIds"; + Object value = projectIds; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (contactID != null) { + String key = "contactID"; + Object value = contactID; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (states != null) { + String key = "states"; + Object value = states; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a single project task + * Allows you to retrieve a specific project + *

200 - OK/success, returns the specified task object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param taskId You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskID} + * @param accessToken Authorization token for user set in header of each request + * @return Task + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Task getTask(String accessToken, String xeroTenantId, UUID projectId, UUID taskId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTaskForHttpResponse(accessToken, xeroTenantId, projectId, taskId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTask -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a single project task + * Allows you to retrieve a specific project + *

200 - OK/success, returns the specified task object + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param taskId You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskID} + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTaskForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, UUID taskId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTask"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling getTask"); + }// verify the required parameter 'taskId' is set + if (taskId == null) { + throw new IllegalArgumentException("Missing the required parameter 'taskId' when calling getTask"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTask"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + uriVariables.put("taskId", taskId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks/{taskId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves all project tasks + * Allows you to retrieve a specific project + *

200 - OK/success, returns a list of task objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param taskIds Search for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskID},{taskID} + * @param chargeType The chargeType parameter + * @param accessToken Authorization token for user set in header of each request + * @return Tasks + * @throws IOException if an error occurs while attempting to invoke the API **/ + public Tasks getTasks(String accessToken, String xeroTenantId, UUID projectId, Integer page, Integer pageSize, String taskIds, ChargeType chargeType) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTasksForHttpResponse(accessToken, xeroTenantId, projectId, page, pageSize, taskIds, chargeType); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTasks -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves all project tasks + * Allows you to retrieve a specific project + *

200 - OK/success, returns a list of task objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param taskIds Search for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskID},{taskID} + * @param chargeType The chargeType parameter + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTasksForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, Integer page, Integer pageSize, String taskIds, ChargeType chargeType) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTasks"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling getTasks"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTasks"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks"); + if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (taskIds != null) { + String key = "taskIds"; + Object value = taskIds; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (chargeType != null) { + String key = "chargeType"; + Object value = chargeType; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves all time entries associated with a specific project + * Allows you to retrieve the time entries associated with a specific project + *

200 - OK/success, returns a list of time entry objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId Identifier of the project, that the task (which the time entry is logged against) belongs to. + * @param userId The xero user identifier of the person who logged time. + * @param taskId Identifier of the task that time entry is logged against. + * @param invoiceId Finds all time entries for this invoice. + * @param contactId Finds all time entries for this contact identifier. + * @param page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param states Comma-separated list of states to find. Will find all time entries that are in the status of whatever is specified. + * @param isChargeable Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. + * @param dateAfterUtc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. + * @param dateBeforeUtc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. + * @param accessToken Authorization token for user set in header of each request + * @return TimeEntries + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimeEntries getTimeEntries(String accessToken, String xeroTenantId, UUID projectId, UUID userId, UUID taskId, UUID invoiceId, UUID contactId, Integer page, Integer pageSize, List states, Boolean isChargeable, OffsetDateTime dateAfterUtc, OffsetDateTime dateBeforeUtc) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimeEntriesForHttpResponse(accessToken, xeroTenantId, projectId, userId, taskId, invoiceId, contactId, page, pageSize, states, isChargeable, dateAfterUtc, dateBeforeUtc); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimeEntries -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves all time entries associated with a specific project + * Allows you to retrieve the time entries associated with a specific project + *

200 - OK/success, returns a list of time entry objects + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId Identifier of the project, that the task (which the time entry is logged against) belongs to. + * @param userId The xero user identifier of the person who logged time. + * @param taskId Identifier of the task that time entry is logged against. + * @param invoiceId Finds all time entries for this invoice. + * @param contactId Finds all time entries for this contact identifier. + * @param page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param pageSize Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param states Comma-separated list of states to find. Will find all time entries that are in the status of whatever is specified. + * @param isChargeable Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. + * @param dateAfterUtc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. + * @param dateBeforeUtc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimeEntriesForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, UUID userId, UUID taskId, UUID invoiceId, UUID contactId, Integer page, Integer pageSize, List states, Boolean isChargeable, OffsetDateTime dateAfterUtc, OffsetDateTime dateBeforeUtc) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimeEntries"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling getTimeEntries"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimeEntries"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time"); + if (userId != null) { + String key = "userId"; + Object value = userId; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (taskId != null) { + String key = "taskId"; + Object value = taskId; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (invoiceId != null) { + String key = "invoiceId"; + Object value = invoiceId; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (contactId != null) { + String key = "contactId"; + Object value = contactId; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (page != null) { + String key = "page"; + Object value = page; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (pageSize != null) { + String key = "pageSize"; + Object value = pageSize; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (states != null) { + String key = "states"; + Object value = states; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (isChargeable != null) { + String key = "isChargeable"; + Object value = isChargeable; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateAfterUtc != null) { + String key = "dateAfterUtc"; + Object value = dateAfterUtc; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (dateBeforeUtc != null) { + String key = "dateBeforeUtc"; + Object value = dateBeforeUtc; + if (value instanceof Collection) { + List valueList = new ArrayList<>((Collection) value); + if(!valueList.isEmpty() && valueList.get(0) instanceof UUID) { + List list=new ArrayList(); + for(int i = 0; i < valueList.size(); i++) + { + list.add(valueList.get(i).toString()); + } + uriBuilder = uriBuilder.queryParam(key, String.join(",", list)); + } + else{ + uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList)); + } + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Retrieves a single time entry for a specific project + * Allows you to get a single time entry in a project + *

200 - OK/success, returns the specified time entry + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @return TimeEntry + * @throws IOException if an error occurs while attempting to invoke the API **/ + public TimeEntry getTimeEntry(String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) throws IOException { + try { + TypeReference typeRef = new TypeReference() {}; + HttpResponse response = getTimeEntryForHttpResponse(accessToken, xeroTenantId, projectId, timeEntryId); + return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getTimeEntry -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + return null; + } + + /** + * Retrieves a single time entry for a specific project + * Allows you to get a single time entry in a project + *

200 - OK/success, returns the specified time entry + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse getTimeEntryForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getTimeEntry"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling getTimeEntry"); + }// verify the required parameter 'timeEntryId' is set + if (timeEntryId == null) { + throw new IllegalArgumentException("Missing the required parameter 'timeEntryId' when calling getTimeEntry"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getTimeEntry"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + uriVariables.put("timeEntryId", timeEntryId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time/{timeEntryId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("GET " + genericUrl.toString()); + } + + HttpContent content = null; + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * creates a project for the specified contact + * Allows you to update a specific projects. + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param projectPatch Update the status of an existing Project + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void patchProject(String accessToken, String xeroTenantId, UUID projectId, ProjectPatch projectPatch, String idempotencyKey) throws IOException { + try { + patchProjectForHttpResponse(accessToken, xeroTenantId, projectId, projectPatch, idempotencyKey); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : patchProject -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * creates a project for the specified contact + * Allows you to update a specific projects. + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param projectPatch Update the status of an existing Project + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse patchProjectForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, ProjectPatch projectPatch, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling patchProject"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling patchProject"); + }// verify the required parameter 'projectPatch' is set + if (projectPatch == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectPatch' when calling patchProject"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling patchProject"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PATCH " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(projectPatch); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PATCH, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a specific project + * Allows you to update a specific projects. + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param projectCreateOrUpdate Request of type ProjectCreateOrUpdate + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void updateProject(String accessToken, String xeroTenantId, UUID projectId, ProjectCreateOrUpdate projectCreateOrUpdate, String idempotencyKey) throws IOException { + try { + updateProjectForHttpResponse(accessToken, xeroTenantId, projectId, projectCreateOrUpdate, idempotencyKey); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateProject -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Updates a specific project + * Allows you to update a specific projects. + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param projectCreateOrUpdate Request of type ProjectCreateOrUpdate + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateProjectForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, ProjectCreateOrUpdate projectCreateOrUpdate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateProject"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling updateProject"); + }// verify the required parameter 'projectCreateOrUpdate' is set + if (projectCreateOrUpdate == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectCreateOrUpdate' when calling updateProject"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateProject"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(projectCreateOrUpdate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Allows you to update a task + * Allows you to update a specific task + *

204 - OK/Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param taskId You can specify an individual task by appending the id to the endpoint + * @param taskCreateOrUpdate The task object you are updating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void updateTask(String accessToken, String xeroTenantId, UUID projectId, UUID taskId, TaskCreateOrUpdate taskCreateOrUpdate, String idempotencyKey) throws IOException { + try { + updateTaskForHttpResponse(accessToken, xeroTenantId, projectId, taskId, taskCreateOrUpdate, idempotencyKey); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTask -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Allows you to update a task + * Allows you to update a specific task + *

204 - OK/Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param taskId You can specify an individual task by appending the id to the endpoint + * @param taskCreateOrUpdate The task object you are updating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTaskForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, UUID taskId, TaskCreateOrUpdate taskCreateOrUpdate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTask"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling updateTask"); + }// verify the required parameter 'taskId' is set + if (taskId == null) { + throw new IllegalArgumentException("Missing the required parameter 'taskId' when calling updateTask"); + }// verify the required parameter 'taskCreateOrUpdate' is set + if (taskCreateOrUpdate == null) { + throw new IllegalArgumentException("Missing the required parameter 'taskCreateOrUpdate' when calling updateTask"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTask"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + uriVariables.put("taskId", taskId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Tasks/{taskId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(taskCreateOrUpdate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** + * Updates a time entry for a specific project + * Allows you to update time entry in a project + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint + * @param timeEntryCreateOrUpdate The time entry object you are updating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @throws IOException if an error occurs while attempting to invoke the API **/ + public void updateTimeEntry(String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId, TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, String idempotencyKey) throws IOException { + try { + updateTimeEntryForHttpResponse(accessToken, xeroTenantId, projectId, timeEntryId, timeEntryCreateOrUpdate, idempotencyKey); + } catch (HttpResponseException e) { + if (logger.isDebugEnabled()) { + logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : updateTimeEntry -------------------"); + logger.debug(e.toString()); + } + XeroApiExceptionHandler handler = new XeroApiExceptionHandler(); + handler.execute(e); + } catch (IOException ioe) { + throw ioe; + } + + } + + /** + * Updates a time entry for a specific project + * Allows you to update time entry in a project + *

204 - Success - return response 204 no content + *

400 - A failed request due to validation error + * @param xeroTenantId Xero identifier for Tenant + * @param projectId You can specify an individual project by appending the projectId to the endpoint + * @param timeEntryId You can specify an individual time entry by appending the id to the endpoint + * @param timeEntryCreateOrUpdate The time entry object you are updating + * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + * @param accessToken Authorization token for user set in header of each request + * @return HttpResponse + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public HttpResponse updateTimeEntryForHttpResponse(String accessToken, String xeroTenantId, UUID projectId, UUID timeEntryId, TimeEntryCreateOrUpdate timeEntryCreateOrUpdate, String idempotencyKey) throws IOException { + // verify the required parameter 'xeroTenantId' is set + if (xeroTenantId == null) { + throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling updateTimeEntry"); + }// verify the required parameter 'projectId' is set + if (projectId == null) { + throw new IllegalArgumentException("Missing the required parameter 'projectId' when calling updateTimeEntry"); + }// verify the required parameter 'timeEntryId' is set + if (timeEntryId == null) { + throw new IllegalArgumentException("Missing the required parameter 'timeEntryId' when calling updateTimeEntry"); + }// verify the required parameter 'timeEntryCreateOrUpdate' is set + if (timeEntryCreateOrUpdate == null) { + throw new IllegalArgumentException("Missing the required parameter 'timeEntryCreateOrUpdate' when calling updateTimeEntry"); + } + if (accessToken == null) { + throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling updateTimeEntry"); + } + HttpHeaders headers = new HttpHeaders(); + headers.set("Xero-Tenant-Id", xeroTenantId); + headers.set("Idempotency-Key", idempotencyKey); + headers.setAccept("application/json"); + headers.setUserAgent(this.getUserAgent()); + // create a map of path variables + final Map uriVariables = new HashMap(); + uriVariables.put("projectId", projectId); + uriVariables.put("timeEntryId", timeEntryId); + + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Projects/{projectId}/Time/{timeEntryId}"); + String url = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(url); + if (logger.isDebugEnabled()) { + logger.debug("PUT " + genericUrl.toString()); + } + + HttpContent content = null; + content = apiClient.new JacksonJsonHttpContent(timeEntryCreateOrUpdate); + + Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken); + HttpTransport transport = apiClient.getHttpTransport(); + HttpRequestFactory requestFactory = transport.createRequestFactory(credential); + return requestFactory.buildRequest(HttpMethods.PUT, genericUrl, content).setHeaders(headers) + .setConnectTimeout(apiClient.getConnectionTimeout()) + .setReadTimeout(apiClient.getReadTimeout()).execute(); + } + + + /** convert intput to byte array + * @param is InputStream the server status code returned + * @return byteArrayInputStream a ByteArrayInputStream + * @throws IOException for failed or interrupted I/O operations + **/ + public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException { + byte[] bytes = IOUtils.toByteArray(is); + try { + // Process the input stream.. + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + return byteArrayInputStream; + } finally { + is.close(); + } + } - } } diff --git a/src/main/java/com/xero/models/accounting/Account.java b/src/main/java/com/xero/models/accounting/Account.java index 5e12e35ef..8d65e8efa 100644 --- a/src/main/java/com/xero/models/accounting/Account.java +++ b/src/main/java/com/xero/models/accounting/Account.java @@ -9,21 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.AccountType; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Account + */ -/** Account */ public class Account { StringUtil util = new StringUtil(); @@ -41,15 +57,23 @@ public class Account { @JsonProperty("BankAccountNumber") private String bankAccountNumber; - /** Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes */ + /** + * Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** ARCHIVED */ + + /** + * ARCHIVED + */ ARCHIVED("ARCHIVED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -58,31 +82,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -94,26 +112,39 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @JsonProperty("Description") private String description; - /** For bank accounts only. See Bank Account types */ + /** + * For bank accounts only. See Bank Account types + */ public enum BankAccountTypeEnum { - /** BANK */ + /** + * BANK + */ BANK("BANK"), - - /** CREDITCARD */ + + /** + * CREDITCARD + */ CREDITCARD("CREDITCARD"), - - /** PAYPAL */ + + /** + * PAYPAL + */ PAYPAL("PAYPAL"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"), - - /** EMPTY */ + + /** + * EMPTY + */ EMPTY(""); private String value; @@ -122,31 +153,25 @@ public enum BankAccountTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static BankAccountTypeEnum fromValue(String value) { for (BankAccountTypeEnum b : BankAccountTypeEnum.values()) { @@ -158,6 +183,7 @@ public static BankAccountTypeEnum fromValue(String value) { } } + @JsonProperty("BankAccountType") private BankAccountTypeEnum bankAccountType; @@ -172,21 +198,33 @@ public static BankAccountTypeEnum fromValue(String value) { @JsonProperty("ShowInExpenseClaims") private Boolean showInExpenseClaims; - /** See Account Class Types */ + /** + * See Account Class Types + */ public enum PropertyClassEnum { - /** ASSET */ + /** + * ASSET + */ ASSET("ASSET"), - - /** EQUITY */ + + /** + * EQUITY + */ EQUITY("EQUITY"), - - /** EXPENSE */ + + /** + * EXPENSE + */ EXPENSE("EXPENSE"), - - /** LIABILITY */ + + /** + * LIABILITY + */ LIABILITY("LIABILITY"), - - /** REVENUE */ + + /** + * REVENUE + */ REVENUE("REVENUE"); private String value; @@ -195,31 +233,25 @@ public enum PropertyClassEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PropertyClassEnum fromValue(String value) { for (PropertyClassEnum b : PropertyClassEnum.values()) { @@ -231,74 +263,116 @@ public static PropertyClassEnum fromValue(String value) { } } + @JsonProperty("Class") private PropertyClassEnum propertyClass; /** - * If this is a system account then this element is returned. See System Account types. Note that - * non-system accounts may have this element set as either “” or null. + * If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. */ public enum SystemAccountEnum { - /** DEBTORS */ + /** + * DEBTORS + */ DEBTORS("DEBTORS"), - - /** CREDITORS */ + + /** + * CREDITORS + */ CREDITORS("CREDITORS"), - - /** BANKCURRENCYGAIN */ + + /** + * BANKCURRENCYGAIN + */ BANKCURRENCYGAIN("BANKCURRENCYGAIN"), - - /** GST */ + + /** + * GST + */ GST("GST"), - - /** GSTONIMPORTS */ + + /** + * GSTONIMPORTS + */ GSTONIMPORTS("GSTONIMPORTS"), - - /** HISTORICAL */ + + /** + * HISTORICAL + */ HISTORICAL("HISTORICAL"), - - /** REALISEDCURRENCYGAIN */ + + /** + * REALISEDCURRENCYGAIN + */ REALISEDCURRENCYGAIN("REALISEDCURRENCYGAIN"), - - /** RETAINEDEARNINGS */ + + /** + * RETAINEDEARNINGS + */ RETAINEDEARNINGS("RETAINEDEARNINGS"), - - /** ROUNDING */ + + /** + * ROUNDING + */ ROUNDING("ROUNDING"), - - /** TRACKINGTRANSFERS */ + + /** + * TRACKINGTRANSFERS + */ TRACKINGTRANSFERS("TRACKINGTRANSFERS"), - - /** UNPAIDEXPCLM */ + + /** + * UNPAIDEXPCLM + */ UNPAIDEXPCLM("UNPAIDEXPCLM"), - - /** UNREALISEDCURRENCYGAIN */ + + /** + * UNREALISEDCURRENCYGAIN + */ UNREALISEDCURRENCYGAIN("UNREALISEDCURRENCYGAIN"), - - /** WAGEPAYABLES */ + + /** + * WAGEPAYABLES + */ WAGEPAYABLES("WAGEPAYABLES"), - - /** CISASSETS */ + + /** + * CISASSETS + */ CISASSETS("CISASSETS"), - - /** CISASSET */ + + /** + * CISASSET + */ CISASSET("CISASSET"), - - /** CISLABOUR */ + + /** + * CISLABOUR + */ CISLABOUR("CISLABOUR"), - - /** CISLABOUREXPENSE */ + + /** + * CISLABOUREXPENSE + */ CISLABOUREXPENSE("CISLABOUREXPENSE"), - - /** CISLABOURINCOME */ + + /** + * CISLABOURINCOME + */ CISLABOURINCOME("CISLABOURINCOME"), - - /** CISLIABILITY */ + + /** + * CISLIABILITY + */ CISLIABILITY("CISLIABILITY"), - - /** CISMATERIALS */ + + /** + * CISMATERIALS + */ CISMATERIALS("CISMATERIALS"), - - /** EMPTY */ + + /** + * EMPTY + */ EMPTY(""); private String value; @@ -307,31 +381,25 @@ public enum SystemAccountEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static SystemAccountEnum fromValue(String value) { for (SystemAccountEnum b : SystemAccountEnum.values()) { @@ -343,6 +411,7 @@ public static SystemAccountEnum fromValue(String value) { } } + @JsonProperty("SystemAccount") private SystemAccountEnum systemAccount; @@ -364,621 +433,537 @@ public static SystemAccountEnum fromValue(String value) { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - * - * @param code String - * @return Account - */ + * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) + * @param code String + * @return Account + **/ public Account code(String code) { this.code = code; return this; } - /** + /** * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - * * @return code - */ - @ApiModelProperty( - example = "4400", - value = "Customer defined alpha numeric account code e.g 200 or SALES (max length = 10)") - /** + **/ + @ApiModelProperty(example = "4400", value = "Customer defined alpha numeric account code e.g 200 or SALES (max length = 10)") + /** * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - * - * @param code String - */ + /** + * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Name of account (max length = 150) - * - * @param name String - * @return Account - */ + * Name of account (max length = 150) + * @param name String + * @return Account + **/ public Account name(String name) { this.name = name; return this; } - /** + /** * Name of account (max length = 150) - * * @return name - */ + **/ @ApiModelProperty(example = "Food Sales", value = "Name of account (max length = 150)") - /** + /** * Name of account (max length = 150) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of account (max length = 150) - * - * @param name String - */ + /** + * Name of account (max length = 150) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The Xero identifier for an account – specified as a string following the endpoint name e.g. - * /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param accountID UUID - * @return Account - */ + * The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param accountID UUID + * @return Account + **/ public Account accountID(UUID accountID) { this.accountID = accountID; return this; } - /** - * The Xero identifier for an account – specified as a string following the endpoint name e.g. - * /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * + /** + * The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 * @return accountID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = - "The Xero identifier for an account – specified as a string following the endpoint name" - + " e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9") - /** - * The Xero identifier for an account – specified as a string following the endpoint name e.g. - * /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9") + /** + * The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * The Xero identifier for an account – specified as a string following the endpoint name e.g. - * /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param accountID UUID - */ + /** + * The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * type - * - * @param type AccountType - * @return Account - */ + * type + * @param type AccountType + * @return Account + **/ public Account type(AccountType type) { this.type = type; return this; } - /** + /** * Get type - * * @return type - */ + **/ @ApiModelProperty(value = "") - /** + /** * type - * * @return type AccountType - */ + **/ public AccountType getType() { return type; } - /** - * type - * - * @param type AccountType - */ + /** + * type + * @param type AccountType + **/ + public void setType(AccountType type) { this.type = type; } /** - * For bank accounts only (Account Type BANK) - * - * @param bankAccountNumber String - * @return Account - */ + * For bank accounts only (Account Type BANK) + * @param bankAccountNumber String + * @return Account + **/ public Account bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; return this; } - /** + /** * For bank accounts only (Account Type BANK) - * * @return bankAccountNumber - */ + **/ @ApiModelProperty(value = "For bank accounts only (Account Type BANK)") - /** + /** * For bank accounts only (Account Type BANK) - * * @return bankAccountNumber String - */ + **/ public String getBankAccountNumber() { return bankAccountNumber; } - /** - * For bank accounts only (Account Type BANK) - * - * @param bankAccountNumber String - */ + /** + * For bank accounts only (Account Type BANK) + * @param bankAccountNumber String + **/ + public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; } /** - * Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes - * - * @param status StatusEnum - * @return Account - */ + * Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes + * @param status StatusEnum + * @return Account + **/ public Account status(StatusEnum status) { this.status = status; return this; } - /** + /** * Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes - * * @return status - */ - @ApiModelProperty( - value = - "Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes") - /** + **/ + @ApiModelProperty(value = "Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes") + /** * Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes - * - * @param status StatusEnum - */ + /** + * Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Description of the Account. Valid for all types of accounts except bank accounts (max length - * = 4000) - * - * @param description String - * @return Account - */ + * Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) + * @param description String + * @return Account + **/ public Account description(String description) { this.description = description; return this; } - /** - * Description of the Account. Valid for all types of accounts except bank accounts (max length - * = 4000) - * + /** + * Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) * @return description - */ - @ApiModelProperty( - value = - "Description of the Account. Valid for all types of accounts except bank accounts (max" - + " length = 4000)") - /** - * Description of the Account. Valid for all types of accounts except bank accounts (max length - * = 4000) - * + **/ + @ApiModelProperty(value = "Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000)") + /** + * Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Description of the Account. Valid for all types of accounts except bank accounts (max length - * = 4000) - * - * @param description String - */ + /** + * Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * For bank accounts only. See Bank Account types - * - * @param bankAccountType BankAccountTypeEnum - * @return Account - */ + * For bank accounts only. See Bank Account types + * @param bankAccountType BankAccountTypeEnum + * @return Account + **/ public Account bankAccountType(BankAccountTypeEnum bankAccountType) { this.bankAccountType = bankAccountType; return this; } - /** + /** * For bank accounts only. See Bank Account types - * * @return bankAccountType - */ + **/ @ApiModelProperty(value = "For bank accounts only. See Bank Account types") - /** + /** * For bank accounts only. See Bank Account types - * * @return bankAccountType BankAccountTypeEnum - */ + **/ public BankAccountTypeEnum getBankAccountType() { return bankAccountType; } - /** - * For bank accounts only. See Bank Account types - * - * @param bankAccountType BankAccountTypeEnum - */ + /** + * For bank accounts only. See Bank Account types + * @param bankAccountType BankAccountTypeEnum + **/ + public void setBankAccountType(BankAccountTypeEnum bankAccountType) { this.bankAccountType = bankAccountType; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return Account - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return Account + **/ public Account currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * The tax type from taxRates - * - * @param taxType String - * @return Account - */ + * The tax type from taxRates + * @param taxType String + * @return Account + **/ public Account taxType(String taxType) { this.taxType = taxType; return this; } - /** + /** * The tax type from taxRates - * * @return taxType - */ + **/ @ApiModelProperty(value = "The tax type from taxRates") - /** + /** * The tax type from taxRates - * * @return taxType String - */ + **/ public String getTaxType() { return taxType; } - /** - * The tax type from taxRates - * - * @param taxType String - */ + /** + * The tax type from taxRates + * @param taxType String + **/ + public void setTaxType(String taxType) { this.taxType = taxType; } /** - * Boolean – describes whether account can have payments applied to it - * - * @param enablePaymentsToAccount Boolean - * @return Account - */ + * Boolean – describes whether account can have payments applied to it + * @param enablePaymentsToAccount Boolean + * @return Account + **/ public Account enablePaymentsToAccount(Boolean enablePaymentsToAccount) { this.enablePaymentsToAccount = enablePaymentsToAccount; return this; } - /** + /** * Boolean – describes whether account can have payments applied to it - * * @return enablePaymentsToAccount - */ + **/ @ApiModelProperty(value = "Boolean – describes whether account can have payments applied to it") - /** + /** * Boolean – describes whether account can have payments applied to it - * * @return enablePaymentsToAccount Boolean - */ + **/ public Boolean getEnablePaymentsToAccount() { return enablePaymentsToAccount; } - /** - * Boolean – describes whether account can have payments applied to it - * - * @param enablePaymentsToAccount Boolean - */ + /** + * Boolean – describes whether account can have payments applied to it + * @param enablePaymentsToAccount Boolean + **/ + public void setEnablePaymentsToAccount(Boolean enablePaymentsToAccount) { this.enablePaymentsToAccount = enablePaymentsToAccount; } /** - * Boolean – describes whether account code is available for use with expense claims - * - * @param showInExpenseClaims Boolean - * @return Account - */ + * Boolean – describes whether account code is available for use with expense claims + * @param showInExpenseClaims Boolean + * @return Account + **/ public Account showInExpenseClaims(Boolean showInExpenseClaims) { this.showInExpenseClaims = showInExpenseClaims; return this; } - /** + /** * Boolean – describes whether account code is available for use with expense claims - * * @return showInExpenseClaims - */ - @ApiModelProperty( - value = "Boolean – describes whether account code is available for use with expense claims") - /** + **/ + @ApiModelProperty(value = "Boolean – describes whether account code is available for use with expense claims") + /** * Boolean – describes whether account code is available for use with expense claims - * * @return showInExpenseClaims Boolean - */ + **/ public Boolean getShowInExpenseClaims() { return showInExpenseClaims; } - /** - * Boolean – describes whether account code is available for use with expense claims - * - * @param showInExpenseClaims Boolean - */ + /** + * Boolean – describes whether account code is available for use with expense claims + * @param showInExpenseClaims Boolean + **/ + public void setShowInExpenseClaims(Boolean showInExpenseClaims) { this.showInExpenseClaims = showInExpenseClaims; } - /** + /** * See Account Class Types - * * @return propertyClass - */ + **/ @ApiModelProperty(value = "See Account Class Types") - /** + /** * See Account Class Types - * * @return propertyClass PropertyClassEnum - */ + **/ public PropertyClassEnum getPropertyClass() { return propertyClass; } - /** - * If this is a system account then this element is returned. See System Account types. Note that - * non-system accounts may have this element set as either “” or null. - * + /** + * If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. * @return systemAccount - */ - @ApiModelProperty( - value = - "If this is a system account then this element is returned. See System Account types." - + " Note that non-system accounts may have this element set as either “” or null.") - /** - * If this is a system account then this element is returned. See System Account types. Note that - * non-system accounts may have this element set as either “” or null. - * + **/ + @ApiModelProperty(value = "If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null.") + /** + * If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. * @return systemAccount SystemAccountEnum - */ + **/ public SystemAccountEnum getSystemAccount() { return systemAccount; } /** - * Shown if set - * - * @param reportingCode String - * @return Account - */ + * Shown if set + * @param reportingCode String + * @return Account + **/ public Account reportingCode(String reportingCode) { this.reportingCode = reportingCode; return this; } - /** + /** * Shown if set - * * @return reportingCode - */ + **/ @ApiModelProperty(value = "Shown if set") - /** + /** * Shown if set - * * @return reportingCode String - */ + **/ public String getReportingCode() { return reportingCode; } - /** - * Shown if set - * - * @param reportingCode String - */ + /** + * Shown if set + * @param reportingCode String + **/ + public void setReportingCode(String reportingCode) { this.reportingCode = reportingCode; } - /** + /** * Shown if set - * * @return reportingCodeName - */ + **/ @ApiModelProperty(value = "Shown if set") - /** + /** * Shown if set - * * @return reportingCodeName String - */ + **/ public String getReportingCodeName() { return reportingCodeName; } - /** + /** * boolean to indicate if an account has an attachment (read only) - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "boolean to indicate if an account has an attachment (read only)") - /** + **/ + @ApiModelProperty(example = "false", value = "boolean to indicate if an account has an attachment (read only)") + /** * boolean to indicate if an account has an attachment (read only) - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Boolean – describes whether the account is shown in the watchlist widget on the dashboard - * - * @param addToWatchlist Boolean - * @return Account - */ + * Boolean – describes whether the account is shown in the watchlist widget on the dashboard + * @param addToWatchlist Boolean + * @return Account + **/ public Account addToWatchlist(Boolean addToWatchlist) { this.addToWatchlist = addToWatchlist; return this; } - /** + /** * Boolean – describes whether the account is shown in the watchlist widget on the dashboard - * * @return addToWatchlist - */ - @ApiModelProperty( - value = - "Boolean – describes whether the account is shown in the watchlist widget on the" - + " dashboard") - /** + **/ + @ApiModelProperty(value = "Boolean – describes whether the account is shown in the watchlist widget on the dashboard") + /** * Boolean – describes whether the account is shown in the watchlist widget on the dashboard - * * @return addToWatchlist Boolean - */ + **/ public Boolean getAddToWatchlist() { return addToWatchlist; } - /** - * Boolean – describes whether the account is shown in the watchlist widget on the dashboard - * - * @param addToWatchlist Boolean - */ + /** + * Boolean – describes whether the account is shown in the watchlist widget on the dashboard + * @param addToWatchlist Boolean + **/ + public void setAddToWatchlist(Boolean addToWatchlist) { this.addToWatchlist = addToWatchlist; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Account - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Account + **/ public Account validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -986,10 +971,9 @@ public Account validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Account - */ + **/ public Account addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -998,30 +982,29 @@ public Account addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1031,53 +1014,34 @@ public boolean equals(java.lang.Object o) { return false; } Account account = (Account) o; - return Objects.equals(this.code, account.code) - && Objects.equals(this.name, account.name) - && Objects.equals(this.accountID, account.accountID) - && Objects.equals(this.type, account.type) - && Objects.equals(this.bankAccountNumber, account.bankAccountNumber) - && Objects.equals(this.status, account.status) - && Objects.equals(this.description, account.description) - && Objects.equals(this.bankAccountType, account.bankAccountType) - && Objects.equals(this.currencyCode, account.currencyCode) - && Objects.equals(this.taxType, account.taxType) - && Objects.equals(this.enablePaymentsToAccount, account.enablePaymentsToAccount) - && Objects.equals(this.showInExpenseClaims, account.showInExpenseClaims) - && Objects.equals(this.propertyClass, account.propertyClass) - && Objects.equals(this.systemAccount, account.systemAccount) - && Objects.equals(this.reportingCode, account.reportingCode) - && Objects.equals(this.reportingCodeName, account.reportingCodeName) - && Objects.equals(this.hasAttachments, account.hasAttachments) - && Objects.equals(this.updatedDateUTC, account.updatedDateUTC) - && Objects.equals(this.addToWatchlist, account.addToWatchlist) - && Objects.equals(this.validationErrors, account.validationErrors); + return Objects.equals(this.code, account.code) && + Objects.equals(this.name, account.name) && + Objects.equals(this.accountID, account.accountID) && + Objects.equals(this.type, account.type) && + Objects.equals(this.bankAccountNumber, account.bankAccountNumber) && + Objects.equals(this.status, account.status) && + Objects.equals(this.description, account.description) && + Objects.equals(this.bankAccountType, account.bankAccountType) && + Objects.equals(this.currencyCode, account.currencyCode) && + Objects.equals(this.taxType, account.taxType) && + Objects.equals(this.enablePaymentsToAccount, account.enablePaymentsToAccount) && + Objects.equals(this.showInExpenseClaims, account.showInExpenseClaims) && + Objects.equals(this.propertyClass, account.propertyClass) && + Objects.equals(this.systemAccount, account.systemAccount) && + Objects.equals(this.reportingCode, account.reportingCode) && + Objects.equals(this.reportingCodeName, account.reportingCodeName) && + Objects.equals(this.hasAttachments, account.hasAttachments) && + Objects.equals(this.updatedDateUTC, account.updatedDateUTC) && + Objects.equals(this.addToWatchlist, account.addToWatchlist) && + Objects.equals(this.validationErrors, account.validationErrors); } @Override public int hashCode() { - return Objects.hash( - code, - name, - accountID, - type, - bankAccountNumber, - status, - description, - bankAccountType, - currencyCode, - taxType, - enablePaymentsToAccount, - showInExpenseClaims, - propertyClass, - systemAccount, - reportingCode, - reportingCodeName, - hasAttachments, - updatedDateUTC, - addToWatchlist, - validationErrors); + return Objects.hash(code, name, accountID, type, bankAccountNumber, status, description, bankAccountType, currencyCode, taxType, enablePaymentsToAccount, showInExpenseClaims, propertyClass, systemAccount, reportingCode, reportingCodeName, hasAttachments, updatedDateUTC, addToWatchlist, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1092,12 +1056,8 @@ public String toString() { sb.append(" bankAccountType: ").append(toIndentedString(bankAccountType)).append("\n"); sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).append("\n"); sb.append(" taxType: ").append(toIndentedString(taxType)).append("\n"); - sb.append(" enablePaymentsToAccount: ") - .append(toIndentedString(enablePaymentsToAccount)) - .append("\n"); - sb.append(" showInExpenseClaims: ") - .append(toIndentedString(showInExpenseClaims)) - .append("\n"); + sb.append(" enablePaymentsToAccount: ").append(toIndentedString(enablePaymentsToAccount)).append("\n"); + sb.append(" showInExpenseClaims: ").append(toIndentedString(showInExpenseClaims)).append("\n"); sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); sb.append(" systemAccount: ").append(toIndentedString(systemAccount)).append("\n"); sb.append(" reportingCode: ").append(toIndentedString(reportingCode)).append("\n"); @@ -1111,7 +1071,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1119,4 +1080,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/AccountType.java b/src/main/java/com/xero/models/accounting/AccountType.java index ad8e61558..1f18a8f16 100644 --- a/src/main/java/com/xero/models/accounting/AccountType.java +++ b/src/main/java/com/xero/models/accounting/AccountType.java @@ -9,67 +9,115 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; - +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** See Account Types */ +/** + * See Account Types + */ public enum AccountType { - - /** BANK */ + + /** + * BANK + */ BANK("BANK"), - - /** CURRENT */ + + /** + * CURRENT + */ CURRENT("CURRENT"), - - /** CURRLIAB */ + + /** + * CURRLIAB + */ CURRLIAB("CURRLIAB"), - - /** DEPRECIATN */ + + /** + * DEPRECIATN + */ DEPRECIATN("DEPRECIATN"), - - /** DIRECTCOSTS */ + + /** + * DIRECTCOSTS + */ DIRECTCOSTS("DIRECTCOSTS"), - - /** EQUITY */ + + /** + * EQUITY + */ EQUITY("EQUITY"), - - /** EXPENSE */ + + /** + * EXPENSE + */ EXPENSE("EXPENSE"), - - /** FIXED */ + + /** + * FIXED + */ FIXED("FIXED"), - - /** INVENTORY */ + + /** + * INVENTORY + */ INVENTORY("INVENTORY"), - - /** LIABILITY */ + + /** + * LIABILITY + */ LIABILITY("LIABILITY"), - - /** NONCURRENT */ + + /** + * NONCURRENT + */ NONCURRENT("NONCURRENT"), - - /** OTHERINCOME */ + + /** + * OTHERINCOME + */ OTHERINCOME("OTHERINCOME"), - - /** OVERHEADS */ + + /** + * OVERHEADS + */ OVERHEADS("OVERHEADS"), - - /** PREPAYMENT */ + + /** + * PREPAYMENT + */ PREPAYMENT("PREPAYMENT"), - - /** REVENUE */ + + /** + * REVENUE + */ REVENUE("REVENUE"), - - /** SALES */ + + /** + * SALES + */ SALES("SALES"), - - /** TERMLIAB */ + + /** + * TERMLIAB + */ TERMLIAB("TERMLIAB"), - - /** PAYG */ + + /** + * PAYG + */ PAYG("PAYG"); private String value; @@ -78,26 +126,24 @@ public enum AccountType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static AccountType fromValue(String value) { @@ -109,3 +155,4 @@ public static AccountType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/Accounts.java b/src/main/java/com/xero/models/accounting/Accounts.java index f3b02938e..da46b7491 100644 --- a/src/main/java/com/xero/models/accounting/Accounts.java +++ b/src/main/java/com/xero/models/accounting/Accounts.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Account; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Accounts + */ -/** Accounts */ public class Accounts { StringUtil util = new StringUtil(); @JsonProperty("Accounts") private List accounts = new ArrayList(); /** - * accounts - * - * @param accounts List<Account> - * @return Accounts - */ + * accounts + * @param accounts List<Account> + * @return Accounts + **/ public Accounts accounts(List accounts) { this.accounts = accounts; return this; @@ -37,10 +54,9 @@ public Accounts accounts(List accounts) { /** * accounts - * - * @param accountsItem Account + * @param accountsItem Account * @return Accounts - */ + **/ public Accounts addAccountsItem(Account accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -49,30 +65,29 @@ public Accounts addAccountsItem(Account accountsItem) { return this; } - /** + /** * Get accounts - * * @return accounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * accounts - * * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * accounts - * - * @param accounts List<Account> - */ + /** + * accounts + * @param accounts List<Account> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(accounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/AccountsPayable.java b/src/main/java/com/xero/models/accounting/AccountsPayable.java index 5644f31a2..6f28d1b77 100644 --- a/src/main/java/com/xero/models/accounting/AccountsPayable.java +++ b/src/main/java/com/xero/models/accounting/AccountsPayable.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * AccountsPayable + */ -/** AccountsPayable */ public class AccountsPayable { StringUtil util = new StringUtil(); @@ -26,75 +43,70 @@ public class AccountsPayable { @JsonProperty("Overdue") private Double overdue; /** - * outstanding - * - * @param outstanding Double - * @return AccountsPayable - */ + * outstanding + * @param outstanding Double + * @return AccountsPayable + **/ public AccountsPayable outstanding(Double outstanding) { this.outstanding = outstanding; return this; } - /** + /** * Get outstanding - * * @return outstanding - */ + **/ @ApiModelProperty(value = "") - /** + /** * outstanding - * * @return outstanding Double - */ + **/ public Double getOutstanding() { return outstanding; } - /** - * outstanding - * - * @param outstanding Double - */ + /** + * outstanding + * @param outstanding Double + **/ + public void setOutstanding(Double outstanding) { this.outstanding = outstanding; } /** - * overdue - * - * @param overdue Double - * @return AccountsPayable - */ + * overdue + * @param overdue Double + * @return AccountsPayable + **/ public AccountsPayable overdue(Double overdue) { this.overdue = overdue; return this; } - /** + /** * Get overdue - * * @return overdue - */ + **/ @ApiModelProperty(value = "") - /** + /** * overdue - * * @return overdue Double - */ + **/ public Double getOverdue() { return overdue; } - /** - * overdue - * - * @param overdue Double - */ + /** + * overdue + * @param overdue Double + **/ + public void setOverdue(Double overdue) { this.overdue = overdue; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } AccountsPayable accountsPayable = (AccountsPayable) o; - return Objects.equals(this.outstanding, accountsPayable.outstanding) - && Objects.equals(this.overdue, accountsPayable.overdue); + return Objects.equals(this.outstanding, accountsPayable.outstanding) && + Objects.equals(this.overdue, accountsPayable.overdue); } @Override @@ -113,6 +125,7 @@ public int hashCode() { return Objects.hash(outstanding, overdue); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/AccountsReceivable.java b/src/main/java/com/xero/models/accounting/AccountsReceivable.java index d485b34fc..cd33d7d23 100644 --- a/src/main/java/com/xero/models/accounting/AccountsReceivable.java +++ b/src/main/java/com/xero/models/accounting/AccountsReceivable.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * AccountsReceivable + */ -/** AccountsReceivable */ public class AccountsReceivable { StringUtil util = new StringUtil(); @@ -26,75 +43,70 @@ public class AccountsReceivable { @JsonProperty("Overdue") private Double overdue; /** - * outstanding - * - * @param outstanding Double - * @return AccountsReceivable - */ + * outstanding + * @param outstanding Double + * @return AccountsReceivable + **/ public AccountsReceivable outstanding(Double outstanding) { this.outstanding = outstanding; return this; } - /** + /** * Get outstanding - * * @return outstanding - */ + **/ @ApiModelProperty(value = "") - /** + /** * outstanding - * * @return outstanding Double - */ + **/ public Double getOutstanding() { return outstanding; } - /** - * outstanding - * - * @param outstanding Double - */ + /** + * outstanding + * @param outstanding Double + **/ + public void setOutstanding(Double outstanding) { this.outstanding = outstanding; } /** - * overdue - * - * @param overdue Double - * @return AccountsReceivable - */ + * overdue + * @param overdue Double + * @return AccountsReceivable + **/ public AccountsReceivable overdue(Double overdue) { this.overdue = overdue; return this; } - /** + /** * Get overdue - * * @return overdue - */ + **/ @ApiModelProperty(value = "") - /** + /** * overdue - * * @return overdue Double - */ + **/ public Double getOverdue() { return overdue; } - /** - * overdue - * - * @param overdue Double - */ + /** + * overdue + * @param overdue Double + **/ + public void setOverdue(Double overdue) { this.overdue = overdue; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } AccountsReceivable accountsReceivable = (AccountsReceivable) o; - return Objects.equals(this.outstanding, accountsReceivable.outstanding) - && Objects.equals(this.overdue, accountsReceivable.overdue); + return Objects.equals(this.outstanding, accountsReceivable.outstanding) && + Objects.equals(this.overdue, accountsReceivable.overdue); } @Override @@ -113,6 +125,7 @@ public int hashCode() { return Objects.hash(outstanding, overdue); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Action.java b/src/main/java/com/xero/models/accounting/Action.java index 70302bdab..6b3409f40 100644 --- a/src/main/java/com/xero/models/accounting/Action.java +++ b/src/main/java/com/xero/models/accounting/Action.java @@ -9,27 +9,48 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Action + */ -/** Action */ public class Action { StringUtil util = new StringUtil(); @JsonProperty("Name") private String name; - /** Status of the action for this organisation */ + /** + * Status of the action for this organisation + */ public enum StatusEnum { - /** ALLOWED */ + /** + * ALLOWED + */ ALLOWED("ALLOWED"), - - /** NOT_ALLOWED */ + + /** + * NOT_ALLOWED + */ NOT_ALLOWED("NOT-ALLOWED"); private String value; @@ -38,31 +59,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -74,80 +89,74 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; /** - * Name of the actions for this organisation - * - * @param name String - * @return Action - */ + * Name of the actions for this organisation + * @param name String + * @return Action + **/ public Action name(String name) { this.name = name; return this; } - /** + /** * Name of the actions for this organisation - * * @return name - */ - @ApiModelProperty( - example = "UseMulticurrency", - value = "Name of the actions for this organisation") - /** + **/ + @ApiModelProperty(example = "UseMulticurrency", value = "Name of the actions for this organisation") + /** * Name of the actions for this organisation - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the actions for this organisation - * - * @param name String - */ + /** + * Name of the actions for this organisation + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Status of the action for this organisation - * - * @param status StatusEnum - * @return Action - */ + * Status of the action for this organisation + * @param status StatusEnum + * @return Action + **/ public Action status(StatusEnum status) { this.status = status; return this; } - /** + /** * Status of the action for this organisation - * * @return status - */ + **/ @ApiModelProperty(value = "Status of the action for this organisation") - /** + /** * Status of the action for this organisation - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the action for this organisation - * - * @param status StatusEnum - */ + /** + * Status of the action for this organisation + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -157,7 +166,8 @@ public boolean equals(java.lang.Object o) { return false; } Action action = (Action) o; - return Objects.equals(this.name, action.name) && Objects.equals(this.status, action.status); + return Objects.equals(this.name, action.name) && + Objects.equals(this.status, action.status); } @Override @@ -165,6 +175,7 @@ public int hashCode() { return Objects.hash(name, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -176,7 +187,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -184,4 +196,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Actions.java b/src/main/java/com/xero/models/accounting/Actions.java index 9bd331748..4c7f4946f 100644 --- a/src/main/java/com/xero/models/accounting/Actions.java +++ b/src/main/java/com/xero/models/accounting/Actions.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Action; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Actions + */ -/** Actions */ public class Actions { StringUtil util = new StringUtil(); @JsonProperty("Actions") private List actions = new ArrayList(); /** - * actions - * - * @param actions List<Action> - * @return Actions - */ + * actions + * @param actions List<Action> + * @return Actions + **/ public Actions actions(List actions) { this.actions = actions; return this; @@ -37,10 +54,9 @@ public Actions actions(List actions) { /** * actions - * - * @param actionsItem Action + * @param actionsItem Action * @return Actions - */ + **/ public Actions addActionsItem(Action actionsItem) { if (this.actions == null) { this.actions = new ArrayList(); @@ -49,30 +65,29 @@ public Actions addActionsItem(Action actionsItem) { return this; } - /** + /** * Get actions - * * @return actions - */ + **/ @ApiModelProperty(value = "") - /** + /** * actions - * * @return actions List - */ + **/ public List getActions() { return actions; } - /** - * actions - * - * @param actions List<Action> - */ + /** + * actions + * @param actions List<Action> + **/ + public void setActions(List actions) { this.actions = actions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(actions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Address.java b/src/main/java/com/xero/models/accounting/Address.java index e5bda7a4c..285541c54 100644 --- a/src/main/java/com/xero/models/accounting/Address.java +++ b/src/main/java/com/xero/models/accounting/Address.java @@ -9,24 +9,45 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Address + */ -/** Address */ public class Address { StringUtil util = new StringUtil(); - /** define the type of address */ + /** + * define the type of address + */ public enum AddressTypeEnum { - /** POBOX */ + /** + * POBOX + */ POBOX("POBOX"), - - /** STREET */ + + /** + * STREET + */ STREET("STREET"); private String value; @@ -35,31 +56,25 @@ public enum AddressTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static AddressTypeEnum fromValue(String value) { for (AddressTypeEnum b : AddressTypeEnum.values()) { @@ -71,6 +86,7 @@ public static AddressTypeEnum fromValue(String value) { } } + @JsonProperty("AddressType") private AddressTypeEnum addressType; @@ -101,355 +117,326 @@ public static AddressTypeEnum fromValue(String value) { @JsonProperty("AttentionTo") private String attentionTo; /** - * define the type of address - * - * @param addressType AddressTypeEnum - * @return Address - */ + * define the type of address + * @param addressType AddressTypeEnum + * @return Address + **/ public Address addressType(AddressTypeEnum addressType) { this.addressType = addressType; return this; } - /** + /** * define the type of address - * * @return addressType - */ + **/ @ApiModelProperty(value = "define the type of address") - /** + /** * define the type of address - * * @return addressType AddressTypeEnum - */ + **/ public AddressTypeEnum getAddressType() { return addressType; } - /** - * define the type of address - * - * @param addressType AddressTypeEnum - */ + /** + * define the type of address + * @param addressType AddressTypeEnum + **/ + public void setAddressType(AddressTypeEnum addressType) { this.addressType = addressType; } /** - * max length = 500 - * - * @param addressLine1 String - * @return Address - */ + * max length = 500 + * @param addressLine1 String + * @return Address + **/ public Address addressLine1(String addressLine1) { this.addressLine1 = addressLine1; return this; } - /** + /** * max length = 500 - * * @return addressLine1 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine1 String - */ + **/ public String getAddressLine1() { return addressLine1; } - /** - * max length = 500 - * - * @param addressLine1 String - */ + /** + * max length = 500 + * @param addressLine1 String + **/ + public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } /** - * max length = 500 - * - * @param addressLine2 String - * @return Address - */ + * max length = 500 + * @param addressLine2 String + * @return Address + **/ public Address addressLine2(String addressLine2) { this.addressLine2 = addressLine2; return this; } - /** + /** * max length = 500 - * * @return addressLine2 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine2 String - */ + **/ public String getAddressLine2() { return addressLine2; } - /** - * max length = 500 - * - * @param addressLine2 String - */ + /** + * max length = 500 + * @param addressLine2 String + **/ + public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } /** - * max length = 500 - * - * @param addressLine3 String - * @return Address - */ + * max length = 500 + * @param addressLine3 String + * @return Address + **/ public Address addressLine3(String addressLine3) { this.addressLine3 = addressLine3; return this; } - /** + /** * max length = 500 - * * @return addressLine3 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine3 String - */ + **/ public String getAddressLine3() { return addressLine3; } - /** - * max length = 500 - * - * @param addressLine3 String - */ + /** + * max length = 500 + * @param addressLine3 String + **/ + public void setAddressLine3(String addressLine3) { this.addressLine3 = addressLine3; } /** - * max length = 500 - * - * @param addressLine4 String - * @return Address - */ + * max length = 500 + * @param addressLine4 String + * @return Address + **/ public Address addressLine4(String addressLine4) { this.addressLine4 = addressLine4; return this; } - /** + /** * max length = 500 - * * @return addressLine4 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine4 String - */ + **/ public String getAddressLine4() { return addressLine4; } - /** - * max length = 500 - * - * @param addressLine4 String - */ + /** + * max length = 500 + * @param addressLine4 String + **/ + public void setAddressLine4(String addressLine4) { this.addressLine4 = addressLine4; } /** - * max length = 255 - * - * @param city String - * @return Address - */ + * max length = 255 + * @param city String + * @return Address + **/ public Address city(String city) { this.city = city; return this; } - /** + /** * max length = 255 - * * @return city - */ + **/ @ApiModelProperty(value = "max length = 255") - /** + /** * max length = 255 - * * @return city String - */ + **/ public String getCity() { return city; } - /** - * max length = 255 - * - * @param city String - */ + /** + * max length = 255 + * @param city String + **/ + public void setCity(String city) { this.city = city; } /** - * max length = 255 - * - * @param region String - * @return Address - */ + * max length = 255 + * @param region String + * @return Address + **/ public Address region(String region) { this.region = region; return this; } - /** + /** * max length = 255 - * * @return region - */ + **/ @ApiModelProperty(value = "max length = 255") - /** + /** * max length = 255 - * * @return region String - */ + **/ public String getRegion() { return region; } - /** - * max length = 255 - * - * @param region String - */ + /** + * max length = 255 + * @param region String + **/ + public void setRegion(String region) { this.region = region; } /** - * max length = 50 - * - * @param postalCode String - * @return Address - */ + * max length = 50 + * @param postalCode String + * @return Address + **/ public Address postalCode(String postalCode) { this.postalCode = postalCode; return this; } - /** + /** * max length = 50 - * * @return postalCode - */ + **/ @ApiModelProperty(value = "max length = 50") - /** + /** * max length = 50 - * * @return postalCode String - */ + **/ public String getPostalCode() { return postalCode; } - /** - * max length = 50 - * - * @param postalCode String - */ + /** + * max length = 50 + * @param postalCode String + **/ + public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** - * max length = 50, [A-Z], [a-z] only - * - * @param country String - * @return Address - */ + * max length = 50, [A-Z], [a-z] only + * @param country String + * @return Address + **/ public Address country(String country) { this.country = country; return this; } - /** + /** * max length = 50, [A-Z], [a-z] only - * * @return country - */ + **/ @ApiModelProperty(value = "max length = 50, [A-Z], [a-z] only") - /** + /** * max length = 50, [A-Z], [a-z] only - * * @return country String - */ + **/ public String getCountry() { return country; } - /** - * max length = 50, [A-Z], [a-z] only - * - * @param country String - */ + /** + * max length = 50, [A-Z], [a-z] only + * @param country String + **/ + public void setCountry(String country) { this.country = country; } /** - * max length = 255 - * - * @param attentionTo String - * @return Address - */ + * max length = 255 + * @param attentionTo String + * @return Address + **/ public Address attentionTo(String attentionTo) { this.attentionTo = attentionTo; return this; } - /** + /** * max length = 255 - * * @return attentionTo - */ + **/ @ApiModelProperty(value = "max length = 255") - /** + /** * max length = 255 - * * @return attentionTo String - */ + **/ public String getAttentionTo() { return attentionTo; } - /** - * max length = 255 - * - * @param attentionTo String - */ + /** + * max length = 255 + * @param attentionTo String + **/ + public void setAttentionTo(String attentionTo) { this.attentionTo = attentionTo; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -459,33 +446,24 @@ public boolean equals(java.lang.Object o) { return false; } Address address = (Address) o; - return Objects.equals(this.addressType, address.addressType) - && Objects.equals(this.addressLine1, address.addressLine1) - && Objects.equals(this.addressLine2, address.addressLine2) - && Objects.equals(this.addressLine3, address.addressLine3) - && Objects.equals(this.addressLine4, address.addressLine4) - && Objects.equals(this.city, address.city) - && Objects.equals(this.region, address.region) - && Objects.equals(this.postalCode, address.postalCode) - && Objects.equals(this.country, address.country) - && Objects.equals(this.attentionTo, address.attentionTo); + return Objects.equals(this.addressType, address.addressType) && + Objects.equals(this.addressLine1, address.addressLine1) && + Objects.equals(this.addressLine2, address.addressLine2) && + Objects.equals(this.addressLine3, address.addressLine3) && + Objects.equals(this.addressLine4, address.addressLine4) && + Objects.equals(this.city, address.city) && + Objects.equals(this.region, address.region) && + Objects.equals(this.postalCode, address.postalCode) && + Objects.equals(this.country, address.country) && + Objects.equals(this.attentionTo, address.attentionTo); } @Override public int hashCode() { - return Objects.hash( - addressType, - addressLine1, - addressLine2, - addressLine3, - addressLine4, - city, - region, - postalCode, - country, - attentionTo); + return Objects.hash(addressType, addressLine1, addressLine2, addressLine3, addressLine4, city, region, postalCode, country, attentionTo); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -505,7 +483,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -513,4 +492,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/AddressForOrganisation.java b/src/main/java/com/xero/models/accounting/AddressForOrganisation.java index a57ffb924..e78c40e58 100644 --- a/src/main/java/com/xero/models/accounting/AddressForOrganisation.java +++ b/src/main/java/com/xero/models/accounting/AddressForOrganisation.java @@ -9,27 +9,50 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * AddressForOrganisation + */ -/** AddressForOrganisation */ public class AddressForOrganisation { StringUtil util = new StringUtil(); - /** define the type of address */ + /** + * define the type of address + */ public enum AddressTypeEnum { - /** POBOX */ + /** + * POBOX + */ POBOX("POBOX"), - - /** STREET */ + + /** + * STREET + */ STREET("STREET"), - - /** DELIVERY */ + + /** + * DELIVERY + */ DELIVERY("DELIVERY"); private String value; @@ -38,31 +61,25 @@ public enum AddressTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static AddressTypeEnum fromValue(String value) { for (AddressTypeEnum b : AddressTypeEnum.values()) { @@ -74,6 +91,7 @@ public static AddressTypeEnum fromValue(String value) { } } + @JsonProperty("AddressType") private AddressTypeEnum addressType; @@ -104,355 +122,326 @@ public static AddressTypeEnum fromValue(String value) { @JsonProperty("AttentionTo") private String attentionTo; /** - * define the type of address - * - * @param addressType AddressTypeEnum - * @return AddressForOrganisation - */ + * define the type of address + * @param addressType AddressTypeEnum + * @return AddressForOrganisation + **/ public AddressForOrganisation addressType(AddressTypeEnum addressType) { this.addressType = addressType; return this; } - /** + /** * define the type of address - * * @return addressType - */ + **/ @ApiModelProperty(value = "define the type of address") - /** + /** * define the type of address - * * @return addressType AddressTypeEnum - */ + **/ public AddressTypeEnum getAddressType() { return addressType; } - /** - * define the type of address - * - * @param addressType AddressTypeEnum - */ + /** + * define the type of address + * @param addressType AddressTypeEnum + **/ + public void setAddressType(AddressTypeEnum addressType) { this.addressType = addressType; } /** - * max length = 500 - * - * @param addressLine1 String - * @return AddressForOrganisation - */ + * max length = 500 + * @param addressLine1 String + * @return AddressForOrganisation + **/ public AddressForOrganisation addressLine1(String addressLine1) { this.addressLine1 = addressLine1; return this; } - /** + /** * max length = 500 - * * @return addressLine1 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine1 String - */ + **/ public String getAddressLine1() { return addressLine1; } - /** - * max length = 500 - * - * @param addressLine1 String - */ + /** + * max length = 500 + * @param addressLine1 String + **/ + public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } /** - * max length = 500 - * - * @param addressLine2 String - * @return AddressForOrganisation - */ + * max length = 500 + * @param addressLine2 String + * @return AddressForOrganisation + **/ public AddressForOrganisation addressLine2(String addressLine2) { this.addressLine2 = addressLine2; return this; } - /** + /** * max length = 500 - * * @return addressLine2 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine2 String - */ + **/ public String getAddressLine2() { return addressLine2; } - /** - * max length = 500 - * - * @param addressLine2 String - */ + /** + * max length = 500 + * @param addressLine2 String + **/ + public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } /** - * max length = 500 - * - * @param addressLine3 String - * @return AddressForOrganisation - */ + * max length = 500 + * @param addressLine3 String + * @return AddressForOrganisation + **/ public AddressForOrganisation addressLine3(String addressLine3) { this.addressLine3 = addressLine3; return this; } - /** + /** * max length = 500 - * * @return addressLine3 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine3 String - */ + **/ public String getAddressLine3() { return addressLine3; } - /** - * max length = 500 - * - * @param addressLine3 String - */ + /** + * max length = 500 + * @param addressLine3 String + **/ + public void setAddressLine3(String addressLine3) { this.addressLine3 = addressLine3; } /** - * max length = 500 - * - * @param addressLine4 String - * @return AddressForOrganisation - */ + * max length = 500 + * @param addressLine4 String + * @return AddressForOrganisation + **/ public AddressForOrganisation addressLine4(String addressLine4) { this.addressLine4 = addressLine4; return this; } - /** + /** * max length = 500 - * * @return addressLine4 - */ + **/ @ApiModelProperty(value = "max length = 500") - /** + /** * max length = 500 - * * @return addressLine4 String - */ + **/ public String getAddressLine4() { return addressLine4; } - /** - * max length = 500 - * - * @param addressLine4 String - */ + /** + * max length = 500 + * @param addressLine4 String + **/ + public void setAddressLine4(String addressLine4) { this.addressLine4 = addressLine4; } /** - * max length = 255 - * - * @param city String - * @return AddressForOrganisation - */ + * max length = 255 + * @param city String + * @return AddressForOrganisation + **/ public AddressForOrganisation city(String city) { this.city = city; return this; } - /** + /** * max length = 255 - * * @return city - */ + **/ @ApiModelProperty(value = "max length = 255") - /** + /** * max length = 255 - * * @return city String - */ + **/ public String getCity() { return city; } - /** - * max length = 255 - * - * @param city String - */ + /** + * max length = 255 + * @param city String + **/ + public void setCity(String city) { this.city = city; } /** - * max length = 255 - * - * @param region String - * @return AddressForOrganisation - */ + * max length = 255 + * @param region String + * @return AddressForOrganisation + **/ public AddressForOrganisation region(String region) { this.region = region; return this; } - /** + /** * max length = 255 - * * @return region - */ + **/ @ApiModelProperty(value = "max length = 255") - /** + /** * max length = 255 - * * @return region String - */ + **/ public String getRegion() { return region; } - /** - * max length = 255 - * - * @param region String - */ + /** + * max length = 255 + * @param region String + **/ + public void setRegion(String region) { this.region = region; } /** - * max length = 50 - * - * @param postalCode String - * @return AddressForOrganisation - */ + * max length = 50 + * @param postalCode String + * @return AddressForOrganisation + **/ public AddressForOrganisation postalCode(String postalCode) { this.postalCode = postalCode; return this; } - /** + /** * max length = 50 - * * @return postalCode - */ + **/ @ApiModelProperty(value = "max length = 50") - /** + /** * max length = 50 - * * @return postalCode String - */ + **/ public String getPostalCode() { return postalCode; } - /** - * max length = 50 - * - * @param postalCode String - */ + /** + * max length = 50 + * @param postalCode String + **/ + public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** - * max length = 50, [A-Z], [a-z] only - * - * @param country String - * @return AddressForOrganisation - */ + * max length = 50, [A-Z], [a-z] only + * @param country String + * @return AddressForOrganisation + **/ public AddressForOrganisation country(String country) { this.country = country; return this; } - /** + /** * max length = 50, [A-Z], [a-z] only - * * @return country - */ + **/ @ApiModelProperty(value = "max length = 50, [A-Z], [a-z] only") - /** + /** * max length = 50, [A-Z], [a-z] only - * * @return country String - */ + **/ public String getCountry() { return country; } - /** - * max length = 50, [A-Z], [a-z] only - * - * @param country String - */ + /** + * max length = 50, [A-Z], [a-z] only + * @param country String + **/ + public void setCountry(String country) { this.country = country; } /** - * max length = 255 - * - * @param attentionTo String - * @return AddressForOrganisation - */ + * max length = 255 + * @param attentionTo String + * @return AddressForOrganisation + **/ public AddressForOrganisation attentionTo(String attentionTo) { this.attentionTo = attentionTo; return this; } - /** + /** * max length = 255 - * * @return attentionTo - */ + **/ @ApiModelProperty(value = "max length = 255") - /** + /** * max length = 255 - * * @return attentionTo String - */ + **/ public String getAttentionTo() { return attentionTo; } - /** - * max length = 255 - * - * @param attentionTo String - */ + /** + * max length = 255 + * @param attentionTo String + **/ + public void setAttentionTo(String attentionTo) { this.attentionTo = attentionTo; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -462,33 +451,24 @@ public boolean equals(java.lang.Object o) { return false; } AddressForOrganisation addressForOrganisation = (AddressForOrganisation) o; - return Objects.equals(this.addressType, addressForOrganisation.addressType) - && Objects.equals(this.addressLine1, addressForOrganisation.addressLine1) - && Objects.equals(this.addressLine2, addressForOrganisation.addressLine2) - && Objects.equals(this.addressLine3, addressForOrganisation.addressLine3) - && Objects.equals(this.addressLine4, addressForOrganisation.addressLine4) - && Objects.equals(this.city, addressForOrganisation.city) - && Objects.equals(this.region, addressForOrganisation.region) - && Objects.equals(this.postalCode, addressForOrganisation.postalCode) - && Objects.equals(this.country, addressForOrganisation.country) - && Objects.equals(this.attentionTo, addressForOrganisation.attentionTo); + return Objects.equals(this.addressType, addressForOrganisation.addressType) && + Objects.equals(this.addressLine1, addressForOrganisation.addressLine1) && + Objects.equals(this.addressLine2, addressForOrganisation.addressLine2) && + Objects.equals(this.addressLine3, addressForOrganisation.addressLine3) && + Objects.equals(this.addressLine4, addressForOrganisation.addressLine4) && + Objects.equals(this.city, addressForOrganisation.city) && + Objects.equals(this.region, addressForOrganisation.region) && + Objects.equals(this.postalCode, addressForOrganisation.postalCode) && + Objects.equals(this.country, addressForOrganisation.country) && + Objects.equals(this.attentionTo, addressForOrganisation.attentionTo); } @Override public int hashCode() { - return Objects.hash( - addressType, - addressLine1, - addressLine2, - addressLine3, - addressLine4, - city, - region, - postalCode, - country, - attentionTo); + return Objects.hash(addressType, addressLine1, addressLine2, addressLine3, addressLine4, city, region, postalCode, country, attentionTo); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -508,7 +488,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -516,4 +497,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Allocation.java b/src/main/java/com/xero/models/accounting/Allocation.java index 20db4db7d..6426e8285 100644 --- a/src/main/java/com/xero/models/accounting/Allocation.java +++ b/src/main/java/com/xero/models/accounting/Allocation.java @@ -9,21 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.CreditNote; +import com.xero.models.accounting.Invoice; +import com.xero.models.accounting.Overpayment; +import com.xero.models.accounting.Prepayment; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; import org.threeten.bp.Instant; import org.threeten.bp.LocalDate; -import org.threeten.bp.ZoneId; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Allocation + */ -/** Allocation */ public class Allocation { StringUtil util = new StringUtil(); @@ -57,334 +75,305 @@ public class Allocation { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * Xero generated unique identifier - * - * @param allocationID UUID - * @return Allocation - */ + * Xero generated unique identifier + * @param allocationID UUID + * @return Allocation + **/ public Allocation allocationID(UUID allocationID) { this.allocationID = allocationID; return this; } - /** + /** * Xero generated unique identifier - * * @return allocationID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier") - /** + /** * Xero generated unique identifier - * * @return allocationID UUID - */ + **/ public UUID getAllocationID() { return allocationID; } - /** - * Xero generated unique identifier - * - * @param allocationID UUID - */ + /** + * Xero generated unique identifier + * @param allocationID UUID + **/ + public void setAllocationID(UUID allocationID) { this.allocationID = allocationID; } /** - * invoice - * - * @param invoice Invoice - * @return Allocation - */ + * invoice + * @param invoice Invoice + * @return Allocation + **/ public Allocation invoice(Invoice invoice) { this.invoice = invoice; return this; } - /** + /** * Get invoice - * * @return invoice - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * invoice - * * @return invoice Invoice - */ + **/ public Invoice getInvoice() { return invoice; } - /** - * invoice - * - * @param invoice Invoice - */ + /** + * invoice + * @param invoice Invoice + **/ + public void setInvoice(Invoice invoice) { this.invoice = invoice; } /** - * overpayment - * - * @param overpayment Overpayment - * @return Allocation - */ + * overpayment + * @param overpayment Overpayment + * @return Allocation + **/ public Allocation overpayment(Overpayment overpayment) { this.overpayment = overpayment; return this; } - /** + /** * Get overpayment - * * @return overpayment - */ + **/ @ApiModelProperty(value = "") - /** + /** * overpayment - * * @return overpayment Overpayment - */ + **/ public Overpayment getOverpayment() { return overpayment; } - /** - * overpayment - * - * @param overpayment Overpayment - */ + /** + * overpayment + * @param overpayment Overpayment + **/ + public void setOverpayment(Overpayment overpayment) { this.overpayment = overpayment; } /** - * prepayment - * - * @param prepayment Prepayment - * @return Allocation - */ + * prepayment + * @param prepayment Prepayment + * @return Allocation + **/ public Allocation prepayment(Prepayment prepayment) { this.prepayment = prepayment; return this; } - /** + /** * Get prepayment - * * @return prepayment - */ + **/ @ApiModelProperty(value = "") - /** + /** * prepayment - * * @return prepayment Prepayment - */ + **/ public Prepayment getPrepayment() { return prepayment; } - /** - * prepayment - * - * @param prepayment Prepayment - */ + /** + * prepayment + * @param prepayment Prepayment + **/ + public void setPrepayment(Prepayment prepayment) { this.prepayment = prepayment; } /** - * creditNote - * - * @param creditNote CreditNote - * @return Allocation - */ + * creditNote + * @param creditNote CreditNote + * @return Allocation + **/ public Allocation creditNote(CreditNote creditNote) { this.creditNote = creditNote; return this; } - /** + /** * Get creditNote - * * @return creditNote - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditNote - * * @return creditNote CreditNote - */ + **/ public CreditNote getCreditNote() { return creditNote; } - /** - * creditNote - * - * @param creditNote CreditNote - */ + /** + * creditNote + * @param creditNote CreditNote + **/ + public void setCreditNote(CreditNote creditNote) { this.creditNote = creditNote; } /** - * the amount being applied to the invoice - * - * @param amount Double - * @return Allocation - */ + * the amount being applied to the invoice + * @param amount Double + * @return Allocation + **/ public Allocation amount(Double amount) { this.amount = amount; return this; } - /** + /** * the amount being applied to the invoice - * * @return amount - */ + **/ @ApiModelProperty(required = true, value = "the amount being applied to the invoice") - /** + /** * the amount being applied to the invoice - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * the amount being applied to the invoice - * - * @param amount Double - */ + /** + * the amount being applied to the invoice + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * the date the allocation is applied YYYY-MM-DD. - * - * @param date String - * @return Allocation - */ + * the date the allocation is applied YYYY-MM-DD. + * @param date String + * @return Allocation + **/ public Allocation date(String date) { this.date = date; return this; } - /** + /** * the date the allocation is applied YYYY-MM-DD. - * * @return date - */ + **/ @ApiModelProperty(required = true, value = "the date the allocation is applied YYYY-MM-DD.") - /** + /** * the date the allocation is applied YYYY-MM-DD. - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * the date the allocation is applied YYYY-MM-DD. - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * the date the allocation is applied YYYY-MM-DD. - * - * @param date String - */ + /** + * the date the allocation is applied YYYY-MM-DD. + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * the date the allocation is applied YYYY-MM-DD. - * - * @param date LocalDateTime - */ + /** + * the date the allocation is applied YYYY-MM-DD. + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } - /** + /** * A flag that returns true when the allocation is succesfully deleted - * * @return isDeleted - */ + **/ @ApiModelProperty(value = "A flag that returns true when the allocation is succesfully deleted") - /** + /** * A flag that returns true when the allocation is succesfully deleted - * * @return isDeleted Boolean - */ + **/ public Boolean getIsDeleted() { return isDeleted; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return Allocation - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return Allocation + **/ public Allocation statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Allocation - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Allocation + **/ public Allocation validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -392,10 +381,9 @@ public Allocation validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Allocation - */ + **/ public Allocation addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -404,30 +392,29 @@ public Allocation addValidationErrorsItem(ValidationError validationErrorsItem) return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -437,33 +424,24 @@ public boolean equals(java.lang.Object o) { return false; } Allocation allocation = (Allocation) o; - return Objects.equals(this.allocationID, allocation.allocationID) - && Objects.equals(this.invoice, allocation.invoice) - && Objects.equals(this.overpayment, allocation.overpayment) - && Objects.equals(this.prepayment, allocation.prepayment) - && Objects.equals(this.creditNote, allocation.creditNote) - && Objects.equals(this.amount, allocation.amount) - && Objects.equals(this.date, allocation.date) - && Objects.equals(this.isDeleted, allocation.isDeleted) - && Objects.equals(this.statusAttributeString, allocation.statusAttributeString) - && Objects.equals(this.validationErrors, allocation.validationErrors); + return Objects.equals(this.allocationID, allocation.allocationID) && + Objects.equals(this.invoice, allocation.invoice) && + Objects.equals(this.overpayment, allocation.overpayment) && + Objects.equals(this.prepayment, allocation.prepayment) && + Objects.equals(this.creditNote, allocation.creditNote) && + Objects.equals(this.amount, allocation.amount) && + Objects.equals(this.date, allocation.date) && + Objects.equals(this.isDeleted, allocation.isDeleted) && + Objects.equals(this.statusAttributeString, allocation.statusAttributeString) && + Objects.equals(this.validationErrors, allocation.validationErrors); } @Override public int hashCode() { - return Objects.hash( - allocationID, - invoice, - overpayment, - prepayment, - creditNote, - amount, - date, - isDeleted, - statusAttributeString, - validationErrors); + return Objects.hash(allocationID, invoice, overpayment, prepayment, creditNote, amount, date, isDeleted, statusAttributeString, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -476,16 +454,15 @@ public String toString() { sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -493,4 +470,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Allocations.java b/src/main/java/com/xero/models/accounting/Allocations.java index 759488a20..af6cce72f 100644 --- a/src/main/java/com/xero/models/accounting/Allocations.java +++ b/src/main/java/com/xero/models/accounting/Allocations.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Allocation; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Allocations + */ -/** Allocations */ public class Allocations { StringUtil util = new StringUtil(); @JsonProperty("Allocations") private List allocations = new ArrayList(); /** - * allocations - * - * @param allocations List<Allocation> - * @return Allocations - */ + * allocations + * @param allocations List<Allocation> + * @return Allocations + **/ public Allocations allocations(List allocations) { this.allocations = allocations; return this; @@ -37,10 +54,9 @@ public Allocations allocations(List allocations) { /** * allocations - * - * @param allocationsItem Allocation + * @param allocationsItem Allocation * @return Allocations - */ + **/ public Allocations addAllocationsItem(Allocation allocationsItem) { if (this.allocations == null) { this.allocations = new ArrayList(); @@ -49,30 +65,29 @@ public Allocations addAllocationsItem(Allocation allocationsItem) { return this; } - /** + /** * Get allocations - * * @return allocations - */ + **/ @ApiModelProperty(value = "") - /** + /** * allocations - * * @return allocations List - */ + **/ public List getAllocations() { return allocations; } - /** - * allocations - * - * @param allocations List<Allocation> - */ + /** + * allocations + * @param allocations List<Allocation> + **/ + public void setAllocations(List allocations) { this.allocations = allocations; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(allocations); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Attachment.java b/src/main/java/com/xero/models/accounting/Attachment.java index dc583f0c5..e2531068d 100644 --- a/src/main/java/com/xero/models/accounting/Attachment.java +++ b/src/main/java/com/xero/models/accounting/Attachment.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Attachment + */ -/** Attachment */ public class Attachment { StringUtil util = new StringUtil(); @@ -39,220 +56,198 @@ public class Attachment { @JsonProperty("IncludeOnline") private Boolean includeOnline; /** - * Unique ID for the file - * - * @param attachmentID UUID - * @return Attachment - */ + * Unique ID for the file + * @param attachmentID UUID + * @return Attachment + **/ public Attachment attachmentID(UUID attachmentID) { this.attachmentID = attachmentID; return this; } - /** + /** * Unique ID for the file - * * @return attachmentID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "Unique ID for the file") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID for the file") + /** * Unique ID for the file - * * @return attachmentID UUID - */ + **/ public UUID getAttachmentID() { return attachmentID; } - /** - * Unique ID for the file - * - * @param attachmentID UUID - */ + /** + * Unique ID for the file + * @param attachmentID UUID + **/ + public void setAttachmentID(UUID attachmentID) { this.attachmentID = attachmentID; } /** - * Name of the file - * - * @param fileName String - * @return Attachment - */ + * Name of the file + * @param fileName String + * @return Attachment + **/ public Attachment fileName(String fileName) { this.fileName = fileName; return this; } - /** + /** * Name of the file - * * @return fileName - */ + **/ @ApiModelProperty(example = "xero-dev.jpg", value = "Name of the file") - /** + /** * Name of the file - * * @return fileName String - */ + **/ public String getFileName() { return fileName; } - /** - * Name of the file - * - * @param fileName String - */ + /** + * Name of the file + * @param fileName String + **/ + public void setFileName(String fileName) { this.fileName = fileName; } /** - * URL to the file on xero.com - * - * @param url String - * @return Attachment - */ + * URL to the file on xero.com + * @param url String + * @return Attachment + **/ public Attachment url(String url) { this.url = url; return this; } - /** + /** * URL to the file on xero.com - * * @return url - */ - @ApiModelProperty( - example = - "https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg", - value = "URL to the file on xero.com") - /** + **/ + @ApiModelProperty(example = "https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg", value = "URL to the file on xero.com") + /** * URL to the file on xero.com - * * @return url String - */ + **/ public String getUrl() { return url; } - /** - * URL to the file on xero.com - * - * @param url String - */ + /** + * URL to the file on xero.com + * @param url String + **/ + public void setUrl(String url) { this.url = url; } /** - * Type of file - * - * @param mimeType String - * @return Attachment - */ + * Type of file + * @param mimeType String + * @return Attachment + **/ public Attachment mimeType(String mimeType) { this.mimeType = mimeType; return this; } - /** + /** * Type of file - * * @return mimeType - */ + **/ @ApiModelProperty(example = "image/jpg", value = "Type of file") - /** + /** * Type of file - * * @return mimeType String - */ + **/ public String getMimeType() { return mimeType; } - /** - * Type of file - * - * @param mimeType String - */ + /** + * Type of file + * @param mimeType String + **/ + public void setMimeType(String mimeType) { this.mimeType = mimeType; } /** - * Length of the file content - * - * @param contentLength Integer - * @return Attachment - */ + * Length of the file content + * @param contentLength Integer + * @return Attachment + **/ public Attachment contentLength(Integer contentLength) { this.contentLength = contentLength; return this; } - /** + /** * Length of the file content - * * @return contentLength - */ + **/ @ApiModelProperty(value = "Length of the file content") - /** + /** * Length of the file content - * * @return contentLength Integer - */ + **/ public Integer getContentLength() { return contentLength; } - /** - * Length of the file content - * - * @param contentLength Integer - */ + /** + * Length of the file content + * @param contentLength Integer + **/ + public void setContentLength(Integer contentLength) { this.contentLength = contentLength; } /** - * Include the file with the online invoice - * - * @param includeOnline Boolean - * @return Attachment - */ + * Include the file with the online invoice + * @param includeOnline Boolean + * @return Attachment + **/ public Attachment includeOnline(Boolean includeOnline) { this.includeOnline = includeOnline; return this; } - /** + /** * Include the file with the online invoice - * * @return includeOnline - */ + **/ @ApiModelProperty(value = "Include the file with the online invoice") - /** + /** * Include the file with the online invoice - * * @return includeOnline Boolean - */ + **/ public Boolean getIncludeOnline() { return includeOnline; } - /** - * Include the file with the online invoice - * - * @param includeOnline Boolean - */ + /** + * Include the file with the online invoice + * @param includeOnline Boolean + **/ + public void setIncludeOnline(Boolean includeOnline) { this.includeOnline = includeOnline; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,12 +257,12 @@ public boolean equals(java.lang.Object o) { return false; } Attachment attachment = (Attachment) o; - return Objects.equals(this.attachmentID, attachment.attachmentID) - && Objects.equals(this.fileName, attachment.fileName) - && Objects.equals(this.url, attachment.url) - && Objects.equals(this.mimeType, attachment.mimeType) - && Objects.equals(this.contentLength, attachment.contentLength) - && Objects.equals(this.includeOnline, attachment.includeOnline); + return Objects.equals(this.attachmentID, attachment.attachmentID) && + Objects.equals(this.fileName, attachment.fileName) && + Objects.equals(this.url, attachment.url) && + Objects.equals(this.mimeType, attachment.mimeType) && + Objects.equals(this.contentLength, attachment.contentLength) && + Objects.equals(this.includeOnline, attachment.includeOnline); } @Override @@ -275,6 +270,7 @@ public int hashCode() { return Objects.hash(attachmentID, fileName, url, mimeType, contentLength, includeOnline); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -290,7 +286,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -298,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Attachments.java b/src/main/java/com/xero/models/accounting/Attachments.java index b6bb12476..5c39ae2c2 100644 --- a/src/main/java/com/xero/models/accounting/Attachments.java +++ b/src/main/java/com/xero/models/accounting/Attachments.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Attachment; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Attachments + */ -/** Attachments */ public class Attachments { StringUtil util = new StringUtil(); @JsonProperty("Attachments") private List attachments = new ArrayList(); /** - * attachments - * - * @param attachments List<Attachment> - * @return Attachments - */ + * attachments + * @param attachments List<Attachment> + * @return Attachments + **/ public Attachments attachments(List attachments) { this.attachments = attachments; return this; @@ -37,10 +54,9 @@ public Attachments attachments(List attachments) { /** * attachments - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return Attachments - */ + **/ public Attachments addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -49,30 +65,29 @@ public Attachments addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * Get attachments - * * @return attachments - */ + **/ @ApiModelProperty(value = "") - /** + /** * attachments - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * attachments - * - * @param attachments List<Attachment> - */ + /** + * attachments + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(attachments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BalanceDetails.java b/src/main/java/com/xero/models/accounting/BalanceDetails.java index d5984b87c..3bff17ca1 100644 --- a/src/main/java/com/xero/models/accounting/BalanceDetails.java +++ b/src/main/java/com/xero/models/accounting/BalanceDetails.java @@ -9,16 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; -/** An array to specify multiple currency balances of an account */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * An array to specify multiple currency balances of an account + */ @ApiModel(description = "An array to specify multiple currency balances of an account") + public class BalanceDetails { StringUtil util = new StringUtil(); @@ -31,119 +47,102 @@ public class BalanceDetails { @JsonProperty("CurrencyRate") private Double currencyRate; /** - * The opening balances of the account. Debits are positive, credits are negative values - * - * @param balance Double - * @return BalanceDetails - */ + * The opening balances of the account. Debits are positive, credits are negative values + * @param balance Double + * @return BalanceDetails + **/ public BalanceDetails balance(Double balance) { this.balance = balance; return this; } - /** + /** * The opening balances of the account. Debits are positive, credits are negative values - * * @return balance - */ - @ApiModelProperty( - value = - "The opening balances of the account. Debits are positive, credits are negative values") - /** + **/ + @ApiModelProperty(value = "The opening balances of the account. Debits are positive, credits are negative values") + /** * The opening balances of the account. Debits are positive, credits are negative values - * * @return balance Double - */ + **/ public Double getBalance() { return balance; } - /** - * The opening balances of the account. Debits are positive, credits are negative values - * - * @param balance Double - */ + /** + * The opening balances of the account. Debits are positive, credits are negative values + * @param balance Double + **/ + public void setBalance(Double balance) { this.balance = balance; } /** - * The currency of the balance (Not required for base currency) - * - * @param currencyCode String - * @return BalanceDetails - */ + * The currency of the balance (Not required for base currency) + * @param currencyCode String + * @return BalanceDetails + **/ public BalanceDetails currencyCode(String currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * The currency of the balance (Not required for base currency) - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "The currency of the balance (Not required for base currency)") - /** + /** * The currency of the balance (Not required for base currency) - * * @return currencyCode String - */ + **/ public String getCurrencyCode() { return currencyCode; } - /** - * The currency of the balance (Not required for base currency) - * - * @param currencyCode String - */ + /** + * The currency of the balance (Not required for base currency) + * @param currencyCode String + **/ + public void setCurrencyCode(String currencyCode) { this.currencyCode = currencyCode; } /** - * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE - * rate for the day is applied - * - * @param currencyRate Double - * @return BalanceDetails - */ + * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE rate for the day is applied + * @param currencyRate Double + * @return BalanceDetails + **/ public BalanceDetails currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE - * rate for the day is applied - * + /** + * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE rate for the day is applied * @return currencyRate - */ - @ApiModelProperty( - value = - "(Optional) Exchange rate to base currency when money is spent or received. If not" - + " specified, XE rate for the day is applied") - /** - * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE - * rate for the day is applied - * + **/ + @ApiModelProperty(value = "(Optional) Exchange rate to base currency when money is spent or received. If not specified, XE rate for the day is applied") + /** + * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE rate for the day is applied * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE - * rate for the day is applied - * - * @param currencyRate Double - */ + /** + * (Optional) Exchange rate to base currency when money is spent or received. If not specified, XE rate for the day is applied + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -153,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } BalanceDetails balanceDetails = (BalanceDetails) o; - return Objects.equals(this.balance, balanceDetails.balance) - && Objects.equals(this.currencyCode, balanceDetails.currencyCode) - && Objects.equals(this.currencyRate, balanceDetails.currencyRate); + return Objects.equals(this.balance, balanceDetails.balance) && + Objects.equals(this.currencyCode, balanceDetails.currencyCode) && + Objects.equals(this.currencyRate, balanceDetails.currencyRate); } @Override @@ -163,6 +162,7 @@ public int hashCode() { return Objects.hash(balance, currencyCode, currencyRate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -175,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -183,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Balances.java b/src/main/java/com/xero/models/accounting/Balances.java index a75fcc71d..d9ca5b8f8 100644 --- a/src/main/java/com/xero/models/accounting/Balances.java +++ b/src/main/java/com/xero/models/accounting/Balances.java @@ -9,22 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.AccountsPayable; +import com.xero.models.accounting.AccountsReceivable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; /** - * The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue - * amounts, not converted to base currency (read only) + * The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ -@ApiModel( - description = - "The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and" - + " overdue amounts, not converted to base currency (read only)") +@ApiModel(description = "The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only)") + public class Balances { StringUtil util = new StringUtil(); @@ -34,75 +46,70 @@ public class Balances { @JsonProperty("AccountsPayable") private AccountsPayable accountsPayable; /** - * accountsReceivable - * - * @param accountsReceivable AccountsReceivable - * @return Balances - */ + * accountsReceivable + * @param accountsReceivable AccountsReceivable + * @return Balances + **/ public Balances accountsReceivable(AccountsReceivable accountsReceivable) { this.accountsReceivable = accountsReceivable; return this; } - /** + /** * Get accountsReceivable - * * @return accountsReceivable - */ + **/ @ApiModelProperty(value = "") - /** + /** * accountsReceivable - * * @return accountsReceivable AccountsReceivable - */ + **/ public AccountsReceivable getAccountsReceivable() { return accountsReceivable; } - /** - * accountsReceivable - * - * @param accountsReceivable AccountsReceivable - */ + /** + * accountsReceivable + * @param accountsReceivable AccountsReceivable + **/ + public void setAccountsReceivable(AccountsReceivable accountsReceivable) { this.accountsReceivable = accountsReceivable; } /** - * accountsPayable - * - * @param accountsPayable AccountsPayable - * @return Balances - */ + * accountsPayable + * @param accountsPayable AccountsPayable + * @return Balances + **/ public Balances accountsPayable(AccountsPayable accountsPayable) { this.accountsPayable = accountsPayable; return this; } - /** + /** * Get accountsPayable - * * @return accountsPayable - */ + **/ @ApiModelProperty(value = "") - /** + /** * accountsPayable - * * @return accountsPayable AccountsPayable - */ + **/ public AccountsPayable getAccountsPayable() { return accountsPayable; } - /** - * accountsPayable - * - * @param accountsPayable AccountsPayable - */ + /** + * accountsPayable + * @param accountsPayable AccountsPayable + **/ + public void setAccountsPayable(AccountsPayable accountsPayable) { this.accountsPayable = accountsPayable; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +119,8 @@ public boolean equals(java.lang.Object o) { return false; } Balances balances = (Balances) o; - return Objects.equals(this.accountsReceivable, balances.accountsReceivable) - && Objects.equals(this.accountsPayable, balances.accountsPayable); + return Objects.equals(this.accountsReceivable, balances.accountsReceivable) && + Objects.equals(this.accountsPayable, balances.accountsPayable); } @Override @@ -121,6 +128,7 @@ public int hashCode() { return Objects.hash(accountsReceivable, accountsPayable); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,7 +140,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -140,4 +149,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BankTransaction.java b/src/main/java/com/xero/models/accounting/BankTransaction.java index 388cc27d8..3eb90b040 100644 --- a/src/main/java/com/xero/models/accounting/BankTransaction.java +++ b/src/main/java/com/xero/models/accounting/BankTransaction.java @@ -9,50 +9,84 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Account; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankTransaction + */ -/** BankTransaction */ public class BankTransaction { StringUtil util = new StringUtil(); - /** See Bank Transaction Types */ + /** + * See Bank Transaction Types + */ public enum TypeEnum { - /** RECEIVE */ + /** + * RECEIVE + */ RECEIVE("RECEIVE"), - - /** RECEIVE_OVERPAYMENT */ + + /** + * RECEIVE_OVERPAYMENT + */ RECEIVE_OVERPAYMENT("RECEIVE-OVERPAYMENT"), - - /** RECEIVE_PREPAYMENT */ + + /** + * RECEIVE_PREPAYMENT + */ RECEIVE_PREPAYMENT("RECEIVE-PREPAYMENT"), - - /** SPEND */ + + /** + * SPEND + */ SPEND("SPEND"), - - /** SPEND_OVERPAYMENT */ + + /** + * SPEND_OVERPAYMENT + */ SPEND_OVERPAYMENT("SPEND-OVERPAYMENT"), - - /** SPEND_PREPAYMENT */ + + /** + * SPEND_PREPAYMENT + */ SPEND_PREPAYMENT("SPEND-PREPAYMENT"), - - /** RECEIVE_TRANSFER */ + + /** + * RECEIVE_TRANSFER + */ RECEIVE_TRANSFER("RECEIVE-TRANSFER"), - - /** SPEND_TRANSFER */ + + /** + * SPEND_TRANSFER + */ SPEND_TRANSFER("SPEND-TRANSFER"); private String value; @@ -61,31 +95,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -97,6 +125,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -126,15 +155,23 @@ public static TypeEnum fromValue(String value) { @JsonProperty("Url") private String url; - /** See Bank Transaction Status Codes */ + /** + * See Bank Transaction Status Codes + */ public enum StatusEnum { - /** AUTHORISED */ + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"); private String value; @@ -143,31 +180,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -179,6 +210,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -215,81 +247,74 @@ public static StatusEnum fromValue(String value) { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * See Bank Transaction Types - * - * @param type TypeEnum - * @return BankTransaction - */ + * See Bank Transaction Types + * @param type TypeEnum + * @return BankTransaction + **/ public BankTransaction type(TypeEnum type) { this.type = type; return this; } - /** + /** * See Bank Transaction Types - * * @return type - */ + **/ @ApiModelProperty(required = true, value = "See Bank Transaction Types") - /** + /** * See Bank Transaction Types - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * See Bank Transaction Types - * - * @param type TypeEnum - */ + /** + * See Bank Transaction Types + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * contact - * - * @param contact Contact - * @return BankTransaction - */ + * contact + * @param contact Contact + * @return BankTransaction + **/ public BankTransaction contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * See LineItems - * - * @param lineItems List<LineItem> - * @return BankTransaction - */ + * See LineItems + * @param lineItems List<LineItem> + * @return BankTransaction + **/ public BankTransaction lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -297,672 +322,581 @@ public BankTransaction lineItems(List lineItems) { /** * See LineItems - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return BankTransaction - */ + **/ public BankTransaction addLineItemsItem(LineItem lineItemsItem) { this.lineItems.add(lineItemsItem); return this; } - /** + /** * See LineItems - * * @return lineItems - */ + **/ @ApiModelProperty(required = true, value = "See LineItems") - /** + /** * See LineItems - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See LineItems - * - * @param lineItems List<LineItem> - */ + /** + * See LineItems + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * bankAccount - * - * @param bankAccount Account - * @return BankTransaction - */ + * bankAccount + * @param bankAccount Account + * @return BankTransaction + **/ public BankTransaction bankAccount(Account bankAccount) { this.bankAccount = bankAccount; return this; } - /** + /** * Get bankAccount - * * @return bankAccount - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * bankAccount - * * @return bankAccount Account - */ + **/ public Account getBankAccount() { return bankAccount; } - /** - * bankAccount - * - * @param bankAccount Account - */ + /** + * bankAccount + * @param bankAccount Account + **/ + public void setBankAccount(Account bankAccount) { this.bankAccount = bankAccount; } /** - * Boolean to show if transaction is reconciled - * - * @param isReconciled Boolean - * @return BankTransaction - */ + * Boolean to show if transaction is reconciled + * @param isReconciled Boolean + * @return BankTransaction + **/ public BankTransaction isReconciled(Boolean isReconciled) { this.isReconciled = isReconciled; return this; } - /** + /** * Boolean to show if transaction is reconciled - * * @return isReconciled - */ + **/ @ApiModelProperty(value = "Boolean to show if transaction is reconciled") - /** + /** * Boolean to show if transaction is reconciled - * * @return isReconciled Boolean - */ + **/ public Boolean getIsReconciled() { return isReconciled; } - /** - * Boolean to show if transaction is reconciled - * - * @param isReconciled Boolean - */ + /** + * Boolean to show if transaction is reconciled + * @param isReconciled Boolean + **/ + public void setIsReconciled(Boolean isReconciled) { this.isReconciled = isReconciled; } /** - * Date of transaction – YYYY-MM-DD - * - * @param date String - * @return BankTransaction - */ + * Date of transaction – YYYY-MM-DD + * @param date String + * @return BankTransaction + **/ public BankTransaction date(String date) { this.date = date; return this; } - /** + /** * Date of transaction – YYYY-MM-DD - * * @return date - */ + **/ @ApiModelProperty(value = "Date of transaction – YYYY-MM-DD") - /** + /** * Date of transaction – YYYY-MM-DD - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * Date of transaction – YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date of transaction – YYYY-MM-DD - * - * @param date String - */ + /** + * Date of transaction – YYYY-MM-DD + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date of transaction – YYYY-MM-DD - * - * @param date LocalDateTime - */ + /** + * Date of transaction – YYYY-MM-DD + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Reference for the transaction. Only supported for SPEND and RECEIVE transactions. - * - * @param reference String - * @return BankTransaction - */ + * Reference for the transaction. Only supported for SPEND and RECEIVE transactions. + * @param reference String + * @return BankTransaction + **/ public BankTransaction reference(String reference) { this.reference = reference; return this; } - /** + /** * Reference for the transaction. Only supported for SPEND and RECEIVE transactions. - * * @return reference - */ - @ApiModelProperty( - value = "Reference for the transaction. Only supported for SPEND and RECEIVE transactions.") - /** + **/ + @ApiModelProperty(value = "Reference for the transaction. Only supported for SPEND and RECEIVE transactions.") + /** * Reference for the transaction. Only supported for SPEND and RECEIVE transactions. - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Reference for the transaction. Only supported for SPEND and RECEIVE transactions. - * - * @param reference String - */ + /** + * Reference for the transaction. Only supported for SPEND and RECEIVE transactions. + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return BankTransaction - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return BankTransaction + **/ public BankTransaction currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank - * transactions in non base currency. If this isn’t specified for non base currency accounts then - * either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency - * is only supported on overpayments. - * - * @param currencyRate Double - * @return BankTransaction - */ + * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. + * @param currencyRate Double + * @return BankTransaction + **/ public BankTransaction currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank - * transactions in non base currency. If this isn’t specified for non base currency accounts then - * either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency - * is only supported on overpayments. - * + /** + * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. * @return currencyRate - */ - @ApiModelProperty( - value = - "Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used" - + " for bank transactions in non base currency. If this isn’t specified for non base" - + " currency accounts then either the user-defined rate (preference) or the XE.com" - + " day rate will be used. Setting currency is only supported on overpayments.") - /** - * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank - * transactions in non base currency. If this isn’t specified for non base currency accounts then - * either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency - * is only supported on overpayments. - * + **/ + @ApiModelProperty(value = "Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments.") + /** + * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank - * transactions in non base currency. If this isn’t specified for non base currency accounts then - * either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency - * is only supported on overpayments. - * - * @param currencyRate Double - */ + /** + * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } /** - * URL link to a source document – shown as “Go to App Name” - * - * @param url String - * @return BankTransaction - */ + * URL link to a source document – shown as “Go to App Name” + * @param url String + * @return BankTransaction + **/ public BankTransaction url(String url) { this.url = url; return this; } - /** + /** * URL link to a source document – shown as “Go to App Name” - * * @return url - */ + **/ @ApiModelProperty(value = "URL link to a source document – shown as “Go to App Name”") - /** + /** * URL link to a source document – shown as “Go to App Name” - * * @return url String - */ + **/ public String getUrl() { return url; } - /** - * URL link to a source document – shown as “Go to App Name” - * - * @param url String - */ + /** + * URL link to a source document – shown as “Go to App Name” + * @param url String + **/ + public void setUrl(String url) { this.url = url; } /** - * See Bank Transaction Status Codes - * - * @param status StatusEnum - * @return BankTransaction - */ + * See Bank Transaction Status Codes + * @param status StatusEnum + * @return BankTransaction + **/ public BankTransaction status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Bank Transaction Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Bank Transaction Status Codes") - /** + /** * See Bank Transaction Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Bank Transaction Status Codes - * - * @param status StatusEnum - */ + /** + * See Bank Transaction Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return BankTransaction - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return BankTransaction + **/ public BankTransaction lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * Total of bank transaction excluding taxes - * - * @param subTotal Double - * @return BankTransaction - */ + * Total of bank transaction excluding taxes + * @param subTotal Double + * @return BankTransaction + **/ public BankTransaction subTotal(Double subTotal) { this.subTotal = subTotal; return this; } - /** + /** * Total of bank transaction excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "Total of bank transaction excluding taxes") - /** + /** * Total of bank transaction excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** - * Total of bank transaction excluding taxes - * - * @param subTotal Double - */ + /** + * Total of bank transaction excluding taxes + * @param subTotal Double + **/ + public void setSubTotal(Double subTotal) { this.subTotal = subTotal; } /** - * Total tax on bank transaction - * - * @param totalTax Double - * @return BankTransaction - */ + * Total tax on bank transaction + * @param totalTax Double + * @return BankTransaction + **/ public BankTransaction totalTax(Double totalTax) { this.totalTax = totalTax; return this; } - /** + /** * Total tax on bank transaction - * * @return totalTax - */ + **/ @ApiModelProperty(value = "Total tax on bank transaction") - /** + /** * Total tax on bank transaction - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * Total tax on bank transaction - * - * @param totalTax Double - */ + /** + * Total tax on bank transaction + * @param totalTax Double + **/ + public void setTotalTax(Double totalTax) { this.totalTax = totalTax; } /** - * Total of bank transaction tax inclusive - * - * @param total Double - * @return BankTransaction - */ + * Total of bank transaction tax inclusive + * @param total Double + * @return BankTransaction + **/ public BankTransaction total(Double total) { this.total = total; return this; } - /** + /** * Total of bank transaction tax inclusive - * * @return total - */ + **/ @ApiModelProperty(value = "Total of bank transaction tax inclusive") - /** + /** * Total of bank transaction tax inclusive - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total of bank transaction tax inclusive - * - * @param total Double - */ + /** + * Total of bank transaction tax inclusive + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Xero generated unique identifier for bank transaction - * - * @param bankTransactionID UUID - * @return BankTransaction - */ + * Xero generated unique identifier for bank transaction + * @param bankTransactionID UUID + * @return BankTransaction + **/ public BankTransaction bankTransactionID(UUID bankTransactionID) { this.bankTransactionID = bankTransactionID; return this; } - /** + /** * Xero generated unique identifier for bank transaction - * * @return bankTransactionID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "Xero generated unique identifier for bank transaction") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Xero generated unique identifier for bank transaction") + /** * Xero generated unique identifier for bank transaction - * * @return bankTransactionID UUID - */ + **/ public UUID getBankTransactionID() { return bankTransactionID; } - /** - * Xero generated unique identifier for bank transaction - * - * @param bankTransactionID UUID - */ + /** + * Xero generated unique identifier for bank transaction + * @param bankTransactionID UUID + **/ + public void setBankTransactionID(UUID bankTransactionID) { this.bankTransactionID = bankTransactionID; } - /** - * Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions - * with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT - * + /** + * Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT * @return prepaymentID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = - "Xero generated unique identifier for a Prepayment. This will be returned on" - + " BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT") - /** - * Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions - * with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT - * + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT") + /** + * Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT * @return prepaymentID UUID - */ + **/ public UUID getPrepaymentID() { return prepaymentID; } - /** - * Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions - * with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT - * + /** + * Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT * @return overpaymentID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = - "Xero generated unique identifier for an Overpayment. This will be returned on" - + " BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT") - /** - * Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions - * with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT - * + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT") + /** + * Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT * @return overpaymentID UUID - */ + **/ public UUID getOverpaymentID() { return overpaymentID; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** + /** * Boolean to indicate if a bank transaction has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate if a bank transaction has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate if a bank transaction has an attachment") + /** * Boolean to indicate if a bank transaction has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return BankTransaction - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return BankTransaction + **/ public BankTransaction statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return BankTransaction - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return BankTransaction + **/ public BankTransaction validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -970,10 +904,9 @@ public BankTransaction validationErrors(List validationErrors) /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return BankTransaction - */ + **/ public BankTransaction addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -982,30 +915,29 @@ public BankTransaction addValidationErrorsItem(ValidationError validationErrorsI return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1015,57 +947,36 @@ public boolean equals(java.lang.Object o) { return false; } BankTransaction bankTransaction = (BankTransaction) o; - return Objects.equals(this.type, bankTransaction.type) - && Objects.equals(this.contact, bankTransaction.contact) - && Objects.equals(this.lineItems, bankTransaction.lineItems) - && Objects.equals(this.bankAccount, bankTransaction.bankAccount) - && Objects.equals(this.isReconciled, bankTransaction.isReconciled) - && Objects.equals(this.date, bankTransaction.date) - && Objects.equals(this.reference, bankTransaction.reference) - && Objects.equals(this.currencyCode, bankTransaction.currencyCode) - && Objects.equals(this.currencyRate, bankTransaction.currencyRate) - && Objects.equals(this.url, bankTransaction.url) - && Objects.equals(this.status, bankTransaction.status) - && Objects.equals(this.lineAmountTypes, bankTransaction.lineAmountTypes) - && Objects.equals(this.subTotal, bankTransaction.subTotal) - && Objects.equals(this.totalTax, bankTransaction.totalTax) - && Objects.equals(this.total, bankTransaction.total) - && Objects.equals(this.bankTransactionID, bankTransaction.bankTransactionID) - && Objects.equals(this.prepaymentID, bankTransaction.prepaymentID) - && Objects.equals(this.overpaymentID, bankTransaction.overpaymentID) - && Objects.equals(this.updatedDateUTC, bankTransaction.updatedDateUTC) - && Objects.equals(this.hasAttachments, bankTransaction.hasAttachments) - && Objects.equals(this.statusAttributeString, bankTransaction.statusAttributeString) - && Objects.equals(this.validationErrors, bankTransaction.validationErrors); + return Objects.equals(this.type, bankTransaction.type) && + Objects.equals(this.contact, bankTransaction.contact) && + Objects.equals(this.lineItems, bankTransaction.lineItems) && + Objects.equals(this.bankAccount, bankTransaction.bankAccount) && + Objects.equals(this.isReconciled, bankTransaction.isReconciled) && + Objects.equals(this.date, bankTransaction.date) && + Objects.equals(this.reference, bankTransaction.reference) && + Objects.equals(this.currencyCode, bankTransaction.currencyCode) && + Objects.equals(this.currencyRate, bankTransaction.currencyRate) && + Objects.equals(this.url, bankTransaction.url) && + Objects.equals(this.status, bankTransaction.status) && + Objects.equals(this.lineAmountTypes, bankTransaction.lineAmountTypes) && + Objects.equals(this.subTotal, bankTransaction.subTotal) && + Objects.equals(this.totalTax, bankTransaction.totalTax) && + Objects.equals(this.total, bankTransaction.total) && + Objects.equals(this.bankTransactionID, bankTransaction.bankTransactionID) && + Objects.equals(this.prepaymentID, bankTransaction.prepaymentID) && + Objects.equals(this.overpaymentID, bankTransaction.overpaymentID) && + Objects.equals(this.updatedDateUTC, bankTransaction.updatedDateUTC) && + Objects.equals(this.hasAttachments, bankTransaction.hasAttachments) && + Objects.equals(this.statusAttributeString, bankTransaction.statusAttributeString) && + Objects.equals(this.validationErrors, bankTransaction.validationErrors); } @Override public int hashCode() { - return Objects.hash( - type, - contact, - lineItems, - bankAccount, - isReconciled, - date, - reference, - currencyCode, - currencyRate, - url, - status, - lineAmountTypes, - subTotal, - totalTax, - total, - bankTransactionID, - prepaymentID, - overpaymentID, - updatedDateUTC, - hasAttachments, - statusAttributeString, - validationErrors); + return Objects.hash(type, contact, lineItems, bankAccount, isReconciled, date, reference, currencyCode, currencyRate, url, status, lineAmountTypes, subTotal, totalTax, total, bankTransactionID, prepaymentID, overpaymentID, updatedDateUTC, hasAttachments, statusAttributeString, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1090,16 +1001,15 @@ public String toString() { sb.append(" overpaymentID: ").append(toIndentedString(overpaymentID)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" hasAttachments: ").append(toIndentedString(hasAttachments)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1107,4 +1017,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BankTransactions.java b/src/main/java/com/xero/models/accounting/BankTransactions.java index cb30c0b14..45d3d91fa 100644 --- a/src/main/java/com/xero/models/accounting/BankTransactions.java +++ b/src/main/java/com/xero/models/accounting/BankTransactions.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.BankTransaction; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankTransactions + */ -/** BankTransactions */ public class BankTransactions { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class BankTransactions { @JsonProperty("BankTransactions") private List bankTransactions = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return BankTransactions - */ + * pagination + * @param pagination Pagination + * @return BankTransactions + **/ public BankTransactions pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return BankTransactions - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return BankTransactions + **/ public BankTransactions warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public BankTransactions warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return BankTransactions - */ + **/ public BankTransactions addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public BankTransactions addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * bankTransactions - * - * @param bankTransactions List<BankTransaction> - * @return BankTransactions - */ + * bankTransactions + * @param bankTransactions List<BankTransaction> + * @return BankTransactions + **/ public BankTransactions bankTransactions(List bankTransactions) { this.bankTransactions = bankTransactions; return this; @@ -127,10 +139,9 @@ public BankTransactions bankTransactions(List bankTransactions) /** * bankTransactions - * - * @param bankTransactionsItem BankTransaction + * @param bankTransactionsItem BankTransaction * @return BankTransactions - */ + **/ public BankTransactions addBankTransactionsItem(BankTransaction bankTransactionsItem) { if (this.bankTransactions == null) { this.bankTransactions = new ArrayList(); @@ -139,30 +150,29 @@ public BankTransactions addBankTransactionsItem(BankTransaction bankTransactions return this; } - /** + /** * Get bankTransactions - * * @return bankTransactions - */ + **/ @ApiModelProperty(value = "") - /** + /** * bankTransactions - * * @return bankTransactions List - */ + **/ public List getBankTransactions() { return bankTransactions; } - /** - * bankTransactions - * - * @param bankTransactions List<BankTransaction> - */ + /** + * bankTransactions + * @param bankTransactions List<BankTransaction> + **/ + public void setBankTransactions(List bankTransactions) { this.bankTransactions = bankTransactions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } BankTransactions bankTransactions = (BankTransactions) o; - return Objects.equals(this.pagination, bankTransactions.pagination) - && Objects.equals(this.warnings, bankTransactions.warnings) - && Objects.equals(this.bankTransactions, bankTransactions.bankTransactions); + return Objects.equals(this.pagination, bankTransactions.pagination) && + Objects.equals(this.warnings, bankTransactions.warnings) && + Objects.equals(this.bankTransactions, bankTransactions.bankTransactions); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, bankTransactions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BankTransfer.java b/src/main/java/com/xero/models/accounting/BankTransfer.java index b0f8edca6..d9349a56f 100644 --- a/src/main/java/com/xero/models/accounting/BankTransfer.java +++ b/src/main/java/com/xero/models/accounting/BankTransfer.java @@ -9,22 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Account; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankTransfer + */ -/** BankTransfer */ public class BankTransfer { StringUtil util = new StringUtil(); @@ -70,398 +84,352 @@ public class BankTransfer { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * fromBankAccount - * - * @param fromBankAccount Account - * @return BankTransfer - */ + * fromBankAccount + * @param fromBankAccount Account + * @return BankTransfer + **/ public BankTransfer fromBankAccount(Account fromBankAccount) { this.fromBankAccount = fromBankAccount; return this; } - /** + /** * Get fromBankAccount - * * @return fromBankAccount - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * fromBankAccount - * * @return fromBankAccount Account - */ + **/ public Account getFromBankAccount() { return fromBankAccount; } - /** - * fromBankAccount - * - * @param fromBankAccount Account - */ + /** + * fromBankAccount + * @param fromBankAccount Account + **/ + public void setFromBankAccount(Account fromBankAccount) { this.fromBankAccount = fromBankAccount; } /** - * toBankAccount - * - * @param toBankAccount Account - * @return BankTransfer - */ + * toBankAccount + * @param toBankAccount Account + * @return BankTransfer + **/ public BankTransfer toBankAccount(Account toBankAccount) { this.toBankAccount = toBankAccount; return this; } - /** + /** * Get toBankAccount - * * @return toBankAccount - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * toBankAccount - * * @return toBankAccount Account - */ + **/ public Account getToBankAccount() { return toBankAccount; } - /** - * toBankAccount - * - * @param toBankAccount Account - */ + /** + * toBankAccount + * @param toBankAccount Account + **/ + public void setToBankAccount(Account toBankAccount) { this.toBankAccount = toBankAccount; } /** - * amount of the transaction - * - * @param amount Double - * @return BankTransfer - */ + * amount of the transaction + * @param amount Double + * @return BankTransfer + **/ public BankTransfer amount(Double amount) { this.amount = amount; return this; } - /** + /** * amount of the transaction - * * @return amount - */ + **/ @ApiModelProperty(required = true, value = "amount of the transaction") - /** + /** * amount of the transaction - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * amount of the transaction - * - * @param amount Double - */ + /** + * amount of the transaction + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The date of the Transfer YYYY-MM-DD - * - * @param date String - * @return BankTransfer - */ + * The date of the Transfer YYYY-MM-DD + * @param date String + * @return BankTransfer + **/ public BankTransfer date(String date) { this.date = date; return this; } - /** + /** * The date of the Transfer YYYY-MM-DD - * * @return date - */ + **/ @ApiModelProperty(value = "The date of the Transfer YYYY-MM-DD") - /** + /** * The date of the Transfer YYYY-MM-DD - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * The date of the Transfer YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The date of the Transfer YYYY-MM-DD - * - * @param date String - */ + /** + * The date of the Transfer YYYY-MM-DD + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * The date of the Transfer YYYY-MM-DD - * - * @param date LocalDateTime - */ + /** + * The date of the Transfer YYYY-MM-DD + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } - /** + /** * The identifier of the Bank Transfer - * * @return bankTransferID - */ + **/ @ApiModelProperty(value = "The identifier of the Bank Transfer") - /** + /** * The identifier of the Bank Transfer - * * @return bankTransferID UUID - */ + **/ public UUID getBankTransferID() { return bankTransferID; } - /** + /** * The currency rate - * * @return currencyRate - */ + **/ @ApiModelProperty(value = "The currency rate") - /** + /** * The currency rate - * * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** + /** * The Bank Transaction ID for the source account - * * @return fromBankTransactionID - */ + **/ @ApiModelProperty(value = "The Bank Transaction ID for the source account") - /** + /** * The Bank Transaction ID for the source account - * * @return fromBankTransactionID UUID - */ + **/ public UUID getFromBankTransactionID() { return fromBankTransactionID; } - /** + /** * The Bank Transaction ID for the destination account - * * @return toBankTransactionID - */ + **/ @ApiModelProperty(value = "The Bank Transaction ID for the destination account") - /** + /** * The Bank Transaction ID for the destination account - * * @return toBankTransactionID UUID - */ + **/ public UUID getToBankTransactionID() { return toBankTransactionID; } /** - * The Bank Transaction boolean to show if it is reconciled for the source account - * - * @param fromIsReconciled Boolean - * @return BankTransfer - */ + * The Bank Transaction boolean to show if it is reconciled for the source account + * @param fromIsReconciled Boolean + * @return BankTransfer + **/ public BankTransfer fromIsReconciled(Boolean fromIsReconciled) { this.fromIsReconciled = fromIsReconciled; return this; } - /** + /** * The Bank Transaction boolean to show if it is reconciled for the source account - * * @return fromIsReconciled - */ - @ApiModelProperty( - example = "false", - value = "The Bank Transaction boolean to show if it is reconciled for the source account") - /** + **/ + @ApiModelProperty(example = "false", value = "The Bank Transaction boolean to show if it is reconciled for the source account") + /** * The Bank Transaction boolean to show if it is reconciled for the source account - * * @return fromIsReconciled Boolean - */ + **/ public Boolean getFromIsReconciled() { return fromIsReconciled; } - /** - * The Bank Transaction boolean to show if it is reconciled for the source account - * - * @param fromIsReconciled Boolean - */ + /** + * The Bank Transaction boolean to show if it is reconciled for the source account + * @param fromIsReconciled Boolean + **/ + public void setFromIsReconciled(Boolean fromIsReconciled) { this.fromIsReconciled = fromIsReconciled; } /** - * The Bank Transaction boolean to show if it is reconciled for the destination account - * - * @param toIsReconciled Boolean - * @return BankTransfer - */ + * The Bank Transaction boolean to show if it is reconciled for the destination account + * @param toIsReconciled Boolean + * @return BankTransfer + **/ public BankTransfer toIsReconciled(Boolean toIsReconciled) { this.toIsReconciled = toIsReconciled; return this; } - /** + /** * The Bank Transaction boolean to show if it is reconciled for the destination account - * * @return toIsReconciled - */ - @ApiModelProperty( - example = "false", - value = - "The Bank Transaction boolean to show if it is reconciled for the destination account") - /** + **/ + @ApiModelProperty(example = "false", value = "The Bank Transaction boolean to show if it is reconciled for the destination account") + /** * The Bank Transaction boolean to show if it is reconciled for the destination account - * * @return toIsReconciled Boolean - */ + **/ public Boolean getToIsReconciled() { return toIsReconciled; } - /** - * The Bank Transaction boolean to show if it is reconciled for the destination account - * - * @param toIsReconciled Boolean - */ + /** + * The Bank Transaction boolean to show if it is reconciled for the destination account + * @param toIsReconciled Boolean + **/ + public void setToIsReconciled(Boolean toIsReconciled) { this.toIsReconciled = toIsReconciled; } /** - * Reference for the transactions. - * - * @param reference String - * @return BankTransfer - */ + * Reference for the transactions. + * @param reference String + * @return BankTransfer + **/ public BankTransfer reference(String reference) { this.reference = reference; return this; } - /** + /** * Reference for the transactions. - * * @return reference - */ + **/ @ApiModelProperty(value = "Reference for the transactions.") - /** + /** * Reference for the transactions. - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Reference for the transactions. - * - * @param reference String - */ + /** + * Reference for the transactions. + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } - /** + /** * Boolean to indicate if a Bank Transfer has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate if a Bank Transfer has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate if a Bank Transfer has an attachment") + /** * Boolean to indicate if a Bank Transfer has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** + /** * UTC timestamp of creation date of bank transfer - * * @return createdDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of creation date of bank transfer") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of creation date of bank transfer") + /** * UTC timestamp of creation date of bank transfer - * * @return createdDateUTC String - */ + **/ public String getCreatedDateUTC() { return createdDateUTC; } - /** + /** * UTC timestamp of creation date of bank transfer - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getCreatedDateUTCAsDate() { if (this.createdDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.createdDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return BankTransfer - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return BankTransfer + **/ public BankTransfer validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -469,10 +437,9 @@ public BankTransfer validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return BankTransfer - */ + **/ public BankTransfer addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -481,30 +448,29 @@ public BankTransfer addValidationErrorsItem(ValidationError validationErrorsItem return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -514,41 +480,28 @@ public boolean equals(java.lang.Object o) { return false; } BankTransfer bankTransfer = (BankTransfer) o; - return Objects.equals(this.fromBankAccount, bankTransfer.fromBankAccount) - && Objects.equals(this.toBankAccount, bankTransfer.toBankAccount) - && Objects.equals(this.amount, bankTransfer.amount) - && Objects.equals(this.date, bankTransfer.date) - && Objects.equals(this.bankTransferID, bankTransfer.bankTransferID) - && Objects.equals(this.currencyRate, bankTransfer.currencyRate) - && Objects.equals(this.fromBankTransactionID, bankTransfer.fromBankTransactionID) - && Objects.equals(this.toBankTransactionID, bankTransfer.toBankTransactionID) - && Objects.equals(this.fromIsReconciled, bankTransfer.fromIsReconciled) - && Objects.equals(this.toIsReconciled, bankTransfer.toIsReconciled) - && Objects.equals(this.reference, bankTransfer.reference) - && Objects.equals(this.hasAttachments, bankTransfer.hasAttachments) - && Objects.equals(this.createdDateUTC, bankTransfer.createdDateUTC) - && Objects.equals(this.validationErrors, bankTransfer.validationErrors); + return Objects.equals(this.fromBankAccount, bankTransfer.fromBankAccount) && + Objects.equals(this.toBankAccount, bankTransfer.toBankAccount) && + Objects.equals(this.amount, bankTransfer.amount) && + Objects.equals(this.date, bankTransfer.date) && + Objects.equals(this.bankTransferID, bankTransfer.bankTransferID) && + Objects.equals(this.currencyRate, bankTransfer.currencyRate) && + Objects.equals(this.fromBankTransactionID, bankTransfer.fromBankTransactionID) && + Objects.equals(this.toBankTransactionID, bankTransfer.toBankTransactionID) && + Objects.equals(this.fromIsReconciled, bankTransfer.fromIsReconciled) && + Objects.equals(this.toIsReconciled, bankTransfer.toIsReconciled) && + Objects.equals(this.reference, bankTransfer.reference) && + Objects.equals(this.hasAttachments, bankTransfer.hasAttachments) && + Objects.equals(this.createdDateUTC, bankTransfer.createdDateUTC) && + Objects.equals(this.validationErrors, bankTransfer.validationErrors); } @Override public int hashCode() { - return Objects.hash( - fromBankAccount, - toBankAccount, - amount, - date, - bankTransferID, - currencyRate, - fromBankTransactionID, - toBankTransactionID, - fromIsReconciled, - toIsReconciled, - reference, - hasAttachments, - createdDateUTC, - validationErrors); + return Objects.hash(fromBankAccount, toBankAccount, amount, date, bankTransferID, currencyRate, fromBankTransactionID, toBankTransactionID, fromIsReconciled, toIsReconciled, reference, hasAttachments, createdDateUTC, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -559,12 +512,8 @@ public String toString() { sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" bankTransferID: ").append(toIndentedString(bankTransferID)).append("\n"); sb.append(" currencyRate: ").append(toIndentedString(currencyRate)).append("\n"); - sb.append(" fromBankTransactionID: ") - .append(toIndentedString(fromBankTransactionID)) - .append("\n"); - sb.append(" toBankTransactionID: ") - .append(toIndentedString(toBankTransactionID)) - .append("\n"); + sb.append(" fromBankTransactionID: ").append(toIndentedString(fromBankTransactionID)).append("\n"); + sb.append(" toBankTransactionID: ").append(toIndentedString(toBankTransactionID)).append("\n"); sb.append(" fromIsReconciled: ").append(toIndentedString(fromIsReconciled)).append("\n"); sb.append(" toIsReconciled: ").append(toIndentedString(toIsReconciled)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); @@ -576,7 +525,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -584,4 +534,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BankTransfers.java b/src/main/java/com/xero/models/accounting/BankTransfers.java index 223ac57c0..672927125 100644 --- a/src/main/java/com/xero/models/accounting/BankTransfers.java +++ b/src/main/java/com/xero/models/accounting/BankTransfers.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.BankTransfer; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankTransfers + */ -/** BankTransfers */ public class BankTransfers { StringUtil util = new StringUtil(); @JsonProperty("BankTransfers") private List bankTransfers = new ArrayList(); /** - * bankTransfers - * - * @param bankTransfers List<BankTransfer> - * @return BankTransfers - */ + * bankTransfers + * @param bankTransfers List<BankTransfer> + * @return BankTransfers + **/ public BankTransfers bankTransfers(List bankTransfers) { this.bankTransfers = bankTransfers; return this; @@ -37,10 +54,9 @@ public BankTransfers bankTransfers(List bankTransfers) { /** * bankTransfers - * - * @param bankTransfersItem BankTransfer + * @param bankTransfersItem BankTransfer * @return BankTransfers - */ + **/ public BankTransfers addBankTransfersItem(BankTransfer bankTransfersItem) { if (this.bankTransfers == null) { this.bankTransfers = new ArrayList(); @@ -49,30 +65,29 @@ public BankTransfers addBankTransfersItem(BankTransfer bankTransfersItem) { return this; } - /** + /** * Get bankTransfers - * * @return bankTransfers - */ + **/ @ApiModelProperty(value = "") - /** + /** * bankTransfers - * * @return bankTransfers List - */ + **/ public List getBankTransfers() { return bankTransfers; } - /** - * bankTransfers - * - * @param bankTransfers List<BankTransfer> - */ + /** + * bankTransfers + * @param bankTransfers List<BankTransfer> + **/ + public void setBankTransfers(List bankTransfers) { this.bankTransfers = bankTransfers; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(bankTransfers); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BatchPayment.java b/src/main/java/com/xero/models/accounting/BatchPayment.java index 7dc6a965f..6159d2769 100644 --- a/src/main/java/com/xero/models/accounting/BatchPayment.java +++ b/src/main/java/com/xero/models/accounting/BatchPayment.java @@ -9,24 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Account; +import com.xero.models.accounting.Payment; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BatchPayment + */ -/** BatchPayment */ public class BatchPayment { StringUtil util = new StringUtil(); @@ -62,12 +75,18 @@ public class BatchPayment { @JsonProperty("Payments") private List payments = new ArrayList(); - /** PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) */ + /** + * PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) + */ public enum TypeEnum { - /** PAYBATCH */ + /** + * PAYBATCH + */ PAYBATCH("PAYBATCH"), - - /** RECBATCH */ + + /** + * RECBATCH + */ RECBATCH("RECBATCH"); private String value; @@ -76,31 +95,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -112,17 +125,21 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; /** - * AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is - * not possible to delete batch payments via the API. + * AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. */ public enum StatusEnum { - /** AUTHORISED */ + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -131,31 +148,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -167,6 +178,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -182,434 +194,337 @@ public static StatusEnum fromValue(String value) { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * account - * - * @param account Account - * @return BatchPayment - */ + * account + * @param account Account + * @return BatchPayment + **/ public BatchPayment account(Account account) { this.account = account; return this; } - /** + /** * Get account - * * @return account - */ + **/ @ApiModelProperty(value = "") - /** + /** * account - * * @return account Account - */ + **/ public Account getAccount() { return account; } - /** - * account - * - * @param account Account - */ + /** + * account + * @param account Account + **/ + public void setAccount(Account account) { this.account = account; } /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param reference String - * @return BatchPayment - */ + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param reference String + * @return BatchPayment + **/ public BatchPayment reference(String reference) { this.reference = reference; return this; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return reference - */ - @ApiModelProperty( - value = - "(NZ Only) Optional references for the batch payment transaction. It will also show with" - + " the batch payment transaction in the bank reconciliation Find & Match screen." - + " Depending on your individual bank, the detail may also show on the bank" - + " statement you import into Xero.") - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + **/ + @ApiModelProperty(value = "(NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero.") + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param reference String - */ + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param particulars String - * @return BatchPayment - */ + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param particulars String + * @return BatchPayment + **/ public BatchPayment particulars(String particulars) { this.particulars = particulars; return this; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return particulars - */ - @ApiModelProperty( - value = - "(NZ Only) Optional references for the batch payment transaction. It will also show with" - + " the batch payment transaction in the bank reconciliation Find & Match screen." - + " Depending on your individual bank, the detail may also show on the bank" - + " statement you import into Xero.") - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + **/ + @ApiModelProperty(value = "(NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero.") + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return particulars String - */ + **/ public String getParticulars() { return particulars; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param particulars String - */ + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param particulars String + **/ + public void setParticulars(String particulars) { this.particulars = particulars; } /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param code String - * @return BatchPayment - */ + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param code String + * @return BatchPayment + **/ public BatchPayment code(String code) { this.code = code; return this; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return code - */ - @ApiModelProperty( - value = - "(NZ Only) Optional references for the batch payment transaction. It will also show with" - + " the batch payment transaction in the bank reconciliation Find & Match screen." - + " Depending on your individual bank, the detail may also show on the bank" - + " statement you import into Xero.") - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + **/ + @ApiModelProperty(value = "(NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero.") + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return code String - */ + **/ public String getCode() { return code; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param code String - */ + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * - * @param details String - * @return BatchPayment - */ + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * @param details String + * @return BatchPayment + **/ public BatchPayment details(String details) { this.details = details; return this; } - /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * + /** + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 * @return details - */ - @ApiModelProperty( - value = - "(Non-NZ Only) These details are sent to the org’s bank as a reference for the batch" - + " payment transaction. They will also show with the batch payment transaction in" - + " the bank reconciliation Find & Match screen. Depending on your individual bank," - + " the detail may also show on the bank statement imported into Xero. Maximum field" - + " length = 18") - /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * + **/ + @ApiModelProperty(value = "(Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18") + /** + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 * @return details String - */ + **/ public String getDetails() { return details; } - /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * - * @param details String - */ + /** + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * @param details String + **/ + public void setDetails(String details) { this.details = details; } /** - * (UK Only) Only shows on the statement line in Xero. Max length =18 - * - * @param narrative String - * @return BatchPayment - */ + * (UK Only) Only shows on the statement line in Xero. Max length =18 + * @param narrative String + * @return BatchPayment + **/ public BatchPayment narrative(String narrative) { this.narrative = narrative; return this; } - /** + /** * (UK Only) Only shows on the statement line in Xero. Max length =18 - * * @return narrative - */ + **/ @ApiModelProperty(value = "(UK Only) Only shows on the statement line in Xero. Max length =18") - /** + /** * (UK Only) Only shows on the statement line in Xero. Max length =18 - * * @return narrative String - */ + **/ public String getNarrative() { return narrative; } - /** - * (UK Only) Only shows on the statement line in Xero. Max length =18 - * - * @param narrative String - */ + /** + * (UK Only) Only shows on the statement line in Xero. Max length =18 + * @param narrative String + **/ + public void setNarrative(String narrative) { this.narrative = narrative; } - /** + /** * The Xero generated unique identifier for the bank transaction (read-only) - * * @return batchPaymentID - */ - @ApiModelProperty( - value = "The Xero generated unique identifier for the bank transaction (read-only)") - /** + **/ + @ApiModelProperty(value = "The Xero generated unique identifier for the bank transaction (read-only)") + /** * The Xero generated unique identifier for the bank transaction (read-only) - * * @return batchPaymentID UUID - */ + **/ public UUID getBatchPaymentID() { return batchPaymentID; } /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param dateString String - * @return BatchPayment - */ + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param dateString String + * @return BatchPayment + **/ public BatchPayment dateString(String dateString) { this.dateString = dateString; return this; } - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return dateString - */ + **/ @ApiModelProperty(value = "Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06") - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return dateString String - */ + **/ public String getDateString() { return dateString; } - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param dateString String - */ + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param dateString String + **/ + public void setDateString(String dateString) { this.dateString = dateString; } /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date String - * @return BatchPayment - */ + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date String + * @return BatchPayment + **/ public BatchPayment date(String date) { this.date = date; return this; } - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return date - */ + **/ @ApiModelProperty(value = "Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06") - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date String - */ + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date LocalDateTime - */ + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * - * @param amount Double - * @return BatchPayment - */ + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * @param amount Double + * @return BatchPayment + **/ public BatchPayment amount(Double amount) { this.amount = amount; return this; } - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 * @return amount - */ - @ApiModelProperty( - value = - "The amount of the payment. Must be less than or equal to the outstanding amount owing" - + " on the invoice e.g. 200.00") - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * + **/ + @ApiModelProperty(value = "The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00") + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * - * @param amount Double - */ + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * An array of payments - * - * @param payments List<Payment> - * @return BatchPayment - */ + * An array of payments + * @param payments List<Payment> + * @return BatchPayment + **/ public BatchPayment payments(List payments) { this.payments = payments; return this; @@ -617,10 +532,9 @@ public BatchPayment payments(List payments) { /** * An array of payments - * - * @param paymentsItem Payment + * @param paymentsItem Payment * @return BatchPayment - */ + **/ public BatchPayment addPaymentsItem(Payment paymentsItem) { if (this.payments == null) { this.payments = new ArrayList(); @@ -629,135 +543,112 @@ public BatchPayment addPaymentsItem(Payment paymentsItem) { return this; } - /** + /** * An array of payments - * * @return payments - */ + **/ @ApiModelProperty(value = "An array of payments") - /** + /** * An array of payments - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** - * An array of payments - * - * @param payments List<Payment> - */ + /** + * An array of payments + * @param payments List<Payment> + **/ + public void setPayments(List payments) { this.payments = payments; } - /** + /** * PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) - * * @return type - */ - @ApiModelProperty( - value = "PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only)") - /** + **/ + @ApiModelProperty(value = "PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only)") + /** * PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is - * not possible to delete batch payments via the API. - * + /** + * AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. * @return status - */ - @ApiModelProperty( - value = - "AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED." - + " It is not possible to delete batch payments via the API.") - /** - * AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is - * not possible to delete batch payments via the API. - * + **/ + @ApiModelProperty(value = "AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API.") + /** + * AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** + /** * The total of the payments that make up the batch (read-only) - * * @return totalAmount - */ + **/ @ApiModelProperty(value = "The total of the payments that make up the batch (read-only)") - /** + /** * The total of the payments that make up the batch (read-only) - * * @return totalAmount Double - */ + **/ public Double getTotalAmount() { return totalAmount; } - /** + /** * UTC timestamp of last update to the payment - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of last update to the payment") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of last update to the payment") + /** * UTC timestamp of last update to the payment - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * UTC timestamp of last update to the payment - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** + /** * Booelan that tells you if the batch payment has been reconciled (read-only) - * * @return isReconciled - */ - @ApiModelProperty( - value = "Booelan that tells you if the batch payment has been reconciled (read-only)") - /** + **/ + @ApiModelProperty(value = "Booelan that tells you if the batch payment has been reconciled (read-only)") + /** * Booelan that tells you if the batch payment has been reconciled (read-only) - * * @return isReconciled Boolean - */ + **/ public Boolean getIsReconciled() { return isReconciled; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return BatchPayment - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return BatchPayment + **/ public BatchPayment validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -765,10 +656,9 @@ public BatchPayment validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return BatchPayment - */ + **/ public BatchPayment addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -777,30 +667,29 @@ public BatchPayment addValidationErrorsItem(ValidationError validationErrorsItem return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -810,47 +699,31 @@ public boolean equals(java.lang.Object o) { return false; } BatchPayment batchPayment = (BatchPayment) o; - return Objects.equals(this.account, batchPayment.account) - && Objects.equals(this.reference, batchPayment.reference) - && Objects.equals(this.particulars, batchPayment.particulars) - && Objects.equals(this.code, batchPayment.code) - && Objects.equals(this.details, batchPayment.details) - && Objects.equals(this.narrative, batchPayment.narrative) - && Objects.equals(this.batchPaymentID, batchPayment.batchPaymentID) - && Objects.equals(this.dateString, batchPayment.dateString) - && Objects.equals(this.date, batchPayment.date) - && Objects.equals(this.amount, batchPayment.amount) - && Objects.equals(this.payments, batchPayment.payments) - && Objects.equals(this.type, batchPayment.type) - && Objects.equals(this.status, batchPayment.status) - && Objects.equals(this.totalAmount, batchPayment.totalAmount) - && Objects.equals(this.updatedDateUTC, batchPayment.updatedDateUTC) - && Objects.equals(this.isReconciled, batchPayment.isReconciled) - && Objects.equals(this.validationErrors, batchPayment.validationErrors); + return Objects.equals(this.account, batchPayment.account) && + Objects.equals(this.reference, batchPayment.reference) && + Objects.equals(this.particulars, batchPayment.particulars) && + Objects.equals(this.code, batchPayment.code) && + Objects.equals(this.details, batchPayment.details) && + Objects.equals(this.narrative, batchPayment.narrative) && + Objects.equals(this.batchPaymentID, batchPayment.batchPaymentID) && + Objects.equals(this.dateString, batchPayment.dateString) && + Objects.equals(this.date, batchPayment.date) && + Objects.equals(this.amount, batchPayment.amount) && + Objects.equals(this.payments, batchPayment.payments) && + Objects.equals(this.type, batchPayment.type) && + Objects.equals(this.status, batchPayment.status) && + Objects.equals(this.totalAmount, batchPayment.totalAmount) && + Objects.equals(this.updatedDateUTC, batchPayment.updatedDateUTC) && + Objects.equals(this.isReconciled, batchPayment.isReconciled) && + Objects.equals(this.validationErrors, batchPayment.validationErrors); } @Override public int hashCode() { - return Objects.hash( - account, - reference, - particulars, - code, - details, - narrative, - batchPaymentID, - dateString, - date, - amount, - payments, - type, - status, - totalAmount, - updatedDateUTC, - isReconciled, - validationErrors); + return Objects.hash(account, reference, particulars, code, details, narrative, batchPaymentID, dateString, date, amount, payments, type, status, totalAmount, updatedDateUTC, isReconciled, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -877,7 +750,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -885,4 +759,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BatchPaymentDelete.java b/src/main/java/com/xero/models/accounting/BatchPaymentDelete.java index 6380862ab..1faf037f2 100644 --- a/src/main/java/com/xero/models/accounting/BatchPaymentDelete.java +++ b/src/main/java/com/xero/models/accounting/BatchPaymentDelete.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BatchPaymentDelete + */ -/** BatchPaymentDelete */ public class BatchPaymentDelete { StringUtil util = new StringUtil(); @@ -27,77 +44,70 @@ public class BatchPaymentDelete { @JsonProperty("Status") private String status = "DELETED"; /** - * The Xero generated unique identifier for the bank transaction (read-only) - * - * @param batchPaymentID UUID - * @return BatchPaymentDelete - */ + * The Xero generated unique identifier for the bank transaction (read-only) + * @param batchPaymentID UUID + * @return BatchPaymentDelete + **/ public BatchPaymentDelete batchPaymentID(UUID batchPaymentID) { this.batchPaymentID = batchPaymentID; return this; } - /** + /** * The Xero generated unique identifier for the bank transaction (read-only) - * * @return batchPaymentID - */ - @ApiModelProperty( - required = true, - value = "The Xero generated unique identifier for the bank transaction (read-only)") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero generated unique identifier for the bank transaction (read-only)") + /** * The Xero generated unique identifier for the bank transaction (read-only) - * * @return batchPaymentID UUID - */ + **/ public UUID getBatchPaymentID() { return batchPaymentID; } - /** - * The Xero generated unique identifier for the bank transaction (read-only) - * - * @param batchPaymentID UUID - */ + /** + * The Xero generated unique identifier for the bank transaction (read-only) + * @param batchPaymentID UUID + **/ + public void setBatchPaymentID(UUID batchPaymentID) { this.batchPaymentID = batchPaymentID; } /** - * The status of the batch payment. - * - * @param status String - * @return BatchPaymentDelete - */ + * The status of the batch payment. + * @param status String + * @return BatchPaymentDelete + **/ public BatchPaymentDelete status(String status) { this.status = status; return this; } - /** + /** * The status of the batch payment. - * * @return status - */ + **/ @ApiModelProperty(required = true, value = "The status of the batch payment.") - /** + /** * The status of the batch payment. - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * The status of the batch payment. - * - * @param status String - */ + /** + * The status of the batch payment. + * @param status String + **/ + public void setStatus(String status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } BatchPaymentDelete batchPaymentDelete = (BatchPaymentDelete) o; - return Objects.equals(this.batchPaymentID, batchPaymentDelete.batchPaymentID) - && Objects.equals(this.status, batchPaymentDelete.status); + return Objects.equals(this.batchPaymentID, batchPaymentDelete.batchPaymentID) && + Objects.equals(this.status, batchPaymentDelete.status); } @Override @@ -116,6 +126,7 @@ public int hashCode() { return Objects.hash(batchPaymentID, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -127,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -135,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BatchPaymentDeleteByUrlParam.java b/src/main/java/com/xero/models/accounting/BatchPaymentDeleteByUrlParam.java index 3746923ec..48dd44a32 100644 --- a/src/main/java/com/xero/models/accounting/BatchPaymentDeleteByUrlParam.java +++ b/src/main/java/com/xero/models/accounting/BatchPaymentDeleteByUrlParam.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BatchPaymentDeleteByUrlParam + */ -/** BatchPaymentDeleteByUrlParam */ public class BatchPaymentDeleteByUrlParam { StringUtil util = new StringUtil(); @JsonProperty("Status") private String status = "DELETED"; /** - * The status of the batch payment. - * - * @param status String - * @return BatchPaymentDeleteByUrlParam - */ + * The status of the batch payment. + * @param status String + * @return BatchPaymentDeleteByUrlParam + **/ public BatchPaymentDeleteByUrlParam status(String status) { this.status = status; return this; } - /** + /** * The status of the batch payment. - * * @return status - */ + **/ @ApiModelProperty(required = true, value = "The status of the batch payment.") - /** + /** * The status of the batch payment. - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * The status of the batch payment. - * - * @param status String - */ + /** + * The status of the batch payment. + * @param status String + **/ + public void setStatus(String status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BatchPaymentDetails.java b/src/main/java/com/xero/models/accounting/BatchPaymentDetails.java index 7d0d1b76a..7b69615ae 100644 --- a/src/main/java/com/xero/models/accounting/BatchPaymentDetails.java +++ b/src/main/java/com/xero/models/accounting/BatchPaymentDetails.java @@ -9,16 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -/** Bank details for use on a batch payment stored with each contact */ +/** + * Bank details for use on a batch payment stored with each contact + */ @ApiModel(description = "Bank details for use on a batch payment stored with each contact") + public class BatchPaymentDetails { StringUtil util = new StringUtil(); @@ -37,229 +53,166 @@ public class BatchPaymentDetails { @JsonProperty("Reference") private String reference; /** - * Bank account number for use with Batch Payments - * - * @param bankAccountNumber String - * @return BatchPaymentDetails - */ + * Bank account number for use with Batch Payments + * @param bankAccountNumber String + * @return BatchPaymentDetails + **/ public BatchPaymentDetails bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; return this; } - /** + /** * Bank account number for use with Batch Payments - * * @return bankAccountNumber - */ - @ApiModelProperty( - example = "123-456-1111111", - value = "Bank account number for use with Batch Payments") - /** + **/ + @ApiModelProperty(example = "123-456-1111111", value = "Bank account number for use with Batch Payments") + /** * Bank account number for use with Batch Payments - * * @return bankAccountNumber String - */ + **/ public String getBankAccountNumber() { return bankAccountNumber; } - /** - * Bank account number for use with Batch Payments - * - * @param bankAccountNumber String - */ + /** + * Bank account number for use with Batch Payments + * @param bankAccountNumber String + **/ + public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; } /** - * Name of bank for use with Batch Payments - * - * @param bankAccountName String - * @return BatchPaymentDetails - */ + * Name of bank for use with Batch Payments + * @param bankAccountName String + * @return BatchPaymentDetails + **/ public BatchPaymentDetails bankAccountName(String bankAccountName) { this.bankAccountName = bankAccountName; return this; } - /** + /** * Name of bank for use with Batch Payments - * * @return bankAccountName - */ + **/ @ApiModelProperty(example = "ACME Bank", value = "Name of bank for use with Batch Payments") - /** + /** * Name of bank for use with Batch Payments - * * @return bankAccountName String - */ + **/ public String getBankAccountName() { return bankAccountName; } - /** - * Name of bank for use with Batch Payments - * - * @param bankAccountName String - */ + /** + * Name of bank for use with Batch Payments + * @param bankAccountName String + **/ + public void setBankAccountName(String bankAccountName) { this.bankAccountName = bankAccountName; } /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * - * @param details String - * @return BatchPaymentDetails - */ + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * @param details String + * @return BatchPaymentDetails + **/ public BatchPaymentDetails details(String details) { this.details = details; return this; } - /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * + /** + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 * @return details - */ - @ApiModelProperty( - example = "Hello World", - value = - "(Non-NZ Only) These details are sent to the org’s bank as a reference for the batch" - + " payment transaction. They will also show with the batch payment transaction in" - + " the bank reconciliation Find & Match screen. Depending on your individual bank," - + " the detail may also show on the bank statement imported into Xero. Maximum field" - + " length = 18") - /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * + **/ + @ApiModelProperty(example = "Hello World", value = "(Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18") + /** + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 * @return details String - */ + **/ public String getDetails() { return details; } - /** - * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment - * transaction. They will also show with the batch payment transaction in the bank reconciliation - * Find & Match screen. Depending on your individual bank, the detail may also show on the - * bank statement imported into Xero. Maximum field length = 18 - * - * @param details String - */ + /** + * (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * @param details String + **/ + public void setDetails(String details) { this.details = details; } /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param code String - * @return BatchPaymentDetails - */ + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param code String + * @return BatchPaymentDetails + **/ public BatchPaymentDetails code(String code) { this.code = code; return this; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return code - */ - @ApiModelProperty( - example = "ABC", - value = - "(NZ Only) Optional references for the batch payment transaction. It will also show with" - + " the batch payment transaction in the bank reconciliation Find & Match screen." - + " Depending on your individual bank, the detail may also show on the bank" - + " statement you import into Xero.") - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + **/ + @ApiModelProperty(example = "ABC", value = "(NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero.") + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return code String - */ + **/ public String getCode() { return code; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param code String - */ + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param reference String - * @return BatchPaymentDetails - */ + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param reference String + * @return BatchPaymentDetails + **/ public BatchPaymentDetails reference(String reference) { this.reference = reference; return this; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return reference - */ - @ApiModelProperty( - example = "Foobar", - value = - "(NZ Only) Optional references for the batch payment transaction. It will also show with" - + " the batch payment transaction in the bank reconciliation Find & Match screen." - + " Depending on your individual bank, the detail may also show on the bank" - + " statement you import into Xero.") - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * + **/ + @ApiModelProperty(example = "Foobar", value = "(NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero.") + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the - * batch payment transaction in the bank reconciliation Find & Match screen. Depending on your - * individual bank, the detail may also show on the bank statement you import into Xero. - * - * @param reference String - */ + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } BatchPaymentDetails batchPaymentDetails = (BatchPaymentDetails) o; - return Objects.equals(this.bankAccountNumber, batchPaymentDetails.bankAccountNumber) - && Objects.equals(this.bankAccountName, batchPaymentDetails.bankAccountName) - && Objects.equals(this.details, batchPaymentDetails.details) - && Objects.equals(this.code, batchPaymentDetails.code) - && Objects.equals(this.reference, batchPaymentDetails.reference); + return Objects.equals(this.bankAccountNumber, batchPaymentDetails.bankAccountNumber) && + Objects.equals(this.bankAccountName, batchPaymentDetails.bankAccountName) && + Objects.equals(this.details, batchPaymentDetails.details) && + Objects.equals(this.code, batchPaymentDetails.code) && + Objects.equals(this.reference, batchPaymentDetails.reference); } @Override @@ -281,6 +234,7 @@ public int hashCode() { return Objects.hash(bankAccountNumber, bankAccountName, details, code, reference); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -295,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -303,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BatchPayments.java b/src/main/java/com/xero/models/accounting/BatchPayments.java index e3da40077..7ed7d28a1 100644 --- a/src/main/java/com/xero/models/accounting/BatchPayments.java +++ b/src/main/java/com/xero/models/accounting/BatchPayments.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.BatchPayment; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BatchPayments + */ -/** BatchPayments */ public class BatchPayments { StringUtil util = new StringUtil(); @JsonProperty("BatchPayments") private List batchPayments = new ArrayList(); /** - * batchPayments - * - * @param batchPayments List<BatchPayment> - * @return BatchPayments - */ + * batchPayments + * @param batchPayments List<BatchPayment> + * @return BatchPayments + **/ public BatchPayments batchPayments(List batchPayments) { this.batchPayments = batchPayments; return this; @@ -37,10 +54,9 @@ public BatchPayments batchPayments(List batchPayments) { /** * batchPayments - * - * @param batchPaymentsItem BatchPayment + * @param batchPaymentsItem BatchPayment * @return BatchPayments - */ + **/ public BatchPayments addBatchPaymentsItem(BatchPayment batchPaymentsItem) { if (this.batchPayments == null) { this.batchPayments = new ArrayList(); @@ -49,30 +65,29 @@ public BatchPayments addBatchPaymentsItem(BatchPayment batchPaymentsItem) { return this; } - /** + /** * Get batchPayments - * * @return batchPayments - */ + **/ @ApiModelProperty(value = "") - /** + /** * batchPayments - * * @return batchPayments List - */ + **/ public List getBatchPayments() { return batchPayments; } - /** - * batchPayments - * - * @param batchPayments List<BatchPayment> - */ + /** + * batchPayments + * @param batchPayments List<BatchPayment> + **/ + public void setBatchPayments(List batchPayments) { this.batchPayments = batchPayments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(batchPayments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Bill.java b/src/main/java/com/xero/models/accounting/Bill.java index 74eece259..23028bb4d 100644 --- a/src/main/java/com/xero/models/accounting/Bill.java +++ b/src/main/java/com/xero/models/accounting/Bill.java @@ -9,14 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.PaymentTermType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Bill + */ -/** Bill */ public class Bill { StringUtil util = new StringUtil(); @@ -26,75 +44,70 @@ public class Bill { @JsonProperty("Type") private PaymentTermType type; /** - * Day of Month (0-31) - * - * @param day Integer - * @return Bill - */ + * Day of Month (0-31) + * @param day Integer + * @return Bill + **/ public Bill day(Integer day) { this.day = day; return this; } - /** + /** * Day of Month (0-31) - * * @return day - */ + **/ @ApiModelProperty(value = "Day of Month (0-31)") - /** + /** * Day of Month (0-31) - * * @return day Integer - */ + **/ public Integer getDay() { return day; } - /** - * Day of Month (0-31) - * - * @param day Integer - */ + /** + * Day of Month (0-31) + * @param day Integer + **/ + public void setDay(Integer day) { this.day = day; } /** - * type - * - * @param type PaymentTermType - * @return Bill - */ + * type + * @param type PaymentTermType + * @return Bill + **/ public Bill type(PaymentTermType type) { this.type = type; return this; } - /** + /** * Get type - * * @return type - */ + **/ @ApiModelProperty(value = "") - /** + /** * type - * * @return type PaymentTermType - */ + **/ public PaymentTermType getType() { return type; } - /** - * type - * - * @param type PaymentTermType - */ + /** + * type + * @param type PaymentTermType + **/ + public void setType(PaymentTermType type) { this.type = type; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,7 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } Bill bill = (Bill) o; - return Objects.equals(this.day, bill.day) && Objects.equals(this.type, bill.type); + return Objects.equals(this.day, bill.day) && + Objects.equals(this.type, bill.type); } @Override @@ -112,6 +126,7 @@ public int hashCode() { return Objects.hash(day, type); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -123,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -131,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BrandingTheme.java b/src/main/java/com/xero/models/accounting/BrandingTheme.java index e3afb5f94..827c62964 100644 --- a/src/main/java/com/xero/models/accounting/BrandingTheme.java +++ b/src/main/java/com/xero/models/accounting/BrandingTheme.java @@ -9,19 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BrandingTheme + */ -/** BrandingTheme */ public class BrandingTheme { StringUtil util = new StringUtil(); @@ -33,9 +46,13 @@ public class BrandingTheme { @JsonProperty("LogoUrl") private String logoUrl; - /** Always INVOICE */ + /** + * Always INVOICE + */ public enum TypeEnum { - /** INVOICE */ + /** + * INVOICE + */ INVOICE("INVOICE"); private String value; @@ -44,31 +61,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -80,6 +91,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -89,215 +101,193 @@ public static TypeEnum fromValue(String value) { @JsonProperty("CreatedDateUTC") private String createdDateUTC; /** - * Xero identifier - * - * @param brandingThemeID UUID - * @return BrandingTheme - */ + * Xero identifier + * @param brandingThemeID UUID + * @return BrandingTheme + **/ public BrandingTheme brandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; return this; } - /** + /** * Xero identifier - * * @return brandingThemeID - */ + **/ @ApiModelProperty(value = "Xero identifier") - /** + /** * Xero identifier - * * @return brandingThemeID UUID - */ + **/ public UUID getBrandingThemeID() { return brandingThemeID; } - /** - * Xero identifier - * - * @param brandingThemeID UUID - */ + /** + * Xero identifier + * @param brandingThemeID UUID + **/ + public void setBrandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; } /** - * Name of branding theme - * - * @param name String - * @return BrandingTheme - */ + * Name of branding theme + * @param name String + * @return BrandingTheme + **/ public BrandingTheme name(String name) { this.name = name; return this; } - /** + /** * Name of branding theme - * * @return name - */ + **/ @ApiModelProperty(value = "Name of branding theme") - /** + /** * Name of branding theme - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of branding theme - * - * @param name String - */ + /** + * Name of branding theme + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The location of the image file used as the logo on this branding theme - * - * @param logoUrl String - * @return BrandingTheme - */ + * The location of the image file used as the logo on this branding theme + * @param logoUrl String + * @return BrandingTheme + **/ public BrandingTheme logoUrl(String logoUrl) { this.logoUrl = logoUrl; return this; } - /** + /** * The location of the image file used as the logo on this branding theme - * * @return logoUrl - */ - @ApiModelProperty( - value = "The location of the image file used as the logo on this branding theme") - /** + **/ + @ApiModelProperty(value = "The location of the image file used as the logo on this branding theme") + /** * The location of the image file used as the logo on this branding theme - * * @return logoUrl String - */ + **/ public String getLogoUrl() { return logoUrl; } - /** - * The location of the image file used as the logo on this branding theme - * - * @param logoUrl String - */ + /** + * The location of the image file used as the logo on this branding theme + * @param logoUrl String + **/ + public void setLogoUrl(String logoUrl) { this.logoUrl = logoUrl; } /** - * Always INVOICE - * - * @param type TypeEnum - * @return BrandingTheme - */ + * Always INVOICE + * @param type TypeEnum + * @return BrandingTheme + **/ public BrandingTheme type(TypeEnum type) { this.type = type; return this; } - /** + /** * Always INVOICE - * * @return type - */ + **/ @ApiModelProperty(value = "Always INVOICE") - /** + /** * Always INVOICE - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * Always INVOICE - * - * @param type TypeEnum - */ + /** + * Always INVOICE + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * Integer – ranked order of branding theme. The default branding theme has a value of 0 - * - * @param sortOrder Integer - * @return BrandingTheme - */ + * Integer – ranked order of branding theme. The default branding theme has a value of 0 + * @param sortOrder Integer + * @return BrandingTheme + **/ public BrandingTheme sortOrder(Integer sortOrder) { this.sortOrder = sortOrder; return this; } - /** + /** * Integer – ranked order of branding theme. The default branding theme has a value of 0 - * * @return sortOrder - */ - @ApiModelProperty( - value = - "Integer – ranked order of branding theme. The default branding theme has a value of 0") - /** + **/ + @ApiModelProperty(value = "Integer – ranked order of branding theme. The default branding theme has a value of 0") + /** * Integer – ranked order of branding theme. The default branding theme has a value of 0 - * * @return sortOrder Integer - */ + **/ public Integer getSortOrder() { return sortOrder; } - /** - * Integer – ranked order of branding theme. The default branding theme has a value of 0 - * - * @param sortOrder Integer - */ + /** + * Integer – ranked order of branding theme. The default branding theme has a value of 0 + * @param sortOrder Integer + **/ + public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; } - /** + /** * UTC timestamp of creation date of branding theme - * * @return createdDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of creation date of branding theme") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of creation date of branding theme") + /** * UTC timestamp of creation date of branding theme - * * @return createdDateUTC String - */ + **/ public String getCreatedDateUTC() { return createdDateUTC; } - /** + /** * UTC timestamp of creation date of branding theme - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getCreatedDateUTCAsDate() { if (this.createdDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.createdDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -307,12 +297,12 @@ public boolean equals(java.lang.Object o) { return false; } BrandingTheme brandingTheme = (BrandingTheme) o; - return Objects.equals(this.brandingThemeID, brandingTheme.brandingThemeID) - && Objects.equals(this.name, brandingTheme.name) - && Objects.equals(this.logoUrl, brandingTheme.logoUrl) - && Objects.equals(this.type, brandingTheme.type) - && Objects.equals(this.sortOrder, brandingTheme.sortOrder) - && Objects.equals(this.createdDateUTC, brandingTheme.createdDateUTC); + return Objects.equals(this.brandingThemeID, brandingTheme.brandingThemeID) && + Objects.equals(this.name, brandingTheme.name) && + Objects.equals(this.logoUrl, brandingTheme.logoUrl) && + Objects.equals(this.type, brandingTheme.type) && + Objects.equals(this.sortOrder, brandingTheme.sortOrder) && + Objects.equals(this.createdDateUTC, brandingTheme.createdDateUTC); } @Override @@ -320,6 +310,7 @@ public int hashCode() { return Objects.hash(brandingThemeID, name, logoUrl, type, sortOrder, createdDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -335,7 +326,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -343,4 +335,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BrandingThemes.java b/src/main/java/com/xero/models/accounting/BrandingThemes.java index d7d3a9a88..77a0ca5eb 100644 --- a/src/main/java/com/xero/models/accounting/BrandingThemes.java +++ b/src/main/java/com/xero/models/accounting/BrandingThemes.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.BrandingTheme; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BrandingThemes + */ -/** BrandingThemes */ public class BrandingThemes { StringUtil util = new StringUtil(); @JsonProperty("BrandingThemes") private List brandingThemes = new ArrayList(); /** - * brandingThemes - * - * @param brandingThemes List<BrandingTheme> - * @return BrandingThemes - */ + * brandingThemes + * @param brandingThemes List<BrandingTheme> + * @return BrandingThemes + **/ public BrandingThemes brandingThemes(List brandingThemes) { this.brandingThemes = brandingThemes; return this; @@ -37,10 +54,9 @@ public BrandingThemes brandingThemes(List brandingThemes) { /** * brandingThemes - * - * @param brandingThemesItem BrandingTheme + * @param brandingThemesItem BrandingTheme * @return BrandingThemes - */ + **/ public BrandingThemes addBrandingThemesItem(BrandingTheme brandingThemesItem) { if (this.brandingThemes == null) { this.brandingThemes = new ArrayList(); @@ -49,30 +65,29 @@ public BrandingThemes addBrandingThemesItem(BrandingTheme brandingThemesItem) { return this; } - /** + /** * Get brandingThemes - * * @return brandingThemes - */ + **/ @ApiModelProperty(value = "") - /** + /** * brandingThemes - * * @return brandingThemes List - */ + **/ public List getBrandingThemes() { return brandingThemes; } - /** - * brandingThemes - * - * @param brandingThemes List<BrandingTheme> - */ + /** + * brandingThemes + * @param brandingThemes List<BrandingTheme> + **/ + public void setBrandingThemes(List brandingThemes) { this.brandingThemes = brandingThemes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(brandingThemes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Budget.java b/src/main/java/com/xero/models/accounting/Budget.java index b4cfbf2ca..6b0a068a4 100644 --- a/src/main/java/com/xero/models/accounting/Budget.java +++ b/src/main/java/com/xero/models/accounting/Budget.java @@ -9,32 +9,53 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.BudgetLine; +import com.xero.models.accounting.TrackingCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Budget + */ -/** Budget */ public class Budget { StringUtil util = new StringUtil(); @JsonProperty("BudgetID") private UUID budgetID; - /** Type of Budget. OVERALL or TRACKING */ + /** + * Type of Budget. OVERALL or TRACKING + */ public enum TypeEnum { - /** OVERALL */ + /** + * OVERALL + */ OVERALL("OVERALL"), - - /** TRACKING */ + + /** + * TRACKING + */ TRACKING("TRACKING"); private String value; @@ -43,31 +64,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -79,6 +94,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -94,148 +110,133 @@ public static TypeEnum fromValue(String value) { @JsonProperty("Tracking") private List tracking = new ArrayList(); /** - * Xero identifier - * - * @param budgetID UUID - * @return Budget - */ + * Xero identifier + * @param budgetID UUID + * @return Budget + **/ public Budget budgetID(UUID budgetID) { this.budgetID = budgetID; return this; } - /** + /** * Xero identifier - * * @return budgetID - */ + **/ @ApiModelProperty(value = "Xero identifier") - /** + /** * Xero identifier - * * @return budgetID UUID - */ + **/ public UUID getBudgetID() { return budgetID; } - /** - * Xero identifier - * - * @param budgetID UUID - */ + /** + * Xero identifier + * @param budgetID UUID + **/ + public void setBudgetID(UUID budgetID) { this.budgetID = budgetID; } /** - * Type of Budget. OVERALL or TRACKING - * - * @param type TypeEnum - * @return Budget - */ + * Type of Budget. OVERALL or TRACKING + * @param type TypeEnum + * @return Budget + **/ public Budget type(TypeEnum type) { this.type = type; return this; } - /** + /** * Type of Budget. OVERALL or TRACKING - * * @return type - */ + **/ @ApiModelProperty(value = "Type of Budget. OVERALL or TRACKING") - /** + /** * Type of Budget. OVERALL or TRACKING - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * Type of Budget. OVERALL or TRACKING - * - * @param type TypeEnum - */ + /** + * Type of Budget. OVERALL or TRACKING + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * The Budget description - * - * @param description String - * @return Budget - */ + * The Budget description + * @param description String + * @return Budget + **/ public Budget description(String description) { this.description = description; return this; } - /** + /** * The Budget description - * * @return description - */ + **/ @ApiModelProperty(value = "The Budget description") - /** + /** * The Budget description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * The Budget description - * - * @param description String - */ + /** + * The Budget description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } - /** + /** * UTC timestamp of last update to budget - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of last update to budget") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of last update to budget") + /** * UTC timestamp of last update to budget - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * UTC timestamp of last update to budget - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * budgetLines - * - * @param budgetLines List<BudgetLine> - * @return Budget - */ + * budgetLines + * @param budgetLines List<BudgetLine> + * @return Budget + **/ public Budget budgetLines(List budgetLines) { this.budgetLines = budgetLines; return this; @@ -243,10 +244,9 @@ public Budget budgetLines(List budgetLines) { /** * budgetLines - * - * @param budgetLinesItem BudgetLine + * @param budgetLinesItem BudgetLine * @return Budget - */ + **/ public Budget addBudgetLinesItem(BudgetLine budgetLinesItem) { if (this.budgetLines == null) { this.budgetLines = new ArrayList(); @@ -255,36 +255,33 @@ public Budget addBudgetLinesItem(BudgetLine budgetLinesItem) { return this; } - /** + /** * Get budgetLines - * * @return budgetLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * budgetLines - * * @return budgetLines List - */ + **/ public List getBudgetLines() { return budgetLines; } - /** - * budgetLines - * - * @param budgetLines List<BudgetLine> - */ + /** + * budgetLines + * @param budgetLines List<BudgetLine> + **/ + public void setBudgetLines(List budgetLines) { this.budgetLines = budgetLines; } /** - * tracking - * - * @param tracking List<TrackingCategory> - * @return Budget - */ + * tracking + * @param tracking List<TrackingCategory> + * @return Budget + **/ public Budget tracking(List tracking) { this.tracking = tracking; return this; @@ -292,10 +289,9 @@ public Budget tracking(List tracking) { /** * tracking - * - * @param trackingItem TrackingCategory + * @param trackingItem TrackingCategory * @return Budget - */ + **/ public Budget addTrackingItem(TrackingCategory trackingItem) { if (this.tracking == null) { this.tracking = new ArrayList(); @@ -304,30 +300,29 @@ public Budget addTrackingItem(TrackingCategory trackingItem) { return this; } - /** + /** * Get tracking - * * @return tracking - */ + **/ @ApiModelProperty(value = "") - /** + /** * tracking - * * @return tracking List - */ + **/ public List getTracking() { return tracking; } - /** - * tracking - * - * @param tracking List<TrackingCategory> - */ + /** + * tracking + * @param tracking List<TrackingCategory> + **/ + public void setTracking(List tracking) { this.tracking = tracking; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -337,12 +332,12 @@ public boolean equals(java.lang.Object o) { return false; } Budget budget = (Budget) o; - return Objects.equals(this.budgetID, budget.budgetID) - && Objects.equals(this.type, budget.type) - && Objects.equals(this.description, budget.description) - && Objects.equals(this.updatedDateUTC, budget.updatedDateUTC) - && Objects.equals(this.budgetLines, budget.budgetLines) - && Objects.equals(this.tracking, budget.tracking); + return Objects.equals(this.budgetID, budget.budgetID) && + Objects.equals(this.type, budget.type) && + Objects.equals(this.description, budget.description) && + Objects.equals(this.updatedDateUTC, budget.updatedDateUTC) && + Objects.equals(this.budgetLines, budget.budgetLines) && + Objects.equals(this.tracking, budget.tracking); } @Override @@ -350,6 +345,7 @@ public int hashCode() { return Objects.hash(budgetID, type, description, updatedDateUTC, budgetLines, tracking); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -365,7 +361,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -373,4 +370,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BudgetBalance.java b/src/main/java/com/xero/models/accounting/BudgetBalance.java index ec535be33..b78e9f832 100644 --- a/src/main/java/com/xero/models/accounting/BudgetBalance.java +++ b/src/main/java/com/xero/models/accounting/BudgetBalance.java @@ -9,18 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Objects; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; import org.threeten.bp.Instant; import org.threeten.bp.LocalDate; -import org.threeten.bp.ZoneId; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BudgetBalance + */ -/** BudgetBalance */ public class BudgetBalance { StringUtil util = new StringUtil(); @@ -36,173 +49,160 @@ public class BudgetBalance { @JsonProperty("Notes") private String notes; /** - * Period the amount applies to (e.g. “2019-08”) - * - * @param period String - * @return BudgetBalance - */ + * Period the amount applies to (e.g. “2019-08”) + * @param period String + * @return BudgetBalance + **/ public BudgetBalance period(String period) { this.period = period; return this; } - /** + /** * Period the amount applies to (e.g. “2019-08”) - * * @return period - */ + **/ @ApiModelProperty(value = "Period the amount applies to (e.g. “2019-08”)") - /** + /** * Period the amount applies to (e.g. “2019-08”) - * * @return period String - */ + **/ public String getPeriod() { return period; } - /** + /** * Period the amount applies to (e.g. “2019-08”) - * * @return LocalDate - */ + **/ public LocalDate getPeriodAsDate() { if (this.period != null) { try { return util.convertStringToDate(this.period); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Period the amount applies to (e.g. “2019-08”) - * - * @param period String - */ + /** + * Period the amount applies to (e.g. “2019-08”) + * @param period String + **/ + public void setPeriod(String period) { this.period = period; } - /** - * Period the amount applies to (e.g. “2019-08”) - * - * @param period LocalDateTime - */ + /** + * Period the amount applies to (e.g. “2019-08”) + * @param period LocalDateTime + **/ public void setPeriod(LocalDate period) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = period.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = period.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.period = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * LineItem Quantity - * - * @param amount Double - * @return BudgetBalance - */ + * LineItem Quantity + * @param amount Double + * @return BudgetBalance + **/ public BudgetBalance amount(Double amount) { this.amount = amount; return this; } - /** + /** * LineItem Quantity - * * @return amount - */ + **/ @ApiModelProperty(value = "LineItem Quantity") - /** + /** * LineItem Quantity - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * LineItem Quantity - * - * @param amount Double - */ + /** + * LineItem Quantity + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Budgeted amount - * - * @param unitAmount Double - * @return BudgetBalance - */ + * Budgeted amount + * @param unitAmount Double + * @return BudgetBalance + **/ public BudgetBalance unitAmount(Double unitAmount) { this.unitAmount = unitAmount; return this; } - /** + /** * Budgeted amount - * * @return unitAmount - */ + **/ @ApiModelProperty(value = "Budgeted amount") - /** + /** * Budgeted amount - * * @return unitAmount Double - */ + **/ public Double getUnitAmount() { return unitAmount; } - /** - * Budgeted amount - * - * @param unitAmount Double - */ + /** + * Budgeted amount + * @param unitAmount Double + **/ + public void setUnitAmount(Double unitAmount) { this.unitAmount = unitAmount; } /** - * Any footnotes associated with this balance - * - * @param notes String - * @return BudgetBalance - */ + * Any footnotes associated with this balance + * @param notes String + * @return BudgetBalance + **/ public BudgetBalance notes(String notes) { this.notes = notes; return this; } - /** + /** * Any footnotes associated with this balance - * * @return notes - */ + **/ @ApiModelProperty(value = "Any footnotes associated with this balance") - /** + /** * Any footnotes associated with this balance - * * @return notes String - */ + **/ public String getNotes() { return notes; } - /** - * Any footnotes associated with this balance - * - * @param notes String - */ + /** + * Any footnotes associated with this balance + * @param notes String + **/ + public void setNotes(String notes) { this.notes = notes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -212,10 +212,10 @@ public boolean equals(java.lang.Object o) { return false; } BudgetBalance budgetBalance = (BudgetBalance) o; - return Objects.equals(this.period, budgetBalance.period) - && Objects.equals(this.amount, budgetBalance.amount) - && Objects.equals(this.unitAmount, budgetBalance.unitAmount) - && Objects.equals(this.notes, budgetBalance.notes); + return Objects.equals(this.period, budgetBalance.period) && + Objects.equals(this.amount, budgetBalance.amount) && + Objects.equals(this.unitAmount, budgetBalance.unitAmount) && + Objects.equals(this.notes, budgetBalance.notes); } @Override @@ -223,6 +223,7 @@ public int hashCode() { return Objects.hash(period, amount, unitAmount, notes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -236,7 +237,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -244,4 +246,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/BudgetLine.java b/src/main/java/com/xero/models/accounting/BudgetLine.java index 1dcba650a..f39529252 100644 --- a/src/main/java/com/xero/models/accounting/BudgetLine.java +++ b/src/main/java/com/xero/models/accounting/BudgetLine.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.BudgetBalance; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BudgetLine + */ -/** BudgetLine */ public class BudgetLine { StringUtil util = new StringUtil(); @@ -32,81 +50,74 @@ public class BudgetLine { @JsonProperty("BudgetBalances") private List budgetBalances = new ArrayList(); /** - * See Accounts - * - * @param accountID UUID - * @return BudgetLine - */ + * See Accounts + * @param accountID UUID + * @return BudgetLine + **/ public BudgetLine accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * See Accounts - * * @return accountID - */ + **/ @ApiModelProperty(value = "See Accounts") - /** + /** * See Accounts - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * See Accounts - * - * @param accountID UUID - */ + /** + * See Accounts + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * See Accounts - * - * @param accountCode String - * @return BudgetLine - */ + * See Accounts + * @param accountCode String + * @return BudgetLine + **/ public BudgetLine accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * See Accounts - * * @return accountCode - */ + **/ @ApiModelProperty(example = "90.0", value = "See Accounts") - /** + /** * See Accounts - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * See Accounts - * - * @param accountCode String - */ + /** + * See Accounts + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * budgetBalances - * - * @param budgetBalances List<BudgetBalance> - * @return BudgetLine - */ + * budgetBalances + * @param budgetBalances List<BudgetBalance> + * @return BudgetLine + **/ public BudgetLine budgetBalances(List budgetBalances) { this.budgetBalances = budgetBalances; return this; @@ -114,10 +125,9 @@ public BudgetLine budgetBalances(List budgetBalances) { /** * budgetBalances - * - * @param budgetBalancesItem BudgetBalance + * @param budgetBalancesItem BudgetBalance * @return BudgetLine - */ + **/ public BudgetLine addBudgetBalancesItem(BudgetBalance budgetBalancesItem) { if (this.budgetBalances == null) { this.budgetBalances = new ArrayList(); @@ -126,30 +136,29 @@ public BudgetLine addBudgetBalancesItem(BudgetBalance budgetBalancesItem) { return this; } - /** + /** * Get budgetBalances - * * @return budgetBalances - */ + **/ @ApiModelProperty(value = "") - /** + /** * budgetBalances - * * @return budgetBalances List - */ + **/ public List getBudgetBalances() { return budgetBalances; } - /** - * budgetBalances - * - * @param budgetBalances List<BudgetBalance> - */ + /** + * budgetBalances + * @param budgetBalances List<BudgetBalance> + **/ + public void setBudgetBalances(List budgetBalances) { this.budgetBalances = budgetBalances; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -159,9 +168,9 @@ public boolean equals(java.lang.Object o) { return false; } BudgetLine budgetLine = (BudgetLine) o; - return Objects.equals(this.accountID, budgetLine.accountID) - && Objects.equals(this.accountCode, budgetLine.accountCode) - && Objects.equals(this.budgetBalances, budgetLine.budgetBalances); + return Objects.equals(this.accountID, budgetLine.accountID) && + Objects.equals(this.accountCode, budgetLine.accountCode) && + Objects.equals(this.budgetBalances, budgetLine.budgetBalances); } @Override @@ -169,6 +178,7 @@ public int hashCode() { return Objects.hash(accountID, accountCode, budgetBalances); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -181,7 +191,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -189,4 +200,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Budgets.java b/src/main/java/com/xero/models/accounting/Budgets.java index d6bec38ad..02165706b 100644 --- a/src/main/java/com/xero/models/accounting/Budgets.java +++ b/src/main/java/com/xero/models/accounting/Budgets.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Budget; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Budgets + */ -/** Budgets */ public class Budgets { StringUtil util = new StringUtil(); @JsonProperty("Budgets") private List budgets = new ArrayList(); /** - * budgets - * - * @param budgets List<Budget> - * @return Budgets - */ + * budgets + * @param budgets List<Budget> + * @return Budgets + **/ public Budgets budgets(List budgets) { this.budgets = budgets; return this; @@ -37,10 +54,9 @@ public Budgets budgets(List budgets) { /** * budgets - * - * @param budgetsItem Budget + * @param budgetsItem Budget * @return Budgets - */ + **/ public Budgets addBudgetsItem(Budget budgetsItem) { if (this.budgets == null) { this.budgets = new ArrayList(); @@ -49,30 +65,29 @@ public Budgets addBudgetsItem(Budget budgetsItem) { return this; } - /** + /** * Get budgets - * * @return budgets - */ + **/ @ApiModelProperty(value = "") - /** + /** * budgets - * * @return budgets List - */ + **/ public List getBudgets() { return budgets; } - /** - * budgets - * - * @param budgets List<Budget> - */ + /** + * budgets + * @param budgets List<Budget> + **/ + public void setBudgets(List budgets) { this.budgets = budgets; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(budgets); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/CISOrgSetting.java b/src/main/java/com/xero/models/accounting/CISOrgSetting.java index b49f4fdb3..74648386c 100644 --- a/src/main/java/com/xero/models/accounting/CISOrgSetting.java +++ b/src/main/java/com/xero/models/accounting/CISOrgSetting.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CISOrgSetting + */ -/** CISOrgSetting */ public class CISOrgSetting { StringUtil util = new StringUtil(); @@ -29,92 +46,83 @@ public class CISOrgSetting { @JsonProperty("Rate") private Double rate; /** - * true or false - Boolean that describes if the organisation is a CIS Contractor - * - * @param ciSContractorEnabled Boolean - * @return CISOrgSetting - */ + * true or false - Boolean that describes if the organisation is a CIS Contractor + * @param ciSContractorEnabled Boolean + * @return CISOrgSetting + **/ public CISOrgSetting ciSContractorEnabled(Boolean ciSContractorEnabled) { this.ciSContractorEnabled = ciSContractorEnabled; return this; } - /** + /** * true or false - Boolean that describes if the organisation is a CIS Contractor - * * @return ciSContractorEnabled - */ - @ApiModelProperty( - value = "true or false - Boolean that describes if the organisation is a CIS Contractor") - /** + **/ + @ApiModelProperty(value = "true or false - Boolean that describes if the organisation is a CIS Contractor") + /** * true or false - Boolean that describes if the organisation is a CIS Contractor - * * @return ciSContractorEnabled Boolean - */ + **/ public Boolean getCiSContractorEnabled() { return ciSContractorEnabled; } - /** - * true or false - Boolean that describes if the organisation is a CIS Contractor - * - * @param ciSContractorEnabled Boolean - */ + /** + * true or false - Boolean that describes if the organisation is a CIS Contractor + * @param ciSContractorEnabled Boolean + **/ + public void setCiSContractorEnabled(Boolean ciSContractorEnabled) { this.ciSContractorEnabled = ciSContractorEnabled; } /** - * true or false - Boolean that describes if the organisation is a CIS SubContractor - * - * @param ciSSubContractorEnabled Boolean - * @return CISOrgSetting - */ + * true or false - Boolean that describes if the organisation is a CIS SubContractor + * @param ciSSubContractorEnabled Boolean + * @return CISOrgSetting + **/ public CISOrgSetting ciSSubContractorEnabled(Boolean ciSSubContractorEnabled) { this.ciSSubContractorEnabled = ciSSubContractorEnabled; return this; } - /** + /** * true or false - Boolean that describes if the organisation is a CIS SubContractor - * * @return ciSSubContractorEnabled - */ - @ApiModelProperty( - value = "true or false - Boolean that describes if the organisation is a CIS SubContractor") - /** + **/ + @ApiModelProperty(value = "true or false - Boolean that describes if the organisation is a CIS SubContractor") + /** * true or false - Boolean that describes if the organisation is a CIS SubContractor - * * @return ciSSubContractorEnabled Boolean - */ + **/ public Boolean getCiSSubContractorEnabled() { return ciSSubContractorEnabled; } - /** - * true or false - Boolean that describes if the organisation is a CIS SubContractor - * - * @param ciSSubContractorEnabled Boolean - */ + /** + * true or false - Boolean that describes if the organisation is a CIS SubContractor + * @param ciSSubContractorEnabled Boolean + **/ + public void setCiSSubContractorEnabled(Boolean ciSSubContractorEnabled) { this.ciSSubContractorEnabled = ciSSubContractorEnabled; } - /** + /** * CIS Deduction rate for the organisation - * * @return rate - */ + **/ @ApiModelProperty(value = "CIS Deduction rate for the organisation") - /** + /** * CIS Deduction rate for the organisation - * * @return rate Double - */ + **/ public Double getRate() { return rate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -124,9 +132,9 @@ public boolean equals(java.lang.Object o) { return false; } CISOrgSetting ciSOrgSetting = (CISOrgSetting) o; - return Objects.equals(this.ciSContractorEnabled, ciSOrgSetting.ciSContractorEnabled) - && Objects.equals(this.ciSSubContractorEnabled, ciSOrgSetting.ciSSubContractorEnabled) - && Objects.equals(this.rate, ciSOrgSetting.rate); + return Objects.equals(this.ciSContractorEnabled, ciSOrgSetting.ciSContractorEnabled) && + Objects.equals(this.ciSSubContractorEnabled, ciSOrgSetting.ciSSubContractorEnabled) && + Objects.equals(this.rate, ciSOrgSetting.rate); } @Override @@ -134,23 +142,21 @@ public int hashCode() { return Objects.hash(ciSContractorEnabled, ciSSubContractorEnabled, rate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CISOrgSetting {\n"); - sb.append(" ciSContractorEnabled: ") - .append(toIndentedString(ciSContractorEnabled)) - .append("\n"); - sb.append(" ciSSubContractorEnabled: ") - .append(toIndentedString(ciSSubContractorEnabled)) - .append("\n"); + sb.append(" ciSContractorEnabled: ").append(toIndentedString(ciSContractorEnabled)).append("\n"); + sb.append(" ciSSubContractorEnabled: ").append(toIndentedString(ciSSubContractorEnabled)).append("\n"); sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -158,4 +164,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/CISOrgSettings.java b/src/main/java/com/xero/models/accounting/CISOrgSettings.java index 2db390d93..388f694de 100644 --- a/src/main/java/com/xero/models/accounting/CISOrgSettings.java +++ b/src/main/java/com/xero/models/accounting/CISOrgSettings.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.CISOrgSetting; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CISOrgSettings + */ -/** CISOrgSettings */ public class CISOrgSettings { StringUtil util = new StringUtil(); @JsonProperty("CISSettings") private List ciSSettings = new ArrayList(); /** - * ciSSettings - * - * @param ciSSettings List<CISOrgSetting> - * @return CISOrgSettings - */ + * ciSSettings + * @param ciSSettings List<CISOrgSetting> + * @return CISOrgSettings + **/ public CISOrgSettings ciSSettings(List ciSSettings) { this.ciSSettings = ciSSettings; return this; @@ -37,10 +54,9 @@ public CISOrgSettings ciSSettings(List ciSSettings) { /** * ciSSettings - * - * @param ciSSettingsItem CISOrgSetting + * @param ciSSettingsItem CISOrgSetting * @return CISOrgSettings - */ + **/ public CISOrgSettings addCiSSettingsItem(CISOrgSetting ciSSettingsItem) { if (this.ciSSettings == null) { this.ciSSettings = new ArrayList(); @@ -49,30 +65,29 @@ public CISOrgSettings addCiSSettingsItem(CISOrgSetting ciSSettingsItem) { return this; } - /** + /** * Get ciSSettings - * * @return ciSSettings - */ + **/ @ApiModelProperty(value = "") - /** + /** * ciSSettings - * * @return ciSSettings List - */ + **/ public List getCiSSettings() { return ciSSettings; } - /** - * ciSSettings - * - * @param ciSSettings List<CISOrgSetting> - */ + /** + * ciSSettings + * @param ciSSettings List<CISOrgSetting> + **/ + public void setCiSSettings(List ciSSettings) { this.ciSSettings = ciSSettings; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(ciSSettings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/CISSetting.java b/src/main/java/com/xero/models/accounting/CISSetting.java index abb55e4f2..21d1ab51f 100644 --- a/src/main/java/com/xero/models/accounting/CISSetting.java +++ b/src/main/java/com/xero/models/accounting/CISSetting.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CISSetting + */ -/** CISSetting */ public class CISSetting { StringUtil util = new StringUtil(); @@ -26,60 +43,51 @@ public class CISSetting { @JsonProperty("Rate") private Double rate; /** - * Boolean that describes if the contact is a CIS Subcontractor - * - * @param ciSEnabled Boolean - * @return CISSetting - */ + * Boolean that describes if the contact is a CIS Subcontractor + * @param ciSEnabled Boolean + * @return CISSetting + **/ public CISSetting ciSEnabled(Boolean ciSEnabled) { this.ciSEnabled = ciSEnabled; return this; } - /** + /** * Boolean that describes if the contact is a CIS Subcontractor - * * @return ciSEnabled - */ + **/ @ApiModelProperty(value = "Boolean that describes if the contact is a CIS Subcontractor") - /** + /** * Boolean that describes if the contact is a CIS Subcontractor - * * @return ciSEnabled Boolean - */ + **/ public Boolean getCiSEnabled() { return ciSEnabled; } - /** - * Boolean that describes if the contact is a CIS Subcontractor - * - * @param ciSEnabled Boolean - */ + /** + * Boolean that describes if the contact is a CIS Subcontractor + * @param ciSEnabled Boolean + **/ + public void setCiSEnabled(Boolean ciSEnabled) { this.ciSEnabled = ciSEnabled; } - /** - * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, - * then the rate is not returned - * + /** + * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned * @return rate - */ - @ApiModelProperty( - value = - "CIS Deduction rate for the contact if he is a subcontractor. If the contact is not" - + " CISEnabled, then the rate is not returned") - /** - * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, - * then the rate is not returned - * + **/ + @ApiModelProperty(value = "CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned") + /** + * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned * @return rate Double - */ + **/ public Double getRate() { return rate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +97,8 @@ public boolean equals(java.lang.Object o) { return false; } CISSetting ciSSetting = (CISSetting) o; - return Objects.equals(this.ciSEnabled, ciSSetting.ciSEnabled) - && Objects.equals(this.rate, ciSSetting.rate); + return Objects.equals(this.ciSEnabled, ciSSetting.ciSEnabled) && + Objects.equals(this.rate, ciSSetting.rate); } @Override @@ -98,6 +106,7 @@ public int hashCode() { return Objects.hash(ciSEnabled, rate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,7 +118,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -117,4 +127,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/CISSettings.java b/src/main/java/com/xero/models/accounting/CISSettings.java index c003d3b24..21342f0fd 100644 --- a/src/main/java/com/xero/models/accounting/CISSettings.java +++ b/src/main/java/com/xero/models/accounting/CISSettings.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.CISSetting; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CISSettings + */ -/** CISSettings */ public class CISSettings { StringUtil util = new StringUtil(); @JsonProperty("CISSettings") private List ciSSettings = new ArrayList(); /** - * ciSSettings - * - * @param ciSSettings List<CISSetting> - * @return CISSettings - */ + * ciSSettings + * @param ciSSettings List<CISSetting> + * @return CISSettings + **/ public CISSettings ciSSettings(List ciSSettings) { this.ciSSettings = ciSSettings; return this; @@ -37,10 +54,9 @@ public CISSettings ciSSettings(List ciSSettings) { /** * ciSSettings - * - * @param ciSSettingsItem CISSetting + * @param ciSSettingsItem CISSetting * @return CISSettings - */ + **/ public CISSettings addCiSSettingsItem(CISSetting ciSSettingsItem) { if (this.ciSSettings == null) { this.ciSSettings = new ArrayList(); @@ -49,30 +65,29 @@ public CISSettings addCiSSettingsItem(CISSetting ciSSettingsItem) { return this; } - /** + /** * Get ciSSettings - * * @return ciSSettings - */ + **/ @ApiModelProperty(value = "") - /** + /** * ciSSettings - * * @return ciSSettings List - */ + **/ public List getCiSSettings() { return ciSSettings; } - /** - * ciSSettings - * - * @param ciSSettings List<CISSetting> - */ + /** + * ciSSettings + * @param ciSSettings List<CISSetting> + **/ + public void setCiSSettings(List ciSSettings) { this.ciSSettings = ciSSettings; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(ciSSettings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Contact.java b/src/main/java/com/xero/models/accounting/Contact.java index 1f2d10727..ee4d062ad 100644 --- a/src/main/java/com/xero/models/accounting/Contact.java +++ b/src/main/java/com/xero/models/accounting/Contact.java @@ -9,21 +9,46 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Address; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.Balances; +import com.xero.models.accounting.BatchPaymentDetails; +import com.xero.models.accounting.BrandingTheme; +import com.xero.models.accounting.ContactGroup; +import com.xero.models.accounting.ContactPerson; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.PaymentTerm; +import com.xero.models.accounting.Phone; +import com.xero.models.accounting.SalesTrackingCategory; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Contact + */ -/** Contact */ public class Contact { StringUtil util = new StringUtil(); @@ -38,15 +63,23 @@ public class Contact { @JsonProperty("AccountNumber") private String accountNumber; - /** Current status of a contact – see contact status types */ + /** + * Current status of a contact – see contact status types + */ public enum ContactStatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** ARCHIVED */ + + /** + * ARCHIVED + */ ARCHIVED("ARCHIVED"), - - /** GDPRREQUEST */ + + /** + * GDPRREQUEST + */ GDPRREQUEST("GDPRREQUEST"); private String value; @@ -55,31 +88,25 @@ public enum ContactStatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static ContactStatusEnum fromValue(String value) { for (ContactStatusEnum b : ContactStatusEnum.values()) { @@ -91,6 +118,7 @@ public static ContactStatusEnum fromValue(String value) { } } + @JsonProperty("ContactStatus") private ContactStatusEnum contactStatus; @@ -136,17 +164,22 @@ public static ContactStatusEnum fromValue(String value) { @JsonProperty("IsCustomer") private Boolean isCustomer; /** - * The default sales line amount type for a contact. Only available when summaryOnly parameter or - * paging is used, or when fetch by ContactId or ContactNumber. + * The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. */ public enum SalesDefaultLineAmountTypeEnum { - /** INCLUSIVE */ + /** + * INCLUSIVE + */ INCLUSIVE("INCLUSIVE"), - - /** EXCLUSIVE */ + + /** + * EXCLUSIVE + */ EXCLUSIVE("EXCLUSIVE"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"); private String value; @@ -155,31 +188,25 @@ public enum SalesDefaultLineAmountTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static SalesDefaultLineAmountTypeEnum fromValue(String value) { for (SalesDefaultLineAmountTypeEnum b : SalesDefaultLineAmountTypeEnum.values()) { @@ -191,20 +218,26 @@ public static SalesDefaultLineAmountTypeEnum fromValue(String value) { } } + @JsonProperty("SalesDefaultLineAmountType") private SalesDefaultLineAmountTypeEnum salesDefaultLineAmountType; /** - * The default purchases line amount type for a contact Only available when summaryOnly parameter - * or paging is used, or when fetch by ContactId or ContactNumber. + * The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. */ public enum PurchasesDefaultLineAmountTypeEnum { - /** INCLUSIVE */ + /** + * INCLUSIVE + */ INCLUSIVE("INCLUSIVE"), - - /** EXCLUSIVE */ + + /** + * EXCLUSIVE + */ EXCLUSIVE("EXCLUSIVE"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"); private String value; @@ -213,31 +246,25 @@ public enum PurchasesDefaultLineAmountTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PurchasesDefaultLineAmountTypeEnum fromValue(String value) { for (PurchasesDefaultLineAmountTypeEnum b : PurchasesDefaultLineAmountTypeEnum.values()) { @@ -249,6 +276,7 @@ public static PurchasesDefaultLineAmountTypeEnum fromValue(String value) { } } + @JsonProperty("PurchasesDefaultLineAmountType") private PurchasesDefaultLineAmountTypeEnum purchasesDefaultLineAmountType; @@ -265,12 +293,10 @@ public static PurchasesDefaultLineAmountTypeEnum fromValue(String value) { private String purchasesDefaultAccountCode; @JsonProperty("SalesTrackingCategories") - private List salesTrackingCategories = - new ArrayList(); + private List salesTrackingCategories = new ArrayList(); @JsonProperty("PurchasesTrackingCategories") - private List purchasesTrackingCategories = - new ArrayList(); + private List purchasesTrackingCategories = new ArrayList(); @JsonProperty("TrackingCategoryName") private String trackingCategoryName; @@ -317,389 +343,330 @@ public static PurchasesDefaultLineAmountTypeEnum fromValue(String value) { @JsonProperty("StatusAttributeString") private String statusAttributeString; /** - * Xero identifier - * - * @param contactID UUID - * @return Contact - */ + * Xero identifier + * @param contactID UUID + * @return Contact + **/ public Contact contactID(UUID contactID) { this.contactID = contactID; return this; } - /** + /** * Xero identifier - * * @return contactID - */ + **/ @ApiModelProperty(value = "Xero identifier") - /** + /** * Xero identifier - * * @return contactID UUID - */ + **/ public UUID getContactID() { return contactID; } - /** - * Xero identifier - * - * @param contactID UUID - */ + /** + * Xero identifier + * @param contactID UUID + **/ + public void setContactID(UUID contactID) { this.contactID = contactID; } /** - * ID for the destination of a merged contact. Only returned when using paging or when fetching a - * contact by ContactId or ContactNumber. - * - * @param mergedToContactID UUID - * @return Contact - */ + * ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber. + * @param mergedToContactID UUID + * @return Contact + **/ public Contact mergedToContactID(UUID mergedToContactID) { this.mergedToContactID = mergedToContactID; return this; } - /** - * ID for the destination of a merged contact. Only returned when using paging or when fetching a - * contact by ContactId or ContactNumber. - * + /** + * ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber. * @return mergedToContactID - */ - @ApiModelProperty( - value = - "ID for the destination of a merged contact. Only returned when using paging or when" - + " fetching a contact by ContactId or ContactNumber.") - /** - * ID for the destination of a merged contact. Only returned when using paging or when fetching a - * contact by ContactId or ContactNumber. - * + **/ + @ApiModelProperty(value = "ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber.") + /** + * ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber. * @return mergedToContactID UUID - */ + **/ public UUID getMergedToContactID() { return mergedToContactID; } - /** - * ID for the destination of a merged contact. Only returned when using paging or when fetching a - * contact by ContactId or ContactNumber. - * - * @param mergedToContactID UUID - */ + /** + * ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber. + * @param mergedToContactID UUID + **/ + public void setMergedToContactID(UUID mergedToContactID) { this.mergedToContactID = mergedToContactID; } /** - * This can be updated via the API only i.e. This field is read only on the Xero contact screen, - * used to identify contacts in external systems (max length = 50). If the Contact Number is - * used, this is displayed as Contact Code in the Contacts UI in Xero. - * - * @param contactNumber String - * @return Contact - */ + * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. + * @param contactNumber String + * @return Contact + **/ public Contact contactNumber(String contactNumber) { this.contactNumber = contactNumber; return this; } - /** - * This can be updated via the API only i.e. This field is read only on the Xero contact screen, - * used to identify contacts in external systems (max length = 50). If the Contact Number is - * used, this is displayed as Contact Code in the Contacts UI in Xero. - * + /** + * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. * @return contactNumber - */ - @ApiModelProperty( - value = - "This can be updated via the API only i.e. This field is read only on the Xero contact" - + " screen, used to identify contacts in external systems (max length = 50). If the" - + " Contact Number is used, this is displayed as Contact Code in the Contacts UI in" - + " Xero.") - /** - * This can be updated via the API only i.e. This field is read only on the Xero contact screen, - * used to identify contacts in external systems (max length = 50). If the Contact Number is - * used, this is displayed as Contact Code in the Contacts UI in Xero. - * + **/ + @ApiModelProperty(value = "This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero.") + /** + * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. * @return contactNumber String - */ + **/ public String getContactNumber() { return contactNumber; } - /** - * This can be updated via the API only i.e. This field is read only on the Xero contact screen, - * used to identify contacts in external systems (max length = 50). If the Contact Number is - * used, this is displayed as Contact Code in the Contacts UI in Xero. - * - * @param contactNumber String - */ + /** + * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. + * @param contactNumber String + **/ + public void setContactNumber(String contactNumber) { this.contactNumber = contactNumber; } /** - * A user defined account number. This can be updated via the API and the Xero UI (max length - * = 50) - * - * @param accountNumber String - * @return Contact - */ + * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) + * @param accountNumber String + * @return Contact + **/ public Contact accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** - * A user defined account number. This can be updated via the API and the Xero UI (max length - * = 50) - * + /** + * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) * @return accountNumber - */ - @ApiModelProperty( - value = - "A user defined account number. This can be updated via the API and the Xero UI (max" - + " length = 50)") - /** - * A user defined account number. This can be updated via the API and the Xero UI (max length - * = 50) - * + **/ + @ApiModelProperty(value = "A user defined account number. This can be updated via the API and the Xero UI (max length = 50)") + /** + * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * A user defined account number. This can be updated via the API and the Xero UI (max length - * = 50) - * - * @param accountNumber String - */ + /** + * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * Current status of a contact – see contact status types - * - * @param contactStatus ContactStatusEnum - * @return Contact - */ + * Current status of a contact – see contact status types + * @param contactStatus ContactStatusEnum + * @return Contact + **/ public Contact contactStatus(ContactStatusEnum contactStatus) { this.contactStatus = contactStatus; return this; } - /** + /** * Current status of a contact – see contact status types - * * @return contactStatus - */ + **/ @ApiModelProperty(value = "Current status of a contact – see contact status types") - /** + /** * Current status of a contact – see contact status types - * * @return contactStatus ContactStatusEnum - */ + **/ public ContactStatusEnum getContactStatus() { return contactStatus; } - /** - * Current status of a contact – see contact status types - * - * @param contactStatus ContactStatusEnum - */ + /** + * Current status of a contact – see contact status types + * @param contactStatus ContactStatusEnum + **/ + public void setContactStatus(ContactStatusEnum contactStatus) { this.contactStatus = contactStatus; } /** - * Full name of contact/organisation (max length = 255) - * - * @param name String - * @return Contact - */ + * Full name of contact/organisation (max length = 255) + * @param name String + * @return Contact + **/ public Contact name(String name) { this.name = name; return this; } - /** + /** * Full name of contact/organisation (max length = 255) - * * @return name - */ + **/ @ApiModelProperty(value = "Full name of contact/organisation (max length = 255)") - /** + /** * Full name of contact/organisation (max length = 255) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Full name of contact/organisation (max length = 255) - * - * @param name String - */ + /** + * Full name of contact/organisation (max length = 255) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * First name of contact person (max length = 255) - * - * @param firstName String - * @return Contact - */ + * First name of contact person (max length = 255) + * @param firstName String + * @return Contact + **/ public Contact firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of contact person (max length = 255) - * * @return firstName - */ + **/ @ApiModelProperty(value = "First name of contact person (max length = 255)") - /** + /** * First name of contact person (max length = 255) - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of contact person (max length = 255) - * - * @param firstName String - */ + /** + * First name of contact person (max length = 255) + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of contact person (max length = 255) - * - * @param lastName String - * @return Contact - */ + * Last name of contact person (max length = 255) + * @param lastName String + * @return Contact + **/ public Contact lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of contact person (max length = 255) - * * @return lastName - */ + **/ @ApiModelProperty(value = "Last name of contact person (max length = 255)") - /** + /** * Last name of contact person (max length = 255) - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of contact person (max length = 255) - * - * @param lastName String - */ + /** + * Last name of contact person (max length = 255) + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Company registration number (max length = 50) - * - * @param companyNumber String - * @return Contact - */ + * Company registration number (max length = 50) + * @param companyNumber String + * @return Contact + **/ public Contact companyNumber(String companyNumber) { this.companyNumber = companyNumber; return this; } - /** + /** * Company registration number (max length = 50) - * * @return companyNumber - */ + **/ @ApiModelProperty(value = "Company registration number (max length = 50)") - /** + /** * Company registration number (max length = 50) - * * @return companyNumber String - */ + **/ public String getCompanyNumber() { return companyNumber; } - /** - * Company registration number (max length = 50) - * - * @param companyNumber String - */ + /** + * Company registration number (max length = 50) + * @param companyNumber String + **/ + public void setCompanyNumber(String companyNumber) { this.companyNumber = companyNumber; } /** - * Email address of contact person (umlauts not supported) (max length = 255) - * - * @param emailAddress String - * @return Contact - */ + * Email address of contact person (umlauts not supported) (max length = 255) + * @param emailAddress String + * @return Contact + **/ public Contact emailAddress(String emailAddress) { this.emailAddress = emailAddress; return this; } - /** - * Email address of contact person (umlauts not supported) (max length = 255) - * + /** + * Email address of contact person (umlauts not supported) (max length = 255) * @return emailAddress - */ - @ApiModelProperty( - value = "Email address of contact person (umlauts not supported) (max length = 255)") - /** - * Email address of contact person (umlauts not supported) (max length = 255) - * + **/ + @ApiModelProperty(value = "Email address of contact person (umlauts not supported) (max length = 255)") + /** + * Email address of contact person (umlauts not supported) (max length = 255) * @return emailAddress String - */ + **/ public String getEmailAddress() { return emailAddress; } - /** - * Email address of contact person (umlauts not supported) (max length = 255) - * - * @param emailAddress String - */ + /** + * Email address of contact person (umlauts not supported) (max length = 255) + * @param emailAddress String + **/ + public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } /** - * See contact persons - * - * @param contactPersons List<ContactPerson> - * @return Contact - */ + * See contact persons + * @param contactPersons List<ContactPerson> + * @return Contact + **/ public Contact contactPersons(List contactPersons) { this.contactPersons = contactPersons; return this; @@ -707,10 +674,9 @@ public Contact contactPersons(List contactPersons) { /** * See contact persons - * - * @param contactPersonsItem ContactPerson + * @param contactPersonsItem ContactPerson * @return Contact - */ + **/ public Contact addContactPersonsItem(ContactPerson contactPersonsItem) { if (this.contactPersons == null) { this.contactPersons = new ArrayList(); @@ -719,188 +685,161 @@ public Contact addContactPersonsItem(ContactPerson contactPersonsItem) { return this; } - /** + /** * See contact persons - * * @return contactPersons - */ + **/ @ApiModelProperty(value = "See contact persons") - /** + /** * See contact persons - * * @return contactPersons List - */ + **/ public List getContactPersons() { return contactPersons; } - /** - * See contact persons - * - * @param contactPersons List<ContactPerson> - */ + /** + * See contact persons + * @param contactPersons List<ContactPerson> + **/ + public void setContactPersons(List contactPersons) { this.contactPersons = contactPersons; } /** - * Bank account number of contact - * - * @param bankAccountDetails String - * @return Contact - */ + * Bank account number of contact + * @param bankAccountDetails String + * @return Contact + **/ public Contact bankAccountDetails(String bankAccountDetails) { this.bankAccountDetails = bankAccountDetails; return this; } - /** + /** * Bank account number of contact - * * @return bankAccountDetails - */ + **/ @ApiModelProperty(value = "Bank account number of contact") - /** + /** * Bank account number of contact - * * @return bankAccountDetails String - */ + **/ public String getBankAccountDetails() { return bankAccountDetails; } - /** - * Bank account number of contact - * - * @param bankAccountDetails String - */ + /** + * Bank account number of contact + * @param bankAccountDetails String + **/ + public void setBankAccountDetails(String bankAccountDetails) { this.bankAccountDetails = bankAccountDetails; } /** - * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), - * VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized - * version of Xero you are using (max length = 50) - * - * @param taxNumber String - * @return Contact - */ + * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) + * @param taxNumber String + * @return Contact + **/ public Contact taxNumber(String taxNumber) { this.taxNumber = taxNumber; return this; } - /** - * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), - * VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized - * version of Xero you are using (max length = 50) - * + /** + * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) * @return taxNumber - */ - @ApiModelProperty( - value = - "Tax number of contact – this is also known as the ABN (Australia), GST Number (New" - + " Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI" - + " depending on which regionalized version of Xero you are using (max length = 50)") - /** - * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), - * VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized - * version of Xero you are using (max length = 50) - * + **/ + @ApiModelProperty(value = "Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50)") + /** + * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) * @return taxNumber String - */ + **/ public String getTaxNumber() { return taxNumber; } - /** - * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), - * VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized - * version of Xero you are using (max length = 50) - * - * @param taxNumber String - */ + /** + * Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) + * @param taxNumber String + **/ + public void setTaxNumber(String taxNumber) { this.taxNumber = taxNumber; } /** - * The tax type from TaxRates - * - * @param accountsReceivableTaxType String - * @return Contact - */ + * The tax type from TaxRates + * @param accountsReceivableTaxType String + * @return Contact + **/ public Contact accountsReceivableTaxType(String accountsReceivableTaxType) { this.accountsReceivableTaxType = accountsReceivableTaxType; return this; } - /** + /** * The tax type from TaxRates - * * @return accountsReceivableTaxType - */ + **/ @ApiModelProperty(value = "The tax type from TaxRates") - /** + /** * The tax type from TaxRates - * * @return accountsReceivableTaxType String - */ + **/ public String getAccountsReceivableTaxType() { return accountsReceivableTaxType; } - /** - * The tax type from TaxRates - * - * @param accountsReceivableTaxType String - */ + /** + * The tax type from TaxRates + * @param accountsReceivableTaxType String + **/ + public void setAccountsReceivableTaxType(String accountsReceivableTaxType) { this.accountsReceivableTaxType = accountsReceivableTaxType; } /** - * The tax type from TaxRates - * - * @param accountsPayableTaxType String - * @return Contact - */ + * The tax type from TaxRates + * @param accountsPayableTaxType String + * @return Contact + **/ public Contact accountsPayableTaxType(String accountsPayableTaxType) { this.accountsPayableTaxType = accountsPayableTaxType; return this; } - /** + /** * The tax type from TaxRates - * * @return accountsPayableTaxType - */ + **/ @ApiModelProperty(value = "The tax type from TaxRates") - /** + /** * The tax type from TaxRates - * * @return accountsPayableTaxType String - */ + **/ public String getAccountsPayableTaxType() { return accountsPayableTaxType; } - /** - * The tax type from TaxRates - * - * @param accountsPayableTaxType String - */ + /** + * The tax type from TaxRates + * @param accountsPayableTaxType String + **/ + public void setAccountsPayableTaxType(String accountsPayableTaxType) { this.accountsPayableTaxType = accountsPayableTaxType; } /** - * Store certain address types for a contact – see address types - * - * @param addresses List<Address> - * @return Contact - */ + * Store certain address types for a contact – see address types + * @param addresses List<Address> + * @return Contact + **/ public Contact addresses(List

addresses) { this.addresses = addresses; return this; @@ -908,10 +847,9 @@ public Contact addresses(List
addresses) { /** * Store certain address types for a contact – see address types - * - * @param addressesItem Address + * @param addressesItem Address * @return Contact - */ + **/ public Contact addAddressesItem(Address addressesItem) { if (this.addresses == null) { this.addresses = new ArrayList
(); @@ -920,36 +858,33 @@ public Contact addAddressesItem(Address addressesItem) { return this; } - /** + /** * Store certain address types for a contact – see address types - * * @return addresses - */ + **/ @ApiModelProperty(value = "Store certain address types for a contact – see address types") - /** + /** * Store certain address types for a contact – see address types - * * @return addresses List
- */ + **/ public List
getAddresses() { return addresses; } - /** - * Store certain address types for a contact – see address types - * - * @param addresses List<Address> - */ + /** + * Store certain address types for a contact – see address types + * @param addresses List<Address> + **/ + public void setAddresses(List
addresses) { this.addresses = addresses; } /** - * Store certain phone types for a contact – see phone types - * - * @param phones List<Phone> - * @return Contact - */ + * Store certain phone types for a contact – see phone types + * @param phones List<Phone> + * @return Contact + **/ public Contact phones(List phones) { this.phones = phones; return this; @@ -957,10 +892,9 @@ public Contact phones(List phones) { /** * Store certain phone types for a contact – see phone types - * - * @param phonesItem Phone + * @param phonesItem Phone * @return Contact - */ + **/ public Contact addPhonesItem(Phone phonesItem) { if (this.phones == null) { this.phones = new ArrayList(); @@ -969,358 +903,289 @@ public Contact addPhonesItem(Phone phonesItem) { return this; } - /** + /** * Store certain phone types for a contact – see phone types - * * @return phones - */ + **/ @ApiModelProperty(value = "Store certain phone types for a contact – see phone types") - /** + /** * Store certain phone types for a contact – see phone types - * * @return phones List - */ + **/ public List getPhones() { return phones; } - /** - * Store certain phone types for a contact – see phone types - * - * @param phones List<Phone> - */ + /** + * Store certain phone types for a contact – see phone types + * @param phones List<Phone> + **/ + public void setPhones(List phones) { this.phones = phones; } /** - * true or false – Boolean that describes if a contact that has any AP invoices entered against - * them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice - * is generated against this contact. - * - * @param isSupplier Boolean - * @return Contact - */ + * true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. + * @param isSupplier Boolean + * @return Contact + **/ public Contact isSupplier(Boolean isSupplier) { this.isSupplier = isSupplier; return this; } - /** - * true or false – Boolean that describes if a contact that has any AP invoices entered against - * them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice - * is generated against this contact. - * + /** + * true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. * @return isSupplier - */ - @ApiModelProperty( - value = - "true or false – Boolean that describes if a contact that has any AP invoices entered" - + " against them. Cannot be set via PUT or POST – it is automatically set when an" - + " accounts payable invoice is generated against this contact.") - /** - * true or false – Boolean that describes if a contact that has any AP invoices entered against - * them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice - * is generated against this contact. - * + **/ + @ApiModelProperty(value = "true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact.") + /** + * true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. * @return isSupplier Boolean - */ + **/ public Boolean getIsSupplier() { return isSupplier; } - /** - * true or false – Boolean that describes if a contact that has any AP invoices entered against - * them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice - * is generated against this contact. - * - * @param isSupplier Boolean - */ + /** + * true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. + * @param isSupplier Boolean + **/ + public void setIsSupplier(Boolean isSupplier) { this.isSupplier = isSupplier; } /** - * true or false – Boolean that describes if a contact has any AR invoices entered against them. - * Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is - * generated against this contact. - * - * @param isCustomer Boolean - * @return Contact - */ + * true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. + * @param isCustomer Boolean + * @return Contact + **/ public Contact isCustomer(Boolean isCustomer) { this.isCustomer = isCustomer; return this; } - /** - * true or false – Boolean that describes if a contact has any AR invoices entered against them. - * Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is - * generated against this contact. - * + /** + * true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. * @return isCustomer - */ - @ApiModelProperty( - value = - "true or false – Boolean that describes if a contact has any AR invoices entered against" - + " them. Cannot be set via PUT or POST – it is automatically set when an accounts" - + " receivable invoice is generated against this contact.") - /** - * true or false – Boolean that describes if a contact has any AR invoices entered against them. - * Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is - * generated against this contact. - * + **/ + @ApiModelProperty(value = "true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact.") + /** + * true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. * @return isCustomer Boolean - */ + **/ public Boolean getIsCustomer() { return isCustomer; } - /** - * true or false – Boolean that describes if a contact has any AR invoices entered against them. - * Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is - * generated against this contact. - * - * @param isCustomer Boolean - */ + /** + * true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. + * @param isCustomer Boolean + **/ + public void setIsCustomer(Boolean isCustomer) { this.isCustomer = isCustomer; } /** - * The default sales line amount type for a contact. Only available when summaryOnly parameter or - * paging is used, or when fetch by ContactId or ContactNumber. - * - * @param salesDefaultLineAmountType SalesDefaultLineAmountTypeEnum - * @return Contact - */ - public Contact salesDefaultLineAmountType( - SalesDefaultLineAmountTypeEnum salesDefaultLineAmountType) { + * The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. + * @param salesDefaultLineAmountType SalesDefaultLineAmountTypeEnum + * @return Contact + **/ + public Contact salesDefaultLineAmountType(SalesDefaultLineAmountTypeEnum salesDefaultLineAmountType) { this.salesDefaultLineAmountType = salesDefaultLineAmountType; return this; } - /** - * The default sales line amount type for a contact. Only available when summaryOnly parameter or - * paging is used, or when fetch by ContactId or ContactNumber. - * + /** + * The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. * @return salesDefaultLineAmountType - */ - @ApiModelProperty( - value = - "The default sales line amount type for a contact. Only available when summaryOnly" - + " parameter or paging is used, or when fetch by ContactId or ContactNumber.") - /** - * The default sales line amount type for a contact. Only available when summaryOnly parameter or - * paging is used, or when fetch by ContactId or ContactNumber. - * + **/ + @ApiModelProperty(value = "The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber.") + /** + * The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. * @return salesDefaultLineAmountType SalesDefaultLineAmountTypeEnum - */ + **/ public SalesDefaultLineAmountTypeEnum getSalesDefaultLineAmountType() { return salesDefaultLineAmountType; } - /** - * The default sales line amount type for a contact. Only available when summaryOnly parameter or - * paging is used, or when fetch by ContactId or ContactNumber. - * - * @param salesDefaultLineAmountType SalesDefaultLineAmountTypeEnum - */ - public void setSalesDefaultLineAmountType( - SalesDefaultLineAmountTypeEnum salesDefaultLineAmountType) { + /** + * The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. + * @param salesDefaultLineAmountType SalesDefaultLineAmountTypeEnum + **/ + + public void setSalesDefaultLineAmountType(SalesDefaultLineAmountTypeEnum salesDefaultLineAmountType) { this.salesDefaultLineAmountType = salesDefaultLineAmountType; } /** - * The default purchases line amount type for a contact Only available when summaryOnly parameter - * or paging is used, or when fetch by ContactId or ContactNumber. - * - * @param purchasesDefaultLineAmountType PurchasesDefaultLineAmountTypeEnum - * @return Contact - */ - public Contact purchasesDefaultLineAmountType( - PurchasesDefaultLineAmountTypeEnum purchasesDefaultLineAmountType) { + * The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. + * @param purchasesDefaultLineAmountType PurchasesDefaultLineAmountTypeEnum + * @return Contact + **/ + public Contact purchasesDefaultLineAmountType(PurchasesDefaultLineAmountTypeEnum purchasesDefaultLineAmountType) { this.purchasesDefaultLineAmountType = purchasesDefaultLineAmountType; return this; } - /** - * The default purchases line amount type for a contact Only available when summaryOnly parameter - * or paging is used, or when fetch by ContactId or ContactNumber. - * + /** + * The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. * @return purchasesDefaultLineAmountType - */ - @ApiModelProperty( - value = - "The default purchases line amount type for a contact Only available when summaryOnly" - + " parameter or paging is used, or when fetch by ContactId or ContactNumber.") - /** - * The default purchases line amount type for a contact Only available when summaryOnly parameter - * or paging is used, or when fetch by ContactId or ContactNumber. - * + **/ + @ApiModelProperty(value = "The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber.") + /** + * The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. * @return purchasesDefaultLineAmountType PurchasesDefaultLineAmountTypeEnum - */ + **/ public PurchasesDefaultLineAmountTypeEnum getPurchasesDefaultLineAmountType() { return purchasesDefaultLineAmountType; } - /** - * The default purchases line amount type for a contact Only available when summaryOnly parameter - * or paging is used, or when fetch by ContactId or ContactNumber. - * - * @param purchasesDefaultLineAmountType PurchasesDefaultLineAmountTypeEnum - */ - public void setPurchasesDefaultLineAmountType( - PurchasesDefaultLineAmountTypeEnum purchasesDefaultLineAmountType) { + /** + * The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. + * @param purchasesDefaultLineAmountType PurchasesDefaultLineAmountTypeEnum + **/ + + public void setPurchasesDefaultLineAmountType(PurchasesDefaultLineAmountTypeEnum purchasesDefaultLineAmountType) { this.purchasesDefaultLineAmountType = purchasesDefaultLineAmountType; } /** - * defaultCurrency - * - * @param defaultCurrency CurrencyCode - * @return Contact - */ + * defaultCurrency + * @param defaultCurrency CurrencyCode + * @return Contact + **/ public Contact defaultCurrency(CurrencyCode defaultCurrency) { this.defaultCurrency = defaultCurrency; return this; } - /** + /** * Get defaultCurrency - * * @return defaultCurrency - */ + **/ @ApiModelProperty(value = "") - /** + /** * defaultCurrency - * * @return defaultCurrency CurrencyCode - */ + **/ public CurrencyCode getDefaultCurrency() { return defaultCurrency; } - /** - * defaultCurrency - * - * @param defaultCurrency CurrencyCode - */ + /** + * defaultCurrency + * @param defaultCurrency CurrencyCode + **/ + public void setDefaultCurrency(CurrencyCode defaultCurrency) { this.defaultCurrency = defaultCurrency; } /** - * Store XeroNetworkKey for contacts. - * - * @param xeroNetworkKey String - * @return Contact - */ + * Store XeroNetworkKey for contacts. + * @param xeroNetworkKey String + * @return Contact + **/ public Contact xeroNetworkKey(String xeroNetworkKey) { this.xeroNetworkKey = xeroNetworkKey; return this; } - /** + /** * Store XeroNetworkKey for contacts. - * * @return xeroNetworkKey - */ + **/ @ApiModelProperty(value = "Store XeroNetworkKey for contacts.") - /** + /** * Store XeroNetworkKey for contacts. - * * @return xeroNetworkKey String - */ + **/ public String getXeroNetworkKey() { return xeroNetworkKey; } - /** - * Store XeroNetworkKey for contacts. - * - * @param xeroNetworkKey String - */ + /** + * Store XeroNetworkKey for contacts. + * @param xeroNetworkKey String + **/ + public void setXeroNetworkKey(String xeroNetworkKey) { this.xeroNetworkKey = xeroNetworkKey; } /** - * The default sales account code for contacts - * - * @param salesDefaultAccountCode String - * @return Contact - */ + * The default sales account code for contacts + * @param salesDefaultAccountCode String + * @return Contact + **/ public Contact salesDefaultAccountCode(String salesDefaultAccountCode) { this.salesDefaultAccountCode = salesDefaultAccountCode; return this; } - /** + /** * The default sales account code for contacts - * * @return salesDefaultAccountCode - */ + **/ @ApiModelProperty(value = "The default sales account code for contacts") - /** + /** * The default sales account code for contacts - * * @return salesDefaultAccountCode String - */ + **/ public String getSalesDefaultAccountCode() { return salesDefaultAccountCode; } - /** - * The default sales account code for contacts - * - * @param salesDefaultAccountCode String - */ + /** + * The default sales account code for contacts + * @param salesDefaultAccountCode String + **/ + public void setSalesDefaultAccountCode(String salesDefaultAccountCode) { this.salesDefaultAccountCode = salesDefaultAccountCode; } /** - * The default purchases account code for contacts - * - * @param purchasesDefaultAccountCode String - * @return Contact - */ + * The default purchases account code for contacts + * @param purchasesDefaultAccountCode String + * @return Contact + **/ public Contact purchasesDefaultAccountCode(String purchasesDefaultAccountCode) { this.purchasesDefaultAccountCode = purchasesDefaultAccountCode; return this; } - /** + /** * The default purchases account code for contacts - * * @return purchasesDefaultAccountCode - */ + **/ @ApiModelProperty(value = "The default purchases account code for contacts") - /** + /** * The default purchases account code for contacts - * * @return purchasesDefaultAccountCode String - */ + **/ public String getPurchasesDefaultAccountCode() { return purchasesDefaultAccountCode; } - /** - * The default purchases account code for contacts - * - * @param purchasesDefaultAccountCode String - */ + /** + * The default purchases account code for contacts + * @param purchasesDefaultAccountCode String + **/ + public void setPurchasesDefaultAccountCode(String purchasesDefaultAccountCode) { this.purchasesDefaultAccountCode = purchasesDefaultAccountCode; } /** - * The default sales tracking categories for contacts - * - * @param salesTrackingCategories List<SalesTrackingCategory> - * @return Contact - */ + * The default sales tracking categories for contacts + * @param salesTrackingCategories List<SalesTrackingCategory> + * @return Contact + **/ public Contact salesTrackingCategories(List salesTrackingCategories) { this.salesTrackingCategories = salesTrackingCategories; return this; @@ -1328,10 +1193,9 @@ public Contact salesTrackingCategories(List salesTracking /** * The default sales tracking categories for contacts - * - * @param salesTrackingCategoriesItem SalesTrackingCategory + * @param salesTrackingCategoriesItem SalesTrackingCategory * @return Contact - */ + **/ public Contact addSalesTrackingCategoriesItem(SalesTrackingCategory salesTrackingCategoriesItem) { if (this.salesTrackingCategories == null) { this.salesTrackingCategories = new ArrayList(); @@ -1340,50 +1204,44 @@ public Contact addSalesTrackingCategoriesItem(SalesTrackingCategory salesTrackin return this; } - /** + /** * The default sales tracking categories for contacts - * * @return salesTrackingCategories - */ + **/ @ApiModelProperty(value = "The default sales tracking categories for contacts") - /** + /** * The default sales tracking categories for contacts - * * @return salesTrackingCategories List - */ + **/ public List getSalesTrackingCategories() { return salesTrackingCategories; } - /** - * The default sales tracking categories for contacts - * - * @param salesTrackingCategories List<SalesTrackingCategory> - */ + /** + * The default sales tracking categories for contacts + * @param salesTrackingCategories List<SalesTrackingCategory> + **/ + public void setSalesTrackingCategories(List salesTrackingCategories) { this.salesTrackingCategories = salesTrackingCategories; } /** - * The default purchases tracking categories for contacts - * - * @param purchasesTrackingCategories List<SalesTrackingCategory> - * @return Contact - */ - public Contact purchasesTrackingCategories( - List purchasesTrackingCategories) { + * The default purchases tracking categories for contacts + * @param purchasesTrackingCategories List<SalesTrackingCategory> + * @return Contact + **/ + public Contact purchasesTrackingCategories(List purchasesTrackingCategories) { this.purchasesTrackingCategories = purchasesTrackingCategories; return this; } /** * The default purchases tracking categories for contacts - * - * @param purchasesTrackingCategoriesItem SalesTrackingCategory + * @param purchasesTrackingCategoriesItem SalesTrackingCategory * @return Contact - */ - public Contact addPurchasesTrackingCategoriesItem( - SalesTrackingCategory purchasesTrackingCategoriesItem) { + **/ + public Contact addPurchasesTrackingCategoriesItem(SalesTrackingCategory purchasesTrackingCategoriesItem) { if (this.purchasesTrackingCategories == null) { this.purchasesTrackingCategories = new ArrayList(); } @@ -1391,188 +1249,156 @@ public Contact addPurchasesTrackingCategoriesItem( return this; } - /** + /** * The default purchases tracking categories for contacts - * * @return purchasesTrackingCategories - */ + **/ @ApiModelProperty(value = "The default purchases tracking categories for contacts") - /** + /** * The default purchases tracking categories for contacts - * * @return purchasesTrackingCategories List - */ + **/ public List getPurchasesTrackingCategories() { return purchasesTrackingCategories; } - /** - * The default purchases tracking categories for contacts - * - * @param purchasesTrackingCategories List<SalesTrackingCategory> - */ - public void setPurchasesTrackingCategories( - List purchasesTrackingCategories) { + /** + * The default purchases tracking categories for contacts + * @param purchasesTrackingCategories List<SalesTrackingCategory> + **/ + + public void setPurchasesTrackingCategories(List purchasesTrackingCategories) { this.purchasesTrackingCategories = purchasesTrackingCategories; } /** - * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * - * @param trackingCategoryName String - * @return Contact - */ + * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories + * @param trackingCategoryName String + * @return Contact + **/ public Contact trackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; return this; } - /** - * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * + /** + * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories * @return trackingCategoryName - */ - @ApiModelProperty( - value = - "The name of the Tracking Category assigned to the contact under SalesTrackingCategories" - + " and PurchasesTrackingCategories") - /** - * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * + **/ + @ApiModelProperty(value = "The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories") + /** + * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories * @return trackingCategoryName String - */ + **/ public String getTrackingCategoryName() { return trackingCategoryName; } - /** - * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * - * @param trackingCategoryName String - */ + /** + * The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories + * @param trackingCategoryName String + **/ + public void setTrackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; } /** - * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * - * @param trackingCategoryOption String - * @return Contact - */ + * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories + * @param trackingCategoryOption String + * @return Contact + **/ public Contact trackingCategoryOption(String trackingCategoryOption) { this.trackingCategoryOption = trackingCategoryOption; return this; } - /** - * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * + /** + * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories * @return trackingCategoryOption - */ - @ApiModelProperty( - value = - "The name of the Tracking Option assigned to the contact under SalesTrackingCategories" - + " and PurchasesTrackingCategories") - /** - * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * + **/ + @ApiModelProperty(value = "The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories") + /** + * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories * @return trackingCategoryOption String - */ + **/ public String getTrackingCategoryOption() { return trackingCategoryOption; } - /** - * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and - * PurchasesTrackingCategories - * - * @param trackingCategoryOption String - */ + /** + * The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories + * @param trackingCategoryOption String + **/ + public void setTrackingCategoryOption(String trackingCategoryOption) { this.trackingCategoryOption = trackingCategoryOption; } /** - * paymentTerms - * - * @param paymentTerms PaymentTerm - * @return Contact - */ + * paymentTerms + * @param paymentTerms PaymentTerm + * @return Contact + **/ public Contact paymentTerms(PaymentTerm paymentTerms) { this.paymentTerms = paymentTerms; return this; } - /** + /** * Get paymentTerms - * * @return paymentTerms - */ + **/ @ApiModelProperty(value = "") - /** + /** * paymentTerms - * * @return paymentTerms PaymentTerm - */ + **/ public PaymentTerm getPaymentTerms() { return paymentTerms; } - /** - * paymentTerms - * - * @param paymentTerms PaymentTerm - */ + /** + * paymentTerms + * @param paymentTerms PaymentTerm + **/ + public void setPaymentTerms(PaymentTerm paymentTerms) { this.paymentTerms = paymentTerms; } - /** + /** * UTC timestamp of last update to contact - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of last update to contact") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of last update to contact") + /** * UTC timestamp of last update to contact - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * UTC timestamp of last update to contact - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Displays which contact groups a contact is included in - * - * @param contactGroups List<ContactGroup> - * @return Contact - */ + * Displays which contact groups a contact is included in + * @param contactGroups List<ContactGroup> + * @return Contact + **/ public Contact contactGroups(List contactGroups) { this.contactGroups = contactGroups; return this; @@ -1580,10 +1406,9 @@ public Contact contactGroups(List contactGroups) { /** * Displays which contact groups a contact is included in - * - * @param contactGroupsItem ContactGroup + * @param contactGroupsItem ContactGroup * @return Contact - */ + **/ public Contact addContactGroupsItem(ContactGroup contactGroupsItem) { if (this.contactGroups == null) { this.contactGroups = new ArrayList(); @@ -1592,171 +1417,155 @@ public Contact addContactGroupsItem(ContactGroup contactGroupsItem) { return this; } - /** + /** * Displays which contact groups a contact is included in - * * @return contactGroups - */ + **/ @ApiModelProperty(value = "Displays which contact groups a contact is included in") - /** + /** * Displays which contact groups a contact is included in - * * @return contactGroups List - */ + **/ public List getContactGroups() { return contactGroups; } - /** - * Displays which contact groups a contact is included in - * - * @param contactGroups List<ContactGroup> - */ + /** + * Displays which contact groups a contact is included in + * @param contactGroups List<ContactGroup> + **/ + public void setContactGroups(List contactGroups) { this.contactGroups = contactGroups; } - /** + /** * Website address for contact (read only) - * * @return website - */ + **/ @ApiModelProperty(value = "Website address for contact (read only)") - /** + /** * Website address for contact (read only) - * * @return website String - */ + **/ public String getWebsite() { return website; } /** - * brandingTheme - * - * @param brandingTheme BrandingTheme - * @return Contact - */ + * brandingTheme + * @param brandingTheme BrandingTheme + * @return Contact + **/ public Contact brandingTheme(BrandingTheme brandingTheme) { this.brandingTheme = brandingTheme; return this; } - /** + /** * Get brandingTheme - * * @return brandingTheme - */ + **/ @ApiModelProperty(value = "") - /** + /** * brandingTheme - * * @return brandingTheme BrandingTheme - */ + **/ public BrandingTheme getBrandingTheme() { return brandingTheme; } - /** - * brandingTheme - * - * @param brandingTheme BrandingTheme - */ + /** + * brandingTheme + * @param brandingTheme BrandingTheme + **/ + public void setBrandingTheme(BrandingTheme brandingTheme) { this.brandingTheme = brandingTheme; } /** - * batchPayments - * - * @param batchPayments BatchPaymentDetails - * @return Contact - */ + * batchPayments + * @param batchPayments BatchPaymentDetails + * @return Contact + **/ public Contact batchPayments(BatchPaymentDetails batchPayments) { this.batchPayments = batchPayments; return this; } - /** + /** * Get batchPayments - * * @return batchPayments - */ + **/ @ApiModelProperty(value = "") - /** + /** * batchPayments - * * @return batchPayments BatchPaymentDetails - */ + **/ public BatchPaymentDetails getBatchPayments() { return batchPayments; } - /** - * batchPayments - * - * @param batchPayments BatchPaymentDetails - */ + /** + * batchPayments + * @param batchPayments BatchPaymentDetails + **/ + public void setBatchPayments(BatchPaymentDetails batchPayments) { this.batchPayments = batchPayments; } - /** + /** * The default discount rate for the contact (read only) - * * @return discount - */ + **/ @ApiModelProperty(value = "The default discount rate for the contact (read only)") - /** + /** * The default discount rate for the contact (read only) - * * @return discount Double - */ + **/ public Double getDiscount() { return discount; } /** - * balances - * - * @param balances Balances - * @return Contact - */ + * balances + * @param balances Balances + * @return Contact + **/ public Contact balances(Balances balances) { this.balances = balances; return this; } - /** + /** * Get balances - * * @return balances - */ + **/ @ApiModelProperty(value = "") - /** + /** * balances - * * @return balances Balances - */ + **/ public Balances getBalances() { return balances; } - /** - * balances - * - * @param balances Balances - */ + /** + * balances + * @param balances Balances + **/ + public void setBalances(Balances balances) { this.balances = balances; } /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - * @return Contact - */ + * Displays array of attachments from the API + * @param attachments List<Attachment> + * @return Contact + **/ public Contact attachments(List attachments) { this.attachments = attachments; return this; @@ -1764,10 +1573,9 @@ public Contact attachments(List attachments) { /** * Displays array of attachments from the API - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return Contact - */ + **/ public Contact addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -1776,73 +1584,65 @@ public Contact addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * Displays array of attachments from the API - * * @return attachments - */ + **/ @ApiModelProperty(value = "Displays array of attachments from the API") - /** + /** * Displays array of attachments from the API - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - */ + /** + * Displays array of attachments from the API + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } /** - * A boolean to indicate if a contact has an attachment - * - * @param hasAttachments Boolean - * @return Contact - */ + * A boolean to indicate if a contact has an attachment + * @param hasAttachments Boolean + * @return Contact + **/ public Contact hasAttachments(Boolean hasAttachments) { this.hasAttachments = hasAttachments; return this; } - /** + /** * A boolean to indicate if a contact has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "A boolean to indicate if a contact has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "A boolean to indicate if a contact has an attachment") + /** * A boolean to indicate if a contact has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** - * A boolean to indicate if a contact has an attachment - * - * @param hasAttachments Boolean - */ + /** + * A boolean to indicate if a contact has an attachment + * @param hasAttachments Boolean + **/ + public void setHasAttachments(Boolean hasAttachments) { this.hasAttachments = hasAttachments; } /** - * Displays validation errors returned from the API - * - * @param validationErrors List<ValidationError> - * @return Contact - */ + * Displays validation errors returned from the API + * @param validationErrors List<ValidationError> + * @return Contact + **/ public Contact validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -1850,10 +1650,9 @@ public Contact validationErrors(List validationErrors) { /** * Displays validation errors returned from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Contact - */ + **/ public Contact addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -1862,102 +1661,93 @@ public Contact addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays validation errors returned from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays validation errors returned from the API") - /** + /** * Displays validation errors returned from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays validation errors returned from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays validation errors returned from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * A boolean to indicate if a contact has an validation errors - * - * @param hasValidationErrors Boolean - * @return Contact - */ + * A boolean to indicate if a contact has an validation errors + * @param hasValidationErrors Boolean + * @return Contact + **/ public Contact hasValidationErrors(Boolean hasValidationErrors) { this.hasValidationErrors = hasValidationErrors; return this; } - /** + /** * A boolean to indicate if a contact has an validation errors - * * @return hasValidationErrors - */ - @ApiModelProperty( - example = "false", - value = "A boolean to indicate if a contact has an validation errors") - /** + **/ + @ApiModelProperty(example = "false", value = "A boolean to indicate if a contact has an validation errors") + /** * A boolean to indicate if a contact has an validation errors - * * @return hasValidationErrors Boolean - */ + **/ public Boolean getHasValidationErrors() { return hasValidationErrors; } - /** - * A boolean to indicate if a contact has an validation errors - * - * @param hasValidationErrors Boolean - */ + /** + * A boolean to indicate if a contact has an validation errors + * @param hasValidationErrors Boolean + **/ + public void setHasValidationErrors(Boolean hasValidationErrors) { this.hasValidationErrors = hasValidationErrors; } /** - * Status of object - * - * @param statusAttributeString String - * @return Contact - */ + * Status of object + * @param statusAttributeString String + * @return Contact + **/ public Contact statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * Status of object - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "Status of object") - /** + /** * Status of object - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * Status of object - * - * @param statusAttributeString String - */ + /** + * Status of object + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1967,98 +1757,56 @@ public boolean equals(java.lang.Object o) { return false; } Contact contact = (Contact) o; - return Objects.equals(this.contactID, contact.contactID) - && Objects.equals(this.mergedToContactID, contact.mergedToContactID) - && Objects.equals(this.contactNumber, contact.contactNumber) - && Objects.equals(this.accountNumber, contact.accountNumber) - && Objects.equals(this.contactStatus, contact.contactStatus) - && Objects.equals(this.name, contact.name) - && Objects.equals(this.firstName, contact.firstName) - && Objects.equals(this.lastName, contact.lastName) - && Objects.equals(this.companyNumber, contact.companyNumber) - && Objects.equals(this.emailAddress, contact.emailAddress) - && Objects.equals(this.contactPersons, contact.contactPersons) - && Objects.equals(this.bankAccountDetails, contact.bankAccountDetails) - && Objects.equals(this.taxNumber, contact.taxNumber) - && Objects.equals(this.accountsReceivableTaxType, contact.accountsReceivableTaxType) - && Objects.equals(this.accountsPayableTaxType, contact.accountsPayableTaxType) - && Objects.equals(this.addresses, contact.addresses) - && Objects.equals(this.phones, contact.phones) - && Objects.equals(this.isSupplier, contact.isSupplier) - && Objects.equals(this.isCustomer, contact.isCustomer) - && Objects.equals(this.salesDefaultLineAmountType, contact.salesDefaultLineAmountType) - && Objects.equals( - this.purchasesDefaultLineAmountType, contact.purchasesDefaultLineAmountType) - && Objects.equals(this.defaultCurrency, contact.defaultCurrency) - && Objects.equals(this.xeroNetworkKey, contact.xeroNetworkKey) - && Objects.equals(this.salesDefaultAccountCode, contact.salesDefaultAccountCode) - && Objects.equals(this.purchasesDefaultAccountCode, contact.purchasesDefaultAccountCode) - && Objects.equals(this.salesTrackingCategories, contact.salesTrackingCategories) - && Objects.equals(this.purchasesTrackingCategories, contact.purchasesTrackingCategories) - && Objects.equals(this.trackingCategoryName, contact.trackingCategoryName) - && Objects.equals(this.trackingCategoryOption, contact.trackingCategoryOption) - && Objects.equals(this.paymentTerms, contact.paymentTerms) - && Objects.equals(this.updatedDateUTC, contact.updatedDateUTC) - && Objects.equals(this.contactGroups, contact.contactGroups) - && Objects.equals(this.website, contact.website) - && Objects.equals(this.brandingTheme, contact.brandingTheme) - && Objects.equals(this.batchPayments, contact.batchPayments) - && Objects.equals(this.discount, contact.discount) - && Objects.equals(this.balances, contact.balances) - && Objects.equals(this.attachments, contact.attachments) - && Objects.equals(this.hasAttachments, contact.hasAttachments) - && Objects.equals(this.validationErrors, contact.validationErrors) - && Objects.equals(this.hasValidationErrors, contact.hasValidationErrors) - && Objects.equals(this.statusAttributeString, contact.statusAttributeString); + return Objects.equals(this.contactID, contact.contactID) && + Objects.equals(this.mergedToContactID, contact.mergedToContactID) && + Objects.equals(this.contactNumber, contact.contactNumber) && + Objects.equals(this.accountNumber, contact.accountNumber) && + Objects.equals(this.contactStatus, contact.contactStatus) && + Objects.equals(this.name, contact.name) && + Objects.equals(this.firstName, contact.firstName) && + Objects.equals(this.lastName, contact.lastName) && + Objects.equals(this.companyNumber, contact.companyNumber) && + Objects.equals(this.emailAddress, contact.emailAddress) && + Objects.equals(this.contactPersons, contact.contactPersons) && + Objects.equals(this.bankAccountDetails, contact.bankAccountDetails) && + Objects.equals(this.taxNumber, contact.taxNumber) && + Objects.equals(this.accountsReceivableTaxType, contact.accountsReceivableTaxType) && + Objects.equals(this.accountsPayableTaxType, contact.accountsPayableTaxType) && + Objects.equals(this.addresses, contact.addresses) && + Objects.equals(this.phones, contact.phones) && + Objects.equals(this.isSupplier, contact.isSupplier) && + Objects.equals(this.isCustomer, contact.isCustomer) && + Objects.equals(this.salesDefaultLineAmountType, contact.salesDefaultLineAmountType) && + Objects.equals(this.purchasesDefaultLineAmountType, contact.purchasesDefaultLineAmountType) && + Objects.equals(this.defaultCurrency, contact.defaultCurrency) && + Objects.equals(this.xeroNetworkKey, contact.xeroNetworkKey) && + Objects.equals(this.salesDefaultAccountCode, contact.salesDefaultAccountCode) && + Objects.equals(this.purchasesDefaultAccountCode, contact.purchasesDefaultAccountCode) && + Objects.equals(this.salesTrackingCategories, contact.salesTrackingCategories) && + Objects.equals(this.purchasesTrackingCategories, contact.purchasesTrackingCategories) && + Objects.equals(this.trackingCategoryName, contact.trackingCategoryName) && + Objects.equals(this.trackingCategoryOption, contact.trackingCategoryOption) && + Objects.equals(this.paymentTerms, contact.paymentTerms) && + Objects.equals(this.updatedDateUTC, contact.updatedDateUTC) && + Objects.equals(this.contactGroups, contact.contactGroups) && + Objects.equals(this.website, contact.website) && + Objects.equals(this.brandingTheme, contact.brandingTheme) && + Objects.equals(this.batchPayments, contact.batchPayments) && + Objects.equals(this.discount, contact.discount) && + Objects.equals(this.balances, contact.balances) && + Objects.equals(this.attachments, contact.attachments) && + Objects.equals(this.hasAttachments, contact.hasAttachments) && + Objects.equals(this.validationErrors, contact.validationErrors) && + Objects.equals(this.hasValidationErrors, contact.hasValidationErrors) && + Objects.equals(this.statusAttributeString, contact.statusAttributeString); } @Override public int hashCode() { - return Objects.hash( - contactID, - mergedToContactID, - contactNumber, - accountNumber, - contactStatus, - name, - firstName, - lastName, - companyNumber, - emailAddress, - contactPersons, - bankAccountDetails, - taxNumber, - accountsReceivableTaxType, - accountsPayableTaxType, - addresses, - phones, - isSupplier, - isCustomer, - salesDefaultLineAmountType, - purchasesDefaultLineAmountType, - defaultCurrency, - xeroNetworkKey, - salesDefaultAccountCode, - purchasesDefaultAccountCode, - salesTrackingCategories, - purchasesTrackingCategories, - trackingCategoryName, - trackingCategoryOption, - paymentTerms, - updatedDateUTC, - contactGroups, - website, - brandingTheme, - batchPayments, - discount, - balances, - attachments, - hasAttachments, - validationErrors, - hasValidationErrors, - statusAttributeString); + return Objects.hash(contactID, mergedToContactID, contactNumber, accountNumber, contactStatus, name, firstName, lastName, companyNumber, emailAddress, contactPersons, bankAccountDetails, taxNumber, accountsReceivableTaxType, accountsPayableTaxType, addresses, phones, isSupplier, isCustomer, salesDefaultLineAmountType, purchasesDefaultLineAmountType, defaultCurrency, xeroNetworkKey, salesDefaultAccountCode, purchasesDefaultAccountCode, salesTrackingCategories, purchasesTrackingCategories, trackingCategoryName, trackingCategoryOption, paymentTerms, updatedDateUTC, contactGroups, website, brandingTheme, batchPayments, discount, balances, attachments, hasAttachments, validationErrors, hasValidationErrors, statusAttributeString); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -2076,42 +1824,22 @@ public String toString() { sb.append(" contactPersons: ").append(toIndentedString(contactPersons)).append("\n"); sb.append(" bankAccountDetails: ").append(toIndentedString(bankAccountDetails)).append("\n"); sb.append(" taxNumber: ").append(toIndentedString(taxNumber)).append("\n"); - sb.append(" accountsReceivableTaxType: ") - .append(toIndentedString(accountsReceivableTaxType)) - .append("\n"); - sb.append(" accountsPayableTaxType: ") - .append(toIndentedString(accountsPayableTaxType)) - .append("\n"); + sb.append(" accountsReceivableTaxType: ").append(toIndentedString(accountsReceivableTaxType)).append("\n"); + sb.append(" accountsPayableTaxType: ").append(toIndentedString(accountsPayableTaxType)).append("\n"); sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); sb.append(" phones: ").append(toIndentedString(phones)).append("\n"); sb.append(" isSupplier: ").append(toIndentedString(isSupplier)).append("\n"); sb.append(" isCustomer: ").append(toIndentedString(isCustomer)).append("\n"); - sb.append(" salesDefaultLineAmountType: ") - .append(toIndentedString(salesDefaultLineAmountType)) - .append("\n"); - sb.append(" purchasesDefaultLineAmountType: ") - .append(toIndentedString(purchasesDefaultLineAmountType)) - .append("\n"); + sb.append(" salesDefaultLineAmountType: ").append(toIndentedString(salesDefaultLineAmountType)).append("\n"); + sb.append(" purchasesDefaultLineAmountType: ").append(toIndentedString(purchasesDefaultLineAmountType)).append("\n"); sb.append(" defaultCurrency: ").append(toIndentedString(defaultCurrency)).append("\n"); sb.append(" xeroNetworkKey: ").append(toIndentedString(xeroNetworkKey)).append("\n"); - sb.append(" salesDefaultAccountCode: ") - .append(toIndentedString(salesDefaultAccountCode)) - .append("\n"); - sb.append(" purchasesDefaultAccountCode: ") - .append(toIndentedString(purchasesDefaultAccountCode)) - .append("\n"); - sb.append(" salesTrackingCategories: ") - .append(toIndentedString(salesTrackingCategories)) - .append("\n"); - sb.append(" purchasesTrackingCategories: ") - .append(toIndentedString(purchasesTrackingCategories)) - .append("\n"); - sb.append(" trackingCategoryName: ") - .append(toIndentedString(trackingCategoryName)) - .append("\n"); - sb.append(" trackingCategoryOption: ") - .append(toIndentedString(trackingCategoryOption)) - .append("\n"); + sb.append(" salesDefaultAccountCode: ").append(toIndentedString(salesDefaultAccountCode)).append("\n"); + sb.append(" purchasesDefaultAccountCode: ").append(toIndentedString(purchasesDefaultAccountCode)).append("\n"); + sb.append(" salesTrackingCategories: ").append(toIndentedString(salesTrackingCategories)).append("\n"); + sb.append(" purchasesTrackingCategories: ").append(toIndentedString(purchasesTrackingCategories)).append("\n"); + sb.append(" trackingCategoryName: ").append(toIndentedString(trackingCategoryName)).append("\n"); + sb.append(" trackingCategoryOption: ").append(toIndentedString(trackingCategoryOption)).append("\n"); sb.append(" paymentTerms: ").append(toIndentedString(paymentTerms)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" contactGroups: ").append(toIndentedString(contactGroups)).append("\n"); @@ -2123,18 +1851,15 @@ public String toString() { sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); sb.append(" hasAttachments: ").append(toIndentedString(hasAttachments)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); - sb.append(" hasValidationErrors: ") - .append(toIndentedString(hasValidationErrors)) - .append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" hasValidationErrors: ").append(toIndentedString(hasValidationErrors)).append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -2142,4 +1867,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ContactGroup.java b/src/main/java/com/xero/models/accounting/ContactGroup.java index acead7130..68ca02e20 100644 --- a/src/main/java/com/xero/models/accounting/ContactGroup.java +++ b/src/main/java/com/xero/models/accounting/ContactGroup.java @@ -9,33 +9,52 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Contact; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ContactGroup + */ -/** ContactGroup */ public class ContactGroup { StringUtil util = new StringUtil(); @JsonProperty("Name") private String name; /** - * The Status of a contact group. To delete a contact group update the status to DELETED. Only - * contact groups with a status of ACTIVE are returned on GETs. + * The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -44,31 +63,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -80,6 +93,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -89,144 +103,116 @@ public static StatusEnum fromValue(String value) { @JsonProperty("Contacts") private List contacts = new ArrayList(); /** - * The Name of the contact group. Required when creating a new contact group - * - * @param name String - * @return ContactGroup - */ + * The Name of the contact group. Required when creating a new contact group + * @param name String + * @return ContactGroup + **/ public ContactGroup name(String name) { this.name = name; return this; } - /** - * The Name of the contact group. Required when creating a new contact group - * + /** + * The Name of the contact group. Required when creating a new contact group * @return name - */ - @ApiModelProperty( - value = "The Name of the contact group. Required when creating a new contact group") - /** - * The Name of the contact group. Required when creating a new contact group - * + **/ + @ApiModelProperty(value = "The Name of the contact group. Required when creating a new contact group") + /** + * The Name of the contact group. Required when creating a new contact group * @return name String - */ + **/ public String getName() { return name; } - /** - * The Name of the contact group. Required when creating a new contact group - * - * @param name String - */ + /** + * The Name of the contact group. Required when creating a new contact group + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The Status of a contact group. To delete a contact group update the status to DELETED. Only - * contact groups with a status of ACTIVE are returned on GETs. - * - * @param status StatusEnum - * @return ContactGroup - */ + * The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. + * @param status StatusEnum + * @return ContactGroup + **/ public ContactGroup status(StatusEnum status) { this.status = status; return this; } - /** - * The Status of a contact group. To delete a contact group update the status to DELETED. Only - * contact groups with a status of ACTIVE are returned on GETs. - * + /** + * The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. * @return status - */ - @ApiModelProperty( - value = - "The Status of a contact group. To delete a contact group update the status to DELETED." - + " Only contact groups with a status of ACTIVE are returned on GETs.") - /** - * The Status of a contact group. To delete a contact group update the status to DELETED. Only - * contact groups with a status of ACTIVE are returned on GETs. - * + **/ + @ApiModelProperty(value = "The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs.") + /** + * The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The Status of a contact group. To delete a contact group update the status to DELETED. Only - * contact groups with a status of ACTIVE are returned on GETs. - * - * @param status StatusEnum - */ + /** + * The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * The Xero identifier for an contact group – specified as a string following the endpoint name. - * e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param contactGroupID UUID - * @return ContactGroup - */ + * The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param contactGroupID UUID + * @return ContactGroup + **/ public ContactGroup contactGroupID(UUID contactGroupID) { this.contactGroupID = contactGroupID; return this; } - /** - * The Xero identifier for an contact group – specified as a string following the endpoint name. - * e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * + /** + * The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 * @return contactGroupID - */ - @ApiModelProperty( - value = - "The Xero identifier for an contact group – specified as a string following the endpoint" - + " name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9") - /** - * The Xero identifier for an contact group – specified as a string following the endpoint name. - * e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * + **/ + @ApiModelProperty(value = "The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9") + /** + * The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 * @return contactGroupID UUID - */ + **/ public UUID getContactGroupID() { return contactGroupID; } - /** - * The Xero identifier for an contact group – specified as a string following the endpoint name. - * e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param contactGroupID UUID - */ + /** + * The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param contactGroupID UUID + **/ + public void setContactGroupID(UUID contactGroupID) { this.contactGroupID = contactGroupID; } /** - * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID - * is supplied in the URL. - * - * @param contacts List<Contact> - * @return ContactGroup - */ + * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. + * @param contacts List<Contact> + * @return ContactGroup + **/ public ContactGroup contacts(List contacts) { this.contacts = contacts; return this; } /** - * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID - * is supplied in the URL. - * - * @param contactsItem Contact + * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. + * @param contactsItem Contact * @return ContactGroup - */ + **/ public ContactGroup addContactsItem(Contact contactsItem) { if (this.contacts == null) { this.contacts = new ArrayList(); @@ -235,36 +221,29 @@ public ContactGroup addContactsItem(Contact contactsItem) { return this; } - /** - * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID - * is supplied in the URL. - * + /** + * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. * @return contacts - */ - @ApiModelProperty( - value = - "The ContactID and Name of Contacts in a contact group. Returned on GETs when the" - + " ContactGroupID is supplied in the URL.") - /** - * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID - * is supplied in the URL. - * + **/ + @ApiModelProperty(value = "The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL.") + /** + * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. * @return contacts List - */ + **/ public List getContacts() { return contacts; } - /** - * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID - * is supplied in the URL. - * - * @param contacts List<Contact> - */ + /** + * The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. + * @param contacts List<Contact> + **/ + public void setContacts(List contacts) { this.contacts = contacts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -274,10 +253,10 @@ public boolean equals(java.lang.Object o) { return false; } ContactGroup contactGroup = (ContactGroup) o; - return Objects.equals(this.name, contactGroup.name) - && Objects.equals(this.status, contactGroup.status) - && Objects.equals(this.contactGroupID, contactGroup.contactGroupID) - && Objects.equals(this.contacts, contactGroup.contacts); + return Objects.equals(this.name, contactGroup.name) && + Objects.equals(this.status, contactGroup.status) && + Objects.equals(this.contactGroupID, contactGroup.contactGroupID) && + Objects.equals(this.contacts, contactGroup.contacts); } @Override @@ -285,6 +264,7 @@ public int hashCode() { return Objects.hash(name, status, contactGroupID, contacts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -298,7 +278,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -306,4 +287,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ContactGroups.java b/src/main/java/com/xero/models/accounting/ContactGroups.java index 6571a7cac..be18c87b1 100644 --- a/src/main/java/com/xero/models/accounting/ContactGroups.java +++ b/src/main/java/com/xero/models/accounting/ContactGroups.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ContactGroup; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ContactGroups + */ -/** ContactGroups */ public class ContactGroups { StringUtil util = new StringUtil(); @JsonProperty("ContactGroups") private List contactGroups = new ArrayList(); /** - * contactGroups - * - * @param contactGroups List<ContactGroup> - * @return ContactGroups - */ + * contactGroups + * @param contactGroups List<ContactGroup> + * @return ContactGroups + **/ public ContactGroups contactGroups(List contactGroups) { this.contactGroups = contactGroups; return this; @@ -37,10 +54,9 @@ public ContactGroups contactGroups(List contactGroups) { /** * contactGroups - * - * @param contactGroupsItem ContactGroup + * @param contactGroupsItem ContactGroup * @return ContactGroups - */ + **/ public ContactGroups addContactGroupsItem(ContactGroup contactGroupsItem) { if (this.contactGroups == null) { this.contactGroups = new ArrayList(); @@ -49,30 +65,29 @@ public ContactGroups addContactGroupsItem(ContactGroup contactGroupsItem) { return this; } - /** + /** * Get contactGroups - * * @return contactGroups - */ + **/ @ApiModelProperty(value = "") - /** + /** * contactGroups - * * @return contactGroups List - */ + **/ public List getContactGroups() { return contactGroups; } - /** - * contactGroups - * - * @param contactGroups List<ContactGroup> - */ + /** + * contactGroups + * @param contactGroups List<ContactGroup> + **/ + public void setContactGroups(List contactGroups) { this.contactGroups = contactGroups; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(contactGroups); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ContactPerson.java b/src/main/java/com/xero/models/accounting/ContactPerson.java index 225def2fc..e8de9f6c6 100644 --- a/src/main/java/com/xero/models/accounting/ContactPerson.java +++ b/src/main/java/com/xero/models/accounting/ContactPerson.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ContactPerson + */ -/** ContactPerson */ public class ContactPerson { StringUtil util = new StringUtil(); @@ -32,146 +49,134 @@ public class ContactPerson { @JsonProperty("IncludeInEmails") private Boolean includeInEmails; /** - * First name of person - * - * @param firstName String - * @return ContactPerson - */ + * First name of person + * @param firstName String + * @return ContactPerson + **/ public ContactPerson firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of person - * * @return firstName - */ + **/ @ApiModelProperty(value = "First name of person") - /** + /** * First name of person - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of person - * - * @param firstName String - */ + /** + * First name of person + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of person - * - * @param lastName String - * @return ContactPerson - */ + * Last name of person + * @param lastName String + * @return ContactPerson + **/ public ContactPerson lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of person - * * @return lastName - */ + **/ @ApiModelProperty(value = "Last name of person") - /** + /** * Last name of person - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of person - * - * @param lastName String - */ + /** + * Last name of person + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Email address of person - * - * @param emailAddress String - * @return ContactPerson - */ + * Email address of person + * @param emailAddress String + * @return ContactPerson + **/ public ContactPerson emailAddress(String emailAddress) { this.emailAddress = emailAddress; return this; } - /** + /** * Email address of person - * * @return emailAddress - */ + **/ @ApiModelProperty(value = "Email address of person") - /** + /** * Email address of person - * * @return emailAddress String - */ + **/ public String getEmailAddress() { return emailAddress; } - /** - * Email address of person - * - * @param emailAddress String - */ + /** + * Email address of person + * @param emailAddress String + **/ + public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } /** - * boolean to indicate whether contact should be included on emails with invoices etc. - * - * @param includeInEmails Boolean - * @return ContactPerson - */ + * boolean to indicate whether contact should be included on emails with invoices etc. + * @param includeInEmails Boolean + * @return ContactPerson + **/ public ContactPerson includeInEmails(Boolean includeInEmails) { this.includeInEmails = includeInEmails; return this; } - /** + /** * boolean to indicate whether contact should be included on emails with invoices etc. - * * @return includeInEmails - */ - @ApiModelProperty( - value = "boolean to indicate whether contact should be included on emails with invoices etc.") - /** + **/ + @ApiModelProperty(value = "boolean to indicate whether contact should be included on emails with invoices etc.") + /** * boolean to indicate whether contact should be included on emails with invoices etc. - * * @return includeInEmails Boolean - */ + **/ public Boolean getIncludeInEmails() { return includeInEmails; } - /** - * boolean to indicate whether contact should be included on emails with invoices etc. - * - * @param includeInEmails Boolean - */ + /** + * boolean to indicate whether contact should be included on emails with invoices etc. + * @param includeInEmails Boolean + **/ + public void setIncludeInEmails(Boolean includeInEmails) { this.includeInEmails = includeInEmails; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } ContactPerson contactPerson = (ContactPerson) o; - return Objects.equals(this.firstName, contactPerson.firstName) - && Objects.equals(this.lastName, contactPerson.lastName) - && Objects.equals(this.emailAddress, contactPerson.emailAddress) - && Objects.equals(this.includeInEmails, contactPerson.includeInEmails); + return Objects.equals(this.firstName, contactPerson.firstName) && + Objects.equals(this.lastName, contactPerson.lastName) && + Objects.equals(this.emailAddress, contactPerson.emailAddress) && + Objects.equals(this.includeInEmails, contactPerson.includeInEmails); } @Override @@ -192,6 +197,7 @@ public int hashCode() { return Objects.hash(firstName, lastName, emailAddress, includeInEmails); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Contacts.java b/src/main/java/com/xero/models/accounting/Contacts.java index fc826e21f..7b617077f 100644 --- a/src/main/java/com/xero/models/accounting/Contacts.java +++ b/src/main/java/com/xero/models/accounting/Contacts.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Contacts + */ -/** Contacts */ public class Contacts { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class Contacts { @JsonProperty("Contacts") private List contacts = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Contacts - */ + * pagination + * @param pagination Pagination + * @return Contacts + **/ public Contacts pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Contacts - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Contacts + **/ public Contacts warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public Contacts warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Contacts - */ + **/ public Contacts addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public Contacts addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * contacts - * - * @param contacts List<Contact> - * @return Contacts - */ + * contacts + * @param contacts List<Contact> + * @return Contacts + **/ public Contacts contacts(List contacts) { this.contacts = contacts; return this; @@ -127,10 +139,9 @@ public Contacts contacts(List contacts) { /** * contacts - * - * @param contactsItem Contact + * @param contactsItem Contact * @return Contacts - */ + **/ public Contacts addContactsItem(Contact contactsItem) { if (this.contacts == null) { this.contacts = new ArrayList(); @@ -139,30 +150,29 @@ public Contacts addContactsItem(Contact contactsItem) { return this; } - /** + /** * Get contacts - * * @return contacts - */ + **/ @ApiModelProperty(value = "") - /** + /** * contacts - * * @return contacts List - */ + **/ public List getContacts() { return contacts; } - /** - * contacts - * - * @param contacts List<Contact> - */ + /** + * contacts + * @param contacts List<Contact> + **/ + public void setContacts(List contacts) { this.contacts = contacts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } Contacts contacts = (Contacts) o; - return Objects.equals(this.pagination, contacts.pagination) - && Objects.equals(this.warnings, contacts.warnings) - && Objects.equals(this.contacts, contacts.contacts); + return Objects.equals(this.pagination, contacts.pagination) && + Objects.equals(this.warnings, contacts.warnings) && + Objects.equals(this.contacts, contacts.contacts); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, contacts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ConversionBalances.java b/src/main/java/com/xero/models/accounting/ConversionBalances.java index 5f13df0ad..9be2f13f8 100644 --- a/src/main/java/com/xero/models/accounting/ConversionBalances.java +++ b/src/main/java/com/xero/models/accounting/ConversionBalances.java @@ -9,19 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.BalanceDetails; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Balance supplied for each account that has a value as at the conversion date. + */ +@ApiModel(description = "Balance supplied for each account that has a value as at the conversion date.") -/** Balance supplied for each account that has a value as at the conversion date. */ -@ApiModel( - description = "Balance supplied for each account that has a value as at the conversion date.") public class ConversionBalances { StringUtil util = new StringUtil(); @@ -34,83 +50,74 @@ public class ConversionBalances { @JsonProperty("BalanceDetails") private List balanceDetails = new ArrayList(); /** - * The account code for a account - * - * @param accountCode String - * @return ConversionBalances - */ + * The account code for a account + * @param accountCode String + * @return ConversionBalances + **/ public ConversionBalances accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * The account code for a account - * * @return accountCode - */ + **/ @ApiModelProperty(value = "The account code for a account") - /** + /** * The account code for a account - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * The account code for a account - * - * @param accountCode String - */ + /** + * The account code for a account + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * The opening balances of the account. Debits are positive, credits are negative values - * - * @param balance Double - * @return ConversionBalances - */ + * The opening balances of the account. Debits are positive, credits are negative values + * @param balance Double + * @return ConversionBalances + **/ public ConversionBalances balance(Double balance) { this.balance = balance; return this; } - /** + /** * The opening balances of the account. Debits are positive, credits are negative values - * * @return balance - */ - @ApiModelProperty( - value = - "The opening balances of the account. Debits are positive, credits are negative values") - /** + **/ + @ApiModelProperty(value = "The opening balances of the account. Debits are positive, credits are negative values") + /** * The opening balances of the account. Debits are positive, credits are negative values - * * @return balance Double - */ + **/ public Double getBalance() { return balance; } - /** - * The opening balances of the account. Debits are positive, credits are negative values - * - * @param balance Double - */ + /** + * The opening balances of the account. Debits are positive, credits are negative values + * @param balance Double + **/ + public void setBalance(Double balance) { this.balance = balance; } /** - * balanceDetails - * - * @param balanceDetails List<BalanceDetails> - * @return ConversionBalances - */ + * balanceDetails + * @param balanceDetails List<BalanceDetails> + * @return ConversionBalances + **/ public ConversionBalances balanceDetails(List balanceDetails) { this.balanceDetails = balanceDetails; return this; @@ -118,10 +125,9 @@ public ConversionBalances balanceDetails(List balanceDetails) { /** * balanceDetails - * - * @param balanceDetailsItem BalanceDetails + * @param balanceDetailsItem BalanceDetails * @return ConversionBalances - */ + **/ public ConversionBalances addBalanceDetailsItem(BalanceDetails balanceDetailsItem) { if (this.balanceDetails == null) { this.balanceDetails = new ArrayList(); @@ -130,30 +136,29 @@ public ConversionBalances addBalanceDetailsItem(BalanceDetails balanceDetailsIte return this; } - /** + /** * Get balanceDetails - * * @return balanceDetails - */ + **/ @ApiModelProperty(value = "") - /** + /** * balanceDetails - * * @return balanceDetails List - */ + **/ public List getBalanceDetails() { return balanceDetails; } - /** - * balanceDetails - * - * @param balanceDetails List<BalanceDetails> - */ + /** + * balanceDetails + * @param balanceDetails List<BalanceDetails> + **/ + public void setBalanceDetails(List balanceDetails) { this.balanceDetails = balanceDetails; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -163,9 +168,9 @@ public boolean equals(java.lang.Object o) { return false; } ConversionBalances conversionBalances = (ConversionBalances) o; - return Objects.equals(this.accountCode, conversionBalances.accountCode) - && Objects.equals(this.balance, conversionBalances.balance) - && Objects.equals(this.balanceDetails, conversionBalances.balanceDetails); + return Objects.equals(this.accountCode, conversionBalances.accountCode) && + Objects.equals(this.balance, conversionBalances.balance) && + Objects.equals(this.balanceDetails, conversionBalances.balanceDetails); } @Override @@ -173,6 +178,7 @@ public int hashCode() { return Objects.hash(accountCode, balance, balanceDetails); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -185,7 +191,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -193,4 +200,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ConversionDate.java b/src/main/java/com/xero/models/accounting/ConversionDate.java index dde3eca95..9e7206363 100644 --- a/src/main/java/com/xero/models/accounting/ConversionDate.java +++ b/src/main/java/com/xero/models/accounting/ConversionDate.java @@ -9,16 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; -/** The date when the organisation starts using Xero */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The date when the organisation starts using Xero + */ @ApiModel(description = "The date when the organisation starts using Xero") + public class ConversionDate { StringUtil util = new StringUtil(); @@ -28,79 +44,70 @@ public class ConversionDate { @JsonProperty("Year") private Integer year; /** - * The month the organisation starts using Xero. Value is an integer between 1 and 12 - * - * @param month Integer - * @return ConversionDate - */ + * The month the organisation starts using Xero. Value is an integer between 1 and 12 + * @param month Integer + * @return ConversionDate + **/ public ConversionDate month(Integer month) { this.month = month; return this; } - /** + /** * The month the organisation starts using Xero. Value is an integer between 1 and 12 - * * @return month - */ - @ApiModelProperty( - example = "1", - value = "The month the organisation starts using Xero. Value is an integer between 1 and 12") - /** + **/ + @ApiModelProperty(example = "1", value = "The month the organisation starts using Xero. Value is an integer between 1 and 12") + /** * The month the organisation starts using Xero. Value is an integer between 1 and 12 - * * @return month Integer - */ + **/ public Integer getMonth() { return month; } - /** - * The month the organisation starts using Xero. Value is an integer between 1 and 12 - * - * @param month Integer - */ + /** + * The month the organisation starts using Xero. Value is an integer between 1 and 12 + * @param month Integer + **/ + public void setMonth(Integer month) { this.month = month; } /** - * The year the organisation starts using Xero. Value is an integer greater than 2006 - * - * @param year Integer - * @return ConversionDate - */ + * The year the organisation starts using Xero. Value is an integer greater than 2006 + * @param year Integer + * @return ConversionDate + **/ public ConversionDate year(Integer year) { this.year = year; return this; } - /** + /** * The year the organisation starts using Xero. Value is an integer greater than 2006 - * * @return year - */ - @ApiModelProperty( - example = "2020", - value = "The year the organisation starts using Xero. Value is an integer greater than 2006") - /** + **/ + @ApiModelProperty(example = "2020", value = "The year the organisation starts using Xero. Value is an integer greater than 2006") + /** * The year the organisation starts using Xero. Value is an integer greater than 2006 - * * @return year Integer - */ + **/ public Integer getYear() { return year; } - /** - * The year the organisation starts using Xero. Value is an integer greater than 2006 - * - * @param year Integer - */ + /** + * The year the organisation starts using Xero. Value is an integer greater than 2006 + * @param year Integer + **/ + public void setYear(Integer year) { this.year = year; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } ConversionDate conversionDate = (ConversionDate) o; - return Objects.equals(this.month, conversionDate.month) - && Objects.equals(this.year, conversionDate.year); + return Objects.equals(this.month, conversionDate.month) && + Objects.equals(this.year, conversionDate.year); } @Override @@ -119,6 +126,7 @@ public int hashCode() { return Objects.hash(month, year); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -130,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -138,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/CountryCode.java b/src/main/java/com/xero/models/accounting/CountryCode.java index 7d3480fd5..84e7cafb5 100644 --- a/src/main/java/com/xero/models/accounting/CountryCode.java +++ b/src/main/java/com/xero/models/accounting/CountryCode.java @@ -9,733 +9,1224 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; - +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets CountryCode */ +/** + * Gets or Sets CountryCode + */ public enum CountryCode { - - /** AD */ + + /** + * AD + */ AD("AD"), - - /** AE */ + + /** + * AE + */ AE("AE"), - - /** AF */ + + /** + * AF + */ AF("AF"), - - /** AG */ + + /** + * AG + */ AG("AG"), - - /** AI */ + + /** + * AI + */ AI("AI"), - - /** AL */ + + /** + * AL + */ AL("AL"), - - /** AM */ + + /** + * AM + */ AM("AM"), - - /** AN */ + + /** + * AN + */ AN("AN"), - - /** AO */ + + /** + * AO + */ AO("AO"), - - /** AQ */ + + /** + * AQ + */ AQ("AQ"), - - /** AR */ + + /** + * AR + */ AR("AR"), - - /** AS */ + + /** + * AS + */ AS("AS"), - - /** AT */ + + /** + * AT + */ AT("AT"), - - /** AU */ + + /** + * AU + */ AU("AU"), - - /** AW */ + + /** + * AW + */ AW("AW"), - - /** AZ */ + + /** + * AZ + */ AZ("AZ"), - - /** BA */ + + /** + * BA + */ BA("BA"), - - /** BB */ + + /** + * BB + */ BB("BB"), - - /** BD */ + + /** + * BD + */ BD("BD"), - - /** BE */ + + /** + * BE + */ BE("BE"), - - /** BF */ + + /** + * BF + */ BF("BF"), - - /** BG */ + + /** + * BG + */ BG("BG"), - - /** BH */ + + /** + * BH + */ BH("BH"), - - /** BI */ + + /** + * BI + */ BI("BI"), - - /** BJ */ + + /** + * BJ + */ BJ("BJ"), - - /** BL */ + + /** + * BL + */ BL("BL"), - - /** BM */ + + /** + * BM + */ BM("BM"), - - /** BN */ + + /** + * BN + */ BN("BN"), - - /** BO */ + + /** + * BO + */ BO("BO"), - - /** BR */ + + /** + * BR + */ BR("BR"), - - /** BS */ + + /** + * BS + */ BS("BS"), - - /** BT */ + + /** + * BT + */ BT("BT"), - - /** BW */ + + /** + * BW + */ BW("BW"), - - /** BY */ + + /** + * BY + */ BY("BY"), - - /** BZ */ + + /** + * BZ + */ BZ("BZ"), - - /** CA */ + + /** + * CA + */ CA("CA"), - - /** CC */ + + /** + * CC + */ CC("CC"), - - /** CD */ + + /** + * CD + */ CD("CD"), - - /** CF */ + + /** + * CF + */ CF("CF"), - - /** CG */ + + /** + * CG + */ CG("CG"), - - /** CH */ + + /** + * CH + */ CH("CH"), - - /** CI */ + + /** + * CI + */ CI("CI"), - - /** CK */ + + /** + * CK + */ CK("CK"), - - /** CL */ + + /** + * CL + */ CL("CL"), - - /** CM */ + + /** + * CM + */ CM("CM"), - - /** CN */ + + /** + * CN + */ CN("CN"), - - /** CO */ + + /** + * CO + */ CO("CO"), - - /** CR */ + + /** + * CR + */ CR("CR"), - - /** CU */ + + /** + * CU + */ CU("CU"), - - /** CV */ + + /** + * CV + */ CV("CV"), - - /** CW */ + + /** + * CW + */ CW("CW"), - - /** CX */ + + /** + * CX + */ CX("CX"), - - /** CY */ + + /** + * CY + */ CY("CY"), - - /** CZ */ + + /** + * CZ + */ CZ("CZ"), - - /** DE */ + + /** + * DE + */ DE("DE"), - - /** DJ */ + + /** + * DJ + */ DJ("DJ"), - - /** DK */ + + /** + * DK + */ DK("DK"), - - /** DM */ + + /** + * DM + */ DM("DM"), - - /** DO */ + + /** + * DO + */ DO("DO"), - - /** DZ */ + + /** + * DZ + */ DZ("DZ"), - - /** EC */ + + /** + * EC + */ EC("EC"), - - /** EE */ + + /** + * EE + */ EE("EE"), - - /** EG */ + + /** + * EG + */ EG("EG"), - - /** EH */ + + /** + * EH + */ EH("EH"), - - /** ER */ + + /** + * ER + */ ER("ER"), - - /** ES */ + + /** + * ES + */ ES("ES"), - - /** ET */ + + /** + * ET + */ ET("ET"), - - /** FI */ + + /** + * FI + */ FI("FI"), - - /** FJ */ + + /** + * FJ + */ FJ("FJ"), - - /** FK */ + + /** + * FK + */ FK("FK"), - - /** FM */ + + /** + * FM + */ FM("FM"), - - /** FO */ + + /** + * FO + */ FO("FO"), - - /** FR */ + + /** + * FR + */ FR("FR"), - - /** GA */ + + /** + * GA + */ GA("GA"), - - /** GB */ + + /** + * GB + */ GB("GB"), - - /** GD */ + + /** + * GD + */ GD("GD"), - - /** GE */ + + /** + * GE + */ GE("GE"), - - /** GG */ + + /** + * GG + */ GG("GG"), - - /** GH */ + + /** + * GH + */ GH("GH"), - - /** GI */ + + /** + * GI + */ GI("GI"), - - /** GL */ + + /** + * GL + */ GL("GL"), - - /** GM */ + + /** + * GM + */ GM("GM"), - - /** GN */ + + /** + * GN + */ GN("GN"), - - /** GQ */ + + /** + * GQ + */ GQ("GQ"), - - /** GR */ + + /** + * GR + */ GR("GR"), - - /** GT */ + + /** + * GT + */ GT("GT"), - - /** GU */ + + /** + * GU + */ GU("GU"), - - /** GW */ + + /** + * GW + */ GW("GW"), - - /** GY */ + + /** + * GY + */ GY("GY"), - - /** HK */ + + /** + * HK + */ HK("HK"), - - /** HN */ + + /** + * HN + */ HN("HN"), - - /** HR */ + + /** + * HR + */ HR("HR"), - - /** HT */ + + /** + * HT + */ HT("HT"), - - /** HU */ + + /** + * HU + */ HU("HU"), - - /** ID */ + + /** + * ID + */ ID("ID"), - - /** IE */ + + /** + * IE + */ IE("IE"), - - /** IL */ + + /** + * IL + */ IL("IL"), - - /** IM */ + + /** + * IM + */ IM("IM"), - - /** IN */ + + /** + * IN + */ IN("IN"), - - /** IO */ + + /** + * IO + */ IO("IO"), - - /** IQ */ + + /** + * IQ + */ IQ("IQ"), - - /** IR */ + + /** + * IR + */ IR("IR"), - - /** IS */ + + /** + * IS + */ IS("IS"), - - /** IT */ + + /** + * IT + */ IT("IT"), - - /** JE */ + + /** + * JE + */ JE("JE"), - - /** JM */ + + /** + * JM + */ JM("JM"), - - /** JO */ + + /** + * JO + */ JO("JO"), - - /** JP */ + + /** + * JP + */ JP("JP"), - - /** KE */ + + /** + * KE + */ KE("KE"), - - /** KG */ + + /** + * KG + */ KG("KG"), - - /** KH */ + + /** + * KH + */ KH("KH"), - - /** KI */ + + /** + * KI + */ KI("KI"), - - /** KM */ + + /** + * KM + */ KM("KM"), - - /** KN */ + + /** + * KN + */ KN("KN"), - - /** KP */ + + /** + * KP + */ KP("KP"), - - /** KR */ + + /** + * KR + */ KR("KR"), - - /** KW */ + + /** + * KW + */ KW("KW"), - - /** KY */ + + /** + * KY + */ KY("KY"), - - /** KZ */ + + /** + * KZ + */ KZ("KZ"), - - /** LA */ + + /** + * LA + */ LA("LA"), - - /** LB */ + + /** + * LB + */ LB("LB"), - - /** LC */ + + /** + * LC + */ LC("LC"), - - /** LI */ + + /** + * LI + */ LI("LI"), - - /** LK */ + + /** + * LK + */ LK("LK"), - - /** LR */ + + /** + * LR + */ LR("LR"), - - /** LS */ + + /** + * LS + */ LS("LS"), - - /** LT */ + + /** + * LT + */ LT("LT"), - - /** LU */ + + /** + * LU + */ LU("LU"), - - /** LV */ + + /** + * LV + */ LV("LV"), - - /** LY */ + + /** + * LY + */ LY("LY"), - - /** MA */ + + /** + * MA + */ MA("MA"), - - /** MC */ + + /** + * MC + */ MC("MC"), - - /** MD */ + + /** + * MD + */ MD("MD"), - - /** ME */ + + /** + * ME + */ ME("ME"), - - /** MF */ + + /** + * MF + */ MF("MF"), - - /** MG */ + + /** + * MG + */ MG("MG"), - - /** MH */ + + /** + * MH + */ MH("MH"), - - /** MK */ + + /** + * MK + */ MK("MK"), - - /** ML */ + + /** + * ML + */ ML("ML"), - - /** MM */ + + /** + * MM + */ MM("MM"), - - /** MN */ + + /** + * MN + */ MN("MN"), - - /** MO */ + + /** + * MO + */ MO("MO"), - - /** MP */ + + /** + * MP + */ MP("MP"), - - /** MR */ + + /** + * MR + */ MR("MR"), - - /** MS */ + + /** + * MS + */ MS("MS"), - - /** MT */ + + /** + * MT + */ MT("MT"), - - /** MU */ + + /** + * MU + */ MU("MU"), - - /** MV */ + + /** + * MV + */ MV("MV"), - - /** MW */ + + /** + * MW + */ MW("MW"), - - /** MX */ + + /** + * MX + */ MX("MX"), - - /** MY */ + + /** + * MY + */ MY("MY"), - - /** MZ */ + + /** + * MZ + */ MZ("MZ"), - - /** NA */ + + /** + * NA + */ NA("NA"), - - /** NC */ + + /** + * NC + */ NC("NC"), - - /** NE */ + + /** + * NE + */ NE("NE"), - - /** NG */ + + /** + * NG + */ NG("NG"), - - /** NI */ + + /** + * NI + */ NI("NI"), - - /** NL */ + + /** + * NL + */ NL("NL"), - - /** NO */ + + /** + * NO + */ NO("NO"), - - /** NP */ + + /** + * NP + */ NP("NP"), - - /** NR */ + + /** + * NR + */ NR("NR"), - - /** NU */ + + /** + * NU + */ NU("NU"), - - /** NZ */ + + /** + * NZ + */ NZ("NZ"), - - /** OM */ + + /** + * OM + */ OM("OM"), - - /** PA */ + + /** + * PA + */ PA("PA"), - - /** PE */ + + /** + * PE + */ PE("PE"), - - /** PF */ + + /** + * PF + */ PF("PF"), - - /** PG */ + + /** + * PG + */ PG("PG"), - - /** PH */ + + /** + * PH + */ PH("PH"), - - /** PK */ + + /** + * PK + */ PK("PK"), - - /** PL */ + + /** + * PL + */ PL("PL"), - - /** PM */ + + /** + * PM + */ PM("PM"), - - /** PN */ + + /** + * PN + */ PN("PN"), - - /** PR */ + + /** + * PR + */ PR("PR"), - - /** PS */ + + /** + * PS + */ PS("PS"), - - /** PT */ + + /** + * PT + */ PT("PT"), - - /** PW */ + + /** + * PW + */ PW("PW"), - - /** PY */ + + /** + * PY + */ PY("PY"), - - /** QA */ + + /** + * QA + */ QA("QA"), - - /** RE */ + + /** + * RE + */ RE("RE"), - - /** RO */ + + /** + * RO + */ RO("RO"), - - /** RS */ + + /** + * RS + */ RS("RS"), - - /** RU */ + + /** + * RU + */ RU("RU"), - - /** RW */ + + /** + * RW + */ RW("RW"), - - /** SA */ + + /** + * SA + */ SA("SA"), - - /** SB */ + + /** + * SB + */ SB("SB"), - - /** SC */ + + /** + * SC + */ SC("SC"), - - /** SD */ + + /** + * SD + */ SD("SD"), - - /** SE */ + + /** + * SE + */ SE("SE"), - - /** SG */ + + /** + * SG + */ SG("SG"), - - /** SH */ + + /** + * SH + */ SH("SH"), - - /** SI */ + + /** + * SI + */ SI("SI"), - - /** SJ */ + + /** + * SJ + */ SJ("SJ"), - - /** SK */ + + /** + * SK + */ SK("SK"), - - /** SL */ + + /** + * SL + */ SL("SL"), - - /** SM */ + + /** + * SM + */ SM("SM"), - - /** SN */ + + /** + * SN + */ SN("SN"), - - /** SO */ + + /** + * SO + */ SO("SO"), - - /** SR */ + + /** + * SR + */ SR("SR"), - - /** SS */ + + /** + * SS + */ SS("SS"), - - /** ST */ + + /** + * ST + */ ST("ST"), - - /** SV */ + + /** + * SV + */ SV("SV"), - - /** SX */ + + /** + * SX + */ SX("SX"), - - /** SY */ + + /** + * SY + */ SY("SY"), - - /** SZ */ + + /** + * SZ + */ SZ("SZ"), - - /** TC */ + + /** + * TC + */ TC("TC"), - - /** TD */ + + /** + * TD + */ TD("TD"), - - /** TG */ + + /** + * TG + */ TG("TG"), - - /** TH */ + + /** + * TH + */ TH("TH"), - - /** TJ */ + + /** + * TJ + */ TJ("TJ"), - - /** TK */ + + /** + * TK + */ TK("TK"), - - /** TL */ + + /** + * TL + */ TL("TL"), - - /** TM */ + + /** + * TM + */ TM("TM"), - - /** TN */ + + /** + * TN + */ TN("TN"), - - /** TO */ + + /** + * TO + */ TO("TO"), - - /** TR */ + + /** + * TR + */ TR("TR"), - - /** TT */ + + /** + * TT + */ TT("TT"), - - /** TV */ + + /** + * TV + */ TV("TV"), - - /** TW */ + + /** + * TW + */ TW("TW"), - - /** TZ */ + + /** + * TZ + */ TZ("TZ"), - - /** UA */ + + /** + * UA + */ UA("UA"), - - /** UG */ + + /** + * UG + */ UG("UG"), - - /** US */ + + /** + * US + */ US("US"), - - /** UY */ + + /** + * UY + */ UY("UY"), - - /** UZ */ + + /** + * UZ + */ UZ("UZ"), - - /** VA */ + + /** + * VA + */ VA("VA"), - - /** VC */ + + /** + * VC + */ VC("VC"), - - /** VE */ + + /** + * VE + */ VE("VE"), - - /** VG */ + + /** + * VG + */ VG("VG"), - - /** VI */ + + /** + * VI + */ VI("VI"), - - /** VN */ + + /** + * VN + */ VN("VN"), - - /** VU */ + + /** + * VU + */ VU("VU"), - - /** WF */ + + /** + * WF + */ WF("WF"), - - /** WS */ + + /** + * WS + */ WS("WS"), - - /** XK */ + + /** + * XK + */ XK("XK"), - - /** YE */ + + /** + * YE + */ YE("YE"), - - /** YT */ + + /** + * YT + */ YT("YT"), - - /** ZA */ + + /** + * ZA + */ ZA("ZA"), - - /** ZM */ + + /** + * ZM + */ ZM("ZM"), - - /** ZW */ + + /** + * ZW + */ ZW("ZW"); private String value; @@ -744,26 +1235,24 @@ public enum CountryCode { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CountryCode fromValue(String value) { @@ -775,3 +1264,4 @@ public static CountryCode fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/CreditNote.java b/src/main/java/com/xero/models/accounting/CreditNote.java index ff4a6e365..1f5ff431a 100644 --- a/src/main/java/com/xero/models/accounting/CreditNote.java +++ b/src/main/java/com/xero/models/accounting/CreditNote.java @@ -9,32 +9,56 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Allocation; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.InvoiceAddress; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.Payment; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CreditNote + */ -/** CreditNote */ public class CreditNote { StringUtil util = new StringUtil(); - /** See Credit Note Types */ + /** + * See Credit Note Types + */ public enum TypeEnum { - /** ACCPAYCREDIT */ + /** + * ACCPAYCREDIT + */ ACCPAYCREDIT("ACCPAYCREDIT"), - - /** ACCRECCREDIT */ + + /** + * ACCRECCREDIT + */ ACCRECCREDIT("ACCRECCREDIT"); private String value; @@ -43,31 +67,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -79,6 +97,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -90,24 +109,38 @@ public static TypeEnum fromValue(String value) { @JsonProperty("DueDate") private String dueDate; - /** See Credit Note Status Codes */ + /** + * See Credit Note Status Codes + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** SUBMITTED */ + + /** + * SUBMITTED + */ SUBMITTED("SUBMITTED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"), - - /** AUTHORISED */ + + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** PAID */ + + /** + * PAID + */ PAID("PAID"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"); private String value; @@ -116,31 +149,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -152,6 +179,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -233,287 +261,254 @@ public static StatusEnum fromValue(String value) { @JsonProperty("InvoiceAddresses") private List invoiceAddresses = new ArrayList(); /** - * See Credit Note Types - * - * @param type TypeEnum - * @return CreditNote - */ + * See Credit Note Types + * @param type TypeEnum + * @return CreditNote + **/ public CreditNote type(TypeEnum type) { this.type = type; return this; } - /** + /** * See Credit Note Types - * * @return type - */ + **/ @ApiModelProperty(value = "See Credit Note Types") - /** + /** * See Credit Note Types - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * See Credit Note Types - * - * @param type TypeEnum - */ + /** + * See Credit Note Types + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * contact - * - * @param contact Contact - * @return CreditNote - */ + * contact + * @param contact Contact + * @return CreditNote + **/ public CreditNote contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it - * will default to the current date based on the timezone setting of the organisation - * - * @param date String - * @return CreditNote - */ + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * @param date String + * @return CreditNote + **/ public CreditNote date(String date) { this.date = date; return this; } - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it - * will default to the current date based on the timezone setting of the organisation - * + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation * @return date - */ - @ApiModelProperty( - value = - "The date the credit note is issued YYYY-MM-DD. If the Date element is not specified" - + " then it will default to the current date based on the timezone setting of the" - + " organisation") - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it - * will default to the current date based on the timezone setting of the organisation - * + **/ + @ApiModelProperty(value = "The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation") + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation * @return date String - */ + **/ public String getDate() { return date; } - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it - * will default to the current date based on the timezone setting of the organisation - * + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it - * will default to the current date based on the timezone setting of the organisation - * - * @param date String - */ + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it - * will default to the current date based on the timezone setting of the organisation - * - * @param date LocalDateTime - */ + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Date invoice is due – YYYY-MM-DD - * - * @param dueDate String - * @return CreditNote - */ + * Date invoice is due – YYYY-MM-DD + * @param dueDate String + * @return CreditNote + **/ public CreditNote dueDate(String dueDate) { this.dueDate = dueDate; return this; } - /** + /** * Date invoice is due – YYYY-MM-DD - * * @return dueDate - */ + **/ @ApiModelProperty(value = "Date invoice is due – YYYY-MM-DD") - /** + /** * Date invoice is due – YYYY-MM-DD - * * @return dueDate String - */ + **/ public String getDueDate() { return dueDate; } - /** + /** * Date invoice is due – YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDueDateAsDate() { if (this.dueDate != null) { try { return util.convertStringToDate(this.dueDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date invoice is due – YYYY-MM-DD - * - * @param dueDate String - */ + /** + * Date invoice is due – YYYY-MM-DD + * @param dueDate String + **/ + public void setDueDate(String dueDate) { this.dueDate = dueDate; } - /** - * Date invoice is due – YYYY-MM-DD - * - * @param dueDate LocalDateTime - */ + /** + * Date invoice is due – YYYY-MM-DD + * @param dueDate LocalDateTime + **/ public void setDueDate(LocalDate dueDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = dueDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = dueDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.dueDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * See Credit Note Status Codes - * - * @param status StatusEnum - * @return CreditNote - */ + * See Credit Note Status Codes + * @param status StatusEnum + * @return CreditNote + **/ public CreditNote status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Credit Note Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Credit Note Status Codes") - /** + /** * See Credit Note Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Credit Note Status Codes - * - * @param status StatusEnum - */ + /** + * See Credit Note Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return CreditNote - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return CreditNote + **/ public CreditNote lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * See Invoice Line Items - * - * @param lineItems List<LineItem> - * @return CreditNote - */ + * See Invoice Line Items + * @param lineItems List<LineItem> + * @return CreditNote + **/ public CreditNote lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -521,10 +516,9 @@ public CreditNote lineItems(List lineItems) { /** * See Invoice Line Items - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return CreditNote - */ + **/ public CreditNote addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -533,510 +527,445 @@ public CreditNote addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * See Invoice Line Items - * * @return lineItems - */ + **/ @ApiModelProperty(value = "See Invoice Line Items") - /** + /** * See Invoice Line Items - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See Invoice Line Items - * - * @param lineItems List<LineItem> - */ + /** + * See Invoice Line Items + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * The subtotal of the credit note excluding taxes - * - * @param subTotal Double - * @return CreditNote - */ + * The subtotal of the credit note excluding taxes + * @param subTotal Double + * @return CreditNote + **/ public CreditNote subTotal(Double subTotal) { this.subTotal = subTotal; return this; } - /** + /** * The subtotal of the credit note excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "The subtotal of the credit note excluding taxes") - /** + /** * The subtotal of the credit note excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** - * The subtotal of the credit note excluding taxes - * - * @param subTotal Double - */ + /** + * The subtotal of the credit note excluding taxes + * @param subTotal Double + **/ + public void setSubTotal(Double subTotal) { this.subTotal = subTotal; } /** - * The total tax on the credit note - * - * @param totalTax Double - * @return CreditNote - */ + * The total tax on the credit note + * @param totalTax Double + * @return CreditNote + **/ public CreditNote totalTax(Double totalTax) { this.totalTax = totalTax; return this; } - /** + /** * The total tax on the credit note - * * @return totalTax - */ + **/ @ApiModelProperty(value = "The total tax on the credit note") - /** + /** * The total tax on the credit note - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * The total tax on the credit note - * - * @param totalTax Double - */ + /** + * The total tax on the credit note + * @param totalTax Double + **/ + public void setTotalTax(Double totalTax) { this.totalTax = totalTax; } /** - * The total of the Credit Note(subtotal + total tax) - * - * @param total Double - * @return CreditNote - */ + * The total of the Credit Note(subtotal + total tax) + * @param total Double + * @return CreditNote + **/ public CreditNote total(Double total) { this.total = total; return this; } - /** + /** * The total of the Credit Note(subtotal + total tax) - * * @return total - */ + **/ @ApiModelProperty(value = "The total of the Credit Note(subtotal + total tax)") - /** + /** * The total of the Credit Note(subtotal + total tax) - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * The total of the Credit Note(subtotal + total tax) - * - * @param total Double - */ + /** + * The total of the Credit Note(subtotal + total tax) + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } - /** + /** * CIS deduction for UK contractors - * * @return ciSDeduction - */ + **/ @ApiModelProperty(value = "CIS deduction for UK contractors") - /** + /** * CIS deduction for UK contractors - * * @return ciSDeduction Double - */ + **/ public Double getCiSDeduction() { return ciSDeduction; } - /** + /** * CIS Deduction rate for the organisation - * * @return ciSRate - */ + **/ @ApiModelProperty(value = "CIS Deduction rate for the organisation") - /** + /** * CIS Deduction rate for the organisation - * * @return ciSRate Double - */ + **/ public Double getCiSRate() { return ciSRate; } - /** + /** * UTC timestamp of last update to the credit note - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of last update to the credit note") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of last update to the credit note") + /** * UTC timestamp of last update to the credit note - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * UTC timestamp of last update to the credit note - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return CreditNote - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return CreditNote + **/ public CreditNote currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * Date when credit note was fully paid(UTC format) - * - * @param fullyPaidOnDate String - * @return CreditNote - */ + * Date when credit note was fully paid(UTC format) + * @param fullyPaidOnDate String + * @return CreditNote + **/ public CreditNote fullyPaidOnDate(String fullyPaidOnDate) { this.fullyPaidOnDate = fullyPaidOnDate; return this; } - /** + /** * Date when credit note was fully paid(UTC format) - * * @return fullyPaidOnDate - */ + **/ @ApiModelProperty(value = "Date when credit note was fully paid(UTC format)") - /** + /** * Date when credit note was fully paid(UTC format) - * * @return fullyPaidOnDate String - */ + **/ public String getFullyPaidOnDate() { return fullyPaidOnDate; } - /** + /** * Date when credit note was fully paid(UTC format) - * * @return LocalDate - */ + **/ public LocalDate getFullyPaidOnDateAsDate() { if (this.fullyPaidOnDate != null) { try { return util.convertStringToDate(this.fullyPaidOnDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date when credit note was fully paid(UTC format) - * - * @param fullyPaidOnDate String - */ + /** + * Date when credit note was fully paid(UTC format) + * @param fullyPaidOnDate String + **/ + public void setFullyPaidOnDate(String fullyPaidOnDate) { this.fullyPaidOnDate = fullyPaidOnDate; } - /** - * Date when credit note was fully paid(UTC format) - * - * @param fullyPaidOnDate LocalDateTime - */ + /** + * Date when credit note was fully paid(UTC format) + * @param fullyPaidOnDate LocalDateTime + **/ public void setFullyPaidOnDate(LocalDate fullyPaidOnDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = fullyPaidOnDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = fullyPaidOnDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.fullyPaidOnDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Xero generated unique identifier - * - * @param creditNoteID UUID - * @return CreditNote - */ + * Xero generated unique identifier + * @param creditNoteID UUID + * @return CreditNote + **/ public CreditNote creditNoteID(UUID creditNoteID) { this.creditNoteID = creditNoteID; return this; } - /** + /** * Xero generated unique identifier - * * @return creditNoteID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier") - /** + /** * Xero generated unique identifier - * * @return creditNoteID UUID - */ + **/ public UUID getCreditNoteID() { return creditNoteID; } - /** - * Xero generated unique identifier - * - * @param creditNoteID UUID - */ + /** + * Xero generated unique identifier + * @param creditNoteID UUID + **/ + public void setCreditNoteID(UUID creditNoteID) { this.creditNoteID = creditNoteID; } /** - * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will - * auto-generate from your Organisation Invoice Settings) - * - * @param creditNoteNumber String - * @return CreditNote - */ + * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) + * @param creditNoteNumber String + * @return CreditNote + **/ public CreditNote creditNoteNumber(String creditNoteNumber) { this.creditNoteNumber = creditNoteNumber; return this; } - /** - * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will - * auto-generate from your Organisation Invoice Settings) - * + /** + * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) * @return creditNoteNumber - */ - @ApiModelProperty( - value = - "ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will" - + " auto-generate from your Organisation Invoice Settings)") - /** - * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will - * auto-generate from your Organisation Invoice Settings) - * + **/ + @ApiModelProperty(value = "ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings)") + /** + * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) * @return creditNoteNumber String - */ + **/ public String getCreditNoteNumber() { return creditNoteNumber; } - /** - * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will - * auto-generate from your Organisation Invoice Settings) - * - * @param creditNoteNumber String - */ + /** + * ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) + * @param creditNoteNumber String + **/ + public void setCreditNoteNumber(String creditNoteNumber) { this.creditNoteNumber = creditNoteNumber; } /** - * ACCRECCREDIT only – additional reference number - * - * @param reference String - * @return CreditNote - */ + * ACCRECCREDIT only – additional reference number + * @param reference String + * @return CreditNote + **/ public CreditNote reference(String reference) { this.reference = reference; return this; } - /** + /** * ACCRECCREDIT only – additional reference number - * * @return reference - */ + **/ @ApiModelProperty(value = "ACCRECCREDIT only – additional reference number") - /** + /** * ACCRECCREDIT only – additional reference number - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * ACCRECCREDIT only – additional reference number - * - * @param reference String - */ + /** + * ACCRECCREDIT only – additional reference number + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } - /** - * Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be - * set only on credit notes that have been approved - * + /** + * Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be set only on credit notes that have been approved * @return sentToContact - */ - @ApiModelProperty( - value = - "Boolean to set whether the credit note in the Xero app should be marked as “sent”. This" - + " can be set only on credit notes that have been approved") - /** - * Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be - * set only on credit notes that have been approved - * + **/ + @ApiModelProperty(value = "Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be set only on credit notes that have been approved") + /** + * Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be set only on credit notes that have been approved * @return sentToContact Boolean - */ + **/ public Boolean getSentToContact() { return sentToContact; } /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used - * - * @param currencyRate Double - * @return CreditNote - */ + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used + * @param currencyRate Double + * @return CreditNote + **/ public CreditNote currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used - * + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used * @return currencyRate - */ - @ApiModelProperty( - value = - "The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day" - + " rate is used") - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used - * + **/ + @ApiModelProperty(value = "The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used") + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used - * - * @param currencyRate Double - */ + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } /** - * The remaining credit balance on the Credit Note - * - * @param remainingCredit Double - * @return CreditNote - */ + * The remaining credit balance on the Credit Note + * @param remainingCredit Double + * @return CreditNote + **/ public CreditNote remainingCredit(Double remainingCredit) { this.remainingCredit = remainingCredit; return this; } - /** + /** * The remaining credit balance on the Credit Note - * * @return remainingCredit - */ + **/ @ApiModelProperty(value = "The remaining credit balance on the Credit Note") - /** + /** * The remaining credit balance on the Credit Note - * * @return remainingCredit Double - */ + **/ public Double getRemainingCredit() { return remainingCredit; } - /** - * The remaining credit balance on the Credit Note - * - * @param remainingCredit Double - */ + /** + * The remaining credit balance on the Credit Note + * @param remainingCredit Double + **/ + public void setRemainingCredit(Double remainingCredit) { this.remainingCredit = remainingCredit; } /** - * See Allocations - * - * @param allocations List<Allocation> - * @return CreditNote - */ + * See Allocations + * @param allocations List<Allocation> + * @return CreditNote + **/ public CreditNote allocations(List allocations) { this.allocations = allocations; return this; @@ -1044,10 +973,9 @@ public CreditNote allocations(List allocations) { /** * See Allocations - * - * @param allocationsItem Allocation + * @param allocationsItem Allocation * @return CreditNote - */ + **/ public CreditNote addAllocationsItem(Allocation allocationsItem) { if (this.allocations == null) { this.allocations = new ArrayList(); @@ -1056,71 +984,65 @@ public CreditNote addAllocationsItem(Allocation allocationsItem) { return this; } - /** + /** * See Allocations - * * @return allocations - */ + **/ @ApiModelProperty(value = "See Allocations") - /** + /** * See Allocations - * * @return allocations List - */ + **/ public List getAllocations() { return allocations; } - /** - * See Allocations - * - * @param allocations List<Allocation> - */ + /** + * See Allocations + * @param allocations List<Allocation> + **/ + public void setAllocations(List allocations) { this.allocations = allocations; } /** - * The amount of applied to an invoice - * - * @param appliedAmount Double - * @return CreditNote - */ + * The amount of applied to an invoice + * @param appliedAmount Double + * @return CreditNote + **/ public CreditNote appliedAmount(Double appliedAmount) { this.appliedAmount = appliedAmount; return this; } - /** + /** * The amount of applied to an invoice - * * @return appliedAmount - */ + **/ @ApiModelProperty(example = "2.0", value = "The amount of applied to an invoice") - /** + /** * The amount of applied to an invoice - * * @return appliedAmount Double - */ + **/ public Double getAppliedAmount() { return appliedAmount; } - /** - * The amount of applied to an invoice - * - * @param appliedAmount Double - */ + /** + * The amount of applied to an invoice + * @param appliedAmount Double + **/ + public void setAppliedAmount(Double appliedAmount) { this.appliedAmount = appliedAmount; } /** - * See Payments - * - * @param payments List<Payment> - * @return CreditNote - */ + * See Payments + * @param payments List<Payment> + * @return CreditNote + **/ public CreditNote payments(List payments) { this.payments = payments; return this; @@ -1128,10 +1050,9 @@ public CreditNote payments(List payments) { /** * See Payments - * - * @param paymentsItem Payment + * @param paymentsItem Payment * @return CreditNote - */ + **/ public CreditNote addPaymentsItem(Payment paymentsItem) { if (this.payments == null) { this.payments = new ArrayList(); @@ -1140,180 +1061,161 @@ public CreditNote addPaymentsItem(Payment paymentsItem) { return this; } - /** + /** * See Payments - * * @return payments - */ + **/ @ApiModelProperty(value = "See Payments") - /** + /** * See Payments - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** - * See Payments - * - * @param payments List<Payment> - */ + /** + * See Payments + * @param payments List<Payment> + **/ + public void setPayments(List payments) { this.payments = payments; } /** - * See BrandingThemes - * - * @param brandingThemeID UUID - * @return CreditNote - */ + * See BrandingThemes + * @param brandingThemeID UUID + * @return CreditNote + **/ public CreditNote brandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; return this; } - /** + /** * See BrandingThemes - * * @return brandingThemeID - */ + **/ @ApiModelProperty(value = "See BrandingThemes") - /** + /** * See BrandingThemes - * * @return brandingThemeID UUID - */ + **/ public UUID getBrandingThemeID() { return brandingThemeID; } - /** - * See BrandingThemes - * - * @param brandingThemeID UUID - */ + /** + * See BrandingThemes + * @param brandingThemeID UUID + **/ + public void setBrandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return CreditNote - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return CreditNote + **/ public CreditNote statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * boolean to indicate if a credit note has an attachment - * - * @param hasAttachments Boolean - * @return CreditNote - */ + * boolean to indicate if a credit note has an attachment + * @param hasAttachments Boolean + * @return CreditNote + **/ public CreditNote hasAttachments(Boolean hasAttachments) { this.hasAttachments = hasAttachments; return this; } - /** + /** * boolean to indicate if a credit note has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "boolean to indicate if a credit note has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "boolean to indicate if a credit note has an attachment") + /** * boolean to indicate if a credit note has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** - * boolean to indicate if a credit note has an attachment - * - * @param hasAttachments Boolean - */ + /** + * boolean to indicate if a credit note has an attachment + * @param hasAttachments Boolean + **/ + public void setHasAttachments(Boolean hasAttachments) { this.hasAttachments = hasAttachments; } /** - * A boolean to indicate if a credit note has an validation errors - * - * @param hasErrors Boolean - * @return CreditNote - */ + * A boolean to indicate if a credit note has an validation errors + * @param hasErrors Boolean + * @return CreditNote + **/ public CreditNote hasErrors(Boolean hasErrors) { this.hasErrors = hasErrors; return this; } - /** + /** * A boolean to indicate if a credit note has an validation errors - * * @return hasErrors - */ - @ApiModelProperty( - example = "false", - value = "A boolean to indicate if a credit note has an validation errors") - /** + **/ + @ApiModelProperty(example = "false", value = "A boolean to indicate if a credit note has an validation errors") + /** * A boolean to indicate if a credit note has an validation errors - * * @return hasErrors Boolean - */ + **/ public Boolean getHasErrors() { return hasErrors; } - /** - * A boolean to indicate if a credit note has an validation errors - * - * @param hasErrors Boolean - */ + /** + * A boolean to indicate if a credit note has an validation errors + * @param hasErrors Boolean + **/ + public void setHasErrors(Boolean hasErrors) { this.hasErrors = hasErrors; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return CreditNote - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return CreditNote + **/ public CreditNote validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -1321,10 +1223,9 @@ public CreditNote validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return CreditNote - */ + **/ public CreditNote addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -1333,36 +1234,33 @@ public CreditNote addValidationErrorsItem(ValidationError validationErrorsItem) return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return CreditNote - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return CreditNote + **/ public CreditNote warnings(List warnings) { this.warnings = warnings; return this; @@ -1370,10 +1268,9 @@ public CreditNote warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return CreditNote - */ + **/ public CreditNote addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -1382,36 +1279,33 @@ public CreditNote addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * An array of addresses used to auto calculate sales tax - * - * @param invoiceAddresses List<InvoiceAddress> - * @return CreditNote - */ + * An array of addresses used to auto calculate sales tax + * @param invoiceAddresses List<InvoiceAddress> + * @return CreditNote + **/ public CreditNote invoiceAddresses(List invoiceAddresses) { this.invoiceAddresses = invoiceAddresses; return this; @@ -1419,10 +1313,9 @@ public CreditNote invoiceAddresses(List invoiceAddresses) { /** * An array of addresses used to auto calculate sales tax - * - * @param invoiceAddressesItem InvoiceAddress + * @param invoiceAddressesItem InvoiceAddress * @return CreditNote - */ + **/ public CreditNote addInvoiceAddressesItem(InvoiceAddress invoiceAddressesItem) { if (this.invoiceAddresses == null) { this.invoiceAddresses = new ArrayList(); @@ -1431,30 +1324,29 @@ public CreditNote addInvoiceAddressesItem(InvoiceAddress invoiceAddressesItem) { return this; } - /** + /** * An array of addresses used to auto calculate sales tax - * * @return invoiceAddresses - */ + **/ @ApiModelProperty(value = "An array of addresses used to auto calculate sales tax") - /** + /** * An array of addresses used to auto calculate sales tax - * * @return invoiceAddresses List - */ + **/ public List getInvoiceAddresses() { return invoiceAddresses; } - /** - * An array of addresses used to auto calculate sales tax - * - * @param invoiceAddresses List<InvoiceAddress> - */ + /** + * An array of addresses used to auto calculate sales tax + * @param invoiceAddresses List<InvoiceAddress> + **/ + public void setInvoiceAddresses(List invoiceAddresses) { this.invoiceAddresses = invoiceAddresses; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1464,75 +1356,45 @@ public boolean equals(java.lang.Object o) { return false; } CreditNote creditNote = (CreditNote) o; - return Objects.equals(this.type, creditNote.type) - && Objects.equals(this.contact, creditNote.contact) - && Objects.equals(this.date, creditNote.date) - && Objects.equals(this.dueDate, creditNote.dueDate) - && Objects.equals(this.status, creditNote.status) - && Objects.equals(this.lineAmountTypes, creditNote.lineAmountTypes) - && Objects.equals(this.lineItems, creditNote.lineItems) - && Objects.equals(this.subTotal, creditNote.subTotal) - && Objects.equals(this.totalTax, creditNote.totalTax) - && Objects.equals(this.total, creditNote.total) - && Objects.equals(this.ciSDeduction, creditNote.ciSDeduction) - && Objects.equals(this.ciSRate, creditNote.ciSRate) - && Objects.equals(this.updatedDateUTC, creditNote.updatedDateUTC) - && Objects.equals(this.currencyCode, creditNote.currencyCode) - && Objects.equals(this.fullyPaidOnDate, creditNote.fullyPaidOnDate) - && Objects.equals(this.creditNoteID, creditNote.creditNoteID) - && Objects.equals(this.creditNoteNumber, creditNote.creditNoteNumber) - && Objects.equals(this.reference, creditNote.reference) - && Objects.equals(this.sentToContact, creditNote.sentToContact) - && Objects.equals(this.currencyRate, creditNote.currencyRate) - && Objects.equals(this.remainingCredit, creditNote.remainingCredit) - && Objects.equals(this.allocations, creditNote.allocations) - && Objects.equals(this.appliedAmount, creditNote.appliedAmount) - && Objects.equals(this.payments, creditNote.payments) - && Objects.equals(this.brandingThemeID, creditNote.brandingThemeID) - && Objects.equals(this.statusAttributeString, creditNote.statusAttributeString) - && Objects.equals(this.hasAttachments, creditNote.hasAttachments) - && Objects.equals(this.hasErrors, creditNote.hasErrors) - && Objects.equals(this.validationErrors, creditNote.validationErrors) - && Objects.equals(this.warnings, creditNote.warnings) - && Objects.equals(this.invoiceAddresses, creditNote.invoiceAddresses); + return Objects.equals(this.type, creditNote.type) && + Objects.equals(this.contact, creditNote.contact) && + Objects.equals(this.date, creditNote.date) && + Objects.equals(this.dueDate, creditNote.dueDate) && + Objects.equals(this.status, creditNote.status) && + Objects.equals(this.lineAmountTypes, creditNote.lineAmountTypes) && + Objects.equals(this.lineItems, creditNote.lineItems) && + Objects.equals(this.subTotal, creditNote.subTotal) && + Objects.equals(this.totalTax, creditNote.totalTax) && + Objects.equals(this.total, creditNote.total) && + Objects.equals(this.ciSDeduction, creditNote.ciSDeduction) && + Objects.equals(this.ciSRate, creditNote.ciSRate) && + Objects.equals(this.updatedDateUTC, creditNote.updatedDateUTC) && + Objects.equals(this.currencyCode, creditNote.currencyCode) && + Objects.equals(this.fullyPaidOnDate, creditNote.fullyPaidOnDate) && + Objects.equals(this.creditNoteID, creditNote.creditNoteID) && + Objects.equals(this.creditNoteNumber, creditNote.creditNoteNumber) && + Objects.equals(this.reference, creditNote.reference) && + Objects.equals(this.sentToContact, creditNote.sentToContact) && + Objects.equals(this.currencyRate, creditNote.currencyRate) && + Objects.equals(this.remainingCredit, creditNote.remainingCredit) && + Objects.equals(this.allocations, creditNote.allocations) && + Objects.equals(this.appliedAmount, creditNote.appliedAmount) && + Objects.equals(this.payments, creditNote.payments) && + Objects.equals(this.brandingThemeID, creditNote.brandingThemeID) && + Objects.equals(this.statusAttributeString, creditNote.statusAttributeString) && + Objects.equals(this.hasAttachments, creditNote.hasAttachments) && + Objects.equals(this.hasErrors, creditNote.hasErrors) && + Objects.equals(this.validationErrors, creditNote.validationErrors) && + Objects.equals(this.warnings, creditNote.warnings) && + Objects.equals(this.invoiceAddresses, creditNote.invoiceAddresses); } @Override public int hashCode() { - return Objects.hash( - type, - contact, - date, - dueDate, - status, - lineAmountTypes, - lineItems, - subTotal, - totalTax, - total, - ciSDeduction, - ciSRate, - updatedDateUTC, - currencyCode, - fullyPaidOnDate, - creditNoteID, - creditNoteNumber, - reference, - sentToContact, - currencyRate, - remainingCredit, - allocations, - appliedAmount, - payments, - brandingThemeID, - statusAttributeString, - hasAttachments, - hasErrors, - validationErrors, - warnings, - invoiceAddresses); + return Objects.hash(type, contact, date, dueDate, status, lineAmountTypes, lineItems, subTotal, totalTax, total, ciSDeduction, ciSRate, updatedDateUTC, currencyCode, fullyPaidOnDate, creditNoteID, creditNoteNumber, reference, sentToContact, currencyRate, remainingCredit, allocations, appliedAmount, payments, brandingThemeID, statusAttributeString, hasAttachments, hasErrors, validationErrors, warnings, invoiceAddresses); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1562,9 +1424,7 @@ public String toString() { sb.append(" appliedAmount: ").append(toIndentedString(appliedAmount)).append("\n"); sb.append(" payments: ").append(toIndentedString(payments)).append("\n"); sb.append(" brandingThemeID: ").append(toIndentedString(brandingThemeID)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" hasAttachments: ").append(toIndentedString(hasAttachments)).append("\n"); sb.append(" hasErrors: ").append(toIndentedString(hasErrors)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); @@ -1575,7 +1435,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1583,4 +1444,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/CreditNotes.java b/src/main/java/com/xero/models/accounting/CreditNotes.java index 16d1feb1a..4a0bacba2 100644 --- a/src/main/java/com/xero/models/accounting/CreditNotes.java +++ b/src/main/java/com/xero/models/accounting/CreditNotes.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.CreditNote; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CreditNotes + */ -/** CreditNotes */ public class CreditNotes { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class CreditNotes { @JsonProperty("CreditNotes") private List creditNotes = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return CreditNotes - */ + * pagination + * @param pagination Pagination + * @return CreditNotes + **/ public CreditNotes pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return CreditNotes - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return CreditNotes + **/ public CreditNotes warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public CreditNotes warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return CreditNotes - */ + **/ public CreditNotes addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public CreditNotes addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * creditNotes - * - * @param creditNotes List<CreditNote> - * @return CreditNotes - */ + * creditNotes + * @param creditNotes List<CreditNote> + * @return CreditNotes + **/ public CreditNotes creditNotes(List creditNotes) { this.creditNotes = creditNotes; return this; @@ -127,10 +139,9 @@ public CreditNotes creditNotes(List creditNotes) { /** * creditNotes - * - * @param creditNotesItem CreditNote + * @param creditNotesItem CreditNote * @return CreditNotes - */ + **/ public CreditNotes addCreditNotesItem(CreditNote creditNotesItem) { if (this.creditNotes == null) { this.creditNotes = new ArrayList(); @@ -139,30 +150,29 @@ public CreditNotes addCreditNotesItem(CreditNote creditNotesItem) { return this; } - /** + /** * Get creditNotes - * * @return creditNotes - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditNotes - * * @return creditNotes List - */ + **/ public List getCreditNotes() { return creditNotes; } - /** - * creditNotes - * - * @param creditNotes List<CreditNote> - */ + /** + * creditNotes + * @param creditNotes List<CreditNote> + **/ + public void setCreditNotes(List creditNotes) { this.creditNotes = creditNotes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } CreditNotes creditNotes = (CreditNotes) o; - return Objects.equals(this.pagination, creditNotes.pagination) - && Objects.equals(this.warnings, creditNotes.warnings) - && Objects.equals(this.creditNotes, creditNotes.creditNotes); + return Objects.equals(this.pagination, creditNotes.pagination) && + Objects.equals(this.warnings, creditNotes.warnings) && + Objects.equals(this.creditNotes, creditNotes.creditNotes); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, creditNotes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Currencies.java b/src/main/java/com/xero/models/accounting/Currencies.java index e530b1564..6e38aa22f 100644 --- a/src/main/java/com/xero/models/accounting/Currencies.java +++ b/src/main/java/com/xero/models/accounting/Currencies.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Currency; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Currencies + */ -/** Currencies */ public class Currencies { StringUtil util = new StringUtil(); @JsonProperty("Currencies") private List currencies = new ArrayList(); /** - * currencies - * - * @param currencies List<Currency> - * @return Currencies - */ + * currencies + * @param currencies List<Currency> + * @return Currencies + **/ public Currencies currencies(List currencies) { this.currencies = currencies; return this; @@ -37,10 +54,9 @@ public Currencies currencies(List currencies) { /** * currencies - * - * @param currenciesItem Currency + * @param currenciesItem Currency * @return Currencies - */ + **/ public Currencies addCurrenciesItem(Currency currenciesItem) { if (this.currencies == null) { this.currencies = new ArrayList(); @@ -49,30 +65,29 @@ public Currencies addCurrenciesItem(Currency currenciesItem) { return this; } - /** + /** * Get currencies - * * @return currencies - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencies - * * @return currencies List - */ + **/ public List getCurrencies() { return currencies; } - /** - * currencies - * - * @param currencies List<Currency> - */ + /** + * currencies + * @param currencies List<Currency> + **/ + public void setCurrencies(List currencies) { this.currencies = currencies; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(currencies); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Currency.java b/src/main/java/com/xero/models/accounting/Currency.java index c111889c7..c7419e5cc 100644 --- a/src/main/java/com/xero/models/accounting/Currency.java +++ b/src/main/java/com/xero/models/accounting/Currency.java @@ -9,14 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.CurrencyCode; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Currency + */ -/** Currency */ public class Currency { StringUtil util = new StringUtil(); @@ -26,75 +44,70 @@ public class Currency { @JsonProperty("Description") private String description; /** - * code - * - * @param code CurrencyCode - * @return Currency - */ + * code + * @param code CurrencyCode + * @return Currency + **/ public Currency code(CurrencyCode code) { this.code = code; return this; } - /** + /** * Get code - * * @return code - */ + **/ @ApiModelProperty(value = "") - /** + /** * code - * * @return code CurrencyCode - */ + **/ public CurrencyCode getCode() { return code; } - /** - * code - * - * @param code CurrencyCode - */ + /** + * code + * @param code CurrencyCode + **/ + public void setCode(CurrencyCode code) { this.code = code; } /** - * Name of Currency - * - * @param description String - * @return Currency - */ + * Name of Currency + * @param description String + * @return Currency + **/ public Currency description(String description) { this.description = description; return this; } - /** + /** * Name of Currency - * * @return description - */ + **/ @ApiModelProperty(value = "Name of Currency") - /** + /** * Name of Currency - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Name of Currency - * - * @param description String - */ + /** + * Name of Currency + * @param description String + **/ + public void setDescription(String description) { this.description = description; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } Currency currency = (Currency) o; - return Objects.equals(this.code, currency.code) - && Objects.equals(this.description, currency.description); + return Objects.equals(this.code, currency.code) && + Objects.equals(this.description, currency.description); } @Override @@ -113,6 +126,7 @@ public int hashCode() { return Objects.hash(code, description); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/CurrencyCode.java b/src/main/java/com/xero/models/accounting/CurrencyCode.java index 215ad71d9..4bc2c9326 100644 --- a/src/main/java/com/xero/models/accounting/CurrencyCode.java +++ b/src/main/java/com/xero/models/accounting/CurrencyCode.java @@ -9,517 +9,865 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; - +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** 3 letter alpha code for the currency – see list of currency codes */ +/** + * 3 letter alpha code for the currency – see list of currency codes + */ public enum CurrencyCode { - - /** AED */ + + /** + * AED + */ AED("AED"), - - /** AFN */ + + /** + * AFN + */ AFN("AFN"), - - /** ALL */ + + /** + * ALL + */ ALL("ALL"), - - /** AMD */ + + /** + * AMD + */ AMD("AMD"), - - /** ANG */ + + /** + * ANG + */ ANG("ANG"), - - /** AOA */ + + /** + * AOA + */ AOA("AOA"), - - /** ARS */ + + /** + * ARS + */ ARS("ARS"), - - /** AUD */ + + /** + * AUD + */ AUD("AUD"), - - /** AWG */ + + /** + * AWG + */ AWG("AWG"), - - /** AZN */ + + /** + * AZN + */ AZN("AZN"), - - /** BAM */ + + /** + * BAM + */ BAM("BAM"), - - /** BBD */ + + /** + * BBD + */ BBD("BBD"), - - /** BDT */ + + /** + * BDT + */ BDT("BDT"), - - /** BGN */ + + /** + * BGN + */ BGN("BGN"), - - /** BHD */ + + /** + * BHD + */ BHD("BHD"), - - /** BIF */ + + /** + * BIF + */ BIF("BIF"), - - /** BMD */ + + /** + * BMD + */ BMD("BMD"), - - /** BND */ + + /** + * BND + */ BND("BND"), - - /** BOB */ + + /** + * BOB + */ BOB("BOB"), - - /** BRL */ + + /** + * BRL + */ BRL("BRL"), - - /** BSD */ + + /** + * BSD + */ BSD("BSD"), - - /** BTN */ + + /** + * BTN + */ BTN("BTN"), - - /** BWP */ + + /** + * BWP + */ BWP("BWP"), - - /** BYN */ + + /** + * BYN + */ BYN("BYN"), - - /** BYR */ + + /** + * BYR + */ BYR("BYR"), - - /** BZD */ + + /** + * BZD + */ BZD("BZD"), - - /** CAD */ + + /** + * CAD + */ CAD("CAD"), - - /** CDF */ + + /** + * CDF + */ CDF("CDF"), - - /** CHF */ + + /** + * CHF + */ CHF("CHF"), - - /** CLF */ + + /** + * CLF + */ CLF("CLF"), - - /** CLP */ + + /** + * CLP + */ CLP("CLP"), - - /** CNY */ + + /** + * CNY + */ CNY("CNY"), - - /** COP */ + + /** + * COP + */ COP("COP"), - - /** CRC */ + + /** + * CRC + */ CRC("CRC"), - - /** CUC */ + + /** + * CUC + */ CUC("CUC"), - - /** CUP */ + + /** + * CUP + */ CUP("CUP"), - - /** CVE */ + + /** + * CVE + */ CVE("CVE"), - - /** CZK */ + + /** + * CZK + */ CZK("CZK"), - - /** DJF */ + + /** + * DJF + */ DJF("DJF"), - - /** DKK */ + + /** + * DKK + */ DKK("DKK"), - - /** DOP */ + + /** + * DOP + */ DOP("DOP"), - - /** DZD */ + + /** + * DZD + */ DZD("DZD"), - - /** EEK */ + + /** + * EEK + */ EEK("EEK"), - - /** EGP */ + + /** + * EGP + */ EGP("EGP"), - - /** ERN */ + + /** + * ERN + */ ERN("ERN"), - - /** ETB */ + + /** + * ETB + */ ETB("ETB"), - - /** EUR */ + + /** + * EUR + */ EUR("EUR"), - - /** FJD */ + + /** + * FJD + */ FJD("FJD"), - - /** FKP */ + + /** + * FKP + */ FKP("FKP"), - - /** GBP */ + + /** + * GBP + */ GBP("GBP"), - - /** GEL */ + + /** + * GEL + */ GEL("GEL"), - - /** GHS */ + + /** + * GHS + */ GHS("GHS"), - - /** GIP */ + + /** + * GIP + */ GIP("GIP"), - - /** GMD */ + + /** + * GMD + */ GMD("GMD"), - - /** GNF */ + + /** + * GNF + */ GNF("GNF"), - - /** GTQ */ + + /** + * GTQ + */ GTQ("GTQ"), - - /** GYD */ + + /** + * GYD + */ GYD("GYD"), - - /** HKD */ + + /** + * HKD + */ HKD("HKD"), - - /** HNL */ + + /** + * HNL + */ HNL("HNL"), - - /** HRK */ + + /** + * HRK + */ HRK("HRK"), - - /** HTG */ + + /** + * HTG + */ HTG("HTG"), - - /** HUF */ + + /** + * HUF + */ HUF("HUF"), - - /** IDR */ + + /** + * IDR + */ IDR("IDR"), - - /** ILS */ + + /** + * ILS + */ ILS("ILS"), - - /** INR */ + + /** + * INR + */ INR("INR"), - - /** IQD */ + + /** + * IQD + */ IQD("IQD"), - - /** IRR */ + + /** + * IRR + */ IRR("IRR"), - - /** ISK */ + + /** + * ISK + */ ISK("ISK"), - - /** JMD */ + + /** + * JMD + */ JMD("JMD"), - - /** JOD */ + + /** + * JOD + */ JOD("JOD"), - - /** JPY */ + + /** + * JPY + */ JPY("JPY"), - - /** KES */ + + /** + * KES + */ KES("KES"), - - /** KGS */ + + /** + * KGS + */ KGS("KGS"), - - /** KHR */ + + /** + * KHR + */ KHR("KHR"), - - /** KMF */ + + /** + * KMF + */ KMF("KMF"), - - /** KPW */ + + /** + * KPW + */ KPW("KPW"), - - /** KRW */ + + /** + * KRW + */ KRW("KRW"), - - /** KWD */ + + /** + * KWD + */ KWD("KWD"), - - /** KYD */ + + /** + * KYD + */ KYD("KYD"), - - /** KZT */ + + /** + * KZT + */ KZT("KZT"), - - /** LAK */ + + /** + * LAK + */ LAK("LAK"), - - /** LBP */ + + /** + * LBP + */ LBP("LBP"), - - /** LKR */ + + /** + * LKR + */ LKR("LKR"), - - /** LRD */ + + /** + * LRD + */ LRD("LRD"), - - /** LSL */ + + /** + * LSL + */ LSL("LSL"), - - /** LTL */ + + /** + * LTL + */ LTL("LTL"), - - /** LVL */ + + /** + * LVL + */ LVL("LVL"), - - /** LYD */ + + /** + * LYD + */ LYD("LYD"), - - /** MAD */ + + /** + * MAD + */ MAD("MAD"), - - /** MDL */ + + /** + * MDL + */ MDL("MDL"), - - /** MGA */ + + /** + * MGA + */ MGA("MGA"), - - /** MKD */ + + /** + * MKD + */ MKD("MKD"), - - /** MMK */ + + /** + * MMK + */ MMK("MMK"), - - /** MNT */ + + /** + * MNT + */ MNT("MNT"), - - /** MOP */ + + /** + * MOP + */ MOP("MOP"), - - /** MRO */ + + /** + * MRO + */ MRO("MRO"), - - /** MRU */ + + /** + * MRU + */ MRU("MRU"), - - /** MUR */ + + /** + * MUR + */ MUR("MUR"), - - /** MVR */ + + /** + * MVR + */ MVR("MVR"), - - /** MWK */ + + /** + * MWK + */ MWK("MWK"), - - /** MXN */ + + /** + * MXN + */ MXN("MXN"), - - /** MXV */ + + /** + * MXV + */ MXV("MXV"), - - /** MYR */ + + /** + * MYR + */ MYR("MYR"), - - /** MZN */ + + /** + * MZN + */ MZN("MZN"), - - /** NAD */ + + /** + * NAD + */ NAD("NAD"), - - /** NGN */ + + /** + * NGN + */ NGN("NGN"), - - /** NIO */ + + /** + * NIO + */ NIO("NIO"), - - /** NOK */ + + /** + * NOK + */ NOK("NOK"), - - /** NPR */ + + /** + * NPR + */ NPR("NPR"), - - /** NZD */ + + /** + * NZD + */ NZD("NZD"), - - /** OMR */ + + /** + * OMR + */ OMR("OMR"), - - /** PAB */ + + /** + * PAB + */ PAB("PAB"), - - /** PEN */ + + /** + * PEN + */ PEN("PEN"), - - /** PGK */ + + /** + * PGK + */ PGK("PGK"), - - /** PHP */ + + /** + * PHP + */ PHP("PHP"), - - /** PKR */ + + /** + * PKR + */ PKR("PKR"), - - /** PLN */ + + /** + * PLN + */ PLN("PLN"), - - /** PYG */ + + /** + * PYG + */ PYG("PYG"), - - /** QAR */ + + /** + * QAR + */ QAR("QAR"), - - /** RON */ + + /** + * RON + */ RON("RON"), - - /** RSD */ + + /** + * RSD + */ RSD("RSD"), - - /** RUB */ + + /** + * RUB + */ RUB("RUB"), - - /** RWF */ + + /** + * RWF + */ RWF("RWF"), - - /** SAR */ + + /** + * SAR + */ SAR("SAR"), - - /** SBD */ + + /** + * SBD + */ SBD("SBD"), - - /** SCR */ + + /** + * SCR + */ SCR("SCR"), - - /** SDG */ + + /** + * SDG + */ SDG("SDG"), - - /** SEK */ + + /** + * SEK + */ SEK("SEK"), - - /** SGD */ + + /** + * SGD + */ SGD("SGD"), - - /** SHP */ + + /** + * SHP + */ SHP("SHP"), - - /** SKK */ + + /** + * SKK + */ SKK("SKK"), - - /** SLE */ + + /** + * SLE + */ SLE("SLE"), - - /** SLL */ + + /** + * SLL + */ SLL("SLL"), - - /** SOS */ + + /** + * SOS + */ SOS("SOS"), - - /** SRD */ + + /** + * SRD + */ SRD("SRD"), - - /** STN */ + + /** + * STN + */ STN("STD"), - - /** STD */ + + /** + * STD + */ STD("STN"), - - /** SVC */ + + /** + * SVC + */ SVC("SVC"), - - /** SYP */ + + /** + * SYP + */ SYP("SYP"), - - /** SZL */ + + /** + * SZL + */ SZL("SZL"), - - /** THB */ + + /** + * THB + */ THB("THB"), - - /** TJS */ + + /** + * TJS + */ TJS("TJS"), - - /** TMT */ + + /** + * TMT + */ TMT("TMT"), - - /** TND */ + + /** + * TND + */ TND("TND"), - - /** TOP */ + + /** + * TOP + */ TOP("TOP"), - - /** TRY_LIRA */ + + /** + * TRY_LIRA + */ TRY_LIRA("TRY"), - - /** TTD */ + + /** + * TTD + */ TTD("TTD"), - - /** TWD */ + + /** + * TWD + */ TWD("TWD"), - - /** TZS */ + + /** + * TZS + */ TZS("TZS"), - - /** UAH */ + + /** + * UAH + */ UAH("UAH"), - - /** UGX */ + + /** + * UGX + */ UGX("UGX"), - - /** USD */ + + /** + * USD + */ USD("USD"), - - /** UYU */ + + /** + * UYU + */ UYU("UYU"), - - /** UZS */ + + /** + * UZS + */ UZS("UZS"), - - /** VEF */ + + /** + * VEF + */ VEF("VEF"), - - /** VES */ + + /** + * VES + */ VES("VES"), - - /** VND */ + + /** + * VND + */ VND("VND"), - - /** VUV */ + + /** + * VUV + */ VUV("VUV"), - - /** WST */ + + /** + * WST + */ WST("WST"), - - /** XAF */ + + /** + * XAF + */ XAF("XAF"), - - /** XCD */ + + /** + * XCD + */ XCD("XCD"), - - /** XOF */ + + /** + * XOF + */ XOF("XOF"), - - /** XPF */ + + /** + * XPF + */ XPF("XPF"), - - /** YER */ + + /** + * YER + */ YER("YER"), - - /** ZAR */ + + /** + * ZAR + */ ZAR("ZAR"), - - /** ZMW */ + + /** + * ZMW + */ ZMW("ZMW"), - - /** ZMK */ + + /** + * ZMK + */ ZMK("ZMK"), - - /** ZWD */ + + /** + * ZWD + */ ZWD("ZWD"); private String value; @@ -528,26 +876,24 @@ public enum CurrencyCode { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CurrencyCode fromValue(String value) { @@ -559,3 +905,4 @@ public static CurrencyCode fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/Element.java b/src/main/java/com/xero/models/accounting/Element.java index 1d031333f..791229bd7 100644 --- a/src/main/java/com/xero/models/accounting/Element.java +++ b/src/main/java/com/xero/models/accounting/Element.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Element + */ -/** Element */ public class Element { StringUtil util = new StringUtil(); @@ -47,11 +65,10 @@ public class Element { @JsonProperty("PurchaseOrderID") private UUID purchaseOrderID; /** - * Array of Validation Error message - * - * @param validationErrors List<ValidationError> - * @return Element - */ + * Array of Validation Error message + * @param validationErrors List<ValidationError> + * @return Element + **/ public Element validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -59,10 +76,9 @@ public Element validationErrors(List validationErrors) { /** * Array of Validation Error message - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Element - */ + **/ public Element addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -71,275 +87,253 @@ public Element addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Array of Validation Error message - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Array of Validation Error message") - /** + /** * Array of Validation Error message - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Array of Validation Error message - * - * @param validationErrors List<ValidationError> - */ + /** + * Array of Validation Error message + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * Unique ID for batch payment object with validation error - * - * @param batchPaymentID UUID - * @return Element - */ + * Unique ID for batch payment object with validation error + * @param batchPaymentID UUID + * @return Element + **/ public Element batchPaymentID(UUID batchPaymentID) { this.batchPaymentID = batchPaymentID; return this; } - /** + /** * Unique ID for batch payment object with validation error - * * @return batchPaymentID - */ + **/ @ApiModelProperty(value = "Unique ID for batch payment object with validation error") - /** + /** * Unique ID for batch payment object with validation error - * * @return batchPaymentID UUID - */ + **/ public UUID getBatchPaymentID() { return batchPaymentID; } - /** - * Unique ID for batch payment object with validation error - * - * @param batchPaymentID UUID - */ + /** + * Unique ID for batch payment object with validation error + * @param batchPaymentID UUID + **/ + public void setBatchPaymentID(UUID batchPaymentID) { this.batchPaymentID = batchPaymentID; } /** - * bankTransactionID - * - * @param bankTransactionID UUID - * @return Element - */ + * bankTransactionID + * @param bankTransactionID UUID + * @return Element + **/ public Element bankTransactionID(UUID bankTransactionID) { this.bankTransactionID = bankTransactionID; return this; } - /** + /** * Get bankTransactionID - * * @return bankTransactionID - */ + **/ @ApiModelProperty(value = "") - /** + /** * bankTransactionID - * * @return bankTransactionID UUID - */ + **/ public UUID getBankTransactionID() { return bankTransactionID; } - /** - * bankTransactionID - * - * @param bankTransactionID UUID - */ + /** + * bankTransactionID + * @param bankTransactionID UUID + **/ + public void setBankTransactionID(UUID bankTransactionID) { this.bankTransactionID = bankTransactionID; } /** - * creditNoteID - * - * @param creditNoteID UUID - * @return Element - */ + * creditNoteID + * @param creditNoteID UUID + * @return Element + **/ public Element creditNoteID(UUID creditNoteID) { this.creditNoteID = creditNoteID; return this; } - /** + /** * Get creditNoteID - * * @return creditNoteID - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditNoteID - * * @return creditNoteID UUID - */ + **/ public UUID getCreditNoteID() { return creditNoteID; } - /** - * creditNoteID - * - * @param creditNoteID UUID - */ + /** + * creditNoteID + * @param creditNoteID UUID + **/ + public void setCreditNoteID(UUID creditNoteID) { this.creditNoteID = creditNoteID; } /** - * contactID - * - * @param contactID UUID - * @return Element - */ + * contactID + * @param contactID UUID + * @return Element + **/ public Element contactID(UUID contactID) { this.contactID = contactID; return this; } - /** + /** * Get contactID - * * @return contactID - */ + **/ @ApiModelProperty(value = "") - /** + /** * contactID - * * @return contactID UUID - */ + **/ public UUID getContactID() { return contactID; } - /** - * contactID - * - * @param contactID UUID - */ + /** + * contactID + * @param contactID UUID + **/ + public void setContactID(UUID contactID) { this.contactID = contactID; } /** - * invoiceID - * - * @param invoiceID UUID - * @return Element - */ + * invoiceID + * @param invoiceID UUID + * @return Element + **/ public Element invoiceID(UUID invoiceID) { this.invoiceID = invoiceID; return this; } - /** + /** * Get invoiceID - * * @return invoiceID - */ + **/ @ApiModelProperty(value = "") - /** + /** * invoiceID - * * @return invoiceID UUID - */ + **/ public UUID getInvoiceID() { return invoiceID; } - /** - * invoiceID - * - * @param invoiceID UUID - */ + /** + * invoiceID + * @param invoiceID UUID + **/ + public void setInvoiceID(UUID invoiceID) { this.invoiceID = invoiceID; } /** - * itemID - * - * @param itemID UUID - * @return Element - */ + * itemID + * @param itemID UUID + * @return Element + **/ public Element itemID(UUID itemID) { this.itemID = itemID; return this; } - /** + /** * Get itemID - * * @return itemID - */ + **/ @ApiModelProperty(value = "") - /** + /** * itemID - * * @return itemID UUID - */ + **/ public UUID getItemID() { return itemID; } - /** - * itemID - * - * @param itemID UUID - */ + /** + * itemID + * @param itemID UUID + **/ + public void setItemID(UUID itemID) { this.itemID = itemID; } /** - * purchaseOrderID - * - * @param purchaseOrderID UUID - * @return Element - */ + * purchaseOrderID + * @param purchaseOrderID UUID + * @return Element + **/ public Element purchaseOrderID(UUID purchaseOrderID) { this.purchaseOrderID = purchaseOrderID; return this; } - /** + /** * Get purchaseOrderID - * * @return purchaseOrderID - */ + **/ @ApiModelProperty(value = "") - /** + /** * purchaseOrderID - * * @return purchaseOrderID UUID - */ + **/ public UUID getPurchaseOrderID() { return purchaseOrderID; } - /** - * purchaseOrderID - * - * @param purchaseOrderID UUID - */ + /** + * purchaseOrderID + * @param purchaseOrderID UUID + **/ + public void setPurchaseOrderID(UUID purchaseOrderID) { this.purchaseOrderID = purchaseOrderID; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -349,29 +343,22 @@ public boolean equals(java.lang.Object o) { return false; } Element element = (Element) o; - return Objects.equals(this.validationErrors, element.validationErrors) - && Objects.equals(this.batchPaymentID, element.batchPaymentID) - && Objects.equals(this.bankTransactionID, element.bankTransactionID) - && Objects.equals(this.creditNoteID, element.creditNoteID) - && Objects.equals(this.contactID, element.contactID) - && Objects.equals(this.invoiceID, element.invoiceID) - && Objects.equals(this.itemID, element.itemID) - && Objects.equals(this.purchaseOrderID, element.purchaseOrderID); + return Objects.equals(this.validationErrors, element.validationErrors) && + Objects.equals(this.batchPaymentID, element.batchPaymentID) && + Objects.equals(this.bankTransactionID, element.bankTransactionID) && + Objects.equals(this.creditNoteID, element.creditNoteID) && + Objects.equals(this.contactID, element.contactID) && + Objects.equals(this.invoiceID, element.invoiceID) && + Objects.equals(this.itemID, element.itemID) && + Objects.equals(this.purchaseOrderID, element.purchaseOrderID); } @Override public int hashCode() { - return Objects.hash( - validationErrors, - batchPaymentID, - bankTransactionID, - creditNoteID, - contactID, - invoiceID, - itemID, - purchaseOrderID); + return Objects.hash(validationErrors, batchPaymentID, bankTransactionID, creditNoteID, contactID, invoiceID, itemID, purchaseOrderID); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -389,7 +376,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -397,4 +385,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Employee.java b/src/main/java/com/xero/models/accounting/Employee.java index a45e25105..2b90a9872 100644 --- a/src/main/java/com/xero/models/accounting/Employee.java +++ b/src/main/java/com/xero/models/accounting/Employee.java @@ -9,38 +9,63 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.ExternalLink; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employee + */ -/** Employee */ public class Employee { StringUtil util = new StringUtil(); @JsonProperty("EmployeeID") private UUID employeeID; - /** Current status of an employee – see contact status types */ + /** + * Current status of an employee – see contact status types + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** ARCHIVED */ + + /** + * ARCHIVED + */ ARCHIVED("ARCHIVED"), - - /** GDPRREQUEST */ + + /** + * GDPRREQUEST + */ GDPRREQUEST("GDPRREQUEST"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -49,31 +74,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -85,6 +104,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -106,252 +126,229 @@ public static StatusEnum fromValue(String value) { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param employeeID UUID - * @return Employee - */ + * The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param employeeID UUID + * @return Employee + **/ public Employee employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return employeeID - */ - @ApiModelProperty( - value = "The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") - /** + **/ + @ApiModelProperty(value = "The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") + /** * The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param employeeID UUID - */ + /** + * The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * Current status of an employee – see contact status types - * - * @param status StatusEnum - * @return Employee - */ + * Current status of an employee – see contact status types + * @param status StatusEnum + * @return Employee + **/ public Employee status(StatusEnum status) { this.status = status; return this; } - /** + /** * Current status of an employee – see contact status types - * * @return status - */ + **/ @ApiModelProperty(value = "Current status of an employee – see contact status types") - /** + /** * Current status of an employee – see contact status types - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Current status of an employee – see contact status types - * - * @param status StatusEnum - */ + /** + * Current status of an employee – see contact status types + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * First name of an employee (max length = 255) - * - * @param firstName String - * @return Employee - */ + * First name of an employee (max length = 255) + * @param firstName String + * @return Employee + **/ public Employee firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of an employee (max length = 255) - * * @return firstName - */ + **/ @ApiModelProperty(value = "First name of an employee (max length = 255)") - /** + /** * First name of an employee (max length = 255) - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of an employee (max length = 255) - * - * @param firstName String - */ + /** + * First name of an employee (max length = 255) + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of an employee (max length = 255) - * - * @param lastName String - * @return Employee - */ + * Last name of an employee (max length = 255) + * @param lastName String + * @return Employee + **/ public Employee lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of an employee (max length = 255) - * * @return lastName - */ + **/ @ApiModelProperty(value = "Last name of an employee (max length = 255)") - /** + /** * Last name of an employee (max length = 255) - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of an employee (max length = 255) - * - * @param lastName String - */ + /** + * Last name of an employee (max length = 255) + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * externalLink - * - * @param externalLink ExternalLink - * @return Employee - */ + * externalLink + * @param externalLink ExternalLink + * @return Employee + **/ public Employee externalLink(ExternalLink externalLink) { this.externalLink = externalLink; return this; } - /** + /** * Get externalLink - * * @return externalLink - */ + **/ @ApiModelProperty(value = "") - /** + /** * externalLink - * * @return externalLink ExternalLink - */ + **/ public ExternalLink getExternalLink() { return externalLink; } - /** - * externalLink - * - * @param externalLink ExternalLink - */ + /** + * externalLink + * @param externalLink ExternalLink + **/ + public void setExternalLink(ExternalLink externalLink) { this.externalLink = externalLink; } - /** + /** * Get updatedDateUTC - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "") - /** + /** * updatedDateUTC - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * updatedDateUTC - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return Employee - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return Employee + **/ public Employee statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(example = "ERROR", value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Employee - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Employee + **/ public Employee validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -359,10 +356,9 @@ public Employee validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Employee - */ + **/ public Employee addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -371,30 +367,29 @@ public Employee addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -404,29 +399,22 @@ public boolean equals(java.lang.Object o) { return false; } Employee employee = (Employee) o; - return Objects.equals(this.employeeID, employee.employeeID) - && Objects.equals(this.status, employee.status) - && Objects.equals(this.firstName, employee.firstName) - && Objects.equals(this.lastName, employee.lastName) - && Objects.equals(this.externalLink, employee.externalLink) - && Objects.equals(this.updatedDateUTC, employee.updatedDateUTC) - && Objects.equals(this.statusAttributeString, employee.statusAttributeString) - && Objects.equals(this.validationErrors, employee.validationErrors); + return Objects.equals(this.employeeID, employee.employeeID) && + Objects.equals(this.status, employee.status) && + Objects.equals(this.firstName, employee.firstName) && + Objects.equals(this.lastName, employee.lastName) && + Objects.equals(this.externalLink, employee.externalLink) && + Objects.equals(this.updatedDateUTC, employee.updatedDateUTC) && + Objects.equals(this.statusAttributeString, employee.statusAttributeString) && + Objects.equals(this.validationErrors, employee.validationErrors); } @Override public int hashCode() { - return Objects.hash( - employeeID, - status, - firstName, - lastName, - externalLink, - updatedDateUTC, - statusAttributeString, - validationErrors); + return Objects.hash(employeeID, status, firstName, lastName, externalLink, updatedDateUTC, statusAttributeString, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -437,16 +425,15 @@ public String toString() { sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); sb.append(" externalLink: ").append(toIndentedString(externalLink)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -454,4 +441,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Employees.java b/src/main/java/com/xero/models/accounting/Employees.java index 978917797..aa7a48bde 100644 --- a/src/main/java/com/xero/models/accounting/Employees.java +++ b/src/main/java/com/xero/models/accounting/Employees.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Employee; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employees + */ -/** Employees */ public class Employees { StringUtil util = new StringUtil(); @JsonProperty("Employees") private List employees = new ArrayList(); /** - * employees - * - * @param employees List<Employee> - * @return Employees - */ + * employees + * @param employees List<Employee> + * @return Employees + **/ public Employees employees(List employees) { this.employees = employees; return this; @@ -37,10 +54,9 @@ public Employees employees(List employees) { /** * employees - * - * @param employeesItem Employee + * @param employeesItem Employee * @return Employees - */ + **/ public Employees addEmployeesItem(Employee employeesItem) { if (this.employees == null) { this.employees = new ArrayList(); @@ -49,30 +65,29 @@ public Employees addEmployeesItem(Employee employeesItem) { return this; } - /** + /** * Get employees - * * @return employees - */ + **/ @ApiModelProperty(value = "") - /** + /** * employees - * * @return employees List - */ + **/ public List getEmployees() { return employees; } - /** - * employees - * - * @param employees List<Employee> - */ + /** + * employees + * @param employees List<Employee> + **/ + public void setEmployees(List employees) { this.employees = employees; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(employees); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Error.java b/src/main/java/com/xero/models/accounting/Error.java index 756d582d0..12b66f343 100644 --- a/src/main/java/com/xero/models/accounting/Error.java +++ b/src/main/java/com/xero/models/accounting/Error.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Element; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Error + */ -/** Error */ public class Error { StringUtil util = new StringUtil(); @@ -34,116 +52,106 @@ public class Error { @JsonProperty("Elements") private List elements = new ArrayList(); /** - * Exception number - * - * @param errorNumber Integer - * @return Error - */ + * Exception number + * @param errorNumber Integer + * @return Error + **/ public Error errorNumber(Integer errorNumber) { this.errorNumber = errorNumber; return this; } - /** + /** * Exception number - * * @return errorNumber - */ + **/ @ApiModelProperty(value = "Exception number") - /** + /** * Exception number - * * @return errorNumber Integer - */ + **/ public Integer getErrorNumber() { return errorNumber; } - /** - * Exception number - * - * @param errorNumber Integer - */ + /** + * Exception number + * @param errorNumber Integer + **/ + public void setErrorNumber(Integer errorNumber) { this.errorNumber = errorNumber; } /** - * Exception type - * - * @param type String - * @return Error - */ + * Exception type + * @param type String + * @return Error + **/ public Error type(String type) { this.type = type; return this; } - /** + /** * Exception type - * * @return type - */ + **/ @ApiModelProperty(value = "Exception type") - /** + /** * Exception type - * * @return type String - */ + **/ public String getType() { return type; } - /** - * Exception type - * - * @param type String - */ + /** + * Exception type + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * Exception message - * - * @param message String - * @return Error - */ + * Exception message + * @param message String + * @return Error + **/ public Error message(String message) { this.message = message; return this; } - /** + /** * Exception message - * * @return message - */ + **/ @ApiModelProperty(value = "Exception message") - /** + /** * Exception message - * * @return message String - */ + **/ public String getMessage() { return message; } - /** - * Exception message - * - * @param message String - */ + /** + * Exception message + * @param message String + **/ + public void setMessage(String message) { this.message = message; } /** - * Array of Elements of validation Errors - * - * @param elements List<Element> - * @return Error - */ + * Array of Elements of validation Errors + * @param elements List<Element> + * @return Error + **/ public Error elements(List elements) { this.elements = elements; return this; @@ -151,10 +159,9 @@ public Error elements(List elements) { /** * Array of Elements of validation Errors - * - * @param elementsItem Element + * @param elementsItem Element * @return Error - */ + **/ public Error addElementsItem(Element elementsItem) { if (this.elements == null) { this.elements = new ArrayList(); @@ -163,30 +170,29 @@ public Error addElementsItem(Element elementsItem) { return this; } - /** + /** * Array of Elements of validation Errors - * * @return elements - */ + **/ @ApiModelProperty(value = "Array of Elements of validation Errors") - /** + /** * Array of Elements of validation Errors - * * @return elements List - */ + **/ public List getElements() { return elements; } - /** - * Array of Elements of validation Errors - * - * @param elements List<Element> - */ + /** + * Array of Elements of validation Errors + * @param elements List<Element> + **/ + public void setElements(List elements) { this.elements = elements; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -196,10 +202,10 @@ public boolean equals(java.lang.Object o) { return false; } Error error = (Error) o; - return Objects.equals(this.errorNumber, error.errorNumber) - && Objects.equals(this.type, error.type) - && Objects.equals(this.message, error.message) - && Objects.equals(this.elements, error.elements); + return Objects.equals(this.errorNumber, error.errorNumber) && + Objects.equals(this.type, error.type) && + Objects.equals(this.message, error.message) && + Objects.equals(this.elements, error.elements); } @Override @@ -207,6 +213,7 @@ public int hashCode() { return Objects.hash(errorNumber, type, message, elements); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -220,7 +227,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -228,4 +236,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ExpenseClaim.java b/src/main/java/com/xero/models/accounting/ExpenseClaim.java index 2728219e1..d96655d2d 100644 --- a/src/main/java/com/xero/models/accounting/ExpenseClaim.java +++ b/src/main/java/com/xero/models/accounting/ExpenseClaim.java @@ -9,42 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Payment; +import com.xero.models.accounting.Receipt; +import com.xero.models.accounting.User; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ExpenseClaim + */ -/** ExpenseClaim */ public class ExpenseClaim { StringUtil util = new StringUtil(); @JsonProperty("ExpenseClaimID") private UUID expenseClaimID; - /** Current status of an expense claim – see status types */ + /** + * Current status of an expense claim – see status types + */ public enum StatusEnum { - /** SUBMITTED */ + /** + * SUBMITTED + */ SUBMITTED("SUBMITTED"), - - /** AUTHORISED */ + + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** PAID */ + + /** + * PAID + */ PAID("PAID"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -53,31 +80,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -89,6 +110,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -122,81 +144,74 @@ public static StatusEnum fromValue(String value) { @JsonProperty("ReceiptID") private UUID receiptID; /** - * Xero generated unique identifier for an expense claim - * - * @param expenseClaimID UUID - * @return ExpenseClaim - */ + * Xero generated unique identifier for an expense claim + * @param expenseClaimID UUID + * @return ExpenseClaim + **/ public ExpenseClaim expenseClaimID(UUID expenseClaimID) { this.expenseClaimID = expenseClaimID; return this; } - /** + /** * Xero generated unique identifier for an expense claim - * * @return expenseClaimID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier for an expense claim") - /** + /** * Xero generated unique identifier for an expense claim - * * @return expenseClaimID UUID - */ + **/ public UUID getExpenseClaimID() { return expenseClaimID; } - /** - * Xero generated unique identifier for an expense claim - * - * @param expenseClaimID UUID - */ + /** + * Xero generated unique identifier for an expense claim + * @param expenseClaimID UUID + **/ + public void setExpenseClaimID(UUID expenseClaimID) { this.expenseClaimID = expenseClaimID; } /** - * Current status of an expense claim – see status types - * - * @param status StatusEnum - * @return ExpenseClaim - */ + * Current status of an expense claim – see status types + * @param status StatusEnum + * @return ExpenseClaim + **/ public ExpenseClaim status(StatusEnum status) { this.status = status; return this; } - /** + /** * Current status of an expense claim – see status types - * * @return status - */ + **/ @ApiModelProperty(value = "Current status of an expense claim – see status types") - /** + /** * Current status of an expense claim – see status types - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Current status of an expense claim – see status types - * - * @param status StatusEnum - */ + /** + * Current status of an expense claim – see status types + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * See Payments - * - * @param payments List<Payment> - * @return ExpenseClaim - */ + * See Payments + * @param payments List<Payment> + * @return ExpenseClaim + **/ public ExpenseClaim payments(List payments) { this.payments = payments; return this; @@ -204,10 +219,9 @@ public ExpenseClaim payments(List payments) { /** * See Payments - * - * @param paymentsItem Payment + * @param paymentsItem Payment * @return ExpenseClaim - */ + **/ public ExpenseClaim addPaymentsItem(Payment paymentsItem) { if (this.payments == null) { this.payments = new ArrayList(); @@ -216,71 +230,65 @@ public ExpenseClaim addPaymentsItem(Payment paymentsItem) { return this; } - /** + /** * See Payments - * * @return payments - */ + **/ @ApiModelProperty(value = "See Payments") - /** + /** * See Payments - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** - * See Payments - * - * @param payments List<Payment> - */ + /** + * See Payments + * @param payments List<Payment> + **/ + public void setPayments(List payments) { this.payments = payments; } /** - * user - * - * @param user User - * @return ExpenseClaim - */ + * user + * @param user User + * @return ExpenseClaim + **/ public ExpenseClaim user(User user) { this.user = user; return this; } - /** + /** * Get user - * * @return user - */ + **/ @ApiModelProperty(value = "") - /** + /** * user - * * @return user User - */ + **/ public User getUser() { return user; } - /** - * user - * - * @param user User - */ + /** + * user + * @param user User + **/ + public void setUser(User user) { this.user = user; } /** - * receipts - * - * @param receipts List<Receipt> - * @return ExpenseClaim - */ + * receipts + * @param receipts List<Receipt> + * @return ExpenseClaim + **/ public ExpenseClaim receipts(List receipts) { this.receipts = receipts; return this; @@ -288,10 +296,9 @@ public ExpenseClaim receipts(List receipts) { /** * receipts - * - * @param receiptsItem Receipt + * @param receiptsItem Receipt * @return ExpenseClaim - */ + **/ public ExpenseClaim addReceiptsItem(Receipt receiptsItem) { if (this.receipts == null) { this.receipts = new ArrayList(); @@ -300,201 +307,181 @@ public ExpenseClaim addReceiptsItem(Receipt receiptsItem) { return this; } - /** + /** * Get receipts - * * @return receipts - */ + **/ @ApiModelProperty(value = "") - /** + /** * receipts - * * @return receipts List - */ + **/ public List getReceipts() { return receipts; } - /** - * receipts - * - * @param receipts List<Receipt> - */ + /** + * receipts + * @param receipts List<Receipt> + **/ + public void setReceipts(List receipts) { this.receipts = receipts; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** + /** * The total of an expense claim being paid - * * @return total - */ + **/ @ApiModelProperty(value = "The total of an expense claim being paid") - /** + /** * The total of an expense claim being paid - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** + /** * The amount due to be paid for an expense claim - * * @return amountDue - */ + **/ @ApiModelProperty(value = "The amount due to be paid for an expense claim") - /** + /** * The amount due to be paid for an expense claim - * * @return amountDue Double - */ + **/ public Double getAmountDue() { return amountDue; } - /** + /** * The amount still to pay for an expense claim - * * @return amountPaid - */ + **/ @ApiModelProperty(value = "The amount still to pay for an expense claim") - /** + /** * The amount still to pay for an expense claim - * * @return amountPaid Double - */ + **/ public Double getAmountPaid() { return amountPaid; } - /** + /** * The date when the expense claim is due to be paid YYYY-MM-DD - * * @return paymentDueDate - */ + **/ @ApiModelProperty(value = "The date when the expense claim is due to be paid YYYY-MM-DD") - /** + /** * The date when the expense claim is due to be paid YYYY-MM-DD - * * @return paymentDueDate String - */ + **/ public String getPaymentDueDate() { return paymentDueDate; } - /** + /** * The date when the expense claim is due to be paid YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getPaymentDueDateAsDate() { if (this.paymentDueDate != null) { try { return util.convertStringToDate(this.paymentDueDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** + /** * The date the expense claim will be reported in Xero YYYY-MM-DD - * * @return reportingDate - */ + **/ @ApiModelProperty(value = "The date the expense claim will be reported in Xero YYYY-MM-DD") - /** + /** * The date the expense claim will be reported in Xero YYYY-MM-DD - * * @return reportingDate String - */ + **/ public String getReportingDate() { return reportingDate; } - /** + /** * The date the expense claim will be reported in Xero YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getReportingDateAsDate() { if (this.reportingDate != null) { try { return util.convertStringToDate(this.reportingDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 - * - * @param receiptID UUID - * @return ExpenseClaim - */ + * The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 + * @param receiptID UUID + * @return ExpenseClaim + **/ public ExpenseClaim receiptID(UUID receiptID) { this.receiptID = receiptID; return this; } - /** + /** * The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 - * * @return receiptID - */ - @ApiModelProperty( - value = "The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9") - /** + **/ + @ApiModelProperty(value = "The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9") + /** * The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 - * * @return receiptID UUID - */ + **/ public UUID getReceiptID() { return receiptID; } - /** - * The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 - * - * @param receiptID UUID - */ + /** + * The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 + * @param receiptID UUID + **/ + public void setReceiptID(UUID receiptID) { this.receiptID = receiptID; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -504,37 +491,26 @@ public boolean equals(java.lang.Object o) { return false; } ExpenseClaim expenseClaim = (ExpenseClaim) o; - return Objects.equals(this.expenseClaimID, expenseClaim.expenseClaimID) - && Objects.equals(this.status, expenseClaim.status) - && Objects.equals(this.payments, expenseClaim.payments) - && Objects.equals(this.user, expenseClaim.user) - && Objects.equals(this.receipts, expenseClaim.receipts) - && Objects.equals(this.updatedDateUTC, expenseClaim.updatedDateUTC) - && Objects.equals(this.total, expenseClaim.total) - && Objects.equals(this.amountDue, expenseClaim.amountDue) - && Objects.equals(this.amountPaid, expenseClaim.amountPaid) - && Objects.equals(this.paymentDueDate, expenseClaim.paymentDueDate) - && Objects.equals(this.reportingDate, expenseClaim.reportingDate) - && Objects.equals(this.receiptID, expenseClaim.receiptID); + return Objects.equals(this.expenseClaimID, expenseClaim.expenseClaimID) && + Objects.equals(this.status, expenseClaim.status) && + Objects.equals(this.payments, expenseClaim.payments) && + Objects.equals(this.user, expenseClaim.user) && + Objects.equals(this.receipts, expenseClaim.receipts) && + Objects.equals(this.updatedDateUTC, expenseClaim.updatedDateUTC) && + Objects.equals(this.total, expenseClaim.total) && + Objects.equals(this.amountDue, expenseClaim.amountDue) && + Objects.equals(this.amountPaid, expenseClaim.amountPaid) && + Objects.equals(this.paymentDueDate, expenseClaim.paymentDueDate) && + Objects.equals(this.reportingDate, expenseClaim.reportingDate) && + Objects.equals(this.receiptID, expenseClaim.receiptID); } @Override public int hashCode() { - return Objects.hash( - expenseClaimID, - status, - payments, - user, - receipts, - updatedDateUTC, - total, - amountDue, - amountPaid, - paymentDueDate, - reportingDate, - receiptID); + return Objects.hash(expenseClaimID, status, payments, user, receipts, updatedDateUTC, total, amountDue, amountPaid, paymentDueDate, reportingDate, receiptID); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -556,7 +532,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -564,4 +541,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ExpenseClaims.java b/src/main/java/com/xero/models/accounting/ExpenseClaims.java index b1cf65ec2..77e944462 100644 --- a/src/main/java/com/xero/models/accounting/ExpenseClaims.java +++ b/src/main/java/com/xero/models/accounting/ExpenseClaims.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ExpenseClaim; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ExpenseClaims + */ -/** ExpenseClaims */ public class ExpenseClaims { StringUtil util = new StringUtil(); @JsonProperty("ExpenseClaims") private List expenseClaims = new ArrayList(); /** - * expenseClaims - * - * @param expenseClaims List<ExpenseClaim> - * @return ExpenseClaims - */ + * expenseClaims + * @param expenseClaims List<ExpenseClaim> + * @return ExpenseClaims + **/ public ExpenseClaims expenseClaims(List expenseClaims) { this.expenseClaims = expenseClaims; return this; @@ -37,10 +54,9 @@ public ExpenseClaims expenseClaims(List expenseClaims) { /** * expenseClaims - * - * @param expenseClaimsItem ExpenseClaim + * @param expenseClaimsItem ExpenseClaim * @return ExpenseClaims - */ + **/ public ExpenseClaims addExpenseClaimsItem(ExpenseClaim expenseClaimsItem) { if (this.expenseClaims == null) { this.expenseClaims = new ArrayList(); @@ -49,30 +65,29 @@ public ExpenseClaims addExpenseClaimsItem(ExpenseClaim expenseClaimsItem) { return this; } - /** + /** * Get expenseClaims - * * @return expenseClaims - */ + **/ @ApiModelProperty(value = "") - /** + /** * expenseClaims - * * @return expenseClaims List - */ + **/ public List getExpenseClaims() { return expenseClaims; } - /** - * expenseClaims - * - * @param expenseClaims List<ExpenseClaim> - */ + /** + * expenseClaims + * @param expenseClaims List<ExpenseClaim> + **/ + public void setExpenseClaims(List expenseClaims) { this.expenseClaims = expenseClaims; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(expenseClaims); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ExternalLink.java b/src/main/java/com/xero/models/accounting/ExternalLink.java index 54542495b..c1bb99a66 100644 --- a/src/main/java/com/xero/models/accounting/ExternalLink.java +++ b/src/main/java/com/xero/models/accounting/ExternalLink.java @@ -9,33 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ExternalLink + */ -/** ExternalLink */ public class ExternalLink { StringUtil util = new StringUtil(); - /** See External link types */ + /** + * See External link types + */ public enum LinkTypeEnum { - /** FACEBOOK */ + /** + * FACEBOOK + */ FACEBOOK("Facebook"), - - /** GOOGLEPLUS */ + + /** + * GOOGLEPLUS + */ GOOGLEPLUS("GooglePlus"), - - /** LINKEDIN */ + + /** + * LINKEDIN + */ LINKEDIN("LinkedIn"), - - /** TWITTER */ + + /** + * TWITTER + */ TWITTER("Twitter"), - - /** WEBSITE */ + + /** + * WEBSITE + */ WEBSITE("Website"); private String value; @@ -44,31 +71,25 @@ public enum LinkTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static LinkTypeEnum fromValue(String value) { for (LinkTypeEnum b : LinkTypeEnum.values()) { @@ -80,6 +101,7 @@ public static LinkTypeEnum fromValue(String value) { } } + @JsonProperty("LinkType") private LinkTypeEnum linkType; @@ -89,110 +111,102 @@ public static LinkTypeEnum fromValue(String value) { @JsonProperty("Description") private String description; /** - * See External link types - * - * @param linkType LinkTypeEnum - * @return ExternalLink - */ + * See External link types + * @param linkType LinkTypeEnum + * @return ExternalLink + **/ public ExternalLink linkType(LinkTypeEnum linkType) { this.linkType = linkType; return this; } - /** + /** * See External link types - * * @return linkType - */ + **/ @ApiModelProperty(value = "See External link types") - /** + /** * See External link types - * * @return linkType LinkTypeEnum - */ + **/ public LinkTypeEnum getLinkType() { return linkType; } - /** - * See External link types - * - * @param linkType LinkTypeEnum - */ + /** + * See External link types + * @param linkType LinkTypeEnum + **/ + public void setLinkType(LinkTypeEnum linkType) { this.linkType = linkType; } /** - * URL for service e.g. http://twitter.com/xeroapi - * - * @param url String - * @return ExternalLink - */ + * URL for service e.g. http://twitter.com/xeroapi + * @param url String + * @return ExternalLink + **/ public ExternalLink url(String url) { this.url = url; return this; } - /** + /** * URL for service e.g. http://twitter.com/xeroapi - * * @return url - */ + **/ @ApiModelProperty(value = "URL for service e.g. http://twitter.com/xeroapi") - /** + /** * URL for service e.g. http://twitter.com/xeroapi - * * @return url String - */ + **/ public String getUrl() { return url; } - /** - * URL for service e.g. http://twitter.com/xeroapi - * - * @param url String - */ + /** + * URL for service e.g. http://twitter.com/xeroapi + * @param url String + **/ + public void setUrl(String url) { this.url = url; } /** - * description - * - * @param description String - * @return ExternalLink - */ + * description + * @param description String + * @return ExternalLink + **/ public ExternalLink description(String description) { this.description = description; return this; } - /** + /** * Get description - * * @return description - */ + **/ @ApiModelProperty(value = "") - /** + /** * description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * description - * - * @param description String - */ + /** + * description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -202,9 +216,9 @@ public boolean equals(java.lang.Object o) { return false; } ExternalLink externalLink = (ExternalLink) o; - return Objects.equals(this.linkType, externalLink.linkType) - && Objects.equals(this.url, externalLink.url) - && Objects.equals(this.description, externalLink.description); + return Objects.equals(this.linkType, externalLink.linkType) && + Objects.equals(this.url, externalLink.url) && + Objects.equals(this.description, externalLink.description); } @Override @@ -212,6 +226,7 @@ public int hashCode() { return Objects.hash(linkType, url, description); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -224,7 +239,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -232,4 +248,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/HistoryRecord.java b/src/main/java/com/xero/models/accounting/HistoryRecord.java index 0bc4dbcc5..5c1d3a435 100644 --- a/src/main/java/com/xero/models/accounting/HistoryRecord.java +++ b/src/main/java/com/xero/models/accounting/HistoryRecord.java @@ -9,16 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Objects; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * HistoryRecord + */ -/** HistoryRecord */ public class HistoryRecord { StringUtil util = new StringUtil(); @@ -34,142 +49,129 @@ public class HistoryRecord { @JsonProperty("DateUTC") private String dateUTC; /** - * details - * - * @param details String - * @return HistoryRecord - */ + * details + * @param details String + * @return HistoryRecord + **/ public HistoryRecord details(String details) { this.details = details; return this; } - /** + /** * details - * * @return details - */ + **/ @ApiModelProperty(value = "details") - /** + /** * details - * * @return details String - */ + **/ public String getDetails() { return details; } - /** - * details - * - * @param details String - */ + /** + * details + * @param details String + **/ + public void setDetails(String details) { this.details = details; } /** - * Name of branding theme - * - * @param changes String - * @return HistoryRecord - */ + * Name of branding theme + * @param changes String + * @return HistoryRecord + **/ public HistoryRecord changes(String changes) { this.changes = changes; return this; } - /** + /** * Name of branding theme - * * @return changes - */ + **/ @ApiModelProperty(value = "Name of branding theme") - /** + /** * Name of branding theme - * * @return changes String - */ + **/ public String getChanges() { return changes; } - /** - * Name of branding theme - * - * @param changes String - */ + /** + * Name of branding theme + * @param changes String + **/ + public void setChanges(String changes) { this.changes = changes; } /** - * has a value of 0 - * - * @param user String - * @return HistoryRecord - */ + * has a value of 0 + * @param user String + * @return HistoryRecord + **/ public HistoryRecord user(String user) { this.user = user; return this; } - /** + /** * has a value of 0 - * * @return user - */ + **/ @ApiModelProperty(value = "has a value of 0") - /** + /** * has a value of 0 - * * @return user String - */ + **/ public String getUser() { return user; } - /** - * has a value of 0 - * - * @param user String - */ + /** + * has a value of 0 + * @param user String + **/ + public void setUser(String user) { this.user = user; } - /** + /** * UTC timestamp of creation date of branding theme - * * @return dateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of creation date of branding theme") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of creation date of branding theme") + /** * UTC timestamp of creation date of branding theme - * * @return dateUTC String - */ + **/ public String getDateUTC() { return dateUTC; } - /** + /** * UTC timestamp of creation date of branding theme - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getDateUTCAsDate() { if (this.dateUTC != null) { try { return util.convertStringToOffsetDateTime(this.dateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -179,10 +181,10 @@ public boolean equals(java.lang.Object o) { return false; } HistoryRecord historyRecord = (HistoryRecord) o; - return Objects.equals(this.details, historyRecord.details) - && Objects.equals(this.changes, historyRecord.changes) - && Objects.equals(this.user, historyRecord.user) - && Objects.equals(this.dateUTC, historyRecord.dateUTC); + return Objects.equals(this.details, historyRecord.details) && + Objects.equals(this.changes, historyRecord.changes) && + Objects.equals(this.user, historyRecord.user) && + Objects.equals(this.dateUTC, historyRecord.dateUTC); } @Override @@ -190,6 +192,7 @@ public int hashCode() { return Objects.hash(details, changes, user, dateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -203,7 +206,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -211,4 +215,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/HistoryRecords.java b/src/main/java/com/xero/models/accounting/HistoryRecords.java index 947012270..193690d43 100644 --- a/src/main/java/com/xero/models/accounting/HistoryRecords.java +++ b/src/main/java/com/xero/models/accounting/HistoryRecords.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.HistoryRecord; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * HistoryRecords + */ -/** HistoryRecords */ public class HistoryRecords { StringUtil util = new StringUtil(); @JsonProperty("HistoryRecords") private List historyRecords = new ArrayList(); /** - * historyRecords - * - * @param historyRecords List<HistoryRecord> - * @return HistoryRecords - */ + * historyRecords + * @param historyRecords List<HistoryRecord> + * @return HistoryRecords + **/ public HistoryRecords historyRecords(List historyRecords) { this.historyRecords = historyRecords; return this; @@ -37,10 +54,9 @@ public HistoryRecords historyRecords(List historyRecords) { /** * historyRecords - * - * @param historyRecordsItem HistoryRecord + * @param historyRecordsItem HistoryRecord * @return HistoryRecords - */ + **/ public HistoryRecords addHistoryRecordsItem(HistoryRecord historyRecordsItem) { if (this.historyRecords == null) { this.historyRecords = new ArrayList(); @@ -49,30 +65,29 @@ public HistoryRecords addHistoryRecordsItem(HistoryRecord historyRecordsItem) { return this; } - /** + /** * Get historyRecords - * * @return historyRecords - */ + **/ @ApiModelProperty(value = "") - /** + /** * historyRecords - * * @return historyRecords List - */ + **/ public List getHistoryRecords() { return historyRecords; } - /** - * historyRecords - * - * @param historyRecords List<HistoryRecord> - */ + /** + * historyRecords + * @param historyRecords List<HistoryRecord> + **/ + public void setHistoryRecords(List historyRecords) { this.historyRecords = historyRecords; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(historyRecords); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ImportSummary.java b/src/main/java/com/xero/models/accounting/ImportSummary.java index 1d28040d0..afddf5692 100644 --- a/src/main/java/com/xero/models/accounting/ImportSummary.java +++ b/src/main/java/com/xero/models/accounting/ImportSummary.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ImportSummaryAccounts; +import com.xero.models.accounting.ImportSummaryOrganisation; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; -/** A summary of the import from setup endpoint */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * A summary of the import from setup endpoint + */ @ApiModel(description = "A summary of the import from setup endpoint") + public class ImportSummary { StringUtil util = new StringUtil(); @@ -28,75 +46,70 @@ public class ImportSummary { @JsonProperty("Organisation") private ImportSummaryOrganisation organisation; /** - * accounts - * - * @param accounts ImportSummaryAccounts - * @return ImportSummary - */ + * accounts + * @param accounts ImportSummaryAccounts + * @return ImportSummary + **/ public ImportSummary accounts(ImportSummaryAccounts accounts) { this.accounts = accounts; return this; } - /** + /** * Get accounts - * * @return accounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * accounts - * * @return accounts ImportSummaryAccounts - */ + **/ public ImportSummaryAccounts getAccounts() { return accounts; } - /** - * accounts - * - * @param accounts ImportSummaryAccounts - */ + /** + * accounts + * @param accounts ImportSummaryAccounts + **/ + public void setAccounts(ImportSummaryAccounts accounts) { this.accounts = accounts; } /** - * organisation - * - * @param organisation ImportSummaryOrganisation - * @return ImportSummary - */ + * organisation + * @param organisation ImportSummaryOrganisation + * @return ImportSummary + **/ public ImportSummary organisation(ImportSummaryOrganisation organisation) { this.organisation = organisation; return this; } - /** + /** * Get organisation - * * @return organisation - */ + **/ @ApiModelProperty(value = "") - /** + /** * organisation - * * @return organisation ImportSummaryOrganisation - */ + **/ public ImportSummaryOrganisation getOrganisation() { return organisation; } - /** - * organisation - * - * @param organisation ImportSummaryOrganisation - */ + /** + * organisation + * @param organisation ImportSummaryOrganisation + **/ + public void setOrganisation(ImportSummaryOrganisation organisation) { this.organisation = organisation; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -106,8 +119,8 @@ public boolean equals(java.lang.Object o) { return false; } ImportSummary importSummary = (ImportSummary) o; - return Objects.equals(this.accounts, importSummary.accounts) - && Objects.equals(this.organisation, importSummary.organisation); + return Objects.equals(this.accounts, importSummary.accounts) && + Objects.equals(this.organisation, importSummary.organisation); } @Override @@ -115,6 +128,7 @@ public int hashCode() { return Objects.hash(accounts, organisation); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -126,7 +140,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -134,4 +149,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ImportSummaryAccounts.java b/src/main/java/com/xero/models/accounting/ImportSummaryAccounts.java index 0bd98babe..66f363677 100644 --- a/src/main/java/com/xero/models/accounting/ImportSummaryAccounts.java +++ b/src/main/java/com/xero/models/accounting/ImportSummaryAccounts.java @@ -9,16 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -/** A summary of the accounts changes */ +/** + * A summary of the accounts changes + */ @ApiModel(description = "A summary of the accounts changes") + public class ImportSummaryAccounts { StringUtil util = new StringUtil(); @@ -49,320 +65,294 @@ public class ImportSummaryAccounts { @JsonProperty("NewOrUpdated") private Integer newOrUpdated; /** - * The total number of accounts in the org - * - * @param total Integer - * @return ImportSummaryAccounts - */ + * The total number of accounts in the org + * @param total Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts total(Integer total) { this.total = total; return this; } - /** + /** * The total number of accounts in the org - * * @return total - */ + **/ @ApiModelProperty(value = "The total number of accounts in the org") - /** + /** * The total number of accounts in the org - * * @return total Integer - */ + **/ public Integer getTotal() { return total; } - /** - * The total number of accounts in the org - * - * @param total Integer - */ + /** + * The total number of accounts in the org + * @param total Integer + **/ + public void setTotal(Integer total) { this.total = total; } /** - * The number of new accounts created - * - * @param _new Integer - * @return ImportSummaryAccounts - */ + * The number of new accounts created + * @param _new Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts _new(Integer _new) { this._new = _new; return this; } - /** + /** * The number of new accounts created - * * @return _new - */ + **/ @ApiModelProperty(value = "The number of new accounts created") - /** + /** * The number of new accounts created - * * @return _new Integer - */ + **/ public Integer getNew() { return _new; } - /** - * The number of new accounts created - * - * @param _new Integer - */ + /** + * The number of new accounts created + * @param _new Integer + **/ + public void setNew(Integer _new) { this._new = _new; } /** - * The number of accounts updated - * - * @param updated Integer - * @return ImportSummaryAccounts - */ + * The number of accounts updated + * @param updated Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts updated(Integer updated) { this.updated = updated; return this; } - /** + /** * The number of accounts updated - * * @return updated - */ + **/ @ApiModelProperty(value = "The number of accounts updated") - /** + /** * The number of accounts updated - * * @return updated Integer - */ + **/ public Integer getUpdated() { return updated; } - /** - * The number of accounts updated - * - * @param updated Integer - */ + /** + * The number of accounts updated + * @param updated Integer + **/ + public void setUpdated(Integer updated) { this.updated = updated; } /** - * The number of accounts deleted - * - * @param deleted Integer - * @return ImportSummaryAccounts - */ + * The number of accounts deleted + * @param deleted Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts deleted(Integer deleted) { this.deleted = deleted; return this; } - /** + /** * The number of accounts deleted - * * @return deleted - */ + **/ @ApiModelProperty(value = "The number of accounts deleted") - /** + /** * The number of accounts deleted - * * @return deleted Integer - */ + **/ public Integer getDeleted() { return deleted; } - /** - * The number of accounts deleted - * - * @param deleted Integer - */ + /** + * The number of accounts deleted + * @param deleted Integer + **/ + public void setDeleted(Integer deleted) { this.deleted = deleted; } /** - * The number of locked accounts - * - * @param locked Integer - * @return ImportSummaryAccounts - */ + * The number of locked accounts + * @param locked Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts locked(Integer locked) { this.locked = locked; return this; } - /** + /** * The number of locked accounts - * * @return locked - */ + **/ @ApiModelProperty(value = "The number of locked accounts") - /** + /** * The number of locked accounts - * * @return locked Integer - */ + **/ public Integer getLocked() { return locked; } - /** - * The number of locked accounts - * - * @param locked Integer - */ + /** + * The number of locked accounts + * @param locked Integer + **/ + public void setLocked(Integer locked) { this.locked = locked; } /** - * The number of system accounts - * - * @param system Integer - * @return ImportSummaryAccounts - */ + * The number of system accounts + * @param system Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts system(Integer system) { this.system = system; return this; } - /** + /** * The number of system accounts - * * @return system - */ + **/ @ApiModelProperty(value = "The number of system accounts") - /** + /** * The number of system accounts - * * @return system Integer - */ + **/ public Integer getSystem() { return system; } - /** - * The number of system accounts - * - * @param system Integer - */ + /** + * The number of system accounts + * @param system Integer + **/ + public void setSystem(Integer system) { this.system = system; } /** - * The number of accounts that had an error - * - * @param errored Integer - * @return ImportSummaryAccounts - */ + * The number of accounts that had an error + * @param errored Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts errored(Integer errored) { this.errored = errored; return this; } - /** + /** * The number of accounts that had an error - * * @return errored - */ + **/ @ApiModelProperty(value = "The number of accounts that had an error") - /** + /** * The number of accounts that had an error - * * @return errored Integer - */ + **/ public Integer getErrored() { return errored; } - /** - * The number of accounts that had an error - * - * @param errored Integer - */ + /** + * The number of accounts that had an error + * @param errored Integer + **/ + public void setErrored(Integer errored) { this.errored = errored; } /** - * present - * - * @param present Boolean - * @return ImportSummaryAccounts - */ + * present + * @param present Boolean + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts present(Boolean present) { this.present = present; return this; } - /** + /** * Get present - * * @return present - */ + **/ @ApiModelProperty(value = "") - /** + /** * present - * * @return present Boolean - */ + **/ public Boolean getPresent() { return present; } - /** - * present - * - * @param present Boolean - */ + /** + * present + * @param present Boolean + **/ + public void setPresent(Boolean present) { this.present = present; } /** - * The number of new or updated accounts - * - * @param newOrUpdated Integer - * @return ImportSummaryAccounts - */ + * The number of new or updated accounts + * @param newOrUpdated Integer + * @return ImportSummaryAccounts + **/ public ImportSummaryAccounts newOrUpdated(Integer newOrUpdated) { this.newOrUpdated = newOrUpdated; return this; } - /** + /** * The number of new or updated accounts - * * @return newOrUpdated - */ + **/ @ApiModelProperty(value = "The number of new or updated accounts") - /** + /** * The number of new or updated accounts - * * @return newOrUpdated Integer - */ + **/ public Integer getNewOrUpdated() { return newOrUpdated; } - /** - * The number of new or updated accounts - * - * @param newOrUpdated Integer - */ + /** + * The number of new or updated accounts + * @param newOrUpdated Integer + **/ + public void setNewOrUpdated(Integer newOrUpdated) { this.newOrUpdated = newOrUpdated; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -372,23 +362,23 @@ public boolean equals(java.lang.Object o) { return false; } ImportSummaryAccounts importSummaryAccounts = (ImportSummaryAccounts) o; - return Objects.equals(this.total, importSummaryAccounts.total) - && Objects.equals(this._new, importSummaryAccounts._new) - && Objects.equals(this.updated, importSummaryAccounts.updated) - && Objects.equals(this.deleted, importSummaryAccounts.deleted) - && Objects.equals(this.locked, importSummaryAccounts.locked) - && Objects.equals(this.system, importSummaryAccounts.system) - && Objects.equals(this.errored, importSummaryAccounts.errored) - && Objects.equals(this.present, importSummaryAccounts.present) - && Objects.equals(this.newOrUpdated, importSummaryAccounts.newOrUpdated); + return Objects.equals(this.total, importSummaryAccounts.total) && + Objects.equals(this._new, importSummaryAccounts._new) && + Objects.equals(this.updated, importSummaryAccounts.updated) && + Objects.equals(this.deleted, importSummaryAccounts.deleted) && + Objects.equals(this.locked, importSummaryAccounts.locked) && + Objects.equals(this.system, importSummaryAccounts.system) && + Objects.equals(this.errored, importSummaryAccounts.errored) && + Objects.equals(this.present, importSummaryAccounts.present) && + Objects.equals(this.newOrUpdated, importSummaryAccounts.newOrUpdated); } @Override public int hashCode() { - return Objects.hash( - total, _new, updated, deleted, locked, system, errored, present, newOrUpdated); + return Objects.hash(total, _new, updated, deleted, locked, system, errored, present, newOrUpdated); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -407,7 +397,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -415,4 +406,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ImportSummaryObject.java b/src/main/java/com/xero/models/accounting/ImportSummaryObject.java index a5d70d270..05f6c8bb3 100644 --- a/src/main/java/com/xero/models/accounting/ImportSummaryObject.java +++ b/src/main/java/com/xero/models/accounting/ImportSummaryObject.java @@ -9,54 +9,70 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ImportSummary; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ImportSummaryObject + */ -/** ImportSummaryObject */ public class ImportSummaryObject { StringUtil util = new StringUtil(); @JsonProperty("ImportSummary") private ImportSummary importSummary; /** - * importSummary - * - * @param importSummary ImportSummary - * @return ImportSummaryObject - */ + * importSummary + * @param importSummary ImportSummary + * @return ImportSummaryObject + **/ public ImportSummaryObject importSummary(ImportSummary importSummary) { this.importSummary = importSummary; return this; } - /** + /** * Get importSummary - * * @return importSummary - */ + **/ @ApiModelProperty(value = "") - /** + /** * importSummary - * * @return importSummary ImportSummary - */ + **/ public ImportSummary getImportSummary() { return importSummary; } - /** - * importSummary - * - * @param importSummary ImportSummary - */ + /** + * importSummary + * @param importSummary ImportSummary + **/ + public void setImportSummary(ImportSummary importSummary) { this.importSummary = importSummary; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +90,7 @@ public int hashCode() { return Objects.hash(importSummary); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +101,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +110,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ImportSummaryOrganisation.java b/src/main/java/com/xero/models/accounting/ImportSummaryOrganisation.java index 958338df1..8d0535df5 100644 --- a/src/main/java/com/xero/models/accounting/ImportSummaryOrganisation.java +++ b/src/main/java/com/xero/models/accounting/ImportSummaryOrganisation.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ImportSummaryOrganisation + */ -/** ImportSummaryOrganisation */ public class ImportSummaryOrganisation { StringUtil util = new StringUtil(); @JsonProperty("Present") private Boolean present; /** - * present - * - * @param present Boolean - * @return ImportSummaryOrganisation - */ + * present + * @param present Boolean + * @return ImportSummaryOrganisation + **/ public ImportSummaryOrganisation present(Boolean present) { this.present = present; return this; } - /** + /** * Get present - * * @return present - */ + **/ @ApiModelProperty(value = "") - /** + /** * present - * * @return present Boolean - */ + **/ public Boolean getPresent() { return present; } - /** - * present - * - * @param present Boolean - */ + /** + * present + * @param present Boolean + **/ + public void setPresent(Boolean present) { this.present = present; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(present); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Invoice.java b/src/main/java/com/xero/models/accounting/Invoice.java index 469c5fbd7..3120cd8f9 100644 --- a/src/main/java/com/xero/models/accounting/Invoice.java +++ b/src/main/java/com/xero/models/accounting/Invoice.java @@ -9,50 +9,89 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CreditNote; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.InvoiceAddress; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.Overpayment; +import com.xero.models.accounting.Payment; +import com.xero.models.accounting.Prepayment; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Invoice + */ -/** Invoice */ public class Invoice { StringUtil util = new StringUtil(); - /** See Invoice Types */ + /** + * See Invoice Types + */ public enum TypeEnum { - /** ACCPAY */ + /** + * ACCPAY + */ ACCPAY("ACCPAY"), - - /** ACCPAYCREDIT */ + + /** + * ACCPAYCREDIT + */ ACCPAYCREDIT("ACCPAYCREDIT"), - - /** APOVERPAYMENT */ + + /** + * APOVERPAYMENT + */ APOVERPAYMENT("APOVERPAYMENT"), - - /** APPREPAYMENT */ + + /** + * APPREPAYMENT + */ APPREPAYMENT("APPREPAYMENT"), - - /** ACCREC */ + + /** + * ACCREC + */ ACCREC("ACCREC"), - - /** ACCRECCREDIT */ + + /** + * ACCRECCREDIT + */ ACCRECCREDIT("ACCRECCREDIT"), - - /** AROVERPAYMENT */ + + /** + * AROVERPAYMENT + */ AROVERPAYMENT("AROVERPAYMENT"), - - /** ARPREPAYMENT */ + + /** + * ARPREPAYMENT + */ ARPREPAYMENT("ARPREPAYMENT"); private String value; @@ -61,31 +100,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -97,6 +130,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -132,24 +166,38 @@ public static TypeEnum fromValue(String value) { @JsonProperty("CurrencyRate") private Double currencyRate; - /** See Invoice Status Codes */ + /** + * See Invoice Status Codes + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** SUBMITTED */ + + /** + * SUBMITTED + */ SUBMITTED("SUBMITTED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"), - - /** AUTHORISED */ + + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** PAID */ + + /** + * PAID + */ PAID("PAID"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"); private String value; @@ -158,31 +206,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -194,6 +236,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -281,81 +324,74 @@ public static StatusEnum fromValue(String value) { @JsonProperty("InvoiceAddresses") private List invoiceAddresses = new ArrayList(); /** - * See Invoice Types - * - * @param type TypeEnum - * @return Invoice - */ + * See Invoice Types + * @param type TypeEnum + * @return Invoice + **/ public Invoice type(TypeEnum type) { this.type = type; return this; } - /** + /** * See Invoice Types - * * @return type - */ + **/ @ApiModelProperty(value = "See Invoice Types") - /** + /** * See Invoice Types - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * See Invoice Types - * - * @param type TypeEnum - */ + /** + * See Invoice Types + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * contact - * - * @param contact Contact - * @return Invoice - */ + * contact + * @param contact Contact + * @return Invoice + **/ public Invoice contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * See LineItems - * - * @param lineItems List<LineItem> - * @return Invoice - */ + * See LineItems + * @param lineItems List<LineItem> + * @return Invoice + **/ public Invoice lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -363,10 +399,9 @@ public Invoice lineItems(List lineItems) { /** * See LineItems - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return Invoice - */ + **/ public Invoice addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -375,998 +410,866 @@ public Invoice addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * See LineItems - * * @return lineItems - */ + **/ @ApiModelProperty(value = "See LineItems") - /** + /** * See LineItems - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See LineItems - * - * @param lineItems List<LineItem> - */ + /** + * See LineItems + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to - * the current date based on the timezone setting of the organisation - * - * @param date String - * @return Invoice - */ + * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * @param date String + * @return Invoice + **/ public Invoice date(String date) { this.date = date; return this; } - /** - * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to - * the current date based on the timezone setting of the organisation - * + /** + * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation * @return date - */ - @ApiModelProperty( - value = - "Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will" - + " default to the current date based on the timezone setting of the organisation") - /** - * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to - * the current date based on the timezone setting of the organisation - * + **/ + @ApiModelProperty(value = "Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation") + /** + * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation * @return date String - */ + **/ public String getDate() { return date; } - /** - * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to - * the current date based on the timezone setting of the organisation - * + /** + * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to - * the current date based on the timezone setting of the organisation - * - * @param date String - */ + /** + * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to - * the current date based on the timezone setting of the organisation - * - * @param date LocalDateTime - */ + /** + * Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Date invoice is due – YYYY-MM-DD - * - * @param dueDate String - * @return Invoice - */ + * Date invoice is due – YYYY-MM-DD + * @param dueDate String + * @return Invoice + **/ public Invoice dueDate(String dueDate) { this.dueDate = dueDate; return this; } - /** + /** * Date invoice is due – YYYY-MM-DD - * * @return dueDate - */ + **/ @ApiModelProperty(value = "Date invoice is due – YYYY-MM-DD") - /** + /** * Date invoice is due – YYYY-MM-DD - * * @return dueDate String - */ + **/ public String getDueDate() { return dueDate; } - /** + /** * Date invoice is due – YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDueDateAsDate() { if (this.dueDate != null) { try { return util.convertStringToDate(this.dueDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date invoice is due – YYYY-MM-DD - * - * @param dueDate String - */ + /** + * Date invoice is due – YYYY-MM-DD + * @param dueDate String + **/ + public void setDueDate(String dueDate) { this.dueDate = dueDate; } - /** - * Date invoice is due – YYYY-MM-DD - * - * @param dueDate LocalDateTime - */ + /** + * Date invoice is due – YYYY-MM-DD + * @param dueDate LocalDateTime + **/ public void setDueDate(LocalDate dueDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = dueDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = dueDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.dueDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return Invoice - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return Invoice + **/ public Invoice lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from - * your Organisation Invoice Settings) (max length = 255) - * - * @param invoiceNumber String - * @return Invoice - */ + * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) + * @param invoiceNumber String + * @return Invoice + **/ public Invoice invoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; return this; } - /** - * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from - * your Organisation Invoice Settings) (max length = 255) - * + /** + * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) * @return invoiceNumber - */ - @ApiModelProperty( - value = - "ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate" - + " from your Organisation Invoice Settings) (max length = 255)") - /** - * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from - * your Organisation Invoice Settings) (max length = 255) - * + **/ + @ApiModelProperty(value = "ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255)") + /** + * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) * @return invoiceNumber String - */ + **/ public String getInvoiceNumber() { return invoiceNumber; } - /** - * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from - * your Organisation Invoice Settings) (max length = 255) - * - * @param invoiceNumber String - */ + /** + * ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) + * @param invoiceNumber String + **/ + public void setInvoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; } /** - * ACCREC only – additional reference number - * - * @param reference String - * @return Invoice - */ + * ACCREC only – additional reference number + * @param reference String + * @return Invoice + **/ public Invoice reference(String reference) { this.reference = reference; return this; } - /** + /** * ACCREC only – additional reference number - * * @return reference - */ + **/ @ApiModelProperty(value = "ACCREC only – additional reference number") - /** + /** * ACCREC only – additional reference number - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * ACCREC only – additional reference number - * - * @param reference String - */ + /** + * ACCREC only – additional reference number + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * See BrandingThemes - * - * @param brandingThemeID UUID - * @return Invoice - */ + * See BrandingThemes + * @param brandingThemeID UUID + * @return Invoice + **/ public Invoice brandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; return this; } - /** + /** * See BrandingThemes - * * @return brandingThemeID - */ + **/ @ApiModelProperty(value = "See BrandingThemes") - /** + /** * See BrandingThemes - * * @return brandingThemeID UUID - */ + **/ public UUID getBrandingThemeID() { return brandingThemeID; } - /** - * See BrandingThemes - * - * @param brandingThemeID UUID - */ + /** + * See BrandingThemes + * @param brandingThemeID UUID + **/ + public void setBrandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; } /** - * URL link to a source document – shown as “Go to [appName]” in the Xero app - * - * @param url String - * @return Invoice - */ + * URL link to a source document – shown as “Go to [appName]” in the Xero app + * @param url String + * @return Invoice + **/ public Invoice url(String url) { this.url = url; return this; } - /** + /** * URL link to a source document – shown as “Go to [appName]” in the Xero app - * * @return url - */ - @ApiModelProperty( - value = "URL link to a source document – shown as “Go to [appName]” in the Xero app") - /** + **/ + @ApiModelProperty(value = "URL link to a source document – shown as “Go to [appName]” in the Xero app") + /** * URL link to a source document – shown as “Go to [appName]” in the Xero app - * * @return url String - */ + **/ public String getUrl() { return url; } - /** - * URL link to a source document – shown as “Go to [appName]” in the Xero app - * - * @param url String - */ + /** + * URL link to a source document – shown as “Go to [appName]” in the Xero app + * @param url String + **/ + public void setUrl(String url) { this.url = url; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return Invoice - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return Invoice + **/ public Invoice currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used. (max length = [18].[6]) - * - * @param currencyRate Double - * @return Invoice - */ + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) + * @param currencyRate Double + * @return Invoice + **/ public Invoice currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used. (max length = [18].[6]) - * + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) * @return currencyRate - */ - @ApiModelProperty( - value = - "The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day" - + " rate is used. (max length = [18].[6])") - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used. (max length = [18].[6]) - * + **/ + @ApiModelProperty(value = "The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6])") + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is - * used. (max length = [18].[6]) - * - * @param currencyRate Double - */ + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } /** - * See Invoice Status Codes - * - * @param status StatusEnum - * @return Invoice - */ + * See Invoice Status Codes + * @param status StatusEnum + * @return Invoice + **/ public Invoice status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Invoice Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Invoice Status Codes") - /** + /** * See Invoice Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Invoice Status Codes - * - * @param status StatusEnum - */ + /** + * See Invoice Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set - * only on invoices that have been approved - * - * @param sentToContact Boolean - * @return Invoice - */ + * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved + * @param sentToContact Boolean + * @return Invoice + **/ public Invoice sentToContact(Boolean sentToContact) { this.sentToContact = sentToContact; return this; } - /** - * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set - * only on invoices that have been approved - * + /** + * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved * @return sentToContact - */ - @ApiModelProperty( - value = - "Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can" - + " be set only on invoices that have been approved") - /** - * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set - * only on invoices that have been approved - * + **/ + @ApiModelProperty(value = "Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved") + /** + * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved * @return sentToContact Boolean - */ + **/ public Boolean getSentToContact() { return sentToContact; } - /** - * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set - * only on invoices that have been approved - * - * @param sentToContact Boolean - */ + /** + * Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved + * @param sentToContact Boolean + **/ + public void setSentToContact(Boolean sentToContact) { this.sentToContact = sentToContact; } /** - * Shown on sales invoices (Accounts Receivable) when this has been set - * - * @param expectedPaymentDate String - * @return Invoice - */ + * Shown on sales invoices (Accounts Receivable) when this has been set + * @param expectedPaymentDate String + * @return Invoice + **/ public Invoice expectedPaymentDate(String expectedPaymentDate) { this.expectedPaymentDate = expectedPaymentDate; return this; } - /** + /** * Shown on sales invoices (Accounts Receivable) when this has been set - * * @return expectedPaymentDate - */ + **/ @ApiModelProperty(value = "Shown on sales invoices (Accounts Receivable) when this has been set") - /** + /** * Shown on sales invoices (Accounts Receivable) when this has been set - * * @return expectedPaymentDate String - */ + **/ public String getExpectedPaymentDate() { return expectedPaymentDate; } - /** + /** * Shown on sales invoices (Accounts Receivable) when this has been set - * * @return LocalDate - */ + **/ public LocalDate getExpectedPaymentDateAsDate() { if (this.expectedPaymentDate != null) { try { return util.convertStringToDate(this.expectedPaymentDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Shown on sales invoices (Accounts Receivable) when this has been set - * - * @param expectedPaymentDate String - */ + /** + * Shown on sales invoices (Accounts Receivable) when this has been set + * @param expectedPaymentDate String + **/ + public void setExpectedPaymentDate(String expectedPaymentDate) { this.expectedPaymentDate = expectedPaymentDate; } - /** - * Shown on sales invoices (Accounts Receivable) when this has been set - * - * @param expectedPaymentDate LocalDateTime - */ + /** + * Shown on sales invoices (Accounts Receivable) when this has been set + * @param expectedPaymentDate LocalDateTime + **/ public void setExpectedPaymentDate(LocalDate expectedPaymentDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = expectedPaymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = expectedPaymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.expectedPaymentDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Shown on bills (Accounts Payable) when this has been set - * - * @param plannedPaymentDate String - * @return Invoice - */ + * Shown on bills (Accounts Payable) when this has been set + * @param plannedPaymentDate String + * @return Invoice + **/ public Invoice plannedPaymentDate(String plannedPaymentDate) { this.plannedPaymentDate = plannedPaymentDate; return this; } - /** + /** * Shown on bills (Accounts Payable) when this has been set - * * @return plannedPaymentDate - */ + **/ @ApiModelProperty(value = "Shown on bills (Accounts Payable) when this has been set") - /** + /** * Shown on bills (Accounts Payable) when this has been set - * * @return plannedPaymentDate String - */ + **/ public String getPlannedPaymentDate() { return plannedPaymentDate; } - /** + /** * Shown on bills (Accounts Payable) when this has been set - * * @return LocalDate - */ + **/ public LocalDate getPlannedPaymentDateAsDate() { if (this.plannedPaymentDate != null) { try { return util.convertStringToDate(this.plannedPaymentDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Shown on bills (Accounts Payable) when this has been set - * - * @param plannedPaymentDate String - */ + /** + * Shown on bills (Accounts Payable) when this has been set + * @param plannedPaymentDate String + **/ + public void setPlannedPaymentDate(String plannedPaymentDate) { this.plannedPaymentDate = plannedPaymentDate; } - /** - * Shown on bills (Accounts Payable) when this has been set - * - * @param plannedPaymentDate LocalDateTime - */ + /** + * Shown on bills (Accounts Payable) when this has been set + * @param plannedPaymentDate LocalDateTime + **/ public void setPlannedPaymentDate(LocalDate plannedPaymentDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = plannedPaymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = plannedPaymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.plannedPaymentDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } - /** + /** * CIS deduction for UK contractors - * * @return ciSDeduction - */ + **/ @ApiModelProperty(value = "CIS deduction for UK contractors") - /** + /** * CIS deduction for UK contractors - * * @return ciSDeduction Double - */ + **/ public Double getCiSDeduction() { return ciSDeduction; } - /** + /** * CIS Deduction rate for the organisation - * * @return ciSRate - */ + **/ @ApiModelProperty(value = "CIS Deduction rate for the organisation") - /** + /** * CIS Deduction rate for the organisation - * * @return ciSRate Double - */ + **/ public Double getCiSRate() { return ciSRate; } - /** + /** * Total of invoice excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "Total of invoice excluding taxes") - /** + /** * Total of invoice excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** + /** * Total tax on invoice - * * @return totalTax - */ + **/ @ApiModelProperty(value = "Total tax on invoice") - /** + /** * Total tax on invoice - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t - * equal the sum of the LineAmounts - * + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts * @return total - */ - @ApiModelProperty( - value = - "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it" - + " doesn’t equal the sum of the LineAmounts") - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t - * equal the sum of the LineAmounts - * + **/ + @ApiModelProperty(value = "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts") + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts * @return total Double - */ + **/ public Double getTotal() { return total; } - /** + /** * Total of discounts applied on the invoice line items - * * @return totalDiscount - */ + **/ @ApiModelProperty(value = "Total of discounts applied on the invoice line items") - /** + /** * Total of discounts applied on the invoice line items - * * @return totalDiscount Double - */ + **/ public Double getTotalDiscount() { return totalDiscount; } /** - * Xero generated unique identifier for invoice - * - * @param invoiceID UUID - * @return Invoice - */ + * Xero generated unique identifier for invoice + * @param invoiceID UUID + * @return Invoice + **/ public Invoice invoiceID(UUID invoiceID) { this.invoiceID = invoiceID; return this; } - /** + /** * Xero generated unique identifier for invoice - * * @return invoiceID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier for invoice") - /** + /** * Xero generated unique identifier for invoice - * * @return invoiceID UUID - */ + **/ public UUID getInvoiceID() { return invoiceID; } - /** - * Xero generated unique identifier for invoice - * - * @param invoiceID UUID - */ + /** + * Xero generated unique identifier for invoice + * @param invoiceID UUID + **/ + public void setInvoiceID(UUID invoiceID) { this.invoiceID = invoiceID; } /** - * Xero generated unique identifier for repeating invoices - * - * @param repeatingInvoiceID UUID - * @return Invoice - */ + * Xero generated unique identifier for repeating invoices + * @param repeatingInvoiceID UUID + * @return Invoice + **/ public Invoice repeatingInvoiceID(UUID repeatingInvoiceID) { this.repeatingInvoiceID = repeatingInvoiceID; return this; } - /** + /** * Xero generated unique identifier for repeating invoices - * * @return repeatingInvoiceID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier for repeating invoices") - /** + /** * Xero generated unique identifier for repeating invoices - * * @return repeatingInvoiceID UUID - */ + **/ public UUID getRepeatingInvoiceID() { return repeatingInvoiceID; } - /** - * Xero generated unique identifier for repeating invoices - * - * @param repeatingInvoiceID UUID - */ + /** + * Xero generated unique identifier for repeating invoices + * @param repeatingInvoiceID UUID + **/ + public void setRepeatingInvoiceID(UUID repeatingInvoiceID) { this.repeatingInvoiceID = repeatingInvoiceID; } - /** + /** * boolean to indicate if an invoice has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "boolean to indicate if an invoice has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "boolean to indicate if an invoice has an attachment") + /** * boolean to indicate if an invoice has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** + /** * boolean to indicate if an invoice has a discount - * * @return isDiscounted - */ + **/ @ApiModelProperty(value = "boolean to indicate if an invoice has a discount") - /** + /** * boolean to indicate if an invoice has a discount - * * @return isDiscounted Boolean - */ + **/ public Boolean getIsDiscounted() { return isDiscounted; } - /** + /** * See Payments - * * @return payments - */ + **/ @ApiModelProperty(value = "See Payments") - /** + /** * See Payments - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** + /** * See Prepayments - * * @return prepayments - */ + **/ @ApiModelProperty(value = "See Prepayments") - /** + /** * See Prepayments - * * @return prepayments List - */ + **/ public List getPrepayments() { return prepayments; } - /** + /** * See Overpayments - * * @return overpayments - */ + **/ @ApiModelProperty(value = "See Overpayments") - /** + /** * See Overpayments - * * @return overpayments List - */ + **/ public List getOverpayments() { return overpayments; } - /** + /** * Amount remaining to be paid on invoice - * * @return amountDue - */ + **/ @ApiModelProperty(value = "Amount remaining to be paid on invoice") - /** + /** * Amount remaining to be paid on invoice - * * @return amountDue Double - */ + **/ public Double getAmountDue() { return amountDue; } - /** + /** * Sum of payments received for invoice - * * @return amountPaid - */ + **/ @ApiModelProperty(value = "Sum of payments received for invoice") - /** + /** * Sum of payments received for invoice - * * @return amountPaid Double - */ + **/ public Double getAmountPaid() { return amountPaid; } - /** + /** * The date the invoice was fully paid. Only returned on fully paid invoices - * * @return fullyPaidOnDate - */ - @ApiModelProperty( - value = "The date the invoice was fully paid. Only returned on fully paid invoices") - /** + **/ + @ApiModelProperty(value = "The date the invoice was fully paid. Only returned on fully paid invoices") + /** * The date the invoice was fully paid. Only returned on fully paid invoices - * * @return fullyPaidOnDate String - */ + **/ public String getFullyPaidOnDate() { return fullyPaidOnDate; } - /** + /** * The date the invoice was fully paid. Only returned on fully paid invoices - * * @return LocalDate - */ + **/ public LocalDate getFullyPaidOnDateAsDate() { if (this.fullyPaidOnDate != null) { try { return util.convertStringToDate(this.fullyPaidOnDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** + /** * Sum of all credit notes, over-payments and pre-payments applied to invoice - * * @return amountCredited - */ - @ApiModelProperty( - value = "Sum of all credit notes, over-payments and pre-payments applied to invoice") - /** + **/ + @ApiModelProperty(value = "Sum of all credit notes, over-payments and pre-payments applied to invoice") + /** * Sum of all credit notes, over-payments and pre-payments applied to invoice - * * @return amountCredited Double - */ + **/ public Double getAmountCredited() { return amountCredited; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** + /** * Details of credit notes that have been applied to an invoice - * * @return creditNotes - */ + **/ @ApiModelProperty(value = "Details of credit notes that have been applied to an invoice") - /** + /** * Details of credit notes that have been applied to an invoice - * * @return creditNotes List - */ + **/ public List getCreditNotes() { return creditNotes; } /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - * @return Invoice - */ + * Displays array of attachments from the API + * @param attachments List<Attachment> + * @return Invoice + **/ public Invoice attachments(List attachments) { this.attachments = attachments; return this; @@ -1374,10 +1277,9 @@ public Invoice attachments(List attachments) { /** * Displays array of attachments from the API - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return Invoice - */ + **/ public Invoice addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -1386,108 +1288,97 @@ public Invoice addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * Displays array of attachments from the API - * * @return attachments - */ + **/ @ApiModelProperty(value = "Displays array of attachments from the API") - /** + /** * Displays array of attachments from the API - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - */ + /** + * Displays array of attachments from the API + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } /** - * A boolean to indicate if a invoice has an validation errors - * - * @param hasErrors Boolean - * @return Invoice - */ + * A boolean to indicate if a invoice has an validation errors + * @param hasErrors Boolean + * @return Invoice + **/ public Invoice hasErrors(Boolean hasErrors) { this.hasErrors = hasErrors; return this; } - /** + /** * A boolean to indicate if a invoice has an validation errors - * * @return hasErrors - */ - @ApiModelProperty( - example = "false", - value = "A boolean to indicate if a invoice has an validation errors") - /** + **/ + @ApiModelProperty(example = "false", value = "A boolean to indicate if a invoice has an validation errors") + /** * A boolean to indicate if a invoice has an validation errors - * * @return hasErrors Boolean - */ + **/ public Boolean getHasErrors() { return hasErrors; } - /** - * A boolean to indicate if a invoice has an validation errors - * - * @param hasErrors Boolean - */ + /** + * A boolean to indicate if a invoice has an validation errors + * @param hasErrors Boolean + **/ + public void setHasErrors(Boolean hasErrors) { this.hasErrors = hasErrors; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return Invoice - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return Invoice + **/ public Invoice statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Invoice - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Invoice + **/ public Invoice validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -1495,10 +1386,9 @@ public Invoice validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Invoice - */ + **/ public Invoice addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -1507,36 +1397,33 @@ public Invoice addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Invoice - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Invoice + **/ public Invoice warnings(List warnings) { this.warnings = warnings; return this; @@ -1544,10 +1431,9 @@ public Invoice warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Invoice - */ + **/ public Invoice addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -1556,36 +1442,33 @@ public Invoice addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * An array of addresses used to auto calculate sales tax - * - * @param invoiceAddresses List<InvoiceAddress> - * @return Invoice - */ + * An array of addresses used to auto calculate sales tax + * @param invoiceAddresses List<InvoiceAddress> + * @return Invoice + **/ public Invoice invoiceAddresses(List invoiceAddresses) { this.invoiceAddresses = invoiceAddresses; return this; @@ -1593,10 +1476,9 @@ public Invoice invoiceAddresses(List invoiceAddresses) { /** * An array of addresses used to auto calculate sales tax - * - * @param invoiceAddressesItem InvoiceAddress + * @param invoiceAddressesItem InvoiceAddress * @return Invoice - */ + **/ public Invoice addInvoiceAddressesItem(InvoiceAddress invoiceAddressesItem) { if (this.invoiceAddresses == null) { this.invoiceAddresses = new ArrayList(); @@ -1605,30 +1487,29 @@ public Invoice addInvoiceAddressesItem(InvoiceAddress invoiceAddressesItem) { return this; } - /** + /** * An array of addresses used to auto calculate sales tax - * * @return invoiceAddresses - */ + **/ @ApiModelProperty(value = "An array of addresses used to auto calculate sales tax") - /** + /** * An array of addresses used to auto calculate sales tax - * * @return invoiceAddresses List - */ + **/ public List getInvoiceAddresses() { return invoiceAddresses; } - /** - * An array of addresses used to auto calculate sales tax - * - * @param invoiceAddresses List<InvoiceAddress> - */ + /** + * An array of addresses used to auto calculate sales tax + * @param invoiceAddresses List<InvoiceAddress> + **/ + public void setInvoiceAddresses(List invoiceAddresses) { this.invoiceAddresses = invoiceAddresses; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1638,95 +1519,55 @@ public boolean equals(java.lang.Object o) { return false; } Invoice invoice = (Invoice) o; - return Objects.equals(this.type, invoice.type) - && Objects.equals(this.contact, invoice.contact) - && Objects.equals(this.lineItems, invoice.lineItems) - && Objects.equals(this.date, invoice.date) - && Objects.equals(this.dueDate, invoice.dueDate) - && Objects.equals(this.lineAmountTypes, invoice.lineAmountTypes) - && Objects.equals(this.invoiceNumber, invoice.invoiceNumber) - && Objects.equals(this.reference, invoice.reference) - && Objects.equals(this.brandingThemeID, invoice.brandingThemeID) - && Objects.equals(this.url, invoice.url) - && Objects.equals(this.currencyCode, invoice.currencyCode) - && Objects.equals(this.currencyRate, invoice.currencyRate) - && Objects.equals(this.status, invoice.status) - && Objects.equals(this.sentToContact, invoice.sentToContact) - && Objects.equals(this.expectedPaymentDate, invoice.expectedPaymentDate) - && Objects.equals(this.plannedPaymentDate, invoice.plannedPaymentDate) - && Objects.equals(this.ciSDeduction, invoice.ciSDeduction) - && Objects.equals(this.ciSRate, invoice.ciSRate) - && Objects.equals(this.subTotal, invoice.subTotal) - && Objects.equals(this.totalTax, invoice.totalTax) - && Objects.equals(this.total, invoice.total) - && Objects.equals(this.totalDiscount, invoice.totalDiscount) - && Objects.equals(this.invoiceID, invoice.invoiceID) - && Objects.equals(this.repeatingInvoiceID, invoice.repeatingInvoiceID) - && Objects.equals(this.hasAttachments, invoice.hasAttachments) - && Objects.equals(this.isDiscounted, invoice.isDiscounted) - && Objects.equals(this.payments, invoice.payments) - && Objects.equals(this.prepayments, invoice.prepayments) - && Objects.equals(this.overpayments, invoice.overpayments) - && Objects.equals(this.amountDue, invoice.amountDue) - && Objects.equals(this.amountPaid, invoice.amountPaid) - && Objects.equals(this.fullyPaidOnDate, invoice.fullyPaidOnDate) - && Objects.equals(this.amountCredited, invoice.amountCredited) - && Objects.equals(this.updatedDateUTC, invoice.updatedDateUTC) - && Objects.equals(this.creditNotes, invoice.creditNotes) - && Objects.equals(this.attachments, invoice.attachments) - && Objects.equals(this.hasErrors, invoice.hasErrors) - && Objects.equals(this.statusAttributeString, invoice.statusAttributeString) - && Objects.equals(this.validationErrors, invoice.validationErrors) - && Objects.equals(this.warnings, invoice.warnings) - && Objects.equals(this.invoiceAddresses, invoice.invoiceAddresses); + return Objects.equals(this.type, invoice.type) && + Objects.equals(this.contact, invoice.contact) && + Objects.equals(this.lineItems, invoice.lineItems) && + Objects.equals(this.date, invoice.date) && + Objects.equals(this.dueDate, invoice.dueDate) && + Objects.equals(this.lineAmountTypes, invoice.lineAmountTypes) && + Objects.equals(this.invoiceNumber, invoice.invoiceNumber) && + Objects.equals(this.reference, invoice.reference) && + Objects.equals(this.brandingThemeID, invoice.brandingThemeID) && + Objects.equals(this.url, invoice.url) && + Objects.equals(this.currencyCode, invoice.currencyCode) && + Objects.equals(this.currencyRate, invoice.currencyRate) && + Objects.equals(this.status, invoice.status) && + Objects.equals(this.sentToContact, invoice.sentToContact) && + Objects.equals(this.expectedPaymentDate, invoice.expectedPaymentDate) && + Objects.equals(this.plannedPaymentDate, invoice.plannedPaymentDate) && + Objects.equals(this.ciSDeduction, invoice.ciSDeduction) && + Objects.equals(this.ciSRate, invoice.ciSRate) && + Objects.equals(this.subTotal, invoice.subTotal) && + Objects.equals(this.totalTax, invoice.totalTax) && + Objects.equals(this.total, invoice.total) && + Objects.equals(this.totalDiscount, invoice.totalDiscount) && + Objects.equals(this.invoiceID, invoice.invoiceID) && + Objects.equals(this.repeatingInvoiceID, invoice.repeatingInvoiceID) && + Objects.equals(this.hasAttachments, invoice.hasAttachments) && + Objects.equals(this.isDiscounted, invoice.isDiscounted) && + Objects.equals(this.payments, invoice.payments) && + Objects.equals(this.prepayments, invoice.prepayments) && + Objects.equals(this.overpayments, invoice.overpayments) && + Objects.equals(this.amountDue, invoice.amountDue) && + Objects.equals(this.amountPaid, invoice.amountPaid) && + Objects.equals(this.fullyPaidOnDate, invoice.fullyPaidOnDate) && + Objects.equals(this.amountCredited, invoice.amountCredited) && + Objects.equals(this.updatedDateUTC, invoice.updatedDateUTC) && + Objects.equals(this.creditNotes, invoice.creditNotes) && + Objects.equals(this.attachments, invoice.attachments) && + Objects.equals(this.hasErrors, invoice.hasErrors) && + Objects.equals(this.statusAttributeString, invoice.statusAttributeString) && + Objects.equals(this.validationErrors, invoice.validationErrors) && + Objects.equals(this.warnings, invoice.warnings) && + Objects.equals(this.invoiceAddresses, invoice.invoiceAddresses); } @Override public int hashCode() { - return Objects.hash( - type, - contact, - lineItems, - date, - dueDate, - lineAmountTypes, - invoiceNumber, - reference, - brandingThemeID, - url, - currencyCode, - currencyRate, - status, - sentToContact, - expectedPaymentDate, - plannedPaymentDate, - ciSDeduction, - ciSRate, - subTotal, - totalTax, - total, - totalDiscount, - invoiceID, - repeatingInvoiceID, - hasAttachments, - isDiscounted, - payments, - prepayments, - overpayments, - amountDue, - amountPaid, - fullyPaidOnDate, - amountCredited, - updatedDateUTC, - creditNotes, - attachments, - hasErrors, - statusAttributeString, - validationErrors, - warnings, - invoiceAddresses); + return Objects.hash(type, contact, lineItems, date, dueDate, lineAmountTypes, invoiceNumber, reference, brandingThemeID, url, currencyCode, currencyRate, status, sentToContact, expectedPaymentDate, plannedPaymentDate, ciSDeduction, ciSRate, subTotal, totalTax, total, totalDiscount, invoiceID, repeatingInvoiceID, hasAttachments, isDiscounted, payments, prepayments, overpayments, amountDue, amountPaid, fullyPaidOnDate, amountCredited, updatedDateUTC, creditNotes, attachments, hasErrors, statusAttributeString, validationErrors, warnings, invoiceAddresses); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1745,9 +1586,7 @@ public String toString() { sb.append(" currencyRate: ").append(toIndentedString(currencyRate)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" sentToContact: ").append(toIndentedString(sentToContact)).append("\n"); - sb.append(" expectedPaymentDate: ") - .append(toIndentedString(expectedPaymentDate)) - .append("\n"); + sb.append(" expectedPaymentDate: ").append(toIndentedString(expectedPaymentDate)).append("\n"); sb.append(" plannedPaymentDate: ").append(toIndentedString(plannedPaymentDate)).append("\n"); sb.append(" ciSDeduction: ").append(toIndentedString(ciSDeduction)).append("\n"); sb.append(" ciSRate: ").append(toIndentedString(ciSRate)).append("\n"); @@ -1770,9 +1609,7 @@ public String toString() { sb.append(" creditNotes: ").append(toIndentedString(creditNotes)).append("\n"); sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); sb.append(" hasErrors: ").append(toIndentedString(hasErrors)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); sb.append(" invoiceAddresses: ").append(toIndentedString(invoiceAddresses)).append("\n"); @@ -1781,7 +1618,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1789,4 +1627,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/InvoiceAddress.java b/src/main/java/com/xero/models/accounting/InvoiceAddress.java index 8ab4136c6..f32328de6 100644 --- a/src/main/java/com/xero/models/accounting/InvoiceAddress.java +++ b/src/main/java/com/xero/models/accounting/InvoiceAddress.java @@ -9,24 +9,45 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * InvoiceAddress + */ -/** InvoiceAddress */ public class InvoiceAddress { StringUtil util = new StringUtil(); - /** Indicates whether the address is defined as origin (FROM) or destination (TO) */ + /** + * Indicates whether the address is defined as origin (FROM) or destination (TO) + */ public enum InvoiceAddressTypeEnum { - /** FROM */ + /** + * FROM + */ FROM("FROM"), - - /** TO */ + + /** + * TO + */ TO("TO"); private String value; @@ -35,31 +56,25 @@ public enum InvoiceAddressTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static InvoiceAddressTypeEnum fromValue(String value) { for (InvoiceAddressTypeEnum b : InvoiceAddressTypeEnum.values()) { @@ -71,6 +86,7 @@ public static InvoiceAddressTypeEnum fromValue(String value) { } } + @JsonProperty("InvoiceAddressType") private InvoiceAddressTypeEnum invoiceAddressType; @@ -98,321 +114,294 @@ public static InvoiceAddressTypeEnum fromValue(String value) { @JsonProperty("Country") private String country; /** - * Indicates whether the address is defined as origin (FROM) or destination (TO) - * - * @param invoiceAddressType InvoiceAddressTypeEnum - * @return InvoiceAddress - */ + * Indicates whether the address is defined as origin (FROM) or destination (TO) + * @param invoiceAddressType InvoiceAddressTypeEnum + * @return InvoiceAddress + **/ public InvoiceAddress invoiceAddressType(InvoiceAddressTypeEnum invoiceAddressType) { this.invoiceAddressType = invoiceAddressType; return this; } - /** + /** * Indicates whether the address is defined as origin (FROM) or destination (TO) - * * @return invoiceAddressType - */ - @ApiModelProperty( - value = "Indicates whether the address is defined as origin (FROM) or destination (TO)") - /** + **/ + @ApiModelProperty(value = "Indicates whether the address is defined as origin (FROM) or destination (TO)") + /** * Indicates whether the address is defined as origin (FROM) or destination (TO) - * * @return invoiceAddressType InvoiceAddressTypeEnum - */ + **/ public InvoiceAddressTypeEnum getInvoiceAddressType() { return invoiceAddressType; } - /** - * Indicates whether the address is defined as origin (FROM) or destination (TO) - * - * @param invoiceAddressType InvoiceAddressTypeEnum - */ + /** + * Indicates whether the address is defined as origin (FROM) or destination (TO) + * @param invoiceAddressType InvoiceAddressTypeEnum + **/ + public void setInvoiceAddressType(InvoiceAddressTypeEnum invoiceAddressType) { this.invoiceAddressType = invoiceAddressType; } /** - * First line of a physical address - * - * @param addressLine1 String - * @return InvoiceAddress - */ + * First line of a physical address + * @param addressLine1 String + * @return InvoiceAddress + **/ public InvoiceAddress addressLine1(String addressLine1) { this.addressLine1 = addressLine1; return this; } - /** + /** * First line of a physical address - * * @return addressLine1 - */ + **/ @ApiModelProperty(value = "First line of a physical address") - /** + /** * First line of a physical address - * * @return addressLine1 String - */ + **/ public String getAddressLine1() { return addressLine1; } - /** - * First line of a physical address - * - * @param addressLine1 String - */ + /** + * First line of a physical address + * @param addressLine1 String + **/ + public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } /** - * Second line of a physical address - * - * @param addressLine2 String - * @return InvoiceAddress - */ + * Second line of a physical address + * @param addressLine2 String + * @return InvoiceAddress + **/ public InvoiceAddress addressLine2(String addressLine2) { this.addressLine2 = addressLine2; return this; } - /** + /** * Second line of a physical address - * * @return addressLine2 - */ + **/ @ApiModelProperty(value = "Second line of a physical address") - /** + /** * Second line of a physical address - * * @return addressLine2 String - */ + **/ public String getAddressLine2() { return addressLine2; } - /** - * Second line of a physical address - * - * @param addressLine2 String - */ + /** + * Second line of a physical address + * @param addressLine2 String + **/ + public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } /** - * Third line of a physical address - * - * @param addressLine3 String - * @return InvoiceAddress - */ + * Third line of a physical address + * @param addressLine3 String + * @return InvoiceAddress + **/ public InvoiceAddress addressLine3(String addressLine3) { this.addressLine3 = addressLine3; return this; } - /** + /** * Third line of a physical address - * * @return addressLine3 - */ + **/ @ApiModelProperty(value = "Third line of a physical address") - /** + /** * Third line of a physical address - * * @return addressLine3 String - */ + **/ public String getAddressLine3() { return addressLine3; } - /** - * Third line of a physical address - * - * @param addressLine3 String - */ + /** + * Third line of a physical address + * @param addressLine3 String + **/ + public void setAddressLine3(String addressLine3) { this.addressLine3 = addressLine3; } /** - * Fourth line of a physical address - * - * @param addressLine4 String - * @return InvoiceAddress - */ + * Fourth line of a physical address + * @param addressLine4 String + * @return InvoiceAddress + **/ public InvoiceAddress addressLine4(String addressLine4) { this.addressLine4 = addressLine4; return this; } - /** + /** * Fourth line of a physical address - * * @return addressLine4 - */ + **/ @ApiModelProperty(value = "Fourth line of a physical address") - /** + /** * Fourth line of a physical address - * * @return addressLine4 String - */ + **/ public String getAddressLine4() { return addressLine4; } - /** - * Fourth line of a physical address - * - * @param addressLine4 String - */ + /** + * Fourth line of a physical address + * @param addressLine4 String + **/ + public void setAddressLine4(String addressLine4) { this.addressLine4 = addressLine4; } /** - * City of a physical address - * - * @param city String - * @return InvoiceAddress - */ + * City of a physical address + * @param city String + * @return InvoiceAddress + **/ public InvoiceAddress city(String city) { this.city = city; return this; } - /** + /** * City of a physical address - * * @return city - */ + **/ @ApiModelProperty(value = "City of a physical address") - /** + /** * City of a physical address - * * @return city String - */ + **/ public String getCity() { return city; } - /** - * City of a physical address - * - * @param city String - */ + /** + * City of a physical address + * @param city String + **/ + public void setCity(String city) { this.city = city; } /** - * Region or state of a physical address - * - * @param region String - * @return InvoiceAddress - */ + * Region or state of a physical address + * @param region String + * @return InvoiceAddress + **/ public InvoiceAddress region(String region) { this.region = region; return this; } - /** + /** * Region or state of a physical address - * * @return region - */ + **/ @ApiModelProperty(value = "Region or state of a physical address") - /** + /** * Region or state of a physical address - * * @return region String - */ + **/ public String getRegion() { return region; } - /** - * Region or state of a physical address - * - * @param region String - */ + /** + * Region or state of a physical address + * @param region String + **/ + public void setRegion(String region) { this.region = region; } /** - * Postal code of a physical address - * - * @param postalCode String - * @return InvoiceAddress - */ + * Postal code of a physical address + * @param postalCode String + * @return InvoiceAddress + **/ public InvoiceAddress postalCode(String postalCode) { this.postalCode = postalCode; return this; } - /** + /** * Postal code of a physical address - * * @return postalCode - */ + **/ @ApiModelProperty(value = "Postal code of a physical address") - /** + /** * Postal code of a physical address - * * @return postalCode String - */ + **/ public String getPostalCode() { return postalCode; } - /** - * Postal code of a physical address - * - * @param postalCode String - */ + /** + * Postal code of a physical address + * @param postalCode String + **/ + public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** - * Country of a physical address - * - * @param country String - * @return InvoiceAddress - */ + * Country of a physical address + * @param country String + * @return InvoiceAddress + **/ public InvoiceAddress country(String country) { this.country = country; return this; } - /** + /** * Country of a physical address - * * @return country - */ + **/ @ApiModelProperty(value = "Country of a physical address") - /** + /** * Country of a physical address - * * @return country String - */ + **/ public String getCountry() { return country; } - /** - * Country of a physical address - * - * @param country String - */ + /** + * Country of a physical address + * @param country String + **/ + public void setCountry(String country) { this.country = country; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -422,31 +411,23 @@ public boolean equals(java.lang.Object o) { return false; } InvoiceAddress invoiceAddress = (InvoiceAddress) o; - return Objects.equals(this.invoiceAddressType, invoiceAddress.invoiceAddressType) - && Objects.equals(this.addressLine1, invoiceAddress.addressLine1) - && Objects.equals(this.addressLine2, invoiceAddress.addressLine2) - && Objects.equals(this.addressLine3, invoiceAddress.addressLine3) - && Objects.equals(this.addressLine4, invoiceAddress.addressLine4) - && Objects.equals(this.city, invoiceAddress.city) - && Objects.equals(this.region, invoiceAddress.region) - && Objects.equals(this.postalCode, invoiceAddress.postalCode) - && Objects.equals(this.country, invoiceAddress.country); + return Objects.equals(this.invoiceAddressType, invoiceAddress.invoiceAddressType) && + Objects.equals(this.addressLine1, invoiceAddress.addressLine1) && + Objects.equals(this.addressLine2, invoiceAddress.addressLine2) && + Objects.equals(this.addressLine3, invoiceAddress.addressLine3) && + Objects.equals(this.addressLine4, invoiceAddress.addressLine4) && + Objects.equals(this.city, invoiceAddress.city) && + Objects.equals(this.region, invoiceAddress.region) && + Objects.equals(this.postalCode, invoiceAddress.postalCode) && + Objects.equals(this.country, invoiceAddress.country); } @Override public int hashCode() { - return Objects.hash( - invoiceAddressType, - addressLine1, - addressLine2, - addressLine3, - addressLine4, - city, - region, - postalCode, - country); + return Objects.hash(invoiceAddressType, addressLine1, addressLine2, addressLine3, addressLine4, city, region, postalCode, country); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -465,7 +446,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -473,4 +455,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/InvoiceReminder.java b/src/main/java/com/xero/models/accounting/InvoiceReminder.java index 5d2eabb51..93da998ce 100644 --- a/src/main/java/com/xero/models/accounting/InvoiceReminder.java +++ b/src/main/java/com/xero/models/accounting/InvoiceReminder.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * InvoiceReminder + */ -/** InvoiceReminder */ public class InvoiceReminder { StringUtil util = new StringUtil(); @JsonProperty("Enabled") private Boolean enabled; /** - * setting for on or off - * - * @param enabled Boolean - * @return InvoiceReminder - */ + * setting for on or off + * @param enabled Boolean + * @return InvoiceReminder + **/ public InvoiceReminder enabled(Boolean enabled) { this.enabled = enabled; return this; } - /** + /** * setting for on or off - * * @return enabled - */ + **/ @ApiModelProperty(value = "setting for on or off") - /** + /** * setting for on or off - * * @return enabled Boolean - */ + **/ public Boolean getEnabled() { return enabled; } - /** - * setting for on or off - * - * @param enabled Boolean - */ + /** + * setting for on or off + * @param enabled Boolean + **/ + public void setEnabled(Boolean enabled) { this.enabled = enabled; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(enabled); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/InvoiceReminders.java b/src/main/java/com/xero/models/accounting/InvoiceReminders.java index a131b6bed..d69c9f802 100644 --- a/src/main/java/com/xero/models/accounting/InvoiceReminders.java +++ b/src/main/java/com/xero/models/accounting/InvoiceReminders.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.InvoiceReminder; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * InvoiceReminders + */ -/** InvoiceReminders */ public class InvoiceReminders { StringUtil util = new StringUtil(); @JsonProperty("InvoiceReminders") private List invoiceReminders = new ArrayList(); /** - * invoiceReminders - * - * @param invoiceReminders List<InvoiceReminder> - * @return InvoiceReminders - */ + * invoiceReminders + * @param invoiceReminders List<InvoiceReminder> + * @return InvoiceReminders + **/ public InvoiceReminders invoiceReminders(List invoiceReminders) { this.invoiceReminders = invoiceReminders; return this; @@ -37,10 +54,9 @@ public InvoiceReminders invoiceReminders(List invoiceReminders) /** * invoiceReminders - * - * @param invoiceRemindersItem InvoiceReminder + * @param invoiceRemindersItem InvoiceReminder * @return InvoiceReminders - */ + **/ public InvoiceReminders addInvoiceRemindersItem(InvoiceReminder invoiceRemindersItem) { if (this.invoiceReminders == null) { this.invoiceReminders = new ArrayList(); @@ -49,30 +65,29 @@ public InvoiceReminders addInvoiceRemindersItem(InvoiceReminder invoiceReminders return this; } - /** + /** * Get invoiceReminders - * * @return invoiceReminders - */ + **/ @ApiModelProperty(value = "") - /** + /** * invoiceReminders - * * @return invoiceReminders List - */ + **/ public List getInvoiceReminders() { return invoiceReminders; } - /** - * invoiceReminders - * - * @param invoiceReminders List<InvoiceReminder> - */ + /** + * invoiceReminders + * @param invoiceReminders List<InvoiceReminder> + **/ + public void setInvoiceReminders(List invoiceReminders) { this.invoiceReminders = invoiceReminders; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(invoiceReminders); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Invoices.java b/src/main/java/com/xero/models/accounting/Invoices.java index e183da2ce..497ebcd59 100644 --- a/src/main/java/com/xero/models/accounting/Invoices.java +++ b/src/main/java/com/xero/models/accounting/Invoices.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Invoice; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Invoices + */ -/** Invoices */ public class Invoices { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class Invoices { @JsonProperty("Invoices") private List invoices = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Invoices - */ + * pagination + * @param pagination Pagination + * @return Invoices + **/ public Invoices pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Invoices - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Invoices + **/ public Invoices warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public Invoices warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Invoices - */ + **/ public Invoices addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public Invoices addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * invoices - * - * @param invoices List<Invoice> - * @return Invoices - */ + * invoices + * @param invoices List<Invoice> + * @return Invoices + **/ public Invoices invoices(List invoices) { this.invoices = invoices; return this; @@ -127,10 +139,9 @@ public Invoices invoices(List invoices) { /** * invoices - * - * @param invoicesItem Invoice + * @param invoicesItem Invoice * @return Invoices - */ + **/ public Invoices addInvoicesItem(Invoice invoicesItem) { if (this.invoices == null) { this.invoices = new ArrayList(); @@ -139,30 +150,29 @@ public Invoices addInvoicesItem(Invoice invoicesItem) { return this; } - /** + /** * Get invoices - * * @return invoices - */ + **/ @ApiModelProperty(value = "") - /** + /** * invoices - * * @return invoices List - */ + **/ public List getInvoices() { return invoices; } - /** - * invoices - * - * @param invoices List<Invoice> - */ + /** + * invoices + * @param invoices List<Invoice> + **/ + public void setInvoices(List invoices) { this.invoices = invoices; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } Invoices invoices = (Invoices) o; - return Objects.equals(this.pagination, invoices.pagination) - && Objects.equals(this.warnings, invoices.warnings) - && Objects.equals(this.invoices, invoices.invoices); + return Objects.equals(this.pagination, invoices.pagination) && + Objects.equals(this.warnings, invoices.warnings) && + Objects.equals(this.invoices, invoices.invoices); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, invoices); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Item.java b/src/main/java/com/xero/models/accounting/Item.java index 68d9a6f69..2e0873236 100644 --- a/src/main/java/com/xero/models/accounting/Item.java +++ b/src/main/java/com/xero/models/accounting/Item.java @@ -9,19 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Purchase; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Item + */ -/** Item */ public class Item { StringUtil util = new StringUtil(); @@ -73,570 +90,485 @@ public class Item { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * User defined item code (max length = 30) - * - * @param code String - * @return Item - */ + * User defined item code (max length = 30) + * @param code String + * @return Item + **/ public Item code(String code) { this.code = code; return this; } - /** + /** * User defined item code (max length = 30) - * * @return code - */ + **/ @ApiModelProperty(required = true, value = "User defined item code (max length = 30)") - /** + /** * User defined item code (max length = 30) - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * User defined item code (max length = 30) - * - * @param code String - */ + /** + * User defined item code (max length = 30) + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * The inventory asset account for the item. The account must be of type INVENTORY. The - * COGSAccountCode in PurchaseDetails is also required to create a tracked item - * - * @param inventoryAssetAccountCode String - * @return Item - */ + * The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item + * @param inventoryAssetAccountCode String + * @return Item + **/ public Item inventoryAssetAccountCode(String inventoryAssetAccountCode) { this.inventoryAssetAccountCode = inventoryAssetAccountCode; return this; } - /** - * The inventory asset account for the item. The account must be of type INVENTORY. The - * COGSAccountCode in PurchaseDetails is also required to create a tracked item - * + /** + * The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item * @return inventoryAssetAccountCode - */ - @ApiModelProperty( - value = - "The inventory asset account for the item. The account must be of type INVENTORY. The " - + " COGSAccountCode in PurchaseDetails is also required to create a tracked item") - /** - * The inventory asset account for the item. The account must be of type INVENTORY. The - * COGSAccountCode in PurchaseDetails is also required to create a tracked item - * + **/ + @ApiModelProperty(value = "The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item") + /** + * The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item * @return inventoryAssetAccountCode String - */ + **/ public String getInventoryAssetAccountCode() { return inventoryAssetAccountCode; } - /** - * The inventory asset account for the item. The account must be of type INVENTORY. The - * COGSAccountCode in PurchaseDetails is also required to create a tracked item - * - * @param inventoryAssetAccountCode String - */ + /** + * The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item + * @param inventoryAssetAccountCode String + **/ + public void setInventoryAssetAccountCode(String inventoryAssetAccountCode) { this.inventoryAssetAccountCode = inventoryAssetAccountCode; } /** - * The name of the item (max length = 50) - * - * @param name String - * @return Item - */ + * The name of the item (max length = 50) + * @param name String + * @return Item + **/ public Item name(String name) { this.name = name; return this; } - /** + /** * The name of the item (max length = 50) - * * @return name - */ + **/ @ApiModelProperty(value = "The name of the item (max length = 50)") - /** + /** * The name of the item (max length = 50) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the item (max length = 50) - * - * @param name String - */ + /** + * The name of the item (max length = 50) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Boolean value, defaults to true. When IsSold is true the item will be available on sales - * transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails - * values will be nulled. - * - * @param isSold Boolean - * @return Item - */ + * Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. + * @param isSold Boolean + * @return Item + **/ public Item isSold(Boolean isSold) { this.isSold = isSold; return this; } - /** - * Boolean value, defaults to true. When IsSold is true the item will be available on sales - * transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails - * values will be nulled. - * + /** + * Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. * @return isSold - */ - @ApiModelProperty( - value = - "Boolean value, defaults to true. When IsSold is true the item will be available on" - + " sales transactions in the Xero UI. If IsSold is updated to false then" - + " Description and SalesDetails values will be nulled.") - /** - * Boolean value, defaults to true. When IsSold is true the item will be available on sales - * transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails - * values will be nulled. - * + **/ + @ApiModelProperty(value = "Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled.") + /** + * Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. * @return isSold Boolean - */ + **/ public Boolean getIsSold() { return isSold; } - /** - * Boolean value, defaults to true. When IsSold is true the item will be available on sales - * transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails - * values will be nulled. - * - * @param isSold Boolean - */ + /** + * Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. + * @param isSold Boolean + **/ + public void setIsSold(Boolean isSold) { this.isSold = isSold; } /** - * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase - * transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and - * PurchaseDetails values will be nulled. - * - * @param isPurchased Boolean - * @return Item - */ + * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. + * @param isPurchased Boolean + * @return Item + **/ public Item isPurchased(Boolean isPurchased) { this.isPurchased = isPurchased; return this; } - /** - * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase - * transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and - * PurchaseDetails values will be nulled. - * + /** + * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. * @return isPurchased - */ - @ApiModelProperty( - value = - "Boolean value, defaults to true. When IsPurchased is true the item is available for" - + " purchase transactions in the Xero UI. If IsPurchased is updated to false then" - + " PurchaseDescription and PurchaseDetails values will be nulled.") - /** - * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase - * transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and - * PurchaseDetails values will be nulled. - * + **/ + @ApiModelProperty(value = "Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled.") + /** + * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. * @return isPurchased Boolean - */ + **/ public Boolean getIsPurchased() { return isPurchased; } - /** - * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase - * transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and - * PurchaseDetails values will be nulled. - * - * @param isPurchased Boolean - */ + /** + * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. + * @param isPurchased Boolean + **/ + public void setIsPurchased(Boolean isPurchased) { this.isPurchased = isPurchased; } /** - * The sales description of the item (max length = 4000) - * - * @param description String - * @return Item - */ + * The sales description of the item (max length = 4000) + * @param description String + * @return Item + **/ public Item description(String description) { this.description = description; return this; } - /** + /** * The sales description of the item (max length = 4000) - * * @return description - */ + **/ @ApiModelProperty(value = "The sales description of the item (max length = 4000)") - /** + /** * The sales description of the item (max length = 4000) - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * The sales description of the item (max length = 4000) - * - * @param description String - */ + /** + * The sales description of the item (max length = 4000) + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * The purchase description of the item (max length = 4000) - * - * @param purchaseDescription String - * @return Item - */ + * The purchase description of the item (max length = 4000) + * @param purchaseDescription String + * @return Item + **/ public Item purchaseDescription(String purchaseDescription) { this.purchaseDescription = purchaseDescription; return this; } - /** + /** * The purchase description of the item (max length = 4000) - * * @return purchaseDescription - */ + **/ @ApiModelProperty(value = "The purchase description of the item (max length = 4000)") - /** + /** * The purchase description of the item (max length = 4000) - * * @return purchaseDescription String - */ + **/ public String getPurchaseDescription() { return purchaseDescription; } - /** - * The purchase description of the item (max length = 4000) - * - * @param purchaseDescription String - */ + /** + * The purchase description of the item (max length = 4000) + * @param purchaseDescription String + **/ + public void setPurchaseDescription(String purchaseDescription) { this.purchaseDescription = purchaseDescription; } /** - * purchaseDetails - * - * @param purchaseDetails Purchase - * @return Item - */ + * purchaseDetails + * @param purchaseDetails Purchase + * @return Item + **/ public Item purchaseDetails(Purchase purchaseDetails) { this.purchaseDetails = purchaseDetails; return this; } - /** + /** * Get purchaseDetails - * * @return purchaseDetails - */ + **/ @ApiModelProperty(value = "") - /** + /** * purchaseDetails - * * @return purchaseDetails Purchase - */ + **/ public Purchase getPurchaseDetails() { return purchaseDetails; } - /** - * purchaseDetails - * - * @param purchaseDetails Purchase - */ + /** + * purchaseDetails + * @param purchaseDetails Purchase + **/ + public void setPurchaseDetails(Purchase purchaseDetails) { this.purchaseDetails = purchaseDetails; } /** - * salesDetails - * - * @param salesDetails Purchase - * @return Item - */ + * salesDetails + * @param salesDetails Purchase + * @return Item + **/ public Item salesDetails(Purchase salesDetails) { this.salesDetails = salesDetails; return this; } - /** + /** * Get salesDetails - * * @return salesDetails - */ + **/ @ApiModelProperty(value = "") - /** + /** * salesDetails - * * @return salesDetails Purchase - */ + **/ public Purchase getSalesDetails() { return salesDetails; } - /** - * salesDetails - * - * @param salesDetails Purchase - */ + /** + * salesDetails + * @param salesDetails Purchase + **/ + public void setSalesDetails(Purchase salesDetails) { this.salesDetails = salesDetails; } /** - * True for items that are tracked as inventory. An item will be tracked as inventory if the - * InventoryAssetAccountCode and COGSAccountCode are set. - * - * @param isTrackedAsInventory Boolean - * @return Item - */ + * True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. + * @param isTrackedAsInventory Boolean + * @return Item + **/ public Item isTrackedAsInventory(Boolean isTrackedAsInventory) { this.isTrackedAsInventory = isTrackedAsInventory; return this; } - /** - * True for items that are tracked as inventory. An item will be tracked as inventory if the - * InventoryAssetAccountCode and COGSAccountCode are set. - * + /** + * True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. * @return isTrackedAsInventory - */ - @ApiModelProperty( - value = - "True for items that are tracked as inventory. An item will be tracked as inventory if" - + " the InventoryAssetAccountCode and COGSAccountCode are set.") - /** - * True for items that are tracked as inventory. An item will be tracked as inventory if the - * InventoryAssetAccountCode and COGSAccountCode are set. - * + **/ + @ApiModelProperty(value = "True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set.") + /** + * True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. * @return isTrackedAsInventory Boolean - */ + **/ public Boolean getIsTrackedAsInventory() { return isTrackedAsInventory; } - /** - * True for items that are tracked as inventory. An item will be tracked as inventory if the - * InventoryAssetAccountCode and COGSAccountCode are set. - * - * @param isTrackedAsInventory Boolean - */ + /** + * True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. + * @param isTrackedAsInventory Boolean + **/ + public void setIsTrackedAsInventory(Boolean isTrackedAsInventory) { this.isTrackedAsInventory = isTrackedAsInventory; } /** - * The value of the item on hand. Calculated using average cost accounting. - * - * @param totalCostPool Double - * @return Item - */ + * The value of the item on hand. Calculated using average cost accounting. + * @param totalCostPool Double + * @return Item + **/ public Item totalCostPool(Double totalCostPool) { this.totalCostPool = totalCostPool; return this; } - /** + /** * The value of the item on hand. Calculated using average cost accounting. - * * @return totalCostPool - */ - @ApiModelProperty( - value = "The value of the item on hand. Calculated using average cost accounting.") - /** + **/ + @ApiModelProperty(value = "The value of the item on hand. Calculated using average cost accounting.") + /** * The value of the item on hand. Calculated using average cost accounting. - * * @return totalCostPool Double - */ + **/ public Double getTotalCostPool() { return totalCostPool; } - /** - * The value of the item on hand. Calculated using average cost accounting. - * - * @param totalCostPool Double - */ + /** + * The value of the item on hand. Calculated using average cost accounting. + * @param totalCostPool Double + **/ + public void setTotalCostPool(Double totalCostPool) { this.totalCostPool = totalCostPool; } /** - * The quantity of the item on hand - * - * @param quantityOnHand Double - * @return Item - */ + * The quantity of the item on hand + * @param quantityOnHand Double + * @return Item + **/ public Item quantityOnHand(Double quantityOnHand) { this.quantityOnHand = quantityOnHand; return this; } - /** + /** * The quantity of the item on hand - * * @return quantityOnHand - */ + **/ @ApiModelProperty(value = "The quantity of the item on hand") - /** + /** * The quantity of the item on hand - * * @return quantityOnHand Double - */ + **/ public Double getQuantityOnHand() { return quantityOnHand; } - /** - * The quantity of the item on hand - * - * @param quantityOnHand Double - */ + /** + * The quantity of the item on hand + * @param quantityOnHand Double + **/ + public void setQuantityOnHand(Double quantityOnHand) { this.quantityOnHand = quantityOnHand; } - /** + /** * Last modified date in UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date in UTC format") - /** + /** * Last modified date in UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date in UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * The Xero identifier for an Item - * - * @param itemID UUID - * @return Item - */ + * The Xero identifier for an Item + * @param itemID UUID + * @return Item + **/ public Item itemID(UUID itemID) { this.itemID = itemID; return this; } - /** + /** * The Xero identifier for an Item - * * @return itemID - */ + **/ @ApiModelProperty(value = "The Xero identifier for an Item") - /** + /** * The Xero identifier for an Item - * * @return itemID UUID - */ + **/ public UUID getItemID() { return itemID; } - /** - * The Xero identifier for an Item - * - * @param itemID UUID - */ + /** + * The Xero identifier for an Item + * @param itemID UUID + **/ + public void setItemID(UUID itemID) { this.itemID = itemID; } /** - * Status of object - * - * @param statusAttributeString String - * @return Item - */ + * Status of object + * @param statusAttributeString String + * @return Item + **/ public Item statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * Status of object - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "Status of object") - /** + /** * Status of object - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * Status of object - * - * @param statusAttributeString String - */ + /** + * Status of object + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Item - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Item + **/ public Item validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -644,10 +576,9 @@ public Item validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Item - */ + **/ public Item addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -656,30 +587,29 @@ public Item addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -689,79 +619,57 @@ public boolean equals(java.lang.Object o) { return false; } Item item = (Item) o; - return Objects.equals(this.code, item.code) - && Objects.equals(this.inventoryAssetAccountCode, item.inventoryAssetAccountCode) - && Objects.equals(this.name, item.name) - && Objects.equals(this.isSold, item.isSold) - && Objects.equals(this.isPurchased, item.isPurchased) - && Objects.equals(this.description, item.description) - && Objects.equals(this.purchaseDescription, item.purchaseDescription) - && Objects.equals(this.purchaseDetails, item.purchaseDetails) - && Objects.equals(this.salesDetails, item.salesDetails) - && Objects.equals(this.isTrackedAsInventory, item.isTrackedAsInventory) - && Objects.equals(this.totalCostPool, item.totalCostPool) - && Objects.equals(this.quantityOnHand, item.quantityOnHand) - && Objects.equals(this.updatedDateUTC, item.updatedDateUTC) - && Objects.equals(this.itemID, item.itemID) - && Objects.equals(this.statusAttributeString, item.statusAttributeString) - && Objects.equals(this.validationErrors, item.validationErrors); + return Objects.equals(this.code, item.code) && + Objects.equals(this.inventoryAssetAccountCode, item.inventoryAssetAccountCode) && + Objects.equals(this.name, item.name) && + Objects.equals(this.isSold, item.isSold) && + Objects.equals(this.isPurchased, item.isPurchased) && + Objects.equals(this.description, item.description) && + Objects.equals(this.purchaseDescription, item.purchaseDescription) && + Objects.equals(this.purchaseDetails, item.purchaseDetails) && + Objects.equals(this.salesDetails, item.salesDetails) && + Objects.equals(this.isTrackedAsInventory, item.isTrackedAsInventory) && + Objects.equals(this.totalCostPool, item.totalCostPool) && + Objects.equals(this.quantityOnHand, item.quantityOnHand) && + Objects.equals(this.updatedDateUTC, item.updatedDateUTC) && + Objects.equals(this.itemID, item.itemID) && + Objects.equals(this.statusAttributeString, item.statusAttributeString) && + Objects.equals(this.validationErrors, item.validationErrors); } @Override public int hashCode() { - return Objects.hash( - code, - inventoryAssetAccountCode, - name, - isSold, - isPurchased, - description, - purchaseDescription, - purchaseDetails, - salesDetails, - isTrackedAsInventory, - totalCostPool, - quantityOnHand, - updatedDateUTC, - itemID, - statusAttributeString, - validationErrors); + return Objects.hash(code, inventoryAssetAccountCode, name, isSold, isPurchased, description, purchaseDescription, purchaseDetails, salesDetails, isTrackedAsInventory, totalCostPool, quantityOnHand, updatedDateUTC, itemID, statusAttributeString, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Item {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" inventoryAssetAccountCode: ") - .append(toIndentedString(inventoryAssetAccountCode)) - .append("\n"); + sb.append(" inventoryAssetAccountCode: ").append(toIndentedString(inventoryAssetAccountCode)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" isSold: ").append(toIndentedString(isSold)).append("\n"); sb.append(" isPurchased: ").append(toIndentedString(isPurchased)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" purchaseDescription: ") - .append(toIndentedString(purchaseDescription)) - .append("\n"); + sb.append(" purchaseDescription: ").append(toIndentedString(purchaseDescription)).append("\n"); sb.append(" purchaseDetails: ").append(toIndentedString(purchaseDetails)).append("\n"); sb.append(" salesDetails: ").append(toIndentedString(salesDetails)).append("\n"); - sb.append(" isTrackedAsInventory: ") - .append(toIndentedString(isTrackedAsInventory)) - .append("\n"); + sb.append(" isTrackedAsInventory: ").append(toIndentedString(isTrackedAsInventory)).append("\n"); sb.append(" totalCostPool: ").append(toIndentedString(totalCostPool)).append("\n"); sb.append(" quantityOnHand: ").append(toIndentedString(quantityOnHand)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" itemID: ").append(toIndentedString(itemID)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -769,4 +677,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Items.java b/src/main/java/com/xero/models/accounting/Items.java index 48e448493..8d3385338 100644 --- a/src/main/java/com/xero/models/accounting/Items.java +++ b/src/main/java/com/xero/models/accounting/Items.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Item; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Items + */ -/** Items */ public class Items { StringUtil util = new StringUtil(); @JsonProperty("Items") private List items = new ArrayList(); /** - * items - * - * @param items List<Item> - * @return Items - */ + * items + * @param items List<Item> + * @return Items + **/ public Items items(List items) { this.items = items; return this; @@ -37,10 +54,9 @@ public Items items(List items) { /** * items - * - * @param itemsItem Item + * @param itemsItem Item * @return Items - */ + **/ public Items addItemsItem(Item itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -49,30 +65,29 @@ public Items addItemsItem(Item itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<Item> - */ + /** + * items + * @param items List<Item> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Journal.java b/src/main/java/com/xero/models/accounting/Journal.java index b55747f0c..6cd9ced1e 100644 --- a/src/main/java/com/xero/models/accounting/Journal.java +++ b/src/main/java/com/xero/models/accounting/Journal.java @@ -9,24 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.JournalLine; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Journal + */ -/** Journal */ public class Journal { StringUtil util = new StringUtil(); @@ -47,81 +58,133 @@ public class Journal { @JsonProperty("SourceID") private UUID sourceID; - /** The journal source type. The type of transaction that created the journal */ + /** + * The journal source type. The type of transaction that created the journal + */ public enum SourceTypeEnum { - /** ACCREC */ + /** + * ACCREC + */ ACCREC("ACCREC"), - - /** ACCPAY */ + + /** + * ACCPAY + */ ACCPAY("ACCPAY"), - - /** ACCRECCREDIT */ + + /** + * ACCRECCREDIT + */ ACCRECCREDIT("ACCRECCREDIT"), - - /** ACCPAYCREDIT */ + + /** + * ACCPAYCREDIT + */ ACCPAYCREDIT("ACCPAYCREDIT"), - - /** ACCRECPAYMENT */ + + /** + * ACCRECPAYMENT + */ ACCRECPAYMENT("ACCRECPAYMENT"), - - /** ACCPAYPAYMENT */ + + /** + * ACCPAYPAYMENT + */ ACCPAYPAYMENT("ACCPAYPAYMENT"), - - /** ARCREDITPAYMENT */ + + /** + * ARCREDITPAYMENT + */ ARCREDITPAYMENT("ARCREDITPAYMENT"), - - /** APCREDITPAYMENT */ + + /** + * APCREDITPAYMENT + */ APCREDITPAYMENT("APCREDITPAYMENT"), - - /** CASHREC */ + + /** + * CASHREC + */ CASHREC("CASHREC"), - - /** CASHPAID */ + + /** + * CASHPAID + */ CASHPAID("CASHPAID"), - - /** TRANSFER */ + + /** + * TRANSFER + */ TRANSFER("TRANSFER"), - - /** ARPREPAYMENT */ + + /** + * ARPREPAYMENT + */ ARPREPAYMENT("ARPREPAYMENT"), - - /** APPREPAYMENT */ + + /** + * APPREPAYMENT + */ APPREPAYMENT("APPREPAYMENT"), - - /** AROVERPAYMENT */ + + /** + * AROVERPAYMENT + */ AROVERPAYMENT("AROVERPAYMENT"), - - /** APOVERPAYMENT */ + + /** + * APOVERPAYMENT + */ APOVERPAYMENT("APOVERPAYMENT"), - - /** EXPCLAIM */ + + /** + * EXPCLAIM + */ EXPCLAIM("EXPCLAIM"), - - /** EXPPAYMENT */ + + /** + * EXPPAYMENT + */ EXPPAYMENT("EXPPAYMENT"), - - /** MANJOURNAL */ + + /** + * MANJOURNAL + */ MANJOURNAL("MANJOURNAL"), - - /** PAYSLIP */ + + /** + * PAYSLIP + */ PAYSLIP("PAYSLIP"), - - /** WAGEPAYABLE */ + + /** + * WAGEPAYABLE + */ WAGEPAYABLE("WAGEPAYABLE"), - - /** INTEGRATEDPAYROLLPE */ + + /** + * INTEGRATEDPAYROLLPE + */ INTEGRATEDPAYROLLPE("INTEGRATEDPAYROLLPE"), - - /** INTEGRATEDPAYROLLPT */ + + /** + * INTEGRATEDPAYROLLPT + */ INTEGRATEDPAYROLLPT("INTEGRATEDPAYROLLPT"), - - /** EXTERNALSPENDMONEY */ + + /** + * EXTERNALSPENDMONEY + */ EXTERNALSPENDMONEY("EXTERNALSPENDMONEY"), - - /** INTEGRATEDPAYROLLPTPAYMENT */ + + /** + * INTEGRATEDPAYROLLPTPAYMENT + */ INTEGRATEDPAYROLLPTPAYMENT("INTEGRATEDPAYROLLPTPAYMENT"), - - /** INTEGRATEDPAYROLLCN */ + + /** + * INTEGRATEDPAYROLLCN + */ INTEGRATEDPAYROLLCN("INTEGRATEDPAYROLLCN"); private String value; @@ -130,31 +193,25 @@ public enum SourceTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static SourceTypeEnum fromValue(String value) { for (SourceTypeEnum b : SourceTypeEnum.values()) { @@ -166,286 +223,262 @@ public static SourceTypeEnum fromValue(String value) { } } + @JsonProperty("SourceType") private SourceTypeEnum sourceType; @JsonProperty("JournalLines") private List journalLines = new ArrayList(); /** - * Xero identifier - * - * @param journalID UUID - * @return Journal - */ + * Xero identifier + * @param journalID UUID + * @return Journal + **/ public Journal journalID(UUID journalID) { this.journalID = journalID; return this; } - /** + /** * Xero identifier - * * @return journalID - */ + **/ @ApiModelProperty(value = "Xero identifier") - /** + /** * Xero identifier - * * @return journalID UUID - */ + **/ public UUID getJournalID() { return journalID; } - /** - * Xero identifier - * - * @param journalID UUID - */ + /** + * Xero identifier + * @param journalID UUID + **/ + public void setJournalID(UUID journalID) { this.journalID = journalID; } /** - * Date the journal was posted - * - * @param journalDate String - * @return Journal - */ + * Date the journal was posted + * @param journalDate String + * @return Journal + **/ public Journal journalDate(String journalDate) { this.journalDate = journalDate; return this; } - /** + /** * Date the journal was posted - * * @return journalDate - */ + **/ @ApiModelProperty(value = "Date the journal was posted") - /** + /** * Date the journal was posted - * * @return journalDate String - */ + **/ public String getJournalDate() { return journalDate; } - /** + /** * Date the journal was posted - * * @return LocalDate - */ + **/ public LocalDate getJournalDateAsDate() { if (this.journalDate != null) { try { return util.convertStringToDate(this.journalDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date the journal was posted - * - * @param journalDate String - */ + /** + * Date the journal was posted + * @param journalDate String + **/ + public void setJournalDate(String journalDate) { this.journalDate = journalDate; } - /** - * Date the journal was posted - * - * @param journalDate LocalDateTime - */ + /** + * Date the journal was posted + * @param journalDate LocalDateTime + **/ public void setJournalDate(LocalDate journalDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = journalDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = journalDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.journalDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Xero generated journal number - * - * @param journalNumber Integer - * @return Journal - */ + * Xero generated journal number + * @param journalNumber Integer + * @return Journal + **/ public Journal journalNumber(Integer journalNumber) { this.journalNumber = journalNumber; return this; } - /** + /** * Xero generated journal number - * * @return journalNumber - */ + **/ @ApiModelProperty(value = "Xero generated journal number") - /** + /** * Xero generated journal number - * * @return journalNumber Integer - */ + **/ public Integer getJournalNumber() { return journalNumber; } - /** - * Xero generated journal number - * - * @param journalNumber Integer - */ + /** + * Xero generated journal number + * @param journalNumber Integer + **/ + public void setJournalNumber(Integer journalNumber) { this.journalNumber = journalNumber; } - /** + /** * Created date UTC format - * * @return createdDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Created date UTC format") - /** + /** * Created date UTC format - * * @return createdDateUTC String - */ + **/ public String getCreatedDateUTC() { return createdDateUTC; } - /** + /** * Created date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getCreatedDateUTCAsDate() { if (this.createdDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.createdDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * reference field for additional indetifying information - * - * @param reference String - * @return Journal - */ + * reference field for additional indetifying information + * @param reference String + * @return Journal + **/ public Journal reference(String reference) { this.reference = reference; return this; } - /** + /** * reference field for additional indetifying information - * * @return reference - */ + **/ @ApiModelProperty(value = "reference field for additional indetifying information") - /** + /** * reference field for additional indetifying information - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * reference field for additional indetifying information - * - * @param reference String - */ + /** + * reference field for additional indetifying information + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * The identifier for the source transaction (e.g. InvoiceID) - * - * @param sourceID UUID - * @return Journal - */ + * The identifier for the source transaction (e.g. InvoiceID) + * @param sourceID UUID + * @return Journal + **/ public Journal sourceID(UUID sourceID) { this.sourceID = sourceID; return this; } - /** + /** * The identifier for the source transaction (e.g. InvoiceID) - * * @return sourceID - */ + **/ @ApiModelProperty(value = "The identifier for the source transaction (e.g. InvoiceID)") - /** + /** * The identifier for the source transaction (e.g. InvoiceID) - * * @return sourceID UUID - */ + **/ public UUID getSourceID() { return sourceID; } - /** - * The identifier for the source transaction (e.g. InvoiceID) - * - * @param sourceID UUID - */ + /** + * The identifier for the source transaction (e.g. InvoiceID) + * @param sourceID UUID + **/ + public void setSourceID(UUID sourceID) { this.sourceID = sourceID; } /** - * The journal source type. The type of transaction that created the journal - * - * @param sourceType SourceTypeEnum - * @return Journal - */ + * The journal source type. The type of transaction that created the journal + * @param sourceType SourceTypeEnum + * @return Journal + **/ public Journal sourceType(SourceTypeEnum sourceType) { this.sourceType = sourceType; return this; } - /** + /** * The journal source type. The type of transaction that created the journal - * * @return sourceType - */ - @ApiModelProperty( - value = "The journal source type. The type of transaction that created the journal") - /** + **/ + @ApiModelProperty(value = "The journal source type. The type of transaction that created the journal") + /** * The journal source type. The type of transaction that created the journal - * * @return sourceType SourceTypeEnum - */ + **/ public SourceTypeEnum getSourceType() { return sourceType; } - /** - * The journal source type. The type of transaction that created the journal - * - * @param sourceType SourceTypeEnum - */ + /** + * The journal source type. The type of transaction that created the journal + * @param sourceType SourceTypeEnum + **/ + public void setSourceType(SourceTypeEnum sourceType) { this.sourceType = sourceType; } /** - * See JournalLines - * - * @param journalLines List<JournalLine> - * @return Journal - */ + * See JournalLines + * @param journalLines List<JournalLine> + * @return Journal + **/ public Journal journalLines(List journalLines) { this.journalLines = journalLines; return this; @@ -453,10 +486,9 @@ public Journal journalLines(List journalLines) { /** * See JournalLines - * - * @param journalLinesItem JournalLine + * @param journalLinesItem JournalLine * @return Journal - */ + **/ public Journal addJournalLinesItem(JournalLine journalLinesItem) { if (this.journalLines == null) { this.journalLines = new ArrayList(); @@ -465,30 +497,29 @@ public Journal addJournalLinesItem(JournalLine journalLinesItem) { return this; } - /** + /** * See JournalLines - * * @return journalLines - */ + **/ @ApiModelProperty(value = "See JournalLines") - /** + /** * See JournalLines - * * @return journalLines List - */ + **/ public List getJournalLines() { return journalLines; } - /** - * See JournalLines - * - * @param journalLines List<JournalLine> - */ + /** + * See JournalLines + * @param journalLines List<JournalLine> + **/ + public void setJournalLines(List journalLines) { this.journalLines = journalLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -498,29 +529,22 @@ public boolean equals(java.lang.Object o) { return false; } Journal journal = (Journal) o; - return Objects.equals(this.journalID, journal.journalID) - && Objects.equals(this.journalDate, journal.journalDate) - && Objects.equals(this.journalNumber, journal.journalNumber) - && Objects.equals(this.createdDateUTC, journal.createdDateUTC) - && Objects.equals(this.reference, journal.reference) - && Objects.equals(this.sourceID, journal.sourceID) - && Objects.equals(this.sourceType, journal.sourceType) - && Objects.equals(this.journalLines, journal.journalLines); + return Objects.equals(this.journalID, journal.journalID) && + Objects.equals(this.journalDate, journal.journalDate) && + Objects.equals(this.journalNumber, journal.journalNumber) && + Objects.equals(this.createdDateUTC, journal.createdDateUTC) && + Objects.equals(this.reference, journal.reference) && + Objects.equals(this.sourceID, journal.sourceID) && + Objects.equals(this.sourceType, journal.sourceType) && + Objects.equals(this.journalLines, journal.journalLines); } @Override public int hashCode() { - return Objects.hash( - journalID, - journalDate, - journalNumber, - createdDateUTC, - reference, - sourceID, - sourceType, - journalLines); + return Objects.hash(journalID, journalDate, journalNumber, createdDateUTC, reference, sourceID, sourceType, journalLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -538,7 +562,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -546,4 +571,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/JournalLine.java b/src/main/java/com/xero/models/accounting/JournalLine.java index 162be7457..6b656a30c 100644 --- a/src/main/java/com/xero/models/accounting/JournalLine.java +++ b/src/main/java/com/xero/models/accounting/JournalLine.java @@ -9,17 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.AccountType; +import com.xero.models.accounting.TrackingCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * JournalLine + */ -/** JournalLine */ public class JournalLine { StringUtil util = new StringUtil(); @@ -59,399 +78,353 @@ public class JournalLine { @JsonProperty("TrackingCategories") private List trackingCategories = new ArrayList(); /** - * Xero identifier for Journal - * - * @param journalLineID UUID - * @return JournalLine - */ + * Xero identifier for Journal + * @param journalLineID UUID + * @return JournalLine + **/ public JournalLine journalLineID(UUID journalLineID) { this.journalLineID = journalLineID; return this; } - /** + /** * Xero identifier for Journal - * * @return journalLineID - */ - @ApiModelProperty( - example = "7be9db36-3598-4755-ba5c-c2dbc8c4a7a2", - value = "Xero identifier for Journal") - /** + **/ + @ApiModelProperty(example = "7be9db36-3598-4755-ba5c-c2dbc8c4a7a2", value = "Xero identifier for Journal") + /** * Xero identifier for Journal - * * @return journalLineID UUID - */ + **/ public UUID getJournalLineID() { return journalLineID; } - /** - * Xero identifier for Journal - * - * @param journalLineID UUID - */ + /** + * Xero identifier for Journal + * @param journalLineID UUID + **/ + public void setJournalLineID(UUID journalLineID) { this.journalLineID = journalLineID; } /** - * See Accounts - * - * @param accountID UUID - * @return JournalLine - */ + * See Accounts + * @param accountID UUID + * @return JournalLine + **/ public JournalLine accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * See Accounts - * * @return accountID - */ + **/ @ApiModelProperty(example = "ceef66a5-a545-413b-9312-78a53caadbc4", value = "See Accounts") - /** + /** * See Accounts - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * See Accounts - * - * @param accountID UUID - */ + /** + * See Accounts + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * See Accounts - * - * @param accountCode String - * @return JournalLine - */ + * See Accounts + * @param accountCode String + * @return JournalLine + **/ public JournalLine accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * See Accounts - * * @return accountCode - */ + **/ @ApiModelProperty(example = "90.0", value = "See Accounts") - /** + /** * See Accounts - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * See Accounts - * - * @param accountCode String - */ + /** + * See Accounts + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * accountType - * - * @param accountType AccountType - * @return JournalLine - */ + * accountType + * @param accountType AccountType + * @return JournalLine + **/ public JournalLine accountType(AccountType accountType) { this.accountType = accountType; return this; } - /** + /** * Get accountType - * * @return accountType - */ + **/ @ApiModelProperty(value = "") - /** + /** * accountType - * * @return accountType AccountType - */ + **/ public AccountType getAccountType() { return accountType; } - /** - * accountType - * - * @param accountType AccountType - */ + /** + * accountType + * @param accountType AccountType + **/ + public void setAccountType(AccountType accountType) { this.accountType = accountType; } /** - * See AccountCodes - * - * @param accountName String - * @return JournalLine - */ + * See AccountCodes + * @param accountName String + * @return JournalLine + **/ public JournalLine accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * See AccountCodes - * * @return accountName - */ + **/ @ApiModelProperty(example = "Checking Account", value = "See AccountCodes") - /** + /** * See AccountCodes - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * See AccountCodes - * - * @param accountName String - */ + /** + * See AccountCodes + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * The description from the source transaction line item. Only returned if populated. - * - * @param description String - * @return JournalLine - */ + * The description from the source transaction line item. Only returned if populated. + * @param description String + * @return JournalLine + **/ public JournalLine description(String description) { this.description = description; return this; } - /** + /** * The description from the source transaction line item. Only returned if populated. - * * @return description - */ - @ApiModelProperty( - example = "My business checking account", - value = "The description from the source transaction line item. Only returned if populated.") - /** + **/ + @ApiModelProperty(example = "My business checking account", value = "The description from the source transaction line item. Only returned if populated.") + /** * The description from the source transaction line item. Only returned if populated. - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * The description from the source transaction line item. Only returned if populated. - * - * @param description String - */ + /** + * The description from the source transaction line item. Only returned if populated. + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Net amount of journal line. This will be a positive value for a debit and negative for a credit - * - * @param netAmount Double - * @return JournalLine - */ + * Net amount of journal line. This will be a positive value for a debit and negative for a credit + * @param netAmount Double + * @return JournalLine + **/ public JournalLine netAmount(Double netAmount) { this.netAmount = netAmount; return this; } - /** + /** * Net amount of journal line. This will be a positive value for a debit and negative for a credit - * * @return netAmount - */ - @ApiModelProperty( - example = "4130.98", - value = - "Net amount of journal line. This will be a positive value for a debit and negative for" - + " a credit") - /** + **/ + @ApiModelProperty(example = "4130.98", value = "Net amount of journal line. This will be a positive value for a debit and negative for a credit") + /** * Net amount of journal line. This will be a positive value for a debit and negative for a credit - * * @return netAmount Double - */ + **/ public Double getNetAmount() { return netAmount; } - /** - * Net amount of journal line. This will be a positive value for a debit and negative for a credit - * - * @param netAmount Double - */ + /** + * Net amount of journal line. This will be a positive value for a debit and negative for a credit + * @param netAmount Double + **/ + public void setNetAmount(Double netAmount) { this.netAmount = netAmount; } /** - * Gross amount of journal line (NetAmount + TaxAmount). - * - * @param grossAmount Double - * @return JournalLine - */ + * Gross amount of journal line (NetAmount + TaxAmount). + * @param grossAmount Double + * @return JournalLine + **/ public JournalLine grossAmount(Double grossAmount) { this.grossAmount = grossAmount; return this; } - /** + /** * Gross amount of journal line (NetAmount + TaxAmount). - * * @return grossAmount - */ - @ApiModelProperty( - example = "4130.98", - value = "Gross amount of journal line (NetAmount + TaxAmount).") - /** + **/ + @ApiModelProperty(example = "4130.98", value = "Gross amount of journal line (NetAmount + TaxAmount).") + /** * Gross amount of journal line (NetAmount + TaxAmount). - * * @return grossAmount Double - */ + **/ public Double getGrossAmount() { return grossAmount; } - /** - * Gross amount of journal line (NetAmount + TaxAmount). - * - * @param grossAmount Double - */ + /** + * Gross amount of journal line (NetAmount + TaxAmount). + * @param grossAmount Double + **/ + public void setGrossAmount(Double grossAmount) { this.grossAmount = grossAmount; } - /** + /** * Total tax on a journal line - * * @return taxAmount - */ + **/ @ApiModelProperty(example = "0.0", value = "Total tax on a journal line") - /** + /** * Total tax on a journal line - * * @return taxAmount Double - */ + **/ public Double getTaxAmount() { return taxAmount; } /** - * The tax type from taxRates - * - * @param taxType String - * @return JournalLine - */ + * The tax type from taxRates + * @param taxType String + * @return JournalLine + **/ public JournalLine taxType(String taxType) { this.taxType = taxType; return this; } - /** + /** * The tax type from taxRates - * * @return taxType - */ + **/ @ApiModelProperty(value = "The tax type from taxRates") - /** + /** * The tax type from taxRates - * * @return taxType String - */ + **/ public String getTaxType() { return taxType; } - /** - * The tax type from taxRates - * - * @param taxType String - */ + /** + * The tax type from taxRates + * @param taxType String + **/ + public void setTaxType(String taxType) { this.taxType = taxType; } /** - * see TaxRates - * - * @param taxName String - * @return JournalLine - */ + * see TaxRates + * @param taxName String + * @return JournalLine + **/ public JournalLine taxName(String taxName) { this.taxName = taxName; return this; } - /** + /** * see TaxRates - * * @return taxName - */ + **/ @ApiModelProperty(example = "Tax Exempt", value = "see TaxRates") - /** + /** * see TaxRates - * * @return taxName String - */ + **/ public String getTaxName() { return taxName; } - /** - * see TaxRates - * - * @param taxName String - */ + /** + * see TaxRates + * @param taxName String + **/ + public void setTaxName(String taxName) { this.taxName = taxName; } /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param trackingCategories List<TrackingCategory> - * @return JournalLine - */ + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. + * @param trackingCategories List<TrackingCategory> + * @return JournalLine + **/ public JournalLine trackingCategories(List trackingCategories) { this.trackingCategories = trackingCategories; return this; } /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param trackingCategoriesItem TrackingCategory + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. + * @param trackingCategoriesItem TrackingCategory * @return JournalLine - */ + **/ public JournalLine addTrackingCategoriesItem(TrackingCategory trackingCategoriesItem) { if (this.trackingCategories == null) { this.trackingCategories = new ArrayList(); @@ -460,36 +433,29 @@ public JournalLine addTrackingCategoriesItem(TrackingCategory trackingCategories return this; } - /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * + /** + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. * @return trackingCategories - */ - @ApiModelProperty( - value = - "Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2" - + " elements.") - /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * + **/ + @ApiModelProperty(value = "Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements.") + /** + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. * @return trackingCategories List - */ + **/ public List getTrackingCategories() { return trackingCategories; } - /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param trackingCategories List<TrackingCategory> - */ + /** + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. + * @param trackingCategories List<TrackingCategory> + **/ + public void setTrackingCategories(List trackingCategories) { this.trackingCategories = trackingCategories; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -499,37 +465,26 @@ public boolean equals(java.lang.Object o) { return false; } JournalLine journalLine = (JournalLine) o; - return Objects.equals(this.journalLineID, journalLine.journalLineID) - && Objects.equals(this.accountID, journalLine.accountID) - && Objects.equals(this.accountCode, journalLine.accountCode) - && Objects.equals(this.accountType, journalLine.accountType) - && Objects.equals(this.accountName, journalLine.accountName) - && Objects.equals(this.description, journalLine.description) - && Objects.equals(this.netAmount, journalLine.netAmount) - && Objects.equals(this.grossAmount, journalLine.grossAmount) - && Objects.equals(this.taxAmount, journalLine.taxAmount) - && Objects.equals(this.taxType, journalLine.taxType) - && Objects.equals(this.taxName, journalLine.taxName) - && Objects.equals(this.trackingCategories, journalLine.trackingCategories); + return Objects.equals(this.journalLineID, journalLine.journalLineID) && + Objects.equals(this.accountID, journalLine.accountID) && + Objects.equals(this.accountCode, journalLine.accountCode) && + Objects.equals(this.accountType, journalLine.accountType) && + Objects.equals(this.accountName, journalLine.accountName) && + Objects.equals(this.description, journalLine.description) && + Objects.equals(this.netAmount, journalLine.netAmount) && + Objects.equals(this.grossAmount, journalLine.grossAmount) && + Objects.equals(this.taxAmount, journalLine.taxAmount) && + Objects.equals(this.taxType, journalLine.taxType) && + Objects.equals(this.taxName, journalLine.taxName) && + Objects.equals(this.trackingCategories, journalLine.trackingCategories); } @Override public int hashCode() { - return Objects.hash( - journalLineID, - accountID, - accountCode, - accountType, - accountName, - description, - netAmount, - grossAmount, - taxAmount, - taxType, - taxName, - trackingCategories); + return Objects.hash(journalLineID, accountID, accountCode, accountType, accountName, description, netAmount, grossAmount, taxAmount, taxType, taxName, trackingCategories); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -551,7 +506,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -559,4 +515,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Journals.java b/src/main/java/com/xero/models/accounting/Journals.java index ea9e82f16..f2f6a563d 100644 --- a/src/main/java/com/xero/models/accounting/Journals.java +++ b/src/main/java/com/xero/models/accounting/Journals.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Journal; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Journals + */ -/** Journals */ public class Journals { StringUtil util = new StringUtil(); @@ -28,11 +47,10 @@ public class Journals { @JsonProperty("Journals") private List journals = new ArrayList(); /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Journals - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Journals + **/ public Journals warnings(List warnings) { this.warnings = warnings; return this; @@ -40,10 +58,9 @@ public Journals warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Journals - */ + **/ public Journals addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -52,36 +69,33 @@ public Journals addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * journals - * - * @param journals List<Journal> - * @return Journals - */ + * journals + * @param journals List<Journal> + * @return Journals + **/ public Journals journals(List journals) { this.journals = journals; return this; @@ -89,10 +103,9 @@ public Journals journals(List journals) { /** * journals - * - * @param journalsItem Journal + * @param journalsItem Journal * @return Journals - */ + **/ public Journals addJournalsItem(Journal journalsItem) { if (this.journals == null) { this.journals = new ArrayList(); @@ -101,30 +114,29 @@ public Journals addJournalsItem(Journal journalsItem) { return this; } - /** + /** * Get journals - * * @return journals - */ + **/ @ApiModelProperty(value = "") - /** + /** * journals - * * @return journals List - */ + **/ public List getJournals() { return journals; } - /** - * journals - * - * @param journals List<Journal> - */ + /** + * journals + * @param journals List<Journal> + **/ + public void setJournals(List journals) { this.journals = journals; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +146,8 @@ public boolean equals(java.lang.Object o) { return false; } Journals journals = (Journals) o; - return Objects.equals(this.warnings, journals.warnings) - && Objects.equals(this.journals, journals.journals); + return Objects.equals(this.warnings, journals.warnings) && + Objects.equals(this.journals, journals.journals); } @Override @@ -143,6 +155,7 @@ public int hashCode() { return Objects.hash(warnings, journals); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -154,7 +167,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -162,4 +176,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/LineAmountTypes.java b/src/main/java/com/xero/models/accounting/LineAmountTypes.java index 3ad89e3b7..029d9eaaa 100644 --- a/src/main/java/com/xero/models/accounting/LineAmountTypes.java +++ b/src/main/java/com/xero/models/accounting/LineAmountTypes.java @@ -9,25 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount - * Types + * Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types */ public enum LineAmountTypes { - - /** EXCLUSIVE */ + + /** + * EXCLUSIVE + */ EXCLUSIVE("Exclusive"), - - /** INCLUSIVE */ + + /** + * INCLUSIVE + */ INCLUSIVE("Inclusive"), - - /** NOTAX */ + + /** + * NOTAX + */ NOTAX("NoTax"); private String value; @@ -36,26 +51,24 @@ public enum LineAmountTypes { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static LineAmountTypes fromValue(String value) { @@ -67,3 +80,4 @@ public static LineAmountTypes fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/LineItem.java b/src/main/java/com/xero/models/accounting/LineItem.java index 4072c8a27..a5229f3b7 100644 --- a/src/main/java/com/xero/models/accounting/LineItem.java +++ b/src/main/java/com/xero/models/accounting/LineItem.java @@ -9,20 +9,38 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.LineItemItem; +import com.xero.models.accounting.LineItemTracking; +import com.xero.models.accounting.TaxBreakdownComponent; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LineItem + */ -/** LineItem */ public class LineItem { StringUtil util = new StringUtil(); @@ -70,21 +88,33 @@ public class LineItem { @JsonProperty("RepeatingInvoiceID") private UUID repeatingInvoiceID; - /** The type of taxability */ + /** + * The type of taxability + */ public enum TaxabilityEnum { - /** TAXABLE */ + /** + * TAXABLE + */ TAXABLE("TAXABLE"), - - /** NON_TAXABLE */ + + /** + * NON_TAXABLE + */ NON_TAXABLE("NON_TAXABLE"), - - /** EXEMPT */ + + /** + * EXEMPT + */ EXEMPT("EXEMPT"), - - /** PART_TAXABLE */ + + /** + * PART_TAXABLE + */ PART_TAXABLE("PART_TAXABLE"), - - /** NOT_APPLICABLE */ + + /** + * NOT_APPLICABLE + */ NOT_APPLICABLE("NOT_APPLICABLE"); private String value; @@ -93,31 +123,25 @@ public enum TaxabilityEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TaxabilityEnum fromValue(String value) { for (TaxabilityEnum b : TaxabilityEnum.values()) { @@ -129,6 +153,7 @@ public static TaxabilityEnum fromValue(String value) { } } + @JsonProperty("Taxability") private TaxabilityEnum taxability; @@ -138,453 +163,372 @@ public static TaxabilityEnum fromValue(String value) { @JsonProperty("TaxBreakdown") private List taxBreakdown = new ArrayList(); /** - * LineItem unique ID - * - * @param lineItemID UUID - * @return LineItem - */ + * LineItem unique ID + * @param lineItemID UUID + * @return LineItem + **/ public LineItem lineItemID(UUID lineItemID) { this.lineItemID = lineItemID; return this; } - /** + /** * LineItem unique ID - * * @return lineItemID - */ + **/ @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "LineItem unique ID") - /** + /** * LineItem unique ID - * * @return lineItemID UUID - */ + **/ public UUID getLineItemID() { return lineItemID; } - /** - * LineItem unique ID - * - * @param lineItemID UUID - */ + /** + * LineItem unique ID + * @param lineItemID UUID + **/ + public void setLineItemID(UUID lineItemID) { this.lineItemID = lineItemID; } /** - * Description needs to be at least 1 char long. A line item with just a description (i.e no unit - * amount or quantity) can be created by specifying just a <Description> element that - * contains at least 1 character - * - * @param description String - * @return LineItem - */ + * Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character + * @param description String + * @return LineItem + **/ public LineItem description(String description) { this.description = description; return this; } - /** - * Description needs to be at least 1 char long. A line item with just a description (i.e no unit - * amount or quantity) can be created by specifying just a <Description> element that - * contains at least 1 character - * + /** + * Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character * @return description - */ - @ApiModelProperty( - value = - "Description needs to be at least 1 char long. A line item with just a description (i.e" - + " no unit amount or quantity) can be created by specifying just a " - + " element that contains at least 1 character") - /** - * Description needs to be at least 1 char long. A line item with just a description (i.e no unit - * amount or quantity) can be created by specifying just a <Description> element that - * contains at least 1 character - * + **/ + @ApiModelProperty(value = "Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character") + /** + * Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Description needs to be at least 1 char long. A line item with just a description (i.e no unit - * amount or quantity) can be created by specifying just a <Description> element that - * contains at least 1 character - * - * @param description String - */ + /** + * Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * LineItem Quantity - * - * @param quantity Double - * @return LineItem - */ + * LineItem Quantity + * @param quantity Double + * @return LineItem + **/ public LineItem quantity(Double quantity) { this.quantity = quantity; return this; } - /** + /** * LineItem Quantity - * * @return quantity - */ + **/ @ApiModelProperty(value = "LineItem Quantity") - /** + /** * LineItem Quantity - * * @return quantity Double - */ + **/ public Double getQuantity() { return quantity; } - /** - * LineItem Quantity - * - * @param quantity Double - */ + /** + * LineItem Quantity + * @param quantity Double + **/ + public void setQuantity(Double quantity) { this.quantity = quantity; } /** - * LineItem Unit Amount - * - * @param unitAmount Double - * @return LineItem - */ + * LineItem Unit Amount + * @param unitAmount Double + * @return LineItem + **/ public LineItem unitAmount(Double unitAmount) { this.unitAmount = unitAmount; return this; } - /** + /** * LineItem Unit Amount - * * @return unitAmount - */ + **/ @ApiModelProperty(value = "LineItem Unit Amount") - /** + /** * LineItem Unit Amount - * * @return unitAmount Double - */ + **/ public Double getUnitAmount() { return unitAmount; } - /** - * LineItem Unit Amount - * - * @param unitAmount Double - */ + /** + * LineItem Unit Amount + * @param unitAmount Double + **/ + public void setUnitAmount(Double unitAmount) { this.unitAmount = unitAmount; } /** - * See Items - * - * @param itemCode String - * @return LineItem - */ + * See Items + * @param itemCode String + * @return LineItem + **/ public LineItem itemCode(String itemCode) { this.itemCode = itemCode; return this; } - /** + /** * See Items - * * @return itemCode - */ + **/ @ApiModelProperty(value = "See Items") - /** + /** * See Items - * * @return itemCode String - */ + **/ public String getItemCode() { return itemCode; } - /** - * See Items - * - * @param itemCode String - */ + /** + * See Items + * @param itemCode String + **/ + public void setItemCode(String itemCode) { this.itemCode = itemCode; } /** - * See Accounts - * - * @param accountCode String - * @return LineItem - */ + * See Accounts + * @param accountCode String + * @return LineItem + **/ public LineItem accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * See Accounts - * * @return accountCode - */ + **/ @ApiModelProperty(value = "See Accounts") - /** + /** * See Accounts - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * See Accounts - * - * @param accountCode String - */ + /** + * See Accounts + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * The associated account ID related to this line item - * - * @param accountID UUID - * @return LineItem - */ + * The associated account ID related to this line item + * @param accountID UUID + * @return LineItem + **/ public LineItem accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * The associated account ID related to this line item - * * @return accountID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "The associated account ID related to this line item") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The associated account ID related to this line item") + /** * The associated account ID related to this line item - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * The associated account ID related to this line item - * - * @param accountID UUID - */ + /** + * The associated account ID related to this line item + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * The tax type from TaxRates - * - * @param taxType String - * @return LineItem - */ + * The tax type from TaxRates + * @param taxType String + * @return LineItem + **/ public LineItem taxType(String taxType) { this.taxType = taxType; return this; } - /** + /** * The tax type from TaxRates - * * @return taxType - */ + **/ @ApiModelProperty(value = "The tax type from TaxRates") - /** + /** * The tax type from TaxRates - * * @return taxType String - */ + **/ public String getTaxType() { return taxType; } - /** - * The tax type from TaxRates - * - * @param taxType String - */ + /** + * The tax type from TaxRates + * @param taxType String + **/ + public void setTaxType(String taxType) { this.taxType = taxType; } /** - * The tax amount is auto calculated as a percentage of the line amount (see below) based on the - * tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. - * - * @param taxAmount Double - * @return LineItem - */ + * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. + * @param taxAmount Double + * @return LineItem + **/ public LineItem taxAmount(Double taxAmount) { this.taxAmount = taxAmount; return this; } - /** - * The tax amount is auto calculated as a percentage of the line amount (see below) based on the - * tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. - * + /** + * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. * @return taxAmount - */ - @ApiModelProperty( - value = - "The tax amount is auto calculated as a percentage of the line amount (see below) based" - + " on the tax rate. This value can be overriden if the calculated is" - + " not correct.") - /** - * The tax amount is auto calculated as a percentage of the line amount (see below) based on the - * tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. - * + **/ + @ApiModelProperty(value = "The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct.") + /** + * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. * @return taxAmount Double - */ + **/ public Double getTaxAmount() { return taxAmount; } - /** - * The tax amount is auto calculated as a percentage of the line amount (see below) based on the - * tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. - * - * @param taxAmount Double - */ + /** + * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. + * @param taxAmount Double + **/ + public void setTaxAmount(Double taxAmount) { this.taxAmount = taxAmount; } /** - * item - * - * @param item LineItemItem - * @return LineItem - */ + * item + * @param item LineItemItem + * @return LineItem + **/ public LineItem item(LineItemItem item) { this.item = item; return this; } - /** + /** * Get item - * * @return item - */ + **/ @ApiModelProperty(value = "") - /** + /** * item - * * @return item LineItemItem - */ + **/ public LineItemItem getItem() { return item; } - /** - * item - * - * @param item LineItemItem - */ + /** + * item + * @param item LineItemItem + **/ + public void setItem(LineItemItem item) { this.item = item; } /** - * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero - * will calculate the missing amount for you. The line amount reflects the discounted price if - * either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit - * Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - - * DiscountAmount - * - * @param lineAmount Double - * @return LineItem - */ + * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount + * @param lineAmount Double + * @return LineItem + **/ public LineItem lineAmount(Double lineAmount) { this.lineAmount = lineAmount; return this; } - /** - * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero - * will calculate the missing amount for you. The line amount reflects the discounted price if - * either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit - * Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - - * DiscountAmount - * + /** + * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount * @return lineAmount - */ - @ApiModelProperty( - value = - "If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and" - + " Xero will calculate the missing amount for you. The line amount reflects the" - + " discounted price if either a DiscountRate or DiscountAmount has been used i.e." - + " LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount =" - + " (Quantity * UnitAmount) - DiscountAmount") - /** - * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero - * will calculate the missing amount for you. The line amount reflects the discounted price if - * either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit - * Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - - * DiscountAmount - * + **/ + @ApiModelProperty(value = "If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount") + /** + * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount * @return lineAmount Double - */ + **/ public Double getLineAmount() { return lineAmount; } - /** - * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero - * will calculate the missing amount for you. The line amount reflects the discounted price if - * either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit - * Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - - * DiscountAmount - * - * @param lineAmount Double - */ + /** + * If you wish to omit either the Quantity or UnitAmount you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount + * @param lineAmount Double + **/ + public void setLineAmount(Double lineAmount) { this.lineAmount = lineAmount; } /** - * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param tracking List<LineItemTracking> - * @return LineItem - */ + * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. + * @param tracking List<LineItemTracking> + * @return LineItem + **/ public LineItem tracking(List tracking) { this.tracking = tracking; return this; } /** - * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param trackingItem LineItemTracking + * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. + * @param trackingItem LineItemTracking * @return LineItem - */ + **/ public LineItem addTrackingItem(LineItemTracking trackingItem) { if (this.tracking == null) { this.tracking = new ArrayList(); @@ -593,233 +537,193 @@ public LineItem addTrackingItem(LineItemTracking trackingItem) { return this; } - /** - * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 - * <TrackingCategory> elements. - * + /** + * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. * @return tracking - */ - @ApiModelProperty( - value = - "Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2" - + " elements.") - /** - * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 - * <TrackingCategory> elements. - * + **/ + @ApiModelProperty(value = "Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 elements.") + /** + * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. * @return tracking List - */ + **/ public List getTracking() { return tracking; } - /** - * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param tracking List<LineItemTracking> - */ + /** + * Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. + * @param tracking List<LineItemTracking> + **/ + public void setTracking(List tracking) { this.tracking = tracking; } /** - * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY - * invoices and credit notes in Xero do not support discounts - * - * @param discountRate Double - * @return LineItem - */ + * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts + * @param discountRate Double + * @return LineItem + **/ public LineItem discountRate(Double discountRate) { this.discountRate = discountRate; return this; } - /** - * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY - * invoices and credit notes in Xero do not support discounts - * + /** + * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts * @return discountRate - */ - @ApiModelProperty( - value = - "Percentage discount being applied to a line item (only supported on ACCREC invoices –" - + " ACC PAY invoices and credit notes in Xero do not support discounts") - /** - * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY - * invoices and credit notes in Xero do not support discounts - * + **/ + @ApiModelProperty(value = "Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts") + /** + * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts * @return discountRate Double - */ + **/ public Double getDiscountRate() { return discountRate; } - /** - * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY - * invoices and credit notes in Xero do not support discounts - * - * @param discountRate Double - */ + /** + * Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts + * @param discountRate Double + **/ + public void setDiscountRate(Double discountRate) { this.discountRate = discountRate; } /** - * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. - * ACCPAY invoices and credit notes in Xero do not support discounts. - * - * @param discountAmount Double - * @return LineItem - */ + * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. + * @param discountAmount Double + * @return LineItem + **/ public LineItem discountAmount(Double discountAmount) { this.discountAmount = discountAmount; return this; } - /** - * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. - * ACCPAY invoices and credit notes in Xero do not support discounts. - * + /** + * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. * @return discountAmount - */ - @ApiModelProperty( - value = - "Discount amount being applied to a line item. Only supported on ACCREC invoices and" - + " quotes. ACCPAY invoices and credit notes in Xero do not support discounts.") - /** - * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. - * ACCPAY invoices and credit notes in Xero do not support discounts. - * + **/ + @ApiModelProperty(value = "Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts.") + /** + * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. * @return discountAmount Double - */ + **/ public Double getDiscountAmount() { return discountAmount; } - /** - * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. - * ACCPAY invoices and credit notes in Xero do not support discounts. - * - * @param discountAmount Double - */ + /** + * Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. + * @param discountAmount Double + **/ + public void setDiscountAmount(Double discountAmount) { this.discountAmount = discountAmount; } /** - * The Xero identifier for a Repeating Invoice - * - * @param repeatingInvoiceID UUID - * @return LineItem - */ + * The Xero identifier for a Repeating Invoice + * @param repeatingInvoiceID UUID + * @return LineItem + **/ public LineItem repeatingInvoiceID(UUID repeatingInvoiceID) { this.repeatingInvoiceID = repeatingInvoiceID; return this; } - /** + /** * The Xero identifier for a Repeating Invoice - * * @return repeatingInvoiceID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "The Xero identifier for a Repeating Invoice") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The Xero identifier for a Repeating Invoice") + /** * The Xero identifier for a Repeating Invoice - * * @return repeatingInvoiceID UUID - */ + **/ public UUID getRepeatingInvoiceID() { return repeatingInvoiceID; } - /** - * The Xero identifier for a Repeating Invoice - * - * @param repeatingInvoiceID UUID - */ + /** + * The Xero identifier for a Repeating Invoice + * @param repeatingInvoiceID UUID + **/ + public void setRepeatingInvoiceID(UUID repeatingInvoiceID) { this.repeatingInvoiceID = repeatingInvoiceID; } /** - * The type of taxability - * - * @param taxability TaxabilityEnum - * @return LineItem - */ + * The type of taxability + * @param taxability TaxabilityEnum + * @return LineItem + **/ public LineItem taxability(TaxabilityEnum taxability) { this.taxability = taxability; return this; } - /** + /** * The type of taxability - * * @return taxability - */ + **/ @ApiModelProperty(value = "The type of taxability") - /** + /** * The type of taxability - * * @return taxability TaxabilityEnum - */ + **/ public TaxabilityEnum getTaxability() { return taxability; } - /** - * The type of taxability - * - * @param taxability TaxabilityEnum - */ + /** + * The type of taxability + * @param taxability TaxabilityEnum + **/ + public void setTaxability(TaxabilityEnum taxability) { this.taxability = taxability; } /** - * The ID of the sales tax code - * - * @param salesTaxCodeId BigDecimal - * @return LineItem - */ + * The ID of the sales tax code + * @param salesTaxCodeId BigDecimal + * @return LineItem + **/ public LineItem salesTaxCodeId(BigDecimal salesTaxCodeId) { this.salesTaxCodeId = salesTaxCodeId; return this; } - /** + /** * The ID of the sales tax code - * * @return salesTaxCodeId - */ + **/ @ApiModelProperty(value = "The ID of the sales tax code") - /** + /** * The ID of the sales tax code - * * @return salesTaxCodeId BigDecimal - */ + **/ public BigDecimal getSalesTaxCodeId() { return salesTaxCodeId; } - /** - * The ID of the sales tax code - * - * @param salesTaxCodeId BigDecimal - */ + /** + * The ID of the sales tax code + * @param salesTaxCodeId BigDecimal + **/ + public void setSalesTaxCodeId(BigDecimal salesTaxCodeId) { this.salesTaxCodeId = salesTaxCodeId; } /** - * An array of tax components defined for this line item - * - * @param taxBreakdown List<TaxBreakdownComponent> - * @return LineItem - */ + * An array of tax components defined for this line item + * @param taxBreakdown List<TaxBreakdownComponent> + * @return LineItem + **/ public LineItem taxBreakdown(List taxBreakdown) { this.taxBreakdown = taxBreakdown; return this; @@ -827,10 +731,9 @@ public LineItem taxBreakdown(List taxBreakdown) { /** * An array of tax components defined for this line item - * - * @param taxBreakdownItem TaxBreakdownComponent + * @param taxBreakdownItem TaxBreakdownComponent * @return LineItem - */ + **/ public LineItem addTaxBreakdownItem(TaxBreakdownComponent taxBreakdownItem) { if (this.taxBreakdown == null) { this.taxBreakdown = new ArrayList(); @@ -839,30 +742,29 @@ public LineItem addTaxBreakdownItem(TaxBreakdownComponent taxBreakdownItem) { return this; } - /** + /** * An array of tax components defined for this line item - * * @return taxBreakdown - */ + **/ @ApiModelProperty(value = "An array of tax components defined for this line item") - /** + /** * An array of tax components defined for this line item - * * @return taxBreakdown List - */ + **/ public List getTaxBreakdown() { return taxBreakdown; } - /** - * An array of tax components defined for this line item - * - * @param taxBreakdown List<TaxBreakdownComponent> - */ + /** + * An array of tax components defined for this line item + * @param taxBreakdown List<TaxBreakdownComponent> + **/ + public void setTaxBreakdown(List taxBreakdown) { this.taxBreakdown = taxBreakdown; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -872,49 +774,32 @@ public boolean equals(java.lang.Object o) { return false; } LineItem lineItem = (LineItem) o; - return Objects.equals(this.lineItemID, lineItem.lineItemID) - && Objects.equals(this.description, lineItem.description) - && Objects.equals(this.quantity, lineItem.quantity) - && Objects.equals(this.unitAmount, lineItem.unitAmount) - && Objects.equals(this.itemCode, lineItem.itemCode) - && Objects.equals(this.accountCode, lineItem.accountCode) - && Objects.equals(this.accountID, lineItem.accountID) - && Objects.equals(this.taxType, lineItem.taxType) - && Objects.equals(this.taxAmount, lineItem.taxAmount) - && Objects.equals(this.item, lineItem.item) - && Objects.equals(this.lineAmount, lineItem.lineAmount) - && Objects.equals(this.tracking, lineItem.tracking) - && Objects.equals(this.discountRate, lineItem.discountRate) - && Objects.equals(this.discountAmount, lineItem.discountAmount) - && Objects.equals(this.repeatingInvoiceID, lineItem.repeatingInvoiceID) - && Objects.equals(this.taxability, lineItem.taxability) - && Objects.equals(this.salesTaxCodeId, lineItem.salesTaxCodeId) - && Objects.equals(this.taxBreakdown, lineItem.taxBreakdown); + return Objects.equals(this.lineItemID, lineItem.lineItemID) && + Objects.equals(this.description, lineItem.description) && + Objects.equals(this.quantity, lineItem.quantity) && + Objects.equals(this.unitAmount, lineItem.unitAmount) && + Objects.equals(this.itemCode, lineItem.itemCode) && + Objects.equals(this.accountCode, lineItem.accountCode) && + Objects.equals(this.accountID, lineItem.accountID) && + Objects.equals(this.taxType, lineItem.taxType) && + Objects.equals(this.taxAmount, lineItem.taxAmount) && + Objects.equals(this.item, lineItem.item) && + Objects.equals(this.lineAmount, lineItem.lineAmount) && + Objects.equals(this.tracking, lineItem.tracking) && + Objects.equals(this.discountRate, lineItem.discountRate) && + Objects.equals(this.discountAmount, lineItem.discountAmount) && + Objects.equals(this.repeatingInvoiceID, lineItem.repeatingInvoiceID) && + Objects.equals(this.taxability, lineItem.taxability) && + Objects.equals(this.salesTaxCodeId, lineItem.salesTaxCodeId) && + Objects.equals(this.taxBreakdown, lineItem.taxBreakdown); } @Override public int hashCode() { - return Objects.hash( - lineItemID, - description, - quantity, - unitAmount, - itemCode, - accountCode, - accountID, - taxType, - taxAmount, - item, - lineAmount, - tracking, - discountRate, - discountAmount, - repeatingInvoiceID, - taxability, - salesTaxCodeId, - taxBreakdown); + return Objects.hash(lineItemID, description, quantity, unitAmount, itemCode, accountCode, accountID, taxType, taxAmount, item, lineAmount, tracking, discountRate, discountAmount, repeatingInvoiceID, taxability, salesTaxCodeId, taxBreakdown); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -942,7 +827,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -950,4 +836,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/LineItemItem.java b/src/main/java/com/xero/models/accounting/LineItemItem.java index 43ff57ca7..0940baf24 100644 --- a/src/main/java/com/xero/models/accounting/LineItemItem.java +++ b/src/main/java/com/xero/models/accounting/LineItemItem.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LineItemItem + */ -/** LineItemItem */ public class LineItemItem { StringUtil util = new StringUtil(); @@ -30,110 +47,102 @@ public class LineItemItem { @JsonProperty("ItemID") private UUID itemID; /** - * User defined item code (max length = 30) - * - * @param code String - * @return LineItemItem - */ + * User defined item code (max length = 30) + * @param code String + * @return LineItemItem + **/ public LineItemItem code(String code) { this.code = code; return this; } - /** + /** * User defined item code (max length = 30) - * * @return code - */ + **/ @ApiModelProperty(value = "User defined item code (max length = 30)") - /** + /** * User defined item code (max length = 30) - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * User defined item code (max length = 30) - * - * @param code String - */ + /** + * User defined item code (max length = 30) + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * The name of the item (max length = 50) - * - * @param name String - * @return LineItemItem - */ + * The name of the item (max length = 50) + * @param name String + * @return LineItemItem + **/ public LineItemItem name(String name) { this.name = name; return this; } - /** + /** * The name of the item (max length = 50) - * * @return name - */ + **/ @ApiModelProperty(value = "The name of the item (max length = 50)") - /** + /** * The name of the item (max length = 50) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the item (max length = 50) - * - * @param name String - */ + /** + * The name of the item (max length = 50) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The Xero identifier for an Item - * - * @param itemID UUID - * @return LineItemItem - */ + * The Xero identifier for an Item + * @param itemID UUID + * @return LineItemItem + **/ public LineItemItem itemID(UUID itemID) { this.itemID = itemID; return this; } - /** + /** * The Xero identifier for an Item - * * @return itemID - */ + **/ @ApiModelProperty(value = "The Xero identifier for an Item") - /** + /** * The Xero identifier for an Item - * * @return itemID UUID - */ + **/ public UUID getItemID() { return itemID; } - /** - * The Xero identifier for an Item - * - * @param itemID UUID - */ + /** + * The Xero identifier for an Item + * @param itemID UUID + **/ + public void setItemID(UUID itemID) { this.itemID = itemID; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -143,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } LineItemItem lineItemItem = (LineItemItem) o; - return Objects.equals(this.code, lineItemItem.code) - && Objects.equals(this.name, lineItemItem.name) - && Objects.equals(this.itemID, lineItemItem.itemID); + return Objects.equals(this.code, lineItemItem.code) && + Objects.equals(this.name, lineItemItem.name) && + Objects.equals(this.itemID, lineItemItem.itemID); } @Override @@ -153,6 +162,7 @@ public int hashCode() { return Objects.hash(code, name, itemID); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -165,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -173,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/LineItemTracking.java b/src/main/java/com/xero/models/accounting/LineItemTracking.java index 05f4de774..0b456dff9 100644 --- a/src/main/java/com/xero/models/accounting/LineItemTracking.java +++ b/src/main/java/com/xero/models/accounting/LineItemTracking.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LineItemTracking + */ -/** LineItemTracking */ public class LineItemTracking { StringUtil util = new StringUtil(); @@ -33,149 +50,134 @@ public class LineItemTracking { @JsonProperty("Option") private String option; /** - * The Xero identifier for a tracking category - * - * @param trackingCategoryID UUID - * @return LineItemTracking - */ + * The Xero identifier for a tracking category + * @param trackingCategoryID UUID + * @return LineItemTracking + **/ public LineItemTracking trackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; return this; } - /** + /** * The Xero identifier for a tracking category - * * @return trackingCategoryID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "The Xero identifier for a tracking category") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The Xero identifier for a tracking category") + /** * The Xero identifier for a tracking category - * * @return trackingCategoryID UUID - */ + **/ public UUID getTrackingCategoryID() { return trackingCategoryID; } - /** - * The Xero identifier for a tracking category - * - * @param trackingCategoryID UUID - */ + /** + * The Xero identifier for a tracking category + * @param trackingCategoryID UUID + **/ + public void setTrackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; } /** - * The Xero identifier for a tracking category option - * - * @param trackingOptionID UUID - * @return LineItemTracking - */ + * The Xero identifier for a tracking category option + * @param trackingOptionID UUID + * @return LineItemTracking + **/ public LineItemTracking trackingOptionID(UUID trackingOptionID) { this.trackingOptionID = trackingOptionID; return this; } - /** + /** * The Xero identifier for a tracking category option - * * @return trackingOptionID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "The Xero identifier for a tracking category option") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The Xero identifier for a tracking category option") + /** * The Xero identifier for a tracking category option - * * @return trackingOptionID UUID - */ + **/ public UUID getTrackingOptionID() { return trackingOptionID; } - /** - * The Xero identifier for a tracking category option - * - * @param trackingOptionID UUID - */ + /** + * The Xero identifier for a tracking category option + * @param trackingOptionID UUID + **/ + public void setTrackingOptionID(UUID trackingOptionID) { this.trackingOptionID = trackingOptionID; } /** - * The name of the tracking category - * - * @param name String - * @return LineItemTracking - */ + * The name of the tracking category + * @param name String + * @return LineItemTracking + **/ public LineItemTracking name(String name) { this.name = name; return this; } - /** + /** * The name of the tracking category - * * @return name - */ + **/ @ApiModelProperty(example = "Region", value = "The name of the tracking category") - /** + /** * The name of the tracking category - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the tracking category - * - * @param name String - */ + /** + * The name of the tracking category + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * See Tracking Options - * - * @param option String - * @return LineItemTracking - */ + * See Tracking Options + * @param option String + * @return LineItemTracking + **/ public LineItemTracking option(String option) { this.option = option; return this; } - /** + /** * See Tracking Options - * * @return option - */ + **/ @ApiModelProperty(example = "North", value = "See Tracking Options") - /** + /** * See Tracking Options - * * @return option String - */ + **/ public String getOption() { return option; } - /** - * See Tracking Options - * - * @param option String - */ + /** + * See Tracking Options + * @param option String + **/ + public void setOption(String option) { this.option = option; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -185,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } LineItemTracking lineItemTracking = (LineItemTracking) o; - return Objects.equals(this.trackingCategoryID, lineItemTracking.trackingCategoryID) - && Objects.equals(this.trackingOptionID, lineItemTracking.trackingOptionID) - && Objects.equals(this.name, lineItemTracking.name) - && Objects.equals(this.option, lineItemTracking.option); + return Objects.equals(this.trackingCategoryID, lineItemTracking.trackingCategoryID) && + Objects.equals(this.trackingOptionID, lineItemTracking.trackingOptionID) && + Objects.equals(this.name, lineItemTracking.name) && + Objects.equals(this.option, lineItemTracking.option); } @Override @@ -196,6 +198,7 @@ public int hashCode() { return Objects.hash(trackingCategoryID, trackingOptionID, name, option); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -209,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -217,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/LinkedTransaction.java b/src/main/java/com/xero/models/accounting/LinkedTransaction.java index c2f7f083c..585f4d80b 100644 --- a/src/main/java/com/xero/models/accounting/LinkedTransaction.java +++ b/src/main/java/com/xero/models/accounting/LinkedTransaction.java @@ -9,21 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LinkedTransaction + */ -/** LinkedTransaction */ public class LinkedTransaction { StringUtil util = new StringUtil(); @@ -45,24 +59,32 @@ public class LinkedTransaction { @JsonProperty("LinkedTransactionID") private UUID linkedTransactionID; /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ public enum StatusEnum { - /** APPROVED */ + /** + * APPROVED + */ APPROVED("APPROVED"), - - /** DRAFT */ + + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** ONDRAFT */ + + /** + * ONDRAFT + */ ONDRAFT("ONDRAFT"), - - /** BILLED */ + + /** + * BILLED + */ BILLED("BILLED"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"); private String value; @@ -71,31 +93,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -107,11 +123,16 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; - /** This will always be BILLABLEEXPENSE. More types may be added in future. */ + /** + * This will always be BILLABLEEXPENSE. More types may be added in future. + */ public enum TypeEnum { - /** BILLABLEEXPENSE */ + /** + * BILLABLEEXPENSE + */ BILLABLEEXPENSE("BILLABLEEXPENSE"); private String value; @@ -120,31 +141,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -156,20 +171,24 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @JsonProperty("UpdatedDateUTC") private String updatedDateUTC; /** - * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created - * from an invoice and SPEND if it was created from a bank transaction. + * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. */ public enum SourceTransactionTypeCodeEnum { - /** ACCPAY */ + /** + * ACCPAY + */ ACCPAY("ACCPAY"), - - /** SPEND */ + + /** + * SPEND + */ SPEND("SPEND"); private String value; @@ -178,31 +197,25 @@ public enum SourceTransactionTypeCodeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static SourceTransactionTypeCodeEnum fromValue(String value) { for (SourceTransactionTypeCodeEnum b : SourceTransactionTypeCodeEnum.values()) { @@ -214,426 +227,332 @@ public static SourceTransactionTypeCodeEnum fromValue(String value) { } } + @JsonProperty("SourceTransactionTypeCode") private SourceTransactionTypeCodeEnum sourceTransactionTypeCode; @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * Filter by the SourceTransactionID. Get all the linked transactions created from a particular - * ACCPAY invoice - * - * @param sourceTransactionID UUID - * @return LinkedTransaction - */ + * Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice + * @param sourceTransactionID UUID + * @return LinkedTransaction + **/ public LinkedTransaction sourceTransactionID(UUID sourceTransactionID) { this.sourceTransactionID = sourceTransactionID; return this; } - /** - * Filter by the SourceTransactionID. Get all the linked transactions created from a particular - * ACCPAY invoice - * + /** + * Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice * @return sourceTransactionID - */ - @ApiModelProperty( - value = - "Filter by the SourceTransactionID. Get all the linked transactions created from a" - + " particular ACCPAY invoice") - /** - * Filter by the SourceTransactionID. Get all the linked transactions created from a particular - * ACCPAY invoice - * + **/ + @ApiModelProperty(value = "Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice") + /** + * Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice * @return sourceTransactionID UUID - */ + **/ public UUID getSourceTransactionID() { return sourceTransactionID; } - /** - * Filter by the SourceTransactionID. Get all the linked transactions created from a particular - * ACCPAY invoice - * - * @param sourceTransactionID UUID - */ + /** + * Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice + * @param sourceTransactionID UUID + **/ + public void setSourceTransactionID(UUID sourceTransactionID) { this.sourceTransactionID = sourceTransactionID; } /** - * The line item identifier from the source transaction. - * - * @param sourceLineItemID UUID - * @return LinkedTransaction - */ + * The line item identifier from the source transaction. + * @param sourceLineItemID UUID + * @return LinkedTransaction + **/ public LinkedTransaction sourceLineItemID(UUID sourceLineItemID) { this.sourceLineItemID = sourceLineItemID; return this; } - /** + /** * The line item identifier from the source transaction. - * * @return sourceLineItemID - */ + **/ @ApiModelProperty(value = "The line item identifier from the source transaction.") - /** + /** * The line item identifier from the source transaction. - * * @return sourceLineItemID UUID - */ + **/ public UUID getSourceLineItemID() { return sourceLineItemID; } - /** - * The line item identifier from the source transaction. - * - * @param sourceLineItemID UUID - */ + /** + * The line item identifier from the source transaction. + * @param sourceLineItemID UUID + **/ + public void setSourceLineItemID(UUID sourceLineItemID) { this.sourceLineItemID = sourceLineItemID; } /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * - * @param contactID UUID - * @return LinkedTransaction - */ + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. + * @param contactID UUID + * @return LinkedTransaction + **/ public LinkedTransaction contactID(UUID contactID) { this.contactID = contactID; return this; } - /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * + /** + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. * @return contactID - */ - @ApiModelProperty( - value = - "Filter by the combination of ContactID and Status. Get all the linked transactions that" - + " have been assigned to a particular customer and have a particular status e.g." - + " GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.") - /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * + **/ + @ApiModelProperty(value = "Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.") + /** + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. * @return contactID UUID - */ + **/ public UUID getContactID() { return contactID; } - /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * - * @param contactID UUID - */ + /** + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. + * @param contactID UUID + **/ + public void setContactID(UUID contactID) { this.contactID = contactID; } /** - * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular - * ACCREC invoice - * - * @param targetTransactionID UUID - * @return LinkedTransaction - */ + * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + * @param targetTransactionID UUID + * @return LinkedTransaction + **/ public LinkedTransaction targetTransactionID(UUID targetTransactionID) { this.targetTransactionID = targetTransactionID; return this; } - /** - * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular - * ACCREC invoice - * + /** + * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice * @return targetTransactionID - */ - @ApiModelProperty( - value = - "Filter by the TargetTransactionID. Get all the linked transactions allocated to a" - + " particular ACCREC invoice") - /** - * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular - * ACCREC invoice - * + **/ + @ApiModelProperty(value = "Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice") + /** + * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice * @return targetTransactionID UUID - */ + **/ public UUID getTargetTransactionID() { return targetTransactionID; } - /** - * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular - * ACCREC invoice - * - * @param targetTransactionID UUID - */ + /** + * Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + * @param targetTransactionID UUID + **/ + public void setTargetTransactionID(UUID targetTransactionID) { this.targetTransactionID = targetTransactionID; } /** - * The line item identifier from the target transaction. It is possible to link multiple billable - * expenses to the same TargetLineItemID. - * - * @param targetLineItemID UUID - * @return LinkedTransaction - */ + * The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. + * @param targetLineItemID UUID + * @return LinkedTransaction + **/ public LinkedTransaction targetLineItemID(UUID targetLineItemID) { this.targetLineItemID = targetLineItemID; return this; } - /** - * The line item identifier from the target transaction. It is possible to link multiple billable - * expenses to the same TargetLineItemID. - * + /** + * The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. * @return targetLineItemID - */ - @ApiModelProperty( - value = - "The line item identifier from the target transaction. It is possible to link multiple" - + " billable expenses to the same TargetLineItemID.") - /** - * The line item identifier from the target transaction. It is possible to link multiple billable - * expenses to the same TargetLineItemID. - * + **/ + @ApiModelProperty(value = "The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID.") + /** + * The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. * @return targetLineItemID UUID - */ + **/ public UUID getTargetLineItemID() { return targetLineItemID; } - /** - * The line item identifier from the target transaction. It is possible to link multiple billable - * expenses to the same TargetLineItemID. - * - * @param targetLineItemID UUID - */ + /** + * The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. + * @param targetLineItemID UUID + **/ + public void setTargetLineItemID(UUID targetLineItemID) { this.targetLineItemID = targetLineItemID; } /** - * The Xero identifier for an Linked Transaction - * e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param linkedTransactionID UUID - * @return LinkedTransaction - */ + * The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param linkedTransactionID UUID + * @return LinkedTransaction + **/ public LinkedTransaction linkedTransactionID(UUID linkedTransactionID) { this.linkedTransactionID = linkedTransactionID; return this; } - /** - * The Xero identifier for an Linked Transaction - * e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * + /** + * The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 * @return linkedTransactionID - */ - @ApiModelProperty( - value = - "The Xero identifier for an Linked Transaction" - + " e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9") - /** - * The Xero identifier for an Linked Transaction - * e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * + **/ + @ApiModelProperty(value = "The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9") + /** + * The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 * @return linkedTransactionID UUID - */ + **/ public UUID getLinkedTransactionID() { return linkedTransactionID; } - /** - * The Xero identifier for an Linked Transaction - * e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param linkedTransactionID UUID - */ + /** + * The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param linkedTransactionID UUID + **/ + public void setLinkedTransactionID(UUID linkedTransactionID) { this.linkedTransactionID = linkedTransactionID; } /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * - * @param status StatusEnum - * @return LinkedTransaction - */ + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. + * @param status StatusEnum + * @return LinkedTransaction + **/ public LinkedTransaction status(StatusEnum status) { this.status = status; return this; } - /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * + /** + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. * @return status - */ - @ApiModelProperty( - value = - "Filter by the combination of ContactID and Status. Get all the linked transactions that" - + " have been assigned to a particular customer and have a particular status e.g." - + " GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.") - /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * + **/ + @ApiModelProperty(value = "Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.") + /** + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Filter by the combination of ContactID and Status. Get all the linked transactions that have - * been assigned to a particular customer and have a particular status e.g. GET - * /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - * - * @param status StatusEnum - */ + /** + * Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * This will always be BILLABLEEXPENSE. More types may be added in future. - * - * @param type TypeEnum - * @return LinkedTransaction - */ + * This will always be BILLABLEEXPENSE. More types may be added in future. + * @param type TypeEnum + * @return LinkedTransaction + **/ public LinkedTransaction type(TypeEnum type) { this.type = type; return this; } - /** + /** * This will always be BILLABLEEXPENSE. More types may be added in future. - * * @return type - */ - @ApiModelProperty( - value = "This will always be BILLABLEEXPENSE. More types may be added in future.") - /** + **/ + @ApiModelProperty(value = "This will always be BILLABLEEXPENSE. More types may be added in future.") + /** * This will always be BILLABLEEXPENSE. More types may be added in future. - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * This will always be BILLABLEEXPENSE. More types may be added in future. - * - * @param type TypeEnum - */ + /** + * This will always be BILLABLEEXPENSE. More types may be added in future. + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } - /** + /** * The last modified date in UTC format - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "The last modified date in UTC format") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "The last modified date in UTC format") + /** * The last modified date in UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * The last modified date in UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created - * from an invoice and SPEND if it was created from a bank transaction. - * - * @param sourceTransactionTypeCode SourceTransactionTypeCodeEnum - * @return LinkedTransaction - */ - public LinkedTransaction sourceTransactionTypeCode( - SourceTransactionTypeCodeEnum sourceTransactionTypeCode) { + * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. + * @param sourceTransactionTypeCode SourceTransactionTypeCodeEnum + * @return LinkedTransaction + **/ + public LinkedTransaction sourceTransactionTypeCode(SourceTransactionTypeCodeEnum sourceTransactionTypeCode) { this.sourceTransactionTypeCode = sourceTransactionTypeCode; return this; } - /** - * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created - * from an invoice and SPEND if it was created from a bank transaction. - * + /** + * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. * @return sourceTransactionTypeCode - */ - @ApiModelProperty( - value = - "The Type of the source tranasction. This will be ACCPAY if the linked transaction was" - + " created from an invoice and SPEND if it was created from a bank transaction.") - /** - * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created - * from an invoice and SPEND if it was created from a bank transaction. - * + **/ + @ApiModelProperty(value = "The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction.") + /** + * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. * @return sourceTransactionTypeCode SourceTransactionTypeCodeEnum - */ + **/ public SourceTransactionTypeCodeEnum getSourceTransactionTypeCode() { return sourceTransactionTypeCode; } - /** - * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created - * from an invoice and SPEND if it was created from a bank transaction. - * - * @param sourceTransactionTypeCode SourceTransactionTypeCodeEnum - */ - public void setSourceTransactionTypeCode( - SourceTransactionTypeCodeEnum sourceTransactionTypeCode) { + /** + * The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. + * @param sourceTransactionTypeCode SourceTransactionTypeCodeEnum + **/ + + public void setSourceTransactionTypeCode(SourceTransactionTypeCodeEnum sourceTransactionTypeCode) { this.sourceTransactionTypeCode = sourceTransactionTypeCode; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return LinkedTransaction - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return LinkedTransaction + **/ public LinkedTransaction validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -641,10 +560,9 @@ public LinkedTransaction validationErrors(List validationErrors /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return LinkedTransaction - */ + **/ public LinkedTransaction addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -653,30 +571,29 @@ public LinkedTransaction addValidationErrorsItem(ValidationError validationError return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -686,65 +603,47 @@ public boolean equals(java.lang.Object o) { return false; } LinkedTransaction linkedTransaction = (LinkedTransaction) o; - return Objects.equals(this.sourceTransactionID, linkedTransaction.sourceTransactionID) - && Objects.equals(this.sourceLineItemID, linkedTransaction.sourceLineItemID) - && Objects.equals(this.contactID, linkedTransaction.contactID) - && Objects.equals(this.targetTransactionID, linkedTransaction.targetTransactionID) - && Objects.equals(this.targetLineItemID, linkedTransaction.targetLineItemID) - && Objects.equals(this.linkedTransactionID, linkedTransaction.linkedTransactionID) - && Objects.equals(this.status, linkedTransaction.status) - && Objects.equals(this.type, linkedTransaction.type) - && Objects.equals(this.updatedDateUTC, linkedTransaction.updatedDateUTC) - && Objects.equals( - this.sourceTransactionTypeCode, linkedTransaction.sourceTransactionTypeCode) - && Objects.equals(this.validationErrors, linkedTransaction.validationErrors); + return Objects.equals(this.sourceTransactionID, linkedTransaction.sourceTransactionID) && + Objects.equals(this.sourceLineItemID, linkedTransaction.sourceLineItemID) && + Objects.equals(this.contactID, linkedTransaction.contactID) && + Objects.equals(this.targetTransactionID, linkedTransaction.targetTransactionID) && + Objects.equals(this.targetLineItemID, linkedTransaction.targetLineItemID) && + Objects.equals(this.linkedTransactionID, linkedTransaction.linkedTransactionID) && + Objects.equals(this.status, linkedTransaction.status) && + Objects.equals(this.type, linkedTransaction.type) && + Objects.equals(this.updatedDateUTC, linkedTransaction.updatedDateUTC) && + Objects.equals(this.sourceTransactionTypeCode, linkedTransaction.sourceTransactionTypeCode) && + Objects.equals(this.validationErrors, linkedTransaction.validationErrors); } @Override public int hashCode() { - return Objects.hash( - sourceTransactionID, - sourceLineItemID, - contactID, - targetTransactionID, - targetLineItemID, - linkedTransactionID, - status, - type, - updatedDateUTC, - sourceTransactionTypeCode, - validationErrors); + return Objects.hash(sourceTransactionID, sourceLineItemID, contactID, targetTransactionID, targetLineItemID, linkedTransactionID, status, type, updatedDateUTC, sourceTransactionTypeCode, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LinkedTransaction {\n"); - sb.append(" sourceTransactionID: ") - .append(toIndentedString(sourceTransactionID)) - .append("\n"); + sb.append(" sourceTransactionID: ").append(toIndentedString(sourceTransactionID)).append("\n"); sb.append(" sourceLineItemID: ").append(toIndentedString(sourceLineItemID)).append("\n"); sb.append(" contactID: ").append(toIndentedString(contactID)).append("\n"); - sb.append(" targetTransactionID: ") - .append(toIndentedString(targetTransactionID)) - .append("\n"); + sb.append(" targetTransactionID: ").append(toIndentedString(targetTransactionID)).append("\n"); sb.append(" targetLineItemID: ").append(toIndentedString(targetLineItemID)).append("\n"); - sb.append(" linkedTransactionID: ") - .append(toIndentedString(linkedTransactionID)) - .append("\n"); + sb.append(" linkedTransactionID: ").append(toIndentedString(linkedTransactionID)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); - sb.append(" sourceTransactionTypeCode: ") - .append(toIndentedString(sourceTransactionTypeCode)) - .append("\n"); + sb.append(" sourceTransactionTypeCode: ").append(toIndentedString(sourceTransactionTypeCode)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -752,4 +651,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/LinkedTransactions.java b/src/main/java/com/xero/models/accounting/LinkedTransactions.java index 0d03eed8f..41c742dc0 100644 --- a/src/main/java/com/xero/models/accounting/LinkedTransactions.java +++ b/src/main/java/com/xero/models/accounting/LinkedTransactions.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.LinkedTransaction; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LinkedTransactions + */ -/** LinkedTransactions */ public class LinkedTransactions { StringUtil util = new StringUtil(); @JsonProperty("LinkedTransactions") private List linkedTransactions = new ArrayList(); /** - * linkedTransactions - * - * @param linkedTransactions List<LinkedTransaction> - * @return LinkedTransactions - */ + * linkedTransactions + * @param linkedTransactions List<LinkedTransaction> + * @return LinkedTransactions + **/ public LinkedTransactions linkedTransactions(List linkedTransactions) { this.linkedTransactions = linkedTransactions; return this; @@ -37,10 +54,9 @@ public LinkedTransactions linkedTransactions(List linkedTrans /** * linkedTransactions - * - * @param linkedTransactionsItem LinkedTransaction + * @param linkedTransactionsItem LinkedTransaction * @return LinkedTransactions - */ + **/ public LinkedTransactions addLinkedTransactionsItem(LinkedTransaction linkedTransactionsItem) { if (this.linkedTransactions == null) { this.linkedTransactions = new ArrayList(); @@ -49,30 +65,29 @@ public LinkedTransactions addLinkedTransactionsItem(LinkedTransaction linkedTran return this; } - /** + /** * Get linkedTransactions - * * @return linkedTransactions - */ + **/ @ApiModelProperty(value = "") - /** + /** * linkedTransactions - * * @return linkedTransactions List - */ + **/ public List getLinkedTransactions() { return linkedTransactions; } - /** - * linkedTransactions - * - * @param linkedTransactions List<LinkedTransaction> - */ + /** + * linkedTransactions + * @param linkedTransactions List<LinkedTransaction> + **/ + public void setLinkedTransactions(List linkedTransactions) { this.linkedTransactions = linkedTransactions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(linkedTransactions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ManualJournal.java b/src/main/java/com/xero/models/accounting/ManualJournal.java index 8b613d74a..a8e340a2a 100644 --- a/src/main/java/com/xero/models/accounting/ManualJournal.java +++ b/src/main/java/com/xero/models/accounting/ManualJournal.java @@ -9,24 +9,38 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.ManualJournalLine; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ManualJournal + */ -/** ManualJournal */ public class ManualJournal { StringUtil util = new StringUtil(); @@ -41,21 +55,33 @@ public class ManualJournal { @JsonProperty("LineAmountTypes") private LineAmountTypes lineAmountTypes; - /** See Manual Journal Status Codes */ + /** + * See Manual Journal Status Codes + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** POSTED */ + + /** + * POSTED + */ POSTED("POSTED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"), - - /** ARCHIVED */ + + /** + * ARCHIVED + */ ARCHIVED("ARCHIVED"); private String value; @@ -64,31 +90,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -100,6 +120,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -130,46 +151,42 @@ public static StatusEnum fromValue(String value) { @JsonProperty("Attachments") private List attachments = new ArrayList(); /** - * Description of journal being posted - * - * @param narration String - * @return ManualJournal - */ + * Description of journal being posted + * @param narration String + * @return ManualJournal + **/ public ManualJournal narration(String narration) { this.narration = narration; return this; } - /** + /** * Description of journal being posted - * * @return narration - */ + **/ @ApiModelProperty(required = true, value = "Description of journal being posted") - /** + /** * Description of journal being posted - * * @return narration String - */ + **/ public String getNarration() { return narration; } - /** - * Description of journal being posted - * - * @param narration String - */ + /** + * Description of journal being posted + * @param narration String + **/ + public void setNarration(String narration) { this.narration = narration; } /** - * See JournalLines - * - * @param journalLines List<ManualJournalLine> - * @return ManualJournal - */ + * See JournalLines + * @param journalLines List<ManualJournalLine> + * @return ManualJournal + **/ public ManualJournal journalLines(List journalLines) { this.journalLines = journalLines; return this; @@ -177,10 +194,9 @@ public ManualJournal journalLines(List journalLines) { /** * See JournalLines - * - * @param journalLinesItem ManualJournalLine + * @param journalLinesItem ManualJournalLine * @return ManualJournal - */ + **/ public ManualJournal addJournalLinesItem(ManualJournalLine journalLinesItem) { if (this.journalLines == null) { this.journalLines = new ArrayList(); @@ -189,357 +205,323 @@ public ManualJournal addJournalLinesItem(ManualJournalLine journalLinesItem) { return this; } - /** + /** * See JournalLines - * * @return journalLines - */ + **/ @ApiModelProperty(value = "See JournalLines") - /** + /** * See JournalLines - * * @return journalLines List - */ + **/ public List getJournalLines() { return journalLines; } - /** - * See JournalLines - * - * @param journalLines List<ManualJournalLine> - */ + /** + * See JournalLines + * @param journalLines List<ManualJournalLine> + **/ + public void setJournalLines(List journalLines) { this.journalLines = journalLines; } /** - * Date journal was posted – YYYY-MM-DD - * - * @param date String - * @return ManualJournal - */ + * Date journal was posted – YYYY-MM-DD + * @param date String + * @return ManualJournal + **/ public ManualJournal date(String date) { this.date = date; return this; } - /** + /** * Date journal was posted – YYYY-MM-DD - * * @return date - */ + **/ @ApiModelProperty(value = "Date journal was posted – YYYY-MM-DD") - /** + /** * Date journal was posted – YYYY-MM-DD - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * Date journal was posted – YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date journal was posted – YYYY-MM-DD - * - * @param date String - */ + /** + * Date journal was posted – YYYY-MM-DD + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date journal was posted – YYYY-MM-DD - * - * @param date LocalDateTime - */ + /** + * Date journal was posted – YYYY-MM-DD + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return ManualJournal - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return ManualJournal + **/ public ManualJournal lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * See Manual Journal Status Codes - * - * @param status StatusEnum - * @return ManualJournal - */ + * See Manual Journal Status Codes + * @param status StatusEnum + * @return ManualJournal + **/ public ManualJournal status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Manual Journal Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Manual Journal Status Codes") - /** + /** * See Manual Journal Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Manual Journal Status Codes - * - * @param status StatusEnum - */ + /** + * See Manual Journal Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Url link to a source document – shown as “Go to [appName]” in the Xero app - * - * @param url String - * @return ManualJournal - */ + * Url link to a source document – shown as “Go to [appName]” in the Xero app + * @param url String + * @return ManualJournal + **/ public ManualJournal url(String url) { this.url = url; return this; } - /** + /** * Url link to a source document – shown as “Go to [appName]” in the Xero app - * * @return url - */ - @ApiModelProperty( - value = "Url link to a source document – shown as “Go to [appName]” in the Xero app") - /** + **/ + @ApiModelProperty(value = "Url link to a source document – shown as “Go to [appName]” in the Xero app") + /** * Url link to a source document – shown as “Go to [appName]” in the Xero app - * * @return url String - */ + **/ public String getUrl() { return url; } - /** - * Url link to a source document – shown as “Go to [appName]” in the Xero app - * - * @param url String - */ + /** + * Url link to a source document – shown as “Go to [appName]” in the Xero app + * @param url String + **/ + public void setUrl(String url) { this.url = url; } /** - * Boolean – default is true if not specified - * - * @param showOnCashBasisReports Boolean - * @return ManualJournal - */ + * Boolean – default is true if not specified + * @param showOnCashBasisReports Boolean + * @return ManualJournal + **/ public ManualJournal showOnCashBasisReports(Boolean showOnCashBasisReports) { this.showOnCashBasisReports = showOnCashBasisReports; return this; } - /** + /** * Boolean – default is true if not specified - * * @return showOnCashBasisReports - */ + **/ @ApiModelProperty(value = "Boolean – default is true if not specified") - /** + /** * Boolean – default is true if not specified - * * @return showOnCashBasisReports Boolean - */ + **/ public Boolean getShowOnCashBasisReports() { return showOnCashBasisReports; } - /** - * Boolean – default is true if not specified - * - * @param showOnCashBasisReports Boolean - */ + /** + * Boolean – default is true if not specified + * @param showOnCashBasisReports Boolean + **/ + public void setShowOnCashBasisReports(Boolean showOnCashBasisReports) { this.showOnCashBasisReports = showOnCashBasisReports; } - /** + /** * Boolean to indicate if a manual journal has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate if a manual journal has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate if a manual journal has an attachment") + /** * Boolean to indicate if a manual journal has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * The Xero identifier for a Manual Journal - * - * @param manualJournalID UUID - * @return ManualJournal - */ + * The Xero identifier for a Manual Journal + * @param manualJournalID UUID + * @return ManualJournal + **/ public ManualJournal manualJournalID(UUID manualJournalID) { this.manualJournalID = manualJournalID; return this; } - /** + /** * The Xero identifier for a Manual Journal - * * @return manualJournalID - */ + **/ @ApiModelProperty(value = "The Xero identifier for a Manual Journal") - /** + /** * The Xero identifier for a Manual Journal - * * @return manualJournalID UUID - */ + **/ public UUID getManualJournalID() { return manualJournalID; } - /** - * The Xero identifier for a Manual Journal - * - * @param manualJournalID UUID - */ + /** + * The Xero identifier for a Manual Journal + * @param manualJournalID UUID + **/ + public void setManualJournalID(UUID manualJournalID) { this.manualJournalID = manualJournalID; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return ManualJournal - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return ManualJournal + **/ public ManualJournal statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(example = "ERROR", value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return ManualJournal - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return ManualJournal + **/ public ManualJournal warnings(List warnings) { this.warnings = warnings; return this; @@ -547,10 +529,9 @@ public ManualJournal warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return ManualJournal - */ + **/ public ManualJournal addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -559,36 +540,33 @@ public ManualJournal addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return ManualJournal - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return ManualJournal + **/ public ManualJournal validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -596,10 +574,9 @@ public ManualJournal validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return ManualJournal - */ + **/ public ManualJournal addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -608,36 +585,33 @@ public ManualJournal addValidationErrorsItem(ValidationError validationErrorsIte return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - * @return ManualJournal - */ + * Displays array of attachments from the API + * @param attachments List<Attachment> + * @return ManualJournal + **/ public ManualJournal attachments(List attachments) { this.attachments = attachments; return this; @@ -645,10 +619,9 @@ public ManualJournal attachments(List attachments) { /** * Displays array of attachments from the API - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return ManualJournal - */ + **/ public ManualJournal addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -657,30 +630,29 @@ public ManualJournal addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * Displays array of attachments from the API - * * @return attachments - */ + **/ @ApiModelProperty(value = "Displays array of attachments from the API") - /** + /** * Displays array of attachments from the API - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - */ + /** + * Displays array of attachments from the API + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -690,41 +662,28 @@ public boolean equals(java.lang.Object o) { return false; } ManualJournal manualJournal = (ManualJournal) o; - return Objects.equals(this.narration, manualJournal.narration) - && Objects.equals(this.journalLines, manualJournal.journalLines) - && Objects.equals(this.date, manualJournal.date) - && Objects.equals(this.lineAmountTypes, manualJournal.lineAmountTypes) - && Objects.equals(this.status, manualJournal.status) - && Objects.equals(this.url, manualJournal.url) - && Objects.equals(this.showOnCashBasisReports, manualJournal.showOnCashBasisReports) - && Objects.equals(this.hasAttachments, manualJournal.hasAttachments) - && Objects.equals(this.updatedDateUTC, manualJournal.updatedDateUTC) - && Objects.equals(this.manualJournalID, manualJournal.manualJournalID) - && Objects.equals(this.statusAttributeString, manualJournal.statusAttributeString) - && Objects.equals(this.warnings, manualJournal.warnings) - && Objects.equals(this.validationErrors, manualJournal.validationErrors) - && Objects.equals(this.attachments, manualJournal.attachments); + return Objects.equals(this.narration, manualJournal.narration) && + Objects.equals(this.journalLines, manualJournal.journalLines) && + Objects.equals(this.date, manualJournal.date) && + Objects.equals(this.lineAmountTypes, manualJournal.lineAmountTypes) && + Objects.equals(this.status, manualJournal.status) && + Objects.equals(this.url, manualJournal.url) && + Objects.equals(this.showOnCashBasisReports, manualJournal.showOnCashBasisReports) && + Objects.equals(this.hasAttachments, manualJournal.hasAttachments) && + Objects.equals(this.updatedDateUTC, manualJournal.updatedDateUTC) && + Objects.equals(this.manualJournalID, manualJournal.manualJournalID) && + Objects.equals(this.statusAttributeString, manualJournal.statusAttributeString) && + Objects.equals(this.warnings, manualJournal.warnings) && + Objects.equals(this.validationErrors, manualJournal.validationErrors) && + Objects.equals(this.attachments, manualJournal.attachments); } @Override public int hashCode() { - return Objects.hash( - narration, - journalLines, - date, - lineAmountTypes, - status, - url, - showOnCashBasisReports, - hasAttachments, - updatedDateUTC, - manualJournalID, - statusAttributeString, - warnings, - validationErrors, - attachments); + return Objects.hash(narration, journalLines, date, lineAmountTypes, status, url, showOnCashBasisReports, hasAttachments, updatedDateUTC, manualJournalID, statusAttributeString, warnings, validationErrors, attachments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -735,15 +694,11 @@ public String toString() { sb.append(" lineAmountTypes: ").append(toIndentedString(lineAmountTypes)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" showOnCashBasisReports: ") - .append(toIndentedString(showOnCashBasisReports)) - .append("\n"); + sb.append(" showOnCashBasisReports: ").append(toIndentedString(showOnCashBasisReports)).append("\n"); sb.append(" hasAttachments: ").append(toIndentedString(hasAttachments)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" manualJournalID: ").append(toIndentedString(manualJournalID)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); @@ -752,7 +707,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -760,4 +716,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ManualJournalLine.java b/src/main/java/com/xero/models/accounting/ManualJournalLine.java index da9025183..797956560 100644 --- a/src/main/java/com/xero/models/accounting/ManualJournalLine.java +++ b/src/main/java/com/xero/models/accounting/ManualJournalLine.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.TrackingCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ManualJournalLine + */ -/** ManualJournalLine */ public class ManualJournalLine { StringUtil util = new StringUtil(); @@ -47,203 +65,180 @@ public class ManualJournalLine { @JsonProperty("IsBlank") private Boolean isBlank; /** - * total for line. Debits are positive, credits are negative value - * - * @param lineAmount Double - * @return ManualJournalLine - */ + * total for line. Debits are positive, credits are negative value + * @param lineAmount Double + * @return ManualJournalLine + **/ public ManualJournalLine lineAmount(Double lineAmount) { this.lineAmount = lineAmount; return this; } - /** + /** * total for line. Debits are positive, credits are negative value - * * @return lineAmount - */ - @ApiModelProperty( - example = "-2569.0", - value = "total for line. Debits are positive, credits are negative value") - /** + **/ + @ApiModelProperty(example = "-2569.0", value = "total for line. Debits are positive, credits are negative value") + /** * total for line. Debits are positive, credits are negative value - * * @return lineAmount Double - */ + **/ public Double getLineAmount() { return lineAmount; } - /** - * total for line. Debits are positive, credits are negative value - * - * @param lineAmount Double - */ + /** + * total for line. Debits are positive, credits are negative value + * @param lineAmount Double + **/ + public void setLineAmount(Double lineAmount) { this.lineAmount = lineAmount; } /** - * See Accounts - * - * @param accountCode String - * @return ManualJournalLine - */ + * See Accounts + * @param accountCode String + * @return ManualJournalLine + **/ public ManualJournalLine accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * See Accounts - * * @return accountCode - */ + **/ @ApiModelProperty(example = "720", value = "See Accounts") - /** + /** * See Accounts - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * See Accounts - * - * @param accountCode String - */ + /** + * See Accounts + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * See Accounts - * - * @param accountID UUID - * @return ManualJournalLine - */ + * See Accounts + * @param accountID UUID + * @return ManualJournalLine + **/ public ManualJournalLine accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * See Accounts - * * @return accountID - */ + **/ @ApiModelProperty(value = "See Accounts") - /** + /** * See Accounts - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * See Accounts - * - * @param accountID UUID - */ + /** + * See Accounts + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * Description for journal line - * - * @param description String - * @return ManualJournalLine - */ + * Description for journal line + * @param description String + * @return ManualJournalLine + **/ public ManualJournalLine description(String description) { this.description = description; return this; } - /** + /** * Description for journal line - * * @return description - */ - @ApiModelProperty( - example = "Coded incorrectly Office Equipment should be Computer Equipment", - value = "Description for journal line") - /** + **/ + @ApiModelProperty(example = "Coded incorrectly Office Equipment should be Computer Equipment", value = "Description for journal line") + /** * Description for journal line - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Description for journal line - * - * @param description String - */ + /** + * Description for journal line + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * The tax type from TaxRates - * - * @param taxType String - * @return ManualJournalLine - */ + * The tax type from TaxRates + * @param taxType String + * @return ManualJournalLine + **/ public ManualJournalLine taxType(String taxType) { this.taxType = taxType; return this; } - /** + /** * The tax type from TaxRates - * * @return taxType - */ + **/ @ApiModelProperty(value = "The tax type from TaxRates") - /** + /** * The tax type from TaxRates - * * @return taxType String - */ + **/ public String getTaxType() { return taxType; } - /** - * The tax type from TaxRates - * - * @param taxType String - */ + /** + * The tax type from TaxRates + * @param taxType String + **/ + public void setTaxType(String taxType) { this.taxType = taxType; } /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param tracking List<TrackingCategory> - * @return ManualJournalLine - */ + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. + * @param tracking List<TrackingCategory> + * @return ManualJournalLine + **/ public ManualJournalLine tracking(List tracking) { this.tracking = tracking; return this; } /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param trackingItem TrackingCategory + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. + * @param trackingItem TrackingCategory * @return ManualJournalLine - */ + **/ public ManualJournalLine addTrackingItem(TrackingCategory trackingItem) { if (this.tracking == null) { this.tracking = new ArrayList(); @@ -252,108 +247,93 @@ public ManualJournalLine addTrackingItem(TrackingCategory trackingItem) { return this; } - /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * + /** + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. * @return tracking - */ - @ApiModelProperty( - value = - "Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2" - + " elements.") - /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * + **/ + @ApiModelProperty(value = "Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements.") + /** + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. * @return tracking List - */ + **/ public List getTracking() { return tracking; } - /** - * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 - * <TrackingCategory> elements. - * - * @param tracking List<TrackingCategory> - */ + /** + * Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. + * @param tracking List<TrackingCategory> + **/ + public void setTracking(List tracking) { this.tracking = tracking; } /** - * The calculated tax amount based on the TaxType and LineAmount - * - * @param taxAmount Double - * @return ManualJournalLine - */ + * The calculated tax amount based on the TaxType and LineAmount + * @param taxAmount Double + * @return ManualJournalLine + **/ public ManualJournalLine taxAmount(Double taxAmount) { this.taxAmount = taxAmount; return this; } - /** + /** * The calculated tax amount based on the TaxType and LineAmount - * * @return taxAmount - */ - @ApiModelProperty( - example = "0.0", - value = "The calculated tax amount based on the TaxType and LineAmount") - /** + **/ + @ApiModelProperty(example = "0.0", value = "The calculated tax amount based on the TaxType and LineAmount") + /** * The calculated tax amount based on the TaxType and LineAmount - * * @return taxAmount Double - */ + **/ public Double getTaxAmount() { return taxAmount; } - /** - * The calculated tax amount based on the TaxType and LineAmount - * - * @param taxAmount Double - */ + /** + * The calculated tax amount based on the TaxType and LineAmount + * @param taxAmount Double + **/ + public void setTaxAmount(Double taxAmount) { this.taxAmount = taxAmount; } /** - * is the line blank - * - * @param isBlank Boolean - * @return ManualJournalLine - */ + * is the line blank + * @param isBlank Boolean + * @return ManualJournalLine + **/ public ManualJournalLine isBlank(Boolean isBlank) { this.isBlank = isBlank; return this; } - /** + /** * is the line blank - * * @return isBlank - */ + **/ @ApiModelProperty(example = "false", value = "is the line blank") - /** + /** * is the line blank - * * @return isBlank Boolean - */ + **/ public Boolean getIsBlank() { return isBlank; } - /** - * is the line blank - * - * @param isBlank Boolean - */ + /** + * is the line blank + * @param isBlank Boolean + **/ + public void setIsBlank(Boolean isBlank) { this.isBlank = isBlank; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -363,22 +343,22 @@ public boolean equals(java.lang.Object o) { return false; } ManualJournalLine manualJournalLine = (ManualJournalLine) o; - return Objects.equals(this.lineAmount, manualJournalLine.lineAmount) - && Objects.equals(this.accountCode, manualJournalLine.accountCode) - && Objects.equals(this.accountID, manualJournalLine.accountID) - && Objects.equals(this.description, manualJournalLine.description) - && Objects.equals(this.taxType, manualJournalLine.taxType) - && Objects.equals(this.tracking, manualJournalLine.tracking) - && Objects.equals(this.taxAmount, manualJournalLine.taxAmount) - && Objects.equals(this.isBlank, manualJournalLine.isBlank); + return Objects.equals(this.lineAmount, manualJournalLine.lineAmount) && + Objects.equals(this.accountCode, manualJournalLine.accountCode) && + Objects.equals(this.accountID, manualJournalLine.accountID) && + Objects.equals(this.description, manualJournalLine.description) && + Objects.equals(this.taxType, manualJournalLine.taxType) && + Objects.equals(this.tracking, manualJournalLine.tracking) && + Objects.equals(this.taxAmount, manualJournalLine.taxAmount) && + Objects.equals(this.isBlank, manualJournalLine.isBlank); } @Override public int hashCode() { - return Objects.hash( - lineAmount, accountCode, accountID, description, taxType, tracking, taxAmount, isBlank); + return Objects.hash(lineAmount, accountCode, accountID, description, taxType, tracking, taxAmount, isBlank); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -396,7 +376,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -404,4 +385,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ManualJournals.java b/src/main/java/com/xero/models/accounting/ManualJournals.java index dc116f02c..e01babde8 100644 --- a/src/main/java/com/xero/models/accounting/ManualJournals.java +++ b/src/main/java/com/xero/models/accounting/ManualJournals.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ManualJournal; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ManualJournals + */ -/** ManualJournals */ public class ManualJournals { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class ManualJournals { @JsonProperty("ManualJournals") private List manualJournals = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return ManualJournals - */ + * pagination + * @param pagination Pagination + * @return ManualJournals + **/ public ManualJournals pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return ManualJournals - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return ManualJournals + **/ public ManualJournals warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public ManualJournals warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return ManualJournals - */ + **/ public ManualJournals addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public ManualJournals addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * manualJournals - * - * @param manualJournals List<ManualJournal> - * @return ManualJournals - */ + * manualJournals + * @param manualJournals List<ManualJournal> + * @return ManualJournals + **/ public ManualJournals manualJournals(List manualJournals) { this.manualJournals = manualJournals; return this; @@ -127,10 +139,9 @@ public ManualJournals manualJournals(List manualJournals) { /** * manualJournals - * - * @param manualJournalsItem ManualJournal + * @param manualJournalsItem ManualJournal * @return ManualJournals - */ + **/ public ManualJournals addManualJournalsItem(ManualJournal manualJournalsItem) { if (this.manualJournals == null) { this.manualJournals = new ArrayList(); @@ -139,30 +150,29 @@ public ManualJournals addManualJournalsItem(ManualJournal manualJournalsItem) { return this; } - /** + /** * Get manualJournals - * * @return manualJournals - */ + **/ @ApiModelProperty(value = "") - /** + /** * manualJournals - * * @return manualJournals List - */ + **/ public List getManualJournals() { return manualJournals; } - /** - * manualJournals - * - * @param manualJournals List<ManualJournal> - */ + /** + * manualJournals + * @param manualJournals List<ManualJournal> + **/ + public void setManualJournals(List manualJournals) { this.manualJournals = manualJournals; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } ManualJournals manualJournals = (ManualJournals) o; - return Objects.equals(this.pagination, manualJournals.pagination) - && Objects.equals(this.warnings, manualJournals.warnings) - && Objects.equals(this.manualJournals, manualJournals.manualJournals); + return Objects.equals(this.pagination, manualJournals.pagination) && + Objects.equals(this.warnings, manualJournals.warnings) && + Objects.equals(this.manualJournals, manualJournals.manualJournals); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, manualJournals); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/OnlineInvoice.java b/src/main/java/com/xero/models/accounting/OnlineInvoice.java index f33d5cd1a..d5c483552 100644 --- a/src/main/java/com/xero/models/accounting/OnlineInvoice.java +++ b/src/main/java/com/xero/models/accounting/OnlineInvoice.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * OnlineInvoice + */ -/** OnlineInvoice */ public class OnlineInvoice { StringUtil util = new StringUtil(); @JsonProperty("OnlineInvoiceUrl") private String onlineInvoiceUrl; /** - * the URL to an online invoice - * - * @param onlineInvoiceUrl String - * @return OnlineInvoice - */ + * the URL to an online invoice + * @param onlineInvoiceUrl String + * @return OnlineInvoice + **/ public OnlineInvoice onlineInvoiceUrl(String onlineInvoiceUrl) { this.onlineInvoiceUrl = onlineInvoiceUrl; return this; } - /** + /** * the URL to an online invoice - * * @return onlineInvoiceUrl - */ + **/ @ApiModelProperty(value = "the URL to an online invoice") - /** + /** * the URL to an online invoice - * * @return onlineInvoiceUrl String - */ + **/ public String getOnlineInvoiceUrl() { return onlineInvoiceUrl; } - /** - * the URL to an online invoice - * - * @param onlineInvoiceUrl String - */ + /** + * the URL to an online invoice + * @param onlineInvoiceUrl String + **/ + public void setOnlineInvoiceUrl(String onlineInvoiceUrl) { this.onlineInvoiceUrl = onlineInvoiceUrl; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(onlineInvoiceUrl); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/OnlineInvoices.java b/src/main/java/com/xero/models/accounting/OnlineInvoices.java index 2490e7cd0..f67b1207c 100644 --- a/src/main/java/com/xero/models/accounting/OnlineInvoices.java +++ b/src/main/java/com/xero/models/accounting/OnlineInvoices.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.OnlineInvoice; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * OnlineInvoices + */ -/** OnlineInvoices */ public class OnlineInvoices { StringUtil util = new StringUtil(); @JsonProperty("OnlineInvoices") private List onlineInvoices = new ArrayList(); /** - * onlineInvoices - * - * @param onlineInvoices List<OnlineInvoice> - * @return OnlineInvoices - */ + * onlineInvoices + * @param onlineInvoices List<OnlineInvoice> + * @return OnlineInvoices + **/ public OnlineInvoices onlineInvoices(List onlineInvoices) { this.onlineInvoices = onlineInvoices; return this; @@ -37,10 +54,9 @@ public OnlineInvoices onlineInvoices(List onlineInvoices) { /** * onlineInvoices - * - * @param onlineInvoicesItem OnlineInvoice + * @param onlineInvoicesItem OnlineInvoice * @return OnlineInvoices - */ + **/ public OnlineInvoices addOnlineInvoicesItem(OnlineInvoice onlineInvoicesItem) { if (this.onlineInvoices == null) { this.onlineInvoices = new ArrayList(); @@ -49,30 +65,29 @@ public OnlineInvoices addOnlineInvoicesItem(OnlineInvoice onlineInvoicesItem) { return this; } - /** + /** * Get onlineInvoices - * * @return onlineInvoices - */ + **/ @ApiModelProperty(value = "") - /** + /** * onlineInvoices - * * @return onlineInvoices List - */ + **/ public List getOnlineInvoices() { return onlineInvoices; } - /** - * onlineInvoices - * - * @param onlineInvoices List<OnlineInvoice> - */ + /** + * onlineInvoices + * @param onlineInvoices List<OnlineInvoice> + **/ + public void setOnlineInvoices(List onlineInvoices) { this.onlineInvoices = onlineInvoices; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(onlineInvoices); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Organisation.java b/src/main/java/com/xero/models/accounting/Organisation.java index c4758c575..83ff1ce79 100644 --- a/src/main/java/com/xero/models/accounting/Organisation.java +++ b/src/main/java/com/xero/models/accounting/Organisation.java @@ -9,24 +9,41 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.AddressForOrganisation; +import com.xero.models.accounting.CountryCode; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.ExternalLink; +import com.xero.models.accounting.PaymentTerm; +import com.xero.models.accounting.Phone; +import com.xero.models.accounting.TimeZone; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Organisation + */ -/** Organisation */ public class Organisation { StringUtil util = new StringUtil(); @@ -44,36 +61,58 @@ public class Organisation { @JsonProperty("PaysTax") private Boolean paysTax; - /** See Version Types */ + /** + * See Version Types + */ public enum VersionEnum { - /** AU */ + /** + * AU + */ AU("AU"), - - /** NZ */ + + /** + * NZ + */ NZ("NZ"), - - /** GLOBAL */ + + /** + * GLOBAL + */ GLOBAL("GLOBAL"), - - /** UK */ + + /** + * UK + */ UK("UK"), - - /** US */ + + /** + * US + */ US("US"), - - /** AUONRAMP */ + + /** + * AUONRAMP + */ AUONRAMP("AUONRAMP"), - - /** NZONRAMP */ + + /** + * NZONRAMP + */ NZONRAMP("NZONRAMP"), - - /** GLOBALONRAMP */ + + /** + * GLOBALONRAMP + */ GLOBALONRAMP("GLOBALONRAMP"), - - /** UKONRAMP */ + + /** + * UKONRAMP + */ UKONRAMP("UKONRAMP"), - - /** USONRAMP */ + + /** + * USONRAMP + */ USONRAMP("USONRAMP"); private String value; @@ -82,31 +121,25 @@ public enum VersionEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static VersionEnum fromValue(String value) { for (VersionEnum b : VersionEnum.values()) { @@ -118,47 +151,76 @@ public static VersionEnum fromValue(String value) { } } + @JsonProperty("Version") private VersionEnum version; - /** Organisation Type */ + /** + * Organisation Type + */ public enum OrganisationTypeEnum { - /** ACCOUNTING_PRACTICE */ + /** + * ACCOUNTING_PRACTICE + */ ACCOUNTING_PRACTICE("ACCOUNTING_PRACTICE"), - - /** COMPANY */ + + /** + * COMPANY + */ COMPANY("COMPANY"), - - /** CHARITY */ + + /** + * CHARITY + */ CHARITY("CHARITY"), - - /** CLUB_OR_SOCIETY */ + + /** + * CLUB_OR_SOCIETY + */ CLUB_OR_SOCIETY("CLUB_OR_SOCIETY"), - - /** INDIVIDUAL */ + + /** + * INDIVIDUAL + */ INDIVIDUAL("INDIVIDUAL"), - - /** LOOK_THROUGH_COMPANY */ + + /** + * LOOK_THROUGH_COMPANY + */ LOOK_THROUGH_COMPANY("LOOK_THROUGH_COMPANY"), - - /** NOT_FOR_PROFIT */ + + /** + * NOT_FOR_PROFIT + */ NOT_FOR_PROFIT("NOT_FOR_PROFIT"), - - /** PARTNERSHIP */ + + /** + * PARTNERSHIP + */ PARTNERSHIP("PARTNERSHIP"), - - /** S_CORPORATION */ + + /** + * S_CORPORATION + */ S_CORPORATION("S_CORPORATION"), - - /** SELF_MANAGED_SUPERANNUATION_FUND */ + + /** + * SELF_MANAGED_SUPERANNUATION_FUND + */ SELF_MANAGED_SUPERANNUATION_FUND("SELF_MANAGED_SUPERANNUATION_FUND"), - - /** SOLE_TRADER */ + + /** + * SOLE_TRADER + */ SOLE_TRADER("SOLE_TRADER"), - - /** SUPERANNUATION_FUND */ + + /** + * SUPERANNUATION_FUND + */ SUPERANNUATION_FUND("SUPERANNUATION_FUND"), - - /** TRUST */ + + /** + * TRUST + */ TRUST("TRUST"); private String value; @@ -167,31 +229,25 @@ public enum OrganisationTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static OrganisationTypeEnum fromValue(String value) { for (OrganisationTypeEnum b : OrganisationTypeEnum.values()) { @@ -203,6 +259,7 @@ public static OrganisationTypeEnum fromValue(String value) { } } + @JsonProperty("OrganisationType") private OrganisationTypeEnum organisationType; @@ -232,30 +289,48 @@ public static OrganisationTypeEnum fromValue(String value) { @JsonProperty("FinancialYearEndMonth") private Integer financialYearEndMonth; - /** The accounting basis used for tax returns. See Sales Tax Basis */ + /** + * The accounting basis used for tax returns. See Sales Tax Basis + */ public enum SalesTaxBasisEnum { - /** PAYMENTS */ + /** + * PAYMENTS + */ PAYMENTS("PAYMENTS"), - - /** INVOICE */ + + /** + * INVOICE + */ INVOICE("INVOICE"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"), - - /** CASH */ + + /** + * CASH + */ CASH("CASH"), - - /** ACCRUAL */ + + /** + * ACCRUAL + */ ACCRUAL("ACCRUAL"), - - /** FLATRATECASH */ + + /** + * FLATRATECASH + */ FLATRATECASH("FLATRATECASH"), - - /** FLATRATEACCRUAL */ + + /** + * FLATRATEACCRUAL + */ FLATRATEACCRUAL("FLATRATEACCRUAL"), - - /** ACCRUALS */ + + /** + * ACCRUALS + */ ACCRUALS("ACCRUALS"); private String value; @@ -264,31 +339,25 @@ public enum SalesTaxBasisEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static SalesTaxBasisEnum fromValue(String value) { for (SalesTaxBasisEnum b : SalesTaxBasisEnum.values()) { @@ -300,53 +369,86 @@ public static SalesTaxBasisEnum fromValue(String value) { } } + @JsonProperty("SalesTaxBasis") private SalesTaxBasisEnum salesTaxBasis; - /** The frequency with which tax returns are processed. See Sales Tax Period */ + /** + * The frequency with which tax returns are processed. See Sales Tax Period + */ public enum SalesTaxPeriodEnum { - /** MONTHLY */ + /** + * MONTHLY + */ MONTHLY("MONTHLY"), - - /** QUARTERLY1 */ + + /** + * QUARTERLY1 + */ QUARTERLY1("QUARTERLY1"), - - /** QUARTERLY2 */ + + /** + * QUARTERLY2 + */ QUARTERLY2("QUARTERLY2"), - - /** QUARTERLY3 */ + + /** + * QUARTERLY3 + */ QUARTERLY3("QUARTERLY3"), - - /** ANNUALLY */ + + /** + * ANNUALLY + */ ANNUALLY("ANNUALLY"), - - /** ONEMONTHS */ + + /** + * ONEMONTHS + */ ONEMONTHS("ONEMONTHS"), - - /** TWOMONTHS */ + + /** + * TWOMONTHS + */ TWOMONTHS("TWOMONTHS"), - - /** SIXMONTHS */ + + /** + * SIXMONTHS + */ SIXMONTHS("SIXMONTHS"), - - /** _1MONTHLY */ + + /** + * _1MONTHLY + */ _1MONTHLY("1MONTHLY"), - - /** _2MONTHLY */ + + /** + * _2MONTHLY + */ _2MONTHLY("2MONTHLY"), - - /** _3MONTHLY */ + + /** + * _3MONTHLY + */ _3MONTHLY("3MONTHLY"), - - /** _6MONTHLY */ + + /** + * _6MONTHLY + */ _6MONTHLY("6MONTHLY"), - - /** QUARTERLY */ + + /** + * QUARTERLY + */ QUARTERLY("QUARTERLY"), - - /** YEARLY */ + + /** + * YEARLY + */ YEARLY("YEARLY"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"); private String value; @@ -355,31 +457,25 @@ public enum SalesTaxPeriodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static SalesTaxPeriodEnum fromValue(String value) { for (SalesTaxPeriodEnum b : SalesTaxPeriodEnum.values()) { @@ -391,6 +487,7 @@ public static SalesTaxPeriodEnum fromValue(String value) { } } + @JsonProperty("SalesTaxPeriod") private SalesTaxPeriodEnum salesTaxPeriod; @@ -411,45 +508,73 @@ public static SalesTaxPeriodEnum fromValue(String value) { @JsonProperty("Timezone") private TimeZone timezone; - /** Organisation Entity Type */ + /** + * Organisation Entity Type + */ public enum OrganisationEntityTypeEnum { - /** ACCOUNTING_PRACTICE */ + /** + * ACCOUNTING_PRACTICE + */ ACCOUNTING_PRACTICE("ACCOUNTING_PRACTICE"), - - /** COMPANY */ + + /** + * COMPANY + */ COMPANY("COMPANY"), - - /** CHARITY */ + + /** + * CHARITY + */ CHARITY("CHARITY"), - - /** CLUB_OR_SOCIETY */ + + /** + * CLUB_OR_SOCIETY + */ CLUB_OR_SOCIETY("CLUB_OR_SOCIETY"), - - /** INDIVIDUAL */ + + /** + * INDIVIDUAL + */ INDIVIDUAL("INDIVIDUAL"), - - /** LOOK_THROUGH_COMPANY */ + + /** + * LOOK_THROUGH_COMPANY + */ LOOK_THROUGH_COMPANY("LOOK_THROUGH_COMPANY"), - - /** NOT_FOR_PROFIT */ + + /** + * NOT_FOR_PROFIT + */ NOT_FOR_PROFIT("NOT_FOR_PROFIT"), - - /** PARTNERSHIP */ + + /** + * PARTNERSHIP + */ PARTNERSHIP("PARTNERSHIP"), - - /** S_CORPORATION */ + + /** + * S_CORPORATION + */ S_CORPORATION("S_CORPORATION"), - - /** SELF_MANAGED_SUPERANNUATION_FUND */ + + /** + * SELF_MANAGED_SUPERANNUATION_FUND + */ SELF_MANAGED_SUPERANNUATION_FUND("SELF_MANAGED_SUPERANNUATION_FUND"), - - /** SOLE_TRADER */ + + /** + * SOLE_TRADER + */ SOLE_TRADER("SOLE_TRADER"), - - /** SUPERANNUATION_FUND */ + + /** + * SUPERANNUATION_FUND + */ SUPERANNUATION_FUND("SUPERANNUATION_FUND"), - - /** TRUST */ + + /** + * TRUST + */ TRUST("TRUST"); private String value; @@ -458,31 +583,25 @@ public enum OrganisationEntityTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static OrganisationEntityTypeEnum fromValue(String value) { for (OrganisationEntityTypeEnum b : OrganisationEntityTypeEnum.values()) { @@ -494,77 +613,119 @@ public static OrganisationEntityTypeEnum fromValue(String value) { } } + @JsonProperty("OrganisationEntityType") private OrganisationEntityTypeEnum organisationEntityType; @JsonProperty("ShortCode") private String shortCode; /** - * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, - * PREMIUM) + * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) */ public enum PropertyClassEnum { - /** DEMO */ + /** + * DEMO + */ DEMO("DEMO"), - - /** TRIAL */ + + /** + * TRIAL + */ TRIAL("TRIAL"), - - /** STARTER */ + + /** + * STARTER + */ STARTER("STARTER"), - - /** STANDARD */ + + /** + * STANDARD + */ STANDARD("STANDARD"), - - /** PREMIUM */ + + /** + * PREMIUM + */ PREMIUM("PREMIUM"), - - /** PREMIUM_20 */ + + /** + * PREMIUM_20 + */ PREMIUM_20("PREMIUM_20"), - - /** PREMIUM_50 */ + + /** + * PREMIUM_50 + */ PREMIUM_50("PREMIUM_50"), - - /** PREMIUM_100 */ + + /** + * PREMIUM_100 + */ PREMIUM_100("PREMIUM_100"), - - /** LEDGER */ + + /** + * LEDGER + */ LEDGER("LEDGER"), - - /** GST_CASHBOOK */ + + /** + * GST_CASHBOOK + */ GST_CASHBOOK("GST_CASHBOOK"), - - /** NON_GST_CASHBOOK */ + + /** + * NON_GST_CASHBOOK + */ NON_GST_CASHBOOK("NON_GST_CASHBOOK"), - - /** ULTIMATE */ + + /** + * ULTIMATE + */ ULTIMATE("ULTIMATE"), - - /** LITE */ + + /** + * LITE + */ LITE("LITE"), - - /** ULTIMATE_10 */ + + /** + * ULTIMATE_10 + */ ULTIMATE_10("ULTIMATE_10"), - - /** ULTIMATE_20 */ + + /** + * ULTIMATE_20 + */ ULTIMATE_20("ULTIMATE_20"), - - /** ULTIMATE_50 */ + + /** + * ULTIMATE_50 + */ ULTIMATE_50("ULTIMATE_50"), - - /** ULTIMATE_100 */ + + /** + * ULTIMATE_100 + */ ULTIMATE_100("ULTIMATE_100"), - - /** IGNITE */ + + /** + * IGNITE + */ IGNITE("IGNITE"), - - /** GROW */ + + /** + * GROW + */ GROW("GROW"), - - /** COMPREHENSIVE */ + + /** + * COMPREHENSIVE + */ COMPREHENSIVE("COMPREHENSIVE"), - - /** SIMPLE */ + + /** + * SIMPLE + */ SIMPLE("SIMPLE"); private String value; @@ -573,31 +734,25 @@ public enum PropertyClassEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PropertyClassEnum fromValue(String value) { for (PropertyClassEnum b : PropertyClassEnum.values()) { @@ -609,17 +764,21 @@ public static PropertyClassEnum fromValue(String value) { } } + @JsonProperty("Class") private PropertyClassEnum propertyClass; /** - * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting - * partners and have restricted functionality (e.g. no access to invoicing) + * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) */ public enum EditionEnum { - /** BUSINESS */ + /** + * BUSINESS + */ BUSINESS("BUSINESS"), - - /** PARTNER */ + + /** + * PARTNER + */ PARTNER("PARTNER"); private String value; @@ -628,31 +787,25 @@ public enum EditionEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static EditionEnum fromValue(String value) { for (EditionEnum b : EditionEnum.values()) { @@ -664,6 +817,7 @@ public static EditionEnum fromValue(String value) { } } + @JsonProperty("Edition") private EditionEnum edition; @@ -682,1108 +836,985 @@ public static EditionEnum fromValue(String value) { @JsonProperty("PaymentTerms") private PaymentTerm paymentTerms; /** - * Unique Xero identifier - * - * @param organisationID UUID - * @return Organisation - */ + * Unique Xero identifier + * @param organisationID UUID + * @return Organisation + **/ public Organisation organisationID(UUID organisationID) { this.organisationID = organisationID; return this; } - /** + /** * Unique Xero identifier - * * @return organisationID - */ - @ApiModelProperty( - example = "8be9db36-3598-4755-ba5c-c2dbc8c4a7a2", - value = "Unique Xero identifier") - /** + **/ + @ApiModelProperty(example = "8be9db36-3598-4755-ba5c-c2dbc8c4a7a2", value = "Unique Xero identifier") + /** * Unique Xero identifier - * * @return organisationID UUID - */ + **/ public UUID getOrganisationID() { return organisationID; } - /** - * Unique Xero identifier - * - * @param organisationID UUID - */ + /** + * Unique Xero identifier + * @param organisationID UUID + **/ + public void setOrganisationID(UUID organisationID) { this.organisationID = organisationID; } /** - * Display a unique key used for Xero-to-Xero transactions - * - * @param apIKey String - * @return Organisation - */ + * Display a unique key used for Xero-to-Xero transactions + * @param apIKey String + * @return Organisation + **/ public Organisation apIKey(String apIKey) { this.apIKey = apIKey; return this; } - /** + /** * Display a unique key used for Xero-to-Xero transactions - * * @return apIKey - */ + **/ @ApiModelProperty(value = "Display a unique key used for Xero-to-Xero transactions") - /** + /** * Display a unique key used for Xero-to-Xero transactions - * * @return apIKey String - */ + **/ public String getApIKey() { return apIKey; } - /** - * Display a unique key used for Xero-to-Xero transactions - * - * @param apIKey String - */ + /** + * Display a unique key used for Xero-to-Xero transactions + * @param apIKey String + **/ + public void setApIKey(String apIKey) { this.apIKey = apIKey; } /** - * Display name of organisation shown in Xero - * - * @param name String - * @return Organisation - */ + * Display name of organisation shown in Xero + * @param name String + * @return Organisation + **/ public Organisation name(String name) { this.name = name; return this; } - /** + /** * Display name of organisation shown in Xero - * * @return name - */ + **/ @ApiModelProperty(value = "Display name of organisation shown in Xero") - /** + /** * Display name of organisation shown in Xero - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Display name of organisation shown in Xero - * - * @param name String - */ + /** + * Display name of organisation shown in Xero + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Organisation name shown on Reports - * - * @param legalName String - * @return Organisation - */ + * Organisation name shown on Reports + * @param legalName String + * @return Organisation + **/ public Organisation legalName(String legalName) { this.legalName = legalName; return this; } - /** + /** * Organisation name shown on Reports - * * @return legalName - */ + **/ @ApiModelProperty(value = "Organisation name shown on Reports") - /** + /** * Organisation name shown on Reports - * * @return legalName String - */ + **/ public String getLegalName() { return legalName; } - /** - * Organisation name shown on Reports - * - * @param legalName String - */ + /** + * Organisation name shown on Reports + * @param legalName String + **/ + public void setLegalName(String legalName) { this.legalName = legalName; } /** - * Boolean to describe if organisation is registered with a local tax authority i.e. true, false - * - * @param paysTax Boolean - * @return Organisation - */ + * Boolean to describe if organisation is registered with a local tax authority i.e. true, false + * @param paysTax Boolean + * @return Organisation + **/ public Organisation paysTax(Boolean paysTax) { this.paysTax = paysTax; return this; } - /** + /** * Boolean to describe if organisation is registered with a local tax authority i.e. true, false - * * @return paysTax - */ - @ApiModelProperty( - value = - "Boolean to describe if organisation is registered with a local tax authority i.e. true," - + " false") - /** + **/ + @ApiModelProperty(value = "Boolean to describe if organisation is registered with a local tax authority i.e. true, false") + /** * Boolean to describe if organisation is registered with a local tax authority i.e. true, false - * * @return paysTax Boolean - */ + **/ public Boolean getPaysTax() { return paysTax; } - /** - * Boolean to describe if organisation is registered with a local tax authority i.e. true, false - * - * @param paysTax Boolean - */ + /** + * Boolean to describe if organisation is registered with a local tax authority i.e. true, false + * @param paysTax Boolean + **/ + public void setPaysTax(Boolean paysTax) { this.paysTax = paysTax; } /** - * See Version Types - * - * @param version VersionEnum - * @return Organisation - */ + * See Version Types + * @param version VersionEnum + * @return Organisation + **/ public Organisation version(VersionEnum version) { this.version = version; return this; } - /** + /** * See Version Types - * * @return version - */ + **/ @ApiModelProperty(value = "See Version Types") - /** + /** * See Version Types - * * @return version VersionEnum - */ + **/ public VersionEnum getVersion() { return version; } - /** - * See Version Types - * - * @param version VersionEnum - */ + /** + * See Version Types + * @param version VersionEnum + **/ + public void setVersion(VersionEnum version) { this.version = version; } /** - * Organisation Type - * - * @param organisationType OrganisationTypeEnum - * @return Organisation - */ + * Organisation Type + * @param organisationType OrganisationTypeEnum + * @return Organisation + **/ public Organisation organisationType(OrganisationTypeEnum organisationType) { this.organisationType = organisationType; return this; } - /** + /** * Organisation Type - * * @return organisationType - */ + **/ @ApiModelProperty(value = "Organisation Type") - /** + /** * Organisation Type - * * @return organisationType OrganisationTypeEnum - */ + **/ public OrganisationTypeEnum getOrganisationType() { return organisationType; } - /** - * Organisation Type - * - * @param organisationType OrganisationTypeEnum - */ + /** + * Organisation Type + * @param organisationType OrganisationTypeEnum + **/ + public void setOrganisationType(OrganisationTypeEnum organisationType) { this.organisationType = organisationType; } /** - * baseCurrency - * - * @param baseCurrency CurrencyCode - * @return Organisation - */ + * baseCurrency + * @param baseCurrency CurrencyCode + * @return Organisation + **/ public Organisation baseCurrency(CurrencyCode baseCurrency) { this.baseCurrency = baseCurrency; return this; } - /** + /** * Get baseCurrency - * * @return baseCurrency - */ + **/ @ApiModelProperty(value = "") - /** + /** * baseCurrency - * * @return baseCurrency CurrencyCode - */ + **/ public CurrencyCode getBaseCurrency() { return baseCurrency; } - /** - * baseCurrency - * - * @param baseCurrency CurrencyCode - */ + /** + * baseCurrency + * @param baseCurrency CurrencyCode + **/ + public void setBaseCurrency(CurrencyCode baseCurrency) { this.baseCurrency = baseCurrency; } /** - * countryCode - * - * @param countryCode CountryCode - * @return Organisation - */ + * countryCode + * @param countryCode CountryCode + * @return Organisation + **/ public Organisation countryCode(CountryCode countryCode) { this.countryCode = countryCode; return this; } - /** + /** * Get countryCode - * * @return countryCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * countryCode - * * @return countryCode CountryCode - */ + **/ public CountryCode getCountryCode() { return countryCode; } - /** - * countryCode - * - * @param countryCode CountryCode - */ + /** + * countryCode + * @param countryCode CountryCode + **/ + public void setCountryCode(CountryCode countryCode) { this.countryCode = countryCode; } /** - * Boolean to describe if organisation is a demo company. - * - * @param isDemoCompany Boolean - * @return Organisation - */ + * Boolean to describe if organisation is a demo company. + * @param isDemoCompany Boolean + * @return Organisation + **/ public Organisation isDemoCompany(Boolean isDemoCompany) { this.isDemoCompany = isDemoCompany; return this; } - /** + /** * Boolean to describe if organisation is a demo company. - * * @return isDemoCompany - */ + **/ @ApiModelProperty(value = "Boolean to describe if organisation is a demo company.") - /** + /** * Boolean to describe if organisation is a demo company. - * * @return isDemoCompany Boolean - */ + **/ public Boolean getIsDemoCompany() { return isDemoCompany; } - /** - * Boolean to describe if organisation is a demo company. - * - * @param isDemoCompany Boolean - */ + /** + * Boolean to describe if organisation is a demo company. + * @param isDemoCompany Boolean + **/ + public void setIsDemoCompany(Boolean isDemoCompany) { this.isDemoCompany = isDemoCompany; } /** - * Will be set to ACTIVE if you can connect to organisation via the Xero API - * - * @param organisationStatus String - * @return Organisation - */ + * Will be set to ACTIVE if you can connect to organisation via the Xero API + * @param organisationStatus String + * @return Organisation + **/ public Organisation organisationStatus(String organisationStatus) { this.organisationStatus = organisationStatus; return this; } - /** + /** * Will be set to ACTIVE if you can connect to organisation via the Xero API - * * @return organisationStatus - */ - @ApiModelProperty( - value = "Will be set to ACTIVE if you can connect to organisation via the Xero API") - /** + **/ + @ApiModelProperty(value = "Will be set to ACTIVE if you can connect to organisation via the Xero API") + /** * Will be set to ACTIVE if you can connect to organisation via the Xero API - * * @return organisationStatus String - */ + **/ public String getOrganisationStatus() { return organisationStatus; } - /** - * Will be set to ACTIVE if you can connect to organisation via the Xero API - * - * @param organisationStatus String - */ + /** + * Will be set to ACTIVE if you can connect to organisation via the Xero API + * @param organisationStatus String + **/ + public void setOrganisationStatus(String organisationStatus) { this.organisationStatus = organisationStatus; } /** - * Shows for New Zealand, Australian and UK organisations - * - * @param registrationNumber String - * @return Organisation - */ + * Shows for New Zealand, Australian and UK organisations + * @param registrationNumber String + * @return Organisation + **/ public Organisation registrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; return this; } - /** + /** * Shows for New Zealand, Australian and UK organisations - * * @return registrationNumber - */ + **/ @ApiModelProperty(value = "Shows for New Zealand, Australian and UK organisations") - /** + /** * Shows for New Zealand, Australian and UK organisations - * * @return registrationNumber String - */ + **/ public String getRegistrationNumber() { return registrationNumber; } - /** - * Shows for New Zealand, Australian and UK organisations - * - * @param registrationNumber String - */ + /** + * Shows for New Zealand, Australian and UK organisations + * @param registrationNumber String + **/ + public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; } /** - * Shown if set. US Only. - * - * @param employerIdentificationNumber String - * @return Organisation - */ + * Shown if set. US Only. + * @param employerIdentificationNumber String + * @return Organisation + **/ public Organisation employerIdentificationNumber(String employerIdentificationNumber) { this.employerIdentificationNumber = employerIdentificationNumber; return this; } - /** + /** * Shown if set. US Only. - * * @return employerIdentificationNumber - */ + **/ @ApiModelProperty(value = "Shown if set. US Only.") - /** + /** * Shown if set. US Only. - * * @return employerIdentificationNumber String - */ + **/ public String getEmployerIdentificationNumber() { return employerIdentificationNumber; } - /** - * Shown if set. US Only. - * - * @param employerIdentificationNumber String - */ + /** + * Shown if set. US Only. + * @param employerIdentificationNumber String + **/ + public void setEmployerIdentificationNumber(String employerIdentificationNumber) { this.employerIdentificationNumber = employerIdentificationNumber; } /** - * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) - * and Tax ID Number (US & Global). - * - * @param taxNumber String - * @return Organisation - */ + * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). + * @param taxNumber String + * @return Organisation + **/ public Organisation taxNumber(String taxNumber) { this.taxNumber = taxNumber; return this; } - /** - * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) - * and Tax ID Number (US & Global). - * + /** + * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). * @return taxNumber - */ - @ApiModelProperty( - value = - "Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT" - + " Number (UK) and Tax ID Number (US & Global).") - /** - * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) - * and Tax ID Number (US & Global). - * + **/ + @ApiModelProperty(value = "Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global).") + /** + * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). * @return taxNumber String - */ + **/ public String getTaxNumber() { return taxNumber; } - /** - * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) - * and Tax ID Number (US & Global). - * - * @param taxNumber String - */ + /** + * Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). + * @param taxNumber String + **/ + public void setTaxNumber(String taxNumber) { this.taxNumber = taxNumber; } /** - * Calendar day e.g. 0-31 - * - * @param financialYearEndDay Integer - * @return Organisation - */ + * Calendar day e.g. 0-31 + * @param financialYearEndDay Integer + * @return Organisation + **/ public Organisation financialYearEndDay(Integer financialYearEndDay) { this.financialYearEndDay = financialYearEndDay; return this; } - /** + /** * Calendar day e.g. 0-31 - * * @return financialYearEndDay - */ + **/ @ApiModelProperty(value = "Calendar day e.g. 0-31") - /** + /** * Calendar day e.g. 0-31 - * * @return financialYearEndDay Integer - */ + **/ public Integer getFinancialYearEndDay() { return financialYearEndDay; } - /** - * Calendar day e.g. 0-31 - * - * @param financialYearEndDay Integer - */ + /** + * Calendar day e.g. 0-31 + * @param financialYearEndDay Integer + **/ + public void setFinancialYearEndDay(Integer financialYearEndDay) { this.financialYearEndDay = financialYearEndDay; } /** - * Calendar Month e.g. 1-12 - * - * @param financialYearEndMonth Integer - * @return Organisation - */ + * Calendar Month e.g. 1-12 + * @param financialYearEndMonth Integer + * @return Organisation + **/ public Organisation financialYearEndMonth(Integer financialYearEndMonth) { this.financialYearEndMonth = financialYearEndMonth; return this; } - /** + /** * Calendar Month e.g. 1-12 - * * @return financialYearEndMonth - */ + **/ @ApiModelProperty(value = "Calendar Month e.g. 1-12") - /** + /** * Calendar Month e.g. 1-12 - * * @return financialYearEndMonth Integer - */ + **/ public Integer getFinancialYearEndMonth() { return financialYearEndMonth; } - /** - * Calendar Month e.g. 1-12 - * - * @param financialYearEndMonth Integer - */ + /** + * Calendar Month e.g. 1-12 + * @param financialYearEndMonth Integer + **/ + public void setFinancialYearEndMonth(Integer financialYearEndMonth) { this.financialYearEndMonth = financialYearEndMonth; } /** - * The accounting basis used for tax returns. See Sales Tax Basis - * - * @param salesTaxBasis SalesTaxBasisEnum - * @return Organisation - */ + * The accounting basis used for tax returns. See Sales Tax Basis + * @param salesTaxBasis SalesTaxBasisEnum + * @return Organisation + **/ public Organisation salesTaxBasis(SalesTaxBasisEnum salesTaxBasis) { this.salesTaxBasis = salesTaxBasis; return this; } - /** + /** * The accounting basis used for tax returns. See Sales Tax Basis - * * @return salesTaxBasis - */ + **/ @ApiModelProperty(value = "The accounting basis used for tax returns. See Sales Tax Basis") - /** + /** * The accounting basis used for tax returns. See Sales Tax Basis - * * @return salesTaxBasis SalesTaxBasisEnum - */ + **/ public SalesTaxBasisEnum getSalesTaxBasis() { return salesTaxBasis; } - /** - * The accounting basis used for tax returns. See Sales Tax Basis - * - * @param salesTaxBasis SalesTaxBasisEnum - */ + /** + * The accounting basis used for tax returns. See Sales Tax Basis + * @param salesTaxBasis SalesTaxBasisEnum + **/ + public void setSalesTaxBasis(SalesTaxBasisEnum salesTaxBasis) { this.salesTaxBasis = salesTaxBasis; } /** - * The frequency with which tax returns are processed. See Sales Tax Period - * - * @param salesTaxPeriod SalesTaxPeriodEnum - * @return Organisation - */ + * The frequency with which tax returns are processed. See Sales Tax Period + * @param salesTaxPeriod SalesTaxPeriodEnum + * @return Organisation + **/ public Organisation salesTaxPeriod(SalesTaxPeriodEnum salesTaxPeriod) { this.salesTaxPeriod = salesTaxPeriod; return this; } - /** + /** * The frequency with which tax returns are processed. See Sales Tax Period - * * @return salesTaxPeriod - */ - @ApiModelProperty( - value = "The frequency with which tax returns are processed. See Sales Tax Period") - /** + **/ + @ApiModelProperty(value = "The frequency with which tax returns are processed. See Sales Tax Period") + /** * The frequency with which tax returns are processed. See Sales Tax Period - * * @return salesTaxPeriod SalesTaxPeriodEnum - */ + **/ public SalesTaxPeriodEnum getSalesTaxPeriod() { return salesTaxPeriod; } - /** - * The frequency with which tax returns are processed. See Sales Tax Period - * - * @param salesTaxPeriod SalesTaxPeriodEnum - */ + /** + * The frequency with which tax returns are processed. See Sales Tax Period + * @param salesTaxPeriod SalesTaxPeriodEnum + **/ + public void setSalesTaxPeriod(SalesTaxPeriodEnum salesTaxPeriod) { this.salesTaxPeriod = salesTaxPeriod; } /** - * The default for LineAmountTypes on sales transactions - * - * @param defaultSalesTax String - * @return Organisation - */ + * The default for LineAmountTypes on sales transactions + * @param defaultSalesTax String + * @return Organisation + **/ public Organisation defaultSalesTax(String defaultSalesTax) { this.defaultSalesTax = defaultSalesTax; return this; } - /** + /** * The default for LineAmountTypes on sales transactions - * * @return defaultSalesTax - */ + **/ @ApiModelProperty(value = "The default for LineAmountTypes on sales transactions") - /** + /** * The default for LineAmountTypes on sales transactions - * * @return defaultSalesTax String - */ + **/ public String getDefaultSalesTax() { return defaultSalesTax; } - /** - * The default for LineAmountTypes on sales transactions - * - * @param defaultSalesTax String - */ + /** + * The default for LineAmountTypes on sales transactions + * @param defaultSalesTax String + **/ + public void setDefaultSalesTax(String defaultSalesTax) { this.defaultSalesTax = defaultSalesTax; } /** - * The default for LineAmountTypes on purchase transactions - * - * @param defaultPurchasesTax String - * @return Organisation - */ + * The default for LineAmountTypes on purchase transactions + * @param defaultPurchasesTax String + * @return Organisation + **/ public Organisation defaultPurchasesTax(String defaultPurchasesTax) { this.defaultPurchasesTax = defaultPurchasesTax; return this; } - /** + /** * The default for LineAmountTypes on purchase transactions - * * @return defaultPurchasesTax - */ + **/ @ApiModelProperty(value = "The default for LineAmountTypes on purchase transactions") - /** + /** * The default for LineAmountTypes on purchase transactions - * * @return defaultPurchasesTax String - */ + **/ public String getDefaultPurchasesTax() { return defaultPurchasesTax; } - /** - * The default for LineAmountTypes on purchase transactions - * - * @param defaultPurchasesTax String - */ + /** + * The default for LineAmountTypes on purchase transactions + * @param defaultPurchasesTax String + **/ + public void setDefaultPurchasesTax(String defaultPurchasesTax) { this.defaultPurchasesTax = defaultPurchasesTax; } /** - * Shown if set. See lock dates - * - * @param periodLockDate String - * @return Organisation - */ + * Shown if set. See lock dates + * @param periodLockDate String + * @return Organisation + **/ public Organisation periodLockDate(String periodLockDate) { this.periodLockDate = periodLockDate; return this; } - /** + /** * Shown if set. See lock dates - * * @return periodLockDate - */ + **/ @ApiModelProperty(value = "Shown if set. See lock dates") - /** + /** * Shown if set. See lock dates - * * @return periodLockDate String - */ + **/ public String getPeriodLockDate() { return periodLockDate; } - /** + /** * Shown if set. See lock dates - * * @return LocalDate - */ + **/ public LocalDate getPeriodLockDateAsDate() { if (this.periodLockDate != null) { try { return util.convertStringToDate(this.periodLockDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Shown if set. See lock dates - * - * @param periodLockDate String - */ + /** + * Shown if set. See lock dates + * @param periodLockDate String + **/ + public void setPeriodLockDate(String periodLockDate) { this.periodLockDate = periodLockDate; } - /** - * Shown if set. See lock dates - * - * @param periodLockDate LocalDateTime - */ + /** + * Shown if set. See lock dates + * @param periodLockDate LocalDateTime + **/ public void setPeriodLockDate(LocalDate periodLockDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = periodLockDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = periodLockDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.periodLockDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Shown if set. See lock dates - * - * @param endOfYearLockDate String - * @return Organisation - */ + * Shown if set. See lock dates + * @param endOfYearLockDate String + * @return Organisation + **/ public Organisation endOfYearLockDate(String endOfYearLockDate) { this.endOfYearLockDate = endOfYearLockDate; return this; } - /** + /** * Shown if set. See lock dates - * * @return endOfYearLockDate - */ + **/ @ApiModelProperty(value = "Shown if set. See lock dates") - /** + /** * Shown if set. See lock dates - * * @return endOfYearLockDate String - */ + **/ public String getEndOfYearLockDate() { return endOfYearLockDate; } - /** + /** * Shown if set. See lock dates - * * @return LocalDate - */ + **/ public LocalDate getEndOfYearLockDateAsDate() { if (this.endOfYearLockDate != null) { try { return util.convertStringToDate(this.endOfYearLockDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Shown if set. See lock dates - * - * @param endOfYearLockDate String - */ + /** + * Shown if set. See lock dates + * @param endOfYearLockDate String + **/ + public void setEndOfYearLockDate(String endOfYearLockDate) { this.endOfYearLockDate = endOfYearLockDate; } - /** - * Shown if set. See lock dates - * - * @param endOfYearLockDate LocalDateTime - */ + /** + * Shown if set. See lock dates + * @param endOfYearLockDate LocalDateTime + **/ public void setEndOfYearLockDate(LocalDate endOfYearLockDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = endOfYearLockDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = endOfYearLockDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.endOfYearLockDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } - /** + /** * Timestamp when the organisation was created in Xero - * * @return createdDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "Timestamp when the organisation was created in Xero") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "Timestamp when the organisation was created in Xero") + /** * Timestamp when the organisation was created in Xero - * * @return createdDateUTC String - */ + **/ public String getCreatedDateUTC() { return createdDateUTC; } - /** + /** * Timestamp when the organisation was created in Xero - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getCreatedDateUTCAsDate() { if (this.createdDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.createdDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * timezone - * - * @param timezone TimeZone - * @return Organisation - */ + * timezone + * @param timezone TimeZone + * @return Organisation + **/ public Organisation timezone(TimeZone timezone) { this.timezone = timezone; return this; } - /** + /** * Get timezone - * * @return timezone - */ + **/ @ApiModelProperty(value = "") - /** + /** * timezone - * * @return timezone TimeZone - */ + **/ public TimeZone getTimezone() { return timezone; } - /** - * timezone - * - * @param timezone TimeZone - */ + /** + * timezone + * @param timezone TimeZone + **/ + public void setTimezone(TimeZone timezone) { this.timezone = timezone; } /** - * Organisation Entity Type - * - * @param organisationEntityType OrganisationEntityTypeEnum - * @return Organisation - */ + * Organisation Entity Type + * @param organisationEntityType OrganisationEntityTypeEnum + * @return Organisation + **/ public Organisation organisationEntityType(OrganisationEntityTypeEnum organisationEntityType) { this.organisationEntityType = organisationEntityType; return this; } - /** + /** * Organisation Entity Type - * * @return organisationEntityType - */ + **/ @ApiModelProperty(value = "Organisation Entity Type") - /** + /** * Organisation Entity Type - * * @return organisationEntityType OrganisationEntityTypeEnum - */ + **/ public OrganisationEntityTypeEnum getOrganisationEntityType() { return organisationEntityType; } - /** - * Organisation Entity Type - * - * @param organisationEntityType OrganisationEntityTypeEnum - */ + /** + * Organisation Entity Type + * @param organisationEntityType OrganisationEntityTypeEnum + **/ + public void setOrganisationEntityType(OrganisationEntityTypeEnum organisationEntityType) { this.organisationEntityType = organisationEntityType; } /** - * A unique identifier for the organisation. Potential uses. - * - * @param shortCode String - * @return Organisation - */ + * A unique identifier for the organisation. Potential uses. + * @param shortCode String + * @return Organisation + **/ public Organisation shortCode(String shortCode) { this.shortCode = shortCode; return this; } - /** + /** * A unique identifier for the organisation. Potential uses. - * * @return shortCode - */ + **/ @ApiModelProperty(value = "A unique identifier for the organisation. Potential uses.") - /** + /** * A unique identifier for the organisation. Potential uses. - * * @return shortCode String - */ + **/ public String getShortCode() { return shortCode; } - /** - * A unique identifier for the organisation. Potential uses. - * - * @param shortCode String - */ + /** + * A unique identifier for the organisation. Potential uses. + * @param shortCode String + **/ + public void setShortCode(String shortCode) { this.shortCode = shortCode; } /** - * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, - * PREMIUM) - * - * @param propertyClass PropertyClassEnum - * @return Organisation - */ + * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) + * @param propertyClass PropertyClassEnum + * @return Organisation + **/ public Organisation propertyClass(PropertyClassEnum propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, - * PREMIUM) - * + /** + * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) * @return propertyClass - */ - @ApiModelProperty( - value = - "Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL," - + " PREMIUM)") - /** - * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, - * PREMIUM) - * + **/ + @ApiModelProperty(value = "Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM)") + /** + * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) * @return propertyClass PropertyClassEnum - */ + **/ public PropertyClassEnum getPropertyClass() { return propertyClass; } - /** - * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, - * PREMIUM) - * - * @param propertyClass PropertyClassEnum - */ + /** + * Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) + * @param propertyClass PropertyClassEnum + **/ + public void setPropertyClass(PropertyClassEnum propertyClass) { this.propertyClass = propertyClass; } /** - * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting - * partners and have restricted functionality (e.g. no access to invoicing) - * - * @param edition EditionEnum - * @return Organisation - */ + * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) + * @param edition EditionEnum + * @return Organisation + **/ public Organisation edition(EditionEnum edition) { this.edition = edition; return this; } - /** - * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting - * partners and have restricted functionality (e.g. no access to invoicing) - * + /** + * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) * @return edition - */ - @ApiModelProperty( - value = - "BUSINESS or PARTNER. Partner edition organisations are sold exclusively through" - + " accounting partners and have restricted functionality (e.g. no access to" - + " invoicing)") - /** - * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting - * partners and have restricted functionality (e.g. no access to invoicing) - * + **/ + @ApiModelProperty(value = "BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing)") + /** + * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) * @return edition EditionEnum - */ + **/ public EditionEnum getEdition() { return edition; } - /** - * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting - * partners and have restricted functionality (e.g. no access to invoicing) - * - * @param edition EditionEnum - */ + /** + * BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) + * @param edition EditionEnum + **/ + public void setEdition(EditionEnum edition) { this.edition = edition; } /** - * Description of business type as defined in Organisation settings - * - * @param lineOfBusiness String - * @return Organisation - */ + * Description of business type as defined in Organisation settings + * @param lineOfBusiness String + * @return Organisation + **/ public Organisation lineOfBusiness(String lineOfBusiness) { this.lineOfBusiness = lineOfBusiness; return this; } - /** + /** * Description of business type as defined in Organisation settings - * * @return lineOfBusiness - */ + **/ @ApiModelProperty(value = "Description of business type as defined in Organisation settings") - /** + /** * Description of business type as defined in Organisation settings - * * @return lineOfBusiness String - */ + **/ public String getLineOfBusiness() { return lineOfBusiness; } - /** - * Description of business type as defined in Organisation settings - * - * @param lineOfBusiness String - */ + /** + * Description of business type as defined in Organisation settings + * @param lineOfBusiness String + **/ + public void setLineOfBusiness(String lineOfBusiness) { this.lineOfBusiness = lineOfBusiness; } /** - * Address details for organisation – see Addresses - * - * @param addresses List<AddressForOrganisation> - * @return Organisation - */ + * Address details for organisation – see Addresses + * @param addresses List<AddressForOrganisation> + * @return Organisation + **/ public Organisation addresses(List addresses) { this.addresses = addresses; return this; @@ -1791,10 +1822,9 @@ public Organisation addresses(List addresses) { /** * Address details for organisation – see Addresses - * - * @param addressesItem AddressForOrganisation + * @param addressesItem AddressForOrganisation * @return Organisation - */ + **/ public Organisation addAddressesItem(AddressForOrganisation addressesItem) { if (this.addresses == null) { this.addresses = new ArrayList(); @@ -1803,36 +1833,33 @@ public Organisation addAddressesItem(AddressForOrganisation addressesItem) { return this; } - /** + /** * Address details for organisation – see Addresses - * * @return addresses - */ + **/ @ApiModelProperty(value = "Address details for organisation – see Addresses") - /** + /** * Address details for organisation – see Addresses - * * @return addresses List - */ + **/ public List getAddresses() { return addresses; } - /** - * Address details for organisation – see Addresses - * - * @param addresses List<AddressForOrganisation> - */ + /** + * Address details for organisation – see Addresses + * @param addresses List<AddressForOrganisation> + **/ + public void setAddresses(List addresses) { this.addresses = addresses; } /** - * Phones details for organisation – see Phones - * - * @param phones List<Phone> - * @return Organisation - */ + * Phones details for organisation – see Phones + * @param phones List<Phone> + * @return Organisation + **/ public Organisation phones(List phones) { this.phones = phones; return this; @@ -1840,10 +1867,9 @@ public Organisation phones(List phones) { /** * Phones details for organisation – see Phones - * - * @param phonesItem Phone + * @param phonesItem Phone * @return Organisation - */ + **/ public Organisation addPhonesItem(Phone phonesItem) { if (this.phones == null) { this.phones = new ArrayList(); @@ -1852,51 +1878,43 @@ public Organisation addPhonesItem(Phone phonesItem) { return this; } - /** + /** * Phones details for organisation – see Phones - * * @return phones - */ + **/ @ApiModelProperty(value = "Phones details for organisation – see Phones") - /** + /** * Phones details for organisation – see Phones - * * @return phones List - */ + **/ public List getPhones() { return phones; } - /** - * Phones details for organisation – see Phones - * - * @param phones List<Phone> - */ + /** + * Phones details for organisation – see Phones + * @param phones List<Phone> + **/ + public void setPhones(List phones) { this.phones = phones; } /** - * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and - * LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated - * in Xero. See ExternalLinks below - * - * @param externalLinks List<ExternalLink> - * @return Organisation - */ + * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below + * @param externalLinks List<ExternalLink> + * @return Organisation + **/ public Organisation externalLinks(List externalLinks) { this.externalLinks = externalLinks; return this; } /** - * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and - * LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated - * in Xero. See ExternalLinks below - * - * @param externalLinksItem ExternalLink + * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below + * @param externalLinksItem ExternalLink * @return Organisation - */ + **/ public Organisation addExternalLinksItem(ExternalLink externalLinksItem) { if (this.externalLinks == null) { this.externalLinks = new ArrayList(); @@ -1905,75 +1923,61 @@ public Organisation addExternalLinksItem(ExternalLink externalLinksItem) { return this; } - /** - * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and - * LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated - * in Xero. See ExternalLinks below - * + /** + * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below * @return externalLinks - */ - @ApiModelProperty( - value = - "Organisation profile links for popular services such as Facebook,Twitter, GooglePlus" - + " and LinkedIn. You can also add link to your website here. Shown if Organisation" - + " settings is updated in Xero. See ExternalLinks below") - /** - * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and - * LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated - * in Xero. See ExternalLinks below - * + **/ + @ApiModelProperty(value = "Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below") + /** + * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below * @return externalLinks List - */ + **/ public List getExternalLinks() { return externalLinks; } - /** - * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and - * LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated - * in Xero. See ExternalLinks below - * - * @param externalLinks List<ExternalLink> - */ + /** + * Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below + * @param externalLinks List<ExternalLink> + **/ + public void setExternalLinks(List externalLinks) { this.externalLinks = externalLinks; } /** - * paymentTerms - * - * @param paymentTerms PaymentTerm - * @return Organisation - */ + * paymentTerms + * @param paymentTerms PaymentTerm + * @return Organisation + **/ public Organisation paymentTerms(PaymentTerm paymentTerms) { this.paymentTerms = paymentTerms; return this; } - /** + /** * Get paymentTerms - * * @return paymentTerms - */ + **/ @ApiModelProperty(value = "") - /** + /** * paymentTerms - * * @return paymentTerms PaymentTerm - */ + **/ public PaymentTerm getPaymentTerms() { return paymentTerms; } - /** - * paymentTerms - * - * @param paymentTerms PaymentTerm - */ + /** + * paymentTerms + * @param paymentTerms PaymentTerm + **/ + public void setPaymentTerms(PaymentTerm paymentTerms) { this.paymentTerms = paymentTerms; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1983,80 +1987,47 @@ public boolean equals(java.lang.Object o) { return false; } Organisation organisation = (Organisation) o; - return Objects.equals(this.organisationID, organisation.organisationID) - && Objects.equals(this.apIKey, organisation.apIKey) - && Objects.equals(this.name, organisation.name) - && Objects.equals(this.legalName, organisation.legalName) - && Objects.equals(this.paysTax, organisation.paysTax) - && Objects.equals(this.version, organisation.version) - && Objects.equals(this.organisationType, organisation.organisationType) - && Objects.equals(this.baseCurrency, organisation.baseCurrency) - && Objects.equals(this.countryCode, organisation.countryCode) - && Objects.equals(this.isDemoCompany, organisation.isDemoCompany) - && Objects.equals(this.organisationStatus, organisation.organisationStatus) - && Objects.equals(this.registrationNumber, organisation.registrationNumber) - && Objects.equals( - this.employerIdentificationNumber, organisation.employerIdentificationNumber) - && Objects.equals(this.taxNumber, organisation.taxNumber) - && Objects.equals(this.financialYearEndDay, organisation.financialYearEndDay) - && Objects.equals(this.financialYearEndMonth, organisation.financialYearEndMonth) - && Objects.equals(this.salesTaxBasis, organisation.salesTaxBasis) - && Objects.equals(this.salesTaxPeriod, organisation.salesTaxPeriod) - && Objects.equals(this.defaultSalesTax, organisation.defaultSalesTax) - && Objects.equals(this.defaultPurchasesTax, organisation.defaultPurchasesTax) - && Objects.equals(this.periodLockDate, organisation.periodLockDate) - && Objects.equals(this.endOfYearLockDate, organisation.endOfYearLockDate) - && Objects.equals(this.createdDateUTC, organisation.createdDateUTC) - && Objects.equals(this.timezone, organisation.timezone) - && Objects.equals(this.organisationEntityType, organisation.organisationEntityType) - && Objects.equals(this.shortCode, organisation.shortCode) - && Objects.equals(this.propertyClass, organisation.propertyClass) - && Objects.equals(this.edition, organisation.edition) - && Objects.equals(this.lineOfBusiness, organisation.lineOfBusiness) - && Objects.equals(this.addresses, organisation.addresses) - && Objects.equals(this.phones, organisation.phones) - && Objects.equals(this.externalLinks, organisation.externalLinks) - && Objects.equals(this.paymentTerms, organisation.paymentTerms); + return Objects.equals(this.organisationID, organisation.organisationID) && + Objects.equals(this.apIKey, organisation.apIKey) && + Objects.equals(this.name, organisation.name) && + Objects.equals(this.legalName, organisation.legalName) && + Objects.equals(this.paysTax, organisation.paysTax) && + Objects.equals(this.version, organisation.version) && + Objects.equals(this.organisationType, organisation.organisationType) && + Objects.equals(this.baseCurrency, organisation.baseCurrency) && + Objects.equals(this.countryCode, organisation.countryCode) && + Objects.equals(this.isDemoCompany, organisation.isDemoCompany) && + Objects.equals(this.organisationStatus, organisation.organisationStatus) && + Objects.equals(this.registrationNumber, organisation.registrationNumber) && + Objects.equals(this.employerIdentificationNumber, organisation.employerIdentificationNumber) && + Objects.equals(this.taxNumber, organisation.taxNumber) && + Objects.equals(this.financialYearEndDay, organisation.financialYearEndDay) && + Objects.equals(this.financialYearEndMonth, organisation.financialYearEndMonth) && + Objects.equals(this.salesTaxBasis, organisation.salesTaxBasis) && + Objects.equals(this.salesTaxPeriod, organisation.salesTaxPeriod) && + Objects.equals(this.defaultSalesTax, organisation.defaultSalesTax) && + Objects.equals(this.defaultPurchasesTax, organisation.defaultPurchasesTax) && + Objects.equals(this.periodLockDate, organisation.periodLockDate) && + Objects.equals(this.endOfYearLockDate, organisation.endOfYearLockDate) && + Objects.equals(this.createdDateUTC, organisation.createdDateUTC) && + Objects.equals(this.timezone, organisation.timezone) && + Objects.equals(this.organisationEntityType, organisation.organisationEntityType) && + Objects.equals(this.shortCode, organisation.shortCode) && + Objects.equals(this.propertyClass, organisation.propertyClass) && + Objects.equals(this.edition, organisation.edition) && + Objects.equals(this.lineOfBusiness, organisation.lineOfBusiness) && + Objects.equals(this.addresses, organisation.addresses) && + Objects.equals(this.phones, organisation.phones) && + Objects.equals(this.externalLinks, organisation.externalLinks) && + Objects.equals(this.paymentTerms, organisation.paymentTerms); } @Override public int hashCode() { - return Objects.hash( - organisationID, - apIKey, - name, - legalName, - paysTax, - version, - organisationType, - baseCurrency, - countryCode, - isDemoCompany, - organisationStatus, - registrationNumber, - employerIdentificationNumber, - taxNumber, - financialYearEndDay, - financialYearEndMonth, - salesTaxBasis, - salesTaxPeriod, - defaultSalesTax, - defaultPurchasesTax, - periodLockDate, - endOfYearLockDate, - createdDateUTC, - timezone, - organisationEntityType, - shortCode, - propertyClass, - edition, - lineOfBusiness, - addresses, - phones, - externalLinks, - paymentTerms); + return Objects.hash(organisationID, apIKey, name, legalName, paysTax, version, organisationType, baseCurrency, countryCode, isDemoCompany, organisationStatus, registrationNumber, employerIdentificationNumber, taxNumber, financialYearEndDay, financialYearEndMonth, salesTaxBasis, salesTaxPeriod, defaultSalesTax, defaultPurchasesTax, periodLockDate, endOfYearLockDate, createdDateUTC, timezone, organisationEntityType, shortCode, propertyClass, edition, lineOfBusiness, addresses, phones, externalLinks, paymentTerms); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -2073,29 +2044,19 @@ public String toString() { sb.append(" isDemoCompany: ").append(toIndentedString(isDemoCompany)).append("\n"); sb.append(" organisationStatus: ").append(toIndentedString(organisationStatus)).append("\n"); sb.append(" registrationNumber: ").append(toIndentedString(registrationNumber)).append("\n"); - sb.append(" employerIdentificationNumber: ") - .append(toIndentedString(employerIdentificationNumber)) - .append("\n"); + sb.append(" employerIdentificationNumber: ").append(toIndentedString(employerIdentificationNumber)).append("\n"); sb.append(" taxNumber: ").append(toIndentedString(taxNumber)).append("\n"); - sb.append(" financialYearEndDay: ") - .append(toIndentedString(financialYearEndDay)) - .append("\n"); - sb.append(" financialYearEndMonth: ") - .append(toIndentedString(financialYearEndMonth)) - .append("\n"); + sb.append(" financialYearEndDay: ").append(toIndentedString(financialYearEndDay)).append("\n"); + sb.append(" financialYearEndMonth: ").append(toIndentedString(financialYearEndMonth)).append("\n"); sb.append(" salesTaxBasis: ").append(toIndentedString(salesTaxBasis)).append("\n"); sb.append(" salesTaxPeriod: ").append(toIndentedString(salesTaxPeriod)).append("\n"); sb.append(" defaultSalesTax: ").append(toIndentedString(defaultSalesTax)).append("\n"); - sb.append(" defaultPurchasesTax: ") - .append(toIndentedString(defaultPurchasesTax)) - .append("\n"); + sb.append(" defaultPurchasesTax: ").append(toIndentedString(defaultPurchasesTax)).append("\n"); sb.append(" periodLockDate: ").append(toIndentedString(periodLockDate)).append("\n"); sb.append(" endOfYearLockDate: ").append(toIndentedString(endOfYearLockDate)).append("\n"); sb.append(" createdDateUTC: ").append(toIndentedString(createdDateUTC)).append("\n"); sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); - sb.append(" organisationEntityType: ") - .append(toIndentedString(organisationEntityType)) - .append("\n"); + sb.append(" organisationEntityType: ").append(toIndentedString(organisationEntityType)).append("\n"); sb.append(" shortCode: ").append(toIndentedString(shortCode)).append("\n"); sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); sb.append(" edition: ").append(toIndentedString(edition)).append("\n"); @@ -2109,7 +2070,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -2117,4 +2079,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Organisations.java b/src/main/java/com/xero/models/accounting/Organisations.java index 76ddfa3db..a8700a7dc 100644 --- a/src/main/java/com/xero/models/accounting/Organisations.java +++ b/src/main/java/com/xero/models/accounting/Organisations.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Organisation; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Organisations + */ -/** Organisations */ public class Organisations { StringUtil util = new StringUtil(); @JsonProperty("Organisations") private List organisations = new ArrayList(); /** - * organisations - * - * @param organisations List<Organisation> - * @return Organisations - */ + * organisations + * @param organisations List<Organisation> + * @return Organisations + **/ public Organisations organisations(List organisations) { this.organisations = organisations; return this; @@ -37,10 +54,9 @@ public Organisations organisations(List organisations) { /** * organisations - * - * @param organisationsItem Organisation + * @param organisationsItem Organisation * @return Organisations - */ + **/ public Organisations addOrganisationsItem(Organisation organisationsItem) { if (this.organisations == null) { this.organisations = new ArrayList(); @@ -49,30 +65,29 @@ public Organisations addOrganisationsItem(Organisation organisationsItem) { return this; } - /** + /** * Get organisations - * * @return organisations - */ + **/ @ApiModelProperty(value = "") - /** + /** * organisations - * * @return organisations List - */ + **/ public List getOrganisations() { return organisations; } - /** - * organisations - * - * @param organisations List<Organisation> - */ + /** + * organisations + * @param organisations List<Organisation> + **/ + public void setOrganisations(List organisations) { this.organisations = organisations; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(organisations); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Overpayment.java b/src/main/java/com/xero/models/accounting/Overpayment.java index a23e4a59d..2d800c3e8 100644 --- a/src/main/java/com/xero/models/accounting/Overpayment.java +++ b/src/main/java/com/xero/models/accounting/Overpayment.java @@ -9,35 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Allocation; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.Payment; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Overpayment + */ -/** Overpayment */ public class Overpayment { StringUtil util = new StringUtil(); - /** See Overpayment Types */ + /** + * See Overpayment Types + */ public enum TypeEnum { - /** RECEIVE_OVERPAYMENT */ + /** + * RECEIVE_OVERPAYMENT + */ RECEIVE_OVERPAYMENT("RECEIVE-OVERPAYMENT"), - - /** SPEND_OVERPAYMENT */ + + /** + * SPEND_OVERPAYMENT + */ SPEND_OVERPAYMENT("SPEND-OVERPAYMENT"), - - /** AROVERPAYMENT */ + + /** + * AROVERPAYMENT + */ AROVERPAYMENT("AROVERPAYMENT"); private String value; @@ -46,31 +71,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -82,6 +101,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -90,15 +110,23 @@ public static TypeEnum fromValue(String value) { @JsonProperty("Date") private String date; - /** See Overpayment Status Codes */ + /** + * See Overpayment Status Codes + */ public enum StatusEnum { - /** AUTHORISED */ + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** PAID */ + + /** + * PAID + */ PAID("PAID"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"); private String value; @@ -107,31 +135,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -143,6 +165,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -191,214 +214,196 @@ public static StatusEnum fromValue(String value) { @JsonProperty("Attachments") private List attachments = new ArrayList(); /** - * See Overpayment Types - * - * @param type TypeEnum - * @return Overpayment - */ + * See Overpayment Types + * @param type TypeEnum + * @return Overpayment + **/ public Overpayment type(TypeEnum type) { this.type = type; return this; } - /** + /** * See Overpayment Types - * * @return type - */ + **/ @ApiModelProperty(value = "See Overpayment Types") - /** + /** * See Overpayment Types - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * See Overpayment Types - * - * @param type TypeEnum - */ + /** + * See Overpayment Types + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * contact - * - * @param contact Contact - * @return Overpayment - */ + * contact + * @param contact Contact + * @return Overpayment + **/ public Overpayment contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * The date the overpayment is created YYYY-MM-DD - * - * @param date String - * @return Overpayment - */ + * The date the overpayment is created YYYY-MM-DD + * @param date String + * @return Overpayment + **/ public Overpayment date(String date) { this.date = date; return this; } - /** + /** * The date the overpayment is created YYYY-MM-DD - * * @return date - */ + **/ @ApiModelProperty(value = "The date the overpayment is created YYYY-MM-DD") - /** + /** * The date the overpayment is created YYYY-MM-DD - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * The date the overpayment is created YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The date the overpayment is created YYYY-MM-DD - * - * @param date String - */ + /** + * The date the overpayment is created YYYY-MM-DD + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * The date the overpayment is created YYYY-MM-DD - * - * @param date LocalDateTime - */ + /** + * The date the overpayment is created YYYY-MM-DD + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * See Overpayment Status Codes - * - * @param status StatusEnum - * @return Overpayment - */ + * See Overpayment Status Codes + * @param status StatusEnum + * @return Overpayment + **/ public Overpayment status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Overpayment Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Overpayment Status Codes") - /** + /** * See Overpayment Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Overpayment Status Codes - * - * @param status StatusEnum - */ + /** + * See Overpayment Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return Overpayment - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return Overpayment + **/ public Overpayment lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * See Overpayment Line Items - * - * @param lineItems List<LineItem> - * @return Overpayment - */ + * See Overpayment Line Items + * @param lineItems List<LineItem> + * @return Overpayment + **/ public Overpayment lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -406,10 +411,9 @@ public Overpayment lineItems(List lineItems) { /** * See Overpayment Line Items - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return Overpayment - */ + **/ public Overpayment addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -418,320 +422,284 @@ public Overpayment addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * See Overpayment Line Items - * * @return lineItems - */ + **/ @ApiModelProperty(value = "See Overpayment Line Items") - /** + /** * See Overpayment Line Items - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See Overpayment Line Items - * - * @param lineItems List<LineItem> - */ + /** + * See Overpayment Line Items + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * The subtotal of the overpayment excluding taxes - * - * @param subTotal Double - * @return Overpayment - */ + * The subtotal of the overpayment excluding taxes + * @param subTotal Double + * @return Overpayment + **/ public Overpayment subTotal(Double subTotal) { this.subTotal = subTotal; return this; } - /** + /** * The subtotal of the overpayment excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "The subtotal of the overpayment excluding taxes") - /** + /** * The subtotal of the overpayment excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** - * The subtotal of the overpayment excluding taxes - * - * @param subTotal Double - */ + /** + * The subtotal of the overpayment excluding taxes + * @param subTotal Double + **/ + public void setSubTotal(Double subTotal) { this.subTotal = subTotal; } /** - * The total tax on the overpayment - * - * @param totalTax Double - * @return Overpayment - */ + * The total tax on the overpayment + * @param totalTax Double + * @return Overpayment + **/ public Overpayment totalTax(Double totalTax) { this.totalTax = totalTax; return this; } - /** + /** * The total tax on the overpayment - * * @return totalTax - */ + **/ @ApiModelProperty(value = "The total tax on the overpayment") - /** + /** * The total tax on the overpayment - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * The total tax on the overpayment - * - * @param totalTax Double - */ + /** + * The total tax on the overpayment + * @param totalTax Double + **/ + public void setTotalTax(Double totalTax) { this.totalTax = totalTax; } /** - * The total of the overpayment (subtotal + total tax) - * - * @param total Double - * @return Overpayment - */ + * The total of the overpayment (subtotal + total tax) + * @param total Double + * @return Overpayment + **/ public Overpayment total(Double total) { this.total = total; return this; } - /** + /** * The total of the overpayment (subtotal + total tax) - * * @return total - */ + **/ @ApiModelProperty(value = "The total of the overpayment (subtotal + total tax)") - /** + /** * The total of the overpayment (subtotal + total tax) - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * The total of the overpayment (subtotal + total tax) - * - * @param total Double - */ + /** + * The total of the overpayment (subtotal + total tax) + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } - /** + /** * UTC timestamp of last update to the overpayment - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of last update to the overpayment") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of last update to the overpayment") + /** * UTC timestamp of last update to the overpayment - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * UTC timestamp of last update to the overpayment - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return Overpayment - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return Overpayment + **/ public Overpayment currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * Xero generated unique identifier - * - * @param overpaymentID UUID - * @return Overpayment - */ + * Xero generated unique identifier + * @param overpaymentID UUID + * @return Overpayment + **/ public Overpayment overpaymentID(UUID overpaymentID) { this.overpaymentID = overpaymentID; return this; } - /** + /** * Xero generated unique identifier - * * @return overpaymentID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier") - /** + /** * Xero generated unique identifier - * * @return overpaymentID UUID - */ + **/ public UUID getOverpaymentID() { return overpaymentID; } - /** - * Xero generated unique identifier - * - * @param overpaymentID UUID - */ + /** + * Xero generated unique identifier + * @param overpaymentID UUID + **/ + public void setOverpaymentID(UUID overpaymentID) { this.overpaymentID = overpaymentID; } /** - * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate - * is used - * - * @param currencyRate Double - * @return Overpayment - */ + * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used + * @param currencyRate Double + * @return Overpayment + **/ public Overpayment currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate - * is used - * + /** + * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used * @return currencyRate - */ - @ApiModelProperty( - value = - "The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com" - + " day rate is used") - /** - * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate - * is used - * + **/ + @ApiModelProperty(value = "The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used") + /** + * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate - * is used - * - * @param currencyRate Double - */ + /** + * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } /** - * The remaining credit balance on the overpayment - * - * @param remainingCredit Double - * @return Overpayment - */ + * The remaining credit balance on the overpayment + * @param remainingCredit Double + * @return Overpayment + **/ public Overpayment remainingCredit(Double remainingCredit) { this.remainingCredit = remainingCredit; return this; } - /** + /** * The remaining credit balance on the overpayment - * * @return remainingCredit - */ + **/ @ApiModelProperty(value = "The remaining credit balance on the overpayment") - /** + /** * The remaining credit balance on the overpayment - * * @return remainingCredit Double - */ + **/ public Double getRemainingCredit() { return remainingCredit; } - /** - * The remaining credit balance on the overpayment - * - * @param remainingCredit Double - */ + /** + * The remaining credit balance on the overpayment + * @param remainingCredit Double + **/ + public void setRemainingCredit(Double remainingCredit) { this.remainingCredit = remainingCredit; } /** - * See Allocations - * - * @param allocations List<Allocation> - * @return Overpayment - */ + * See Allocations + * @param allocations List<Allocation> + * @return Overpayment + **/ public Overpayment allocations(List allocations) { this.allocations = allocations; return this; @@ -739,10 +707,9 @@ public Overpayment allocations(List allocations) { /** * See Allocations - * - * @param allocationsItem Allocation + * @param allocationsItem Allocation * @return Overpayment - */ + **/ public Overpayment addAllocationsItem(Allocation allocationsItem) { if (this.allocations == null) { this.allocations = new ArrayList(); @@ -751,71 +718,65 @@ public Overpayment addAllocationsItem(Allocation allocationsItem) { return this; } - /** + /** * See Allocations - * * @return allocations - */ + **/ @ApiModelProperty(value = "See Allocations") - /** + /** * See Allocations - * * @return allocations List - */ + **/ public List getAllocations() { return allocations; } - /** - * See Allocations - * - * @param allocations List<Allocation> - */ + /** + * See Allocations + * @param allocations List<Allocation> + **/ + public void setAllocations(List allocations) { this.allocations = allocations; } /** - * The amount of applied to an invoice - * - * @param appliedAmount Double - * @return Overpayment - */ + * The amount of applied to an invoice + * @param appliedAmount Double + * @return Overpayment + **/ public Overpayment appliedAmount(Double appliedAmount) { this.appliedAmount = appliedAmount; return this; } - /** + /** * The amount of applied to an invoice - * * @return appliedAmount - */ + **/ @ApiModelProperty(example = "2.0", value = "The amount of applied to an invoice") - /** + /** * The amount of applied to an invoice - * * @return appliedAmount Double - */ + **/ public Double getAppliedAmount() { return appliedAmount; } - /** - * The amount of applied to an invoice - * - * @param appliedAmount Double - */ + /** + * The amount of applied to an invoice + * @param appliedAmount Double + **/ + public void setAppliedAmount(Double appliedAmount) { this.appliedAmount = appliedAmount; } /** - * See Payments - * - * @param payments List<Payment> - * @return Overpayment - */ + * See Payments + * @param payments List<Payment> + * @return Overpayment + **/ public Overpayment payments(List payments) { this.payments = payments; return this; @@ -823,10 +784,9 @@ public Overpayment payments(List payments) { /** * See Payments - * - * @param paymentsItem Payment + * @param paymentsItem Payment * @return Overpayment - */ + **/ public Overpayment addPaymentsItem(Payment paymentsItem) { if (this.payments == null) { this.payments = new ArrayList(); @@ -835,53 +795,46 @@ public Overpayment addPaymentsItem(Payment paymentsItem) { return this; } - /** + /** * See Payments - * * @return payments - */ + **/ @ApiModelProperty(value = "See Payments") - /** + /** * See Payments - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** - * See Payments - * - * @param payments List<Payment> - */ + /** + * See Payments + * @param payments List<Payment> + **/ + public void setPayments(List payments) { this.payments = payments; } - /** + /** * boolean to indicate if a overpayment has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "boolean to indicate if a overpayment has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "boolean to indicate if a overpayment has an attachment") + /** * boolean to indicate if a overpayment has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } /** - * See Attachments - * - * @param attachments List<Attachment> - * @return Overpayment - */ + * See Attachments + * @param attachments List<Attachment> + * @return Overpayment + **/ public Overpayment attachments(List attachments) { this.attachments = attachments; return this; @@ -889,10 +842,9 @@ public Overpayment attachments(List attachments) { /** * See Attachments - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return Overpayment - */ + **/ public Overpayment addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -901,30 +853,29 @@ public Overpayment addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * See Attachments - * * @return attachments - */ + **/ @ApiModelProperty(value = "See Attachments") - /** + /** * See Attachments - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * See Attachments - * - * @param attachments List<Attachment> - */ + /** + * See Attachments + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -934,51 +885,33 @@ public boolean equals(java.lang.Object o) { return false; } Overpayment overpayment = (Overpayment) o; - return Objects.equals(this.type, overpayment.type) - && Objects.equals(this.contact, overpayment.contact) - && Objects.equals(this.date, overpayment.date) - && Objects.equals(this.status, overpayment.status) - && Objects.equals(this.lineAmountTypes, overpayment.lineAmountTypes) - && Objects.equals(this.lineItems, overpayment.lineItems) - && Objects.equals(this.subTotal, overpayment.subTotal) - && Objects.equals(this.totalTax, overpayment.totalTax) - && Objects.equals(this.total, overpayment.total) - && Objects.equals(this.updatedDateUTC, overpayment.updatedDateUTC) - && Objects.equals(this.currencyCode, overpayment.currencyCode) - && Objects.equals(this.overpaymentID, overpayment.overpaymentID) - && Objects.equals(this.currencyRate, overpayment.currencyRate) - && Objects.equals(this.remainingCredit, overpayment.remainingCredit) - && Objects.equals(this.allocations, overpayment.allocations) - && Objects.equals(this.appliedAmount, overpayment.appliedAmount) - && Objects.equals(this.payments, overpayment.payments) - && Objects.equals(this.hasAttachments, overpayment.hasAttachments) - && Objects.equals(this.attachments, overpayment.attachments); + return Objects.equals(this.type, overpayment.type) && + Objects.equals(this.contact, overpayment.contact) && + Objects.equals(this.date, overpayment.date) && + Objects.equals(this.status, overpayment.status) && + Objects.equals(this.lineAmountTypes, overpayment.lineAmountTypes) && + Objects.equals(this.lineItems, overpayment.lineItems) && + Objects.equals(this.subTotal, overpayment.subTotal) && + Objects.equals(this.totalTax, overpayment.totalTax) && + Objects.equals(this.total, overpayment.total) && + Objects.equals(this.updatedDateUTC, overpayment.updatedDateUTC) && + Objects.equals(this.currencyCode, overpayment.currencyCode) && + Objects.equals(this.overpaymentID, overpayment.overpaymentID) && + Objects.equals(this.currencyRate, overpayment.currencyRate) && + Objects.equals(this.remainingCredit, overpayment.remainingCredit) && + Objects.equals(this.allocations, overpayment.allocations) && + Objects.equals(this.appliedAmount, overpayment.appliedAmount) && + Objects.equals(this.payments, overpayment.payments) && + Objects.equals(this.hasAttachments, overpayment.hasAttachments) && + Objects.equals(this.attachments, overpayment.attachments); } @Override public int hashCode() { - return Objects.hash( - type, - contact, - date, - status, - lineAmountTypes, - lineItems, - subTotal, - totalTax, - total, - updatedDateUTC, - currencyCode, - overpaymentID, - currencyRate, - remainingCredit, - allocations, - appliedAmount, - payments, - hasAttachments, - attachments); + return Objects.hash(type, contact, date, status, lineAmountTypes, lineItems, subTotal, totalTax, total, updatedDateUTC, currencyCode, overpaymentID, currencyRate, remainingCredit, allocations, appliedAmount, payments, hasAttachments, attachments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1007,7 +940,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1015,4 +949,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Overpayments.java b/src/main/java/com/xero/models/accounting/Overpayments.java index 7f2104c34..4828ae34b 100644 --- a/src/main/java/com/xero/models/accounting/Overpayments.java +++ b/src/main/java/com/xero/models/accounting/Overpayments.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Overpayment; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Overpayments + */ -/** Overpayments */ public class Overpayments { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class Overpayments { @JsonProperty("Overpayments") private List overpayments = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Overpayments - */ + * pagination + * @param pagination Pagination + * @return Overpayments + **/ public Overpayments pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Overpayments - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Overpayments + **/ public Overpayments warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public Overpayments warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Overpayments - */ + **/ public Overpayments addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public Overpayments addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * overpayments - * - * @param overpayments List<Overpayment> - * @return Overpayments - */ + * overpayments + * @param overpayments List<Overpayment> + * @return Overpayments + **/ public Overpayments overpayments(List overpayments) { this.overpayments = overpayments; return this; @@ -127,10 +139,9 @@ public Overpayments overpayments(List overpayments) { /** * overpayments - * - * @param overpaymentsItem Overpayment + * @param overpaymentsItem Overpayment * @return Overpayments - */ + **/ public Overpayments addOverpaymentsItem(Overpayment overpaymentsItem) { if (this.overpayments == null) { this.overpayments = new ArrayList(); @@ -139,30 +150,29 @@ public Overpayments addOverpaymentsItem(Overpayment overpaymentsItem) { return this; } - /** + /** * Get overpayments - * * @return overpayments - */ + **/ @ApiModelProperty(value = "") - /** + /** * overpayments - * * @return overpayments List - */ + **/ public List getOverpayments() { return overpayments; } - /** - * overpayments - * - * @param overpayments List<Overpayment> - */ + /** + * overpayments + * @param overpayments List<Overpayment> + **/ + public void setOverpayments(List overpayments) { this.overpayments = overpayments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } Overpayments overpayments = (Overpayments) o; - return Objects.equals(this.pagination, overpayments.pagination) - && Objects.equals(this.warnings, overpayments.warnings) - && Objects.equals(this.overpayments, overpayments.overpayments); + return Objects.equals(this.pagination, overpayments.pagination) && + Objects.equals(this.warnings, overpayments.warnings) && + Objects.equals(this.overpayments, overpayments.overpayments); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, overpayments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Pagination.java b/src/main/java/com/xero/models/accounting/Pagination.java index db1ba77d2..21ad7702d 100644 --- a/src/main/java/com/xero/models/accounting/Pagination.java +++ b/src/main/java/com/xero/models/accounting/Pagination.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Pagination + */ -/** Pagination */ public class Pagination { StringUtil util = new StringUtil(); @@ -32,145 +49,134 @@ public class Pagination { @JsonProperty("itemCount") private Integer itemCount; /** - * page - * - * @param page Integer - * @return Pagination - */ + * page + * @param page Integer + * @return Pagination + **/ public Pagination page(Integer page) { this.page = page; return this; } - /** + /** * Get page - * * @return page - */ + **/ @ApiModelProperty(value = "") - /** + /** * page - * * @return page Integer - */ + **/ public Integer getPage() { return page; } - /** - * page - * - * @param page Integer - */ + /** + * page + * @param page Integer + **/ + public void setPage(Integer page) { this.page = page; } /** - * pageSize - * - * @param pageSize Integer - * @return Pagination - */ + * pageSize + * @param pageSize Integer + * @return Pagination + **/ public Pagination pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } - /** + /** * Get pageSize - * * @return pageSize - */ + **/ @ApiModelProperty(value = "") - /** + /** * pageSize - * * @return pageSize Integer - */ + **/ public Integer getPageSize() { return pageSize; } - /** - * pageSize - * - * @param pageSize Integer - */ + /** + * pageSize + * @param pageSize Integer + **/ + public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** - * pageCount - * - * @param pageCount Integer - * @return Pagination - */ + * pageCount + * @param pageCount Integer + * @return Pagination + **/ public Pagination pageCount(Integer pageCount) { this.pageCount = pageCount; return this; } - /** + /** * Get pageCount - * * @return pageCount - */ + **/ @ApiModelProperty(value = "") - /** + /** * pageCount - * * @return pageCount Integer - */ + **/ public Integer getPageCount() { return pageCount; } - /** - * pageCount - * - * @param pageCount Integer - */ + /** + * pageCount + * @param pageCount Integer + **/ + public void setPageCount(Integer pageCount) { this.pageCount = pageCount; } /** - * itemCount - * - * @param itemCount Integer - * @return Pagination - */ + * itemCount + * @param itemCount Integer + * @return Pagination + **/ public Pagination itemCount(Integer itemCount) { this.itemCount = itemCount; return this; } - /** + /** * Get itemCount - * * @return itemCount - */ + **/ @ApiModelProperty(value = "") - /** + /** * itemCount - * * @return itemCount Integer - */ + **/ public Integer getItemCount() { return itemCount; } - /** - * itemCount - * - * @param itemCount Integer - */ + /** + * itemCount + * @param itemCount Integer + **/ + public void setItemCount(Integer itemCount) { this.itemCount = itemCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } Pagination pagination = (Pagination) o; - return Objects.equals(this.page, pagination.page) - && Objects.equals(this.pageSize, pagination.pageSize) - && Objects.equals(this.pageCount, pagination.pageCount) - && Objects.equals(this.itemCount, pagination.itemCount); + return Objects.equals(this.page, pagination.page) && + Objects.equals(this.pageSize, pagination.pageSize) && + Objects.equals(this.pageCount, pagination.pageCount) && + Objects.equals(this.itemCount, pagination.itemCount); } @Override @@ -191,6 +197,7 @@ public int hashCode() { return Objects.hash(page, pageSize, pageCount, itemCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -212,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Payment.java b/src/main/java/com/xero/models/accounting/Payment.java index 190b52a50..8e88b9c42 100644 --- a/src/main/java/com/xero/models/accounting/Payment.java +++ b/src/main/java/com/xero/models/accounting/Payment.java @@ -9,24 +9,41 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Account; +import com.xero.models.accounting.BatchPayment; +import com.xero.models.accounting.CreditNote; +import com.xero.models.accounting.Invoice; +import com.xero.models.accounting.Overpayment; +import com.xero.models.accounting.Prepayment; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Payment + */ -/** Payment */ public class Payment { StringUtil util = new StringUtil(); @@ -74,12 +91,18 @@ public class Payment { @JsonProperty("IsReconciled") private Boolean isReconciled; - /** The status of the payment. */ + /** + * The status of the payment. + */ public enum StatusEnum { - /** AUTHORISED */ + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -88,31 +111,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -124,32 +141,51 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; - /** See Payment Types. */ + /** + * See Payment Types. + */ public enum PaymentTypeEnum { - /** ACCRECPAYMENT */ + /** + * ACCRECPAYMENT + */ ACCRECPAYMENT("ACCRECPAYMENT"), - - /** ACCPAYPAYMENT */ + + /** + * ACCPAYPAYMENT + */ ACCPAYPAYMENT("ACCPAYPAYMENT"), - - /** ARCREDITPAYMENT */ + + /** + * ARCREDITPAYMENT + */ ARCREDITPAYMENT("ARCREDITPAYMENT"), - - /** APCREDITPAYMENT */ + + /** + * APCREDITPAYMENT + */ APCREDITPAYMENT("APCREDITPAYMENT"), - - /** AROVERPAYMENTPAYMENT */ + + /** + * AROVERPAYMENTPAYMENT + */ AROVERPAYMENTPAYMENT("AROVERPAYMENTPAYMENT"), - - /** ARPREPAYMENTPAYMENT */ + + /** + * ARPREPAYMENTPAYMENT + */ ARPREPAYMENTPAYMENT("ARPREPAYMENTPAYMENT"), - - /** APPREPAYMENTPAYMENT */ + + /** + * APPREPAYMENTPAYMENT + */ APPREPAYMENTPAYMENT("APPREPAYMENTPAYMENT"), - - /** APOVERPAYMENTPAYMENT */ + + /** + * APOVERPAYMENTPAYMENT + */ APOVERPAYMENTPAYMENT("APOVERPAYMENTPAYMENT"); private String value; @@ -158,31 +194,25 @@ public enum PaymentTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PaymentTypeEnum fromValue(String value) { for (PaymentTypeEnum b : PaymentTypeEnum.values()) { @@ -194,6 +224,7 @@ public static PaymentTypeEnum fromValue(String value) { } } + @JsonProperty("PaymentType") private PaymentTypeEnum paymentType; @@ -230,969 +261,844 @@ public static PaymentTypeEnum fromValue(String value) { @JsonProperty("Warnings") private List warnings = new ArrayList(); /** - * invoice - * - * @param invoice Invoice - * @return Payment - */ + * invoice + * @param invoice Invoice + * @return Payment + **/ public Payment invoice(Invoice invoice) { this.invoice = invoice; return this; } - /** + /** * Get invoice - * * @return invoice - */ + **/ @ApiModelProperty(value = "") - /** + /** * invoice - * * @return invoice Invoice - */ + **/ public Invoice getInvoice() { return invoice; } - /** - * invoice - * - * @param invoice Invoice - */ + /** + * invoice + * @param invoice Invoice + **/ + public void setInvoice(Invoice invoice) { this.invoice = invoice; } /** - * creditNote - * - * @param creditNote CreditNote - * @return Payment - */ + * creditNote + * @param creditNote CreditNote + * @return Payment + **/ public Payment creditNote(CreditNote creditNote) { this.creditNote = creditNote; return this; } - /** + /** * Get creditNote - * * @return creditNote - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditNote - * * @return creditNote CreditNote - */ + **/ public CreditNote getCreditNote() { return creditNote; } - /** - * creditNote - * - * @param creditNote CreditNote - */ + /** + * creditNote + * @param creditNote CreditNote + **/ + public void setCreditNote(CreditNote creditNote) { this.creditNote = creditNote; } /** - * prepayment - * - * @param prepayment Prepayment - * @return Payment - */ + * prepayment + * @param prepayment Prepayment + * @return Payment + **/ public Payment prepayment(Prepayment prepayment) { this.prepayment = prepayment; return this; } - /** + /** * Get prepayment - * * @return prepayment - */ + **/ @ApiModelProperty(value = "") - /** + /** * prepayment - * * @return prepayment Prepayment - */ + **/ public Prepayment getPrepayment() { return prepayment; } - /** - * prepayment - * - * @param prepayment Prepayment - */ + /** + * prepayment + * @param prepayment Prepayment + **/ + public void setPrepayment(Prepayment prepayment) { this.prepayment = prepayment; } /** - * overpayment - * - * @param overpayment Overpayment - * @return Payment - */ + * overpayment + * @param overpayment Overpayment + * @return Payment + **/ public Payment overpayment(Overpayment overpayment) { this.overpayment = overpayment; return this; } - /** + /** * Get overpayment - * * @return overpayment - */ + **/ @ApiModelProperty(value = "") - /** + /** * overpayment - * * @return overpayment Overpayment - */ + **/ public Overpayment getOverpayment() { return overpayment; } - /** - * overpayment - * - * @param overpayment Overpayment - */ + /** + * overpayment + * @param overpayment Overpayment + **/ + public void setOverpayment(Overpayment overpayment) { this.overpayment = overpayment; } /** - * Number of invoice or credit note you are applying payment to e.g.INV-4003 - * - * @param invoiceNumber String - * @return Payment - */ + * Number of invoice or credit note you are applying payment to e.g.INV-4003 + * @param invoiceNumber String + * @return Payment + **/ public Payment invoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; return this; } - /** + /** * Number of invoice or credit note you are applying payment to e.g.INV-4003 - * * @return invoiceNumber - */ - @ApiModelProperty( - value = "Number of invoice or credit note you are applying payment to e.g.INV-4003") - /** + **/ + @ApiModelProperty(value = "Number of invoice or credit note you are applying payment to e.g.INV-4003") + /** * Number of invoice or credit note you are applying payment to e.g.INV-4003 - * * @return invoiceNumber String - */ + **/ public String getInvoiceNumber() { return invoiceNumber; } - /** - * Number of invoice or credit note you are applying payment to e.g.INV-4003 - * - * @param invoiceNumber String - */ + /** + * Number of invoice or credit note you are applying payment to e.g.INV-4003 + * @param invoiceNumber String + **/ + public void setInvoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; } /** - * Number of invoice or credit note you are applying payment to e.g. INV-4003 - * - * @param creditNoteNumber String - * @return Payment - */ + * Number of invoice or credit note you are applying payment to e.g. INV-4003 + * @param creditNoteNumber String + * @return Payment + **/ public Payment creditNoteNumber(String creditNoteNumber) { this.creditNoteNumber = creditNoteNumber; return this; } - /** + /** * Number of invoice or credit note you are applying payment to e.g. INV-4003 - * * @return creditNoteNumber - */ - @ApiModelProperty( - value = "Number of invoice or credit note you are applying payment to e.g. INV-4003") - /** + **/ + @ApiModelProperty(value = "Number of invoice or credit note you are applying payment to e.g. INV-4003") + /** * Number of invoice or credit note you are applying payment to e.g. INV-4003 - * * @return creditNoteNumber String - */ + **/ public String getCreditNoteNumber() { return creditNoteNumber; } - /** - * Number of invoice or credit note you are applying payment to e.g. INV-4003 - * - * @param creditNoteNumber String - */ + /** + * Number of invoice or credit note you are applying payment to e.g. INV-4003 + * @param creditNoteNumber String + **/ + public void setCreditNoteNumber(String creditNoteNumber) { this.creditNoteNumber = creditNoteNumber; } /** - * batchPayment - * - * @param batchPayment BatchPayment - * @return Payment - */ + * batchPayment + * @param batchPayment BatchPayment + * @return Payment + **/ public Payment batchPayment(BatchPayment batchPayment) { this.batchPayment = batchPayment; return this; } - /** + /** * Get batchPayment - * * @return batchPayment - */ + **/ @ApiModelProperty(value = "") - /** + /** * batchPayment - * * @return batchPayment BatchPayment - */ + **/ public BatchPayment getBatchPayment() { return batchPayment; } - /** - * batchPayment - * - * @param batchPayment BatchPayment - */ + /** + * batchPayment + * @param batchPayment BatchPayment + **/ + public void setBatchPayment(BatchPayment batchPayment) { this.batchPayment = batchPayment; } /** - * account - * - * @param account Account - * @return Payment - */ + * account + * @param account Account + * @return Payment + **/ public Payment account(Account account) { this.account = account; return this; } - /** + /** * Get account - * * @return account - */ + **/ @ApiModelProperty(value = "") - /** + /** * account - * * @return account Account - */ + **/ public Account getAccount() { return account; } - /** - * account - * - * @param account Account - */ + /** + * account + * @param account Account + **/ + public void setAccount(Account account) { this.account = account; } /** - * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code - * value) - * - * @param code String - * @return Payment - */ + * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) + * @param code String + * @return Payment + **/ public Payment code(String code) { this.code = code; return this; } - /** - * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code - * value) - * + /** + * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) * @return code - */ - @ApiModelProperty( - value = - "Code of account you are using to make the payment e.g. 001 (note- not all accounts have" - + " a code value)") - /** - * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code - * value) - * + **/ + @ApiModelProperty(value = "Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value)") + /** + * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) * @return code String - */ + **/ public String getCode() { return code; } - /** - * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code - * value) - * - * @param code String - */ + /** + * Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date String - * @return Payment - */ + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date String + * @return Payment + **/ public Payment date(String date) { this.date = date; return this; } - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return date - */ + **/ @ApiModelProperty(value = "Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06") - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date String - */ + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date LocalDateTime - */ + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * - * @param currencyRate Double - * @return Payment - */ + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + * @param currencyRate Double + * @return Payment + **/ public Payment currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 * @return currencyRate - */ - @ApiModelProperty( - value = - "Exchange rate when payment is received. Only used for non base currency invoices and" - + " credit notes e.g. 0.7500") - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * + **/ + @ApiModelProperty(value = "Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500") + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * - * @param currencyRate Double - */ + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * - * @param amount Double - * @return Payment - */ + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * @param amount Double + * @return Payment + **/ public Payment amount(Double amount) { this.amount = amount; return this; } - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 * @return amount - */ - @ApiModelProperty( - value = - "The amount of the payment. Must be less than or equal to the outstanding amount owing" - + " on the invoice e.g. 200.00") - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * + **/ + @ApiModelProperty(value = "The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00") + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the - * invoice e.g. 200.00 - * - * @param amount Double - */ + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The amount of the payment in the currency of the bank account. - * - * @param bankAmount Double - * @return Payment - */ + * The amount of the payment in the currency of the bank account. + * @param bankAmount Double + * @return Payment + **/ public Payment bankAmount(Double bankAmount) { this.bankAmount = bankAmount; return this; } - /** + /** * The amount of the payment in the currency of the bank account. - * * @return bankAmount - */ + **/ @ApiModelProperty(value = "The amount of the payment in the currency of the bank account.") - /** + /** * The amount of the payment in the currency of the bank account. - * * @return bankAmount Double - */ + **/ public Double getBankAmount() { return bankAmount; } - /** - * The amount of the payment in the currency of the bank account. - * - * @param bankAmount Double - */ + /** + * The amount of the payment in the currency of the bank account. + * @param bankAmount Double + **/ + public void setBankAmount(Double bankAmount) { this.bankAmount = bankAmount; } /** - * An optional description for the payment e.g. Direct Debit - * - * @param reference String - * @return Payment - */ + * An optional description for the payment e.g. Direct Debit + * @param reference String + * @return Payment + **/ public Payment reference(String reference) { this.reference = reference; return this; } - /** + /** * An optional description for the payment e.g. Direct Debit - * * @return reference - */ + **/ @ApiModelProperty(value = "An optional description for the payment e.g. Direct Debit") - /** + /** * An optional description for the payment e.g. Direct Debit - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * An optional description for the payment e.g. Direct Debit - * - * @param reference String - */ + /** + * An optional description for the payment e.g. Direct Debit + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * An optional parameter for the payment. A boolean indicating whether you would like the payment - * to be created as reconciled when using PUT, or whether a payment has been reconciled when using - * GET - * - * @param isReconciled Boolean - * @return Payment - */ + * An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET + * @param isReconciled Boolean + * @return Payment + **/ public Payment isReconciled(Boolean isReconciled) { this.isReconciled = isReconciled; return this; } - /** - * An optional parameter for the payment. A boolean indicating whether you would like the payment - * to be created as reconciled when using PUT, or whether a payment has been reconciled when using - * GET - * + /** + * An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET * @return isReconciled - */ - @ApiModelProperty( - value = - "An optional parameter for the payment. A boolean indicating whether you would like the" - + " payment to be created as reconciled when using PUT, or whether a payment has" - + " been reconciled when using GET") - /** - * An optional parameter for the payment. A boolean indicating whether you would like the payment - * to be created as reconciled when using PUT, or whether a payment has been reconciled when using - * GET - * + **/ + @ApiModelProperty(value = "An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET") + /** + * An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET * @return isReconciled Boolean - */ + **/ public Boolean getIsReconciled() { return isReconciled; } - /** - * An optional parameter for the payment. A boolean indicating whether you would like the payment - * to be created as reconciled when using PUT, or whether a payment has been reconciled when using - * GET - * - * @param isReconciled Boolean - */ + /** + * An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET + * @param isReconciled Boolean + **/ + public void setIsReconciled(Boolean isReconciled) { this.isReconciled = isReconciled; } /** - * The status of the payment. - * - * @param status StatusEnum - * @return Payment - */ + * The status of the payment. + * @param status StatusEnum + * @return Payment + **/ public Payment status(StatusEnum status) { this.status = status; return this; } - /** + /** * The status of the payment. - * * @return status - */ + **/ @ApiModelProperty(value = "The status of the payment.") - /** + /** * The status of the payment. - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The status of the payment. - * - * @param status StatusEnum - */ + /** + * The status of the payment. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } - /** + /** * See Payment Types. - * * @return paymentType - */ + **/ @ApiModelProperty(value = "See Payment Types.") - /** + /** * See Payment Types. - * * @return paymentType PaymentTypeEnum - */ + **/ public PaymentTypeEnum getPaymentType() { return paymentType; } - /** + /** * UTC timestamp of last update to the payment - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of last update to the payment") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of last update to the payment") + /** * UTC timestamp of last update to the payment - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * UTC timestamp of last update to the payment - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param paymentID UUID - * @return Payment - */ + * The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param paymentID UUID + * @return Payment + **/ public Payment paymentID(UUID paymentID) { this.paymentID = paymentID; return this; } - /** + /** * The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return paymentID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") + /** * The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return paymentID UUID - */ + **/ public UUID getPaymentID() { return paymentID; } - /** - * The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param paymentID UUID - */ + /** + * The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param paymentID UUID + **/ + public void setPaymentID(UUID paymentID) { this.paymentID = paymentID; } /** - * Present if the payment was created as part of a batch. - * - * @param batchPaymentID UUID - * @return Payment - */ + * Present if the payment was created as part of a batch. + * @param batchPaymentID UUID + * @return Payment + **/ public Payment batchPaymentID(UUID batchPaymentID) { this.batchPaymentID = batchPaymentID; return this; } - /** + /** * Present if the payment was created as part of a batch. - * * @return batchPaymentID - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "Present if the payment was created as part of a batch.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Present if the payment was created as part of a batch.") + /** * Present if the payment was created as part of a batch. - * * @return batchPaymentID UUID - */ + **/ public UUID getBatchPaymentID() { return batchPaymentID; } - /** - * Present if the payment was created as part of a batch. - * - * @param batchPaymentID UUID - */ + /** + * Present if the payment was created as part of a batch. + * @param batchPaymentID UUID + **/ + public void setBatchPaymentID(UUID batchPaymentID) { this.batchPaymentID = batchPaymentID; } /** - * The suppliers bank account number the payment is being made to - * - * @param bankAccountNumber String - * @return Payment - */ + * The suppliers bank account number the payment is being made to + * @param bankAccountNumber String + * @return Payment + **/ public Payment bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; return this; } - /** + /** * The suppliers bank account number the payment is being made to - * * @return bankAccountNumber - */ + **/ @ApiModelProperty(value = "The suppliers bank account number the payment is being made to") - /** + /** * The suppliers bank account number the payment is being made to - * * @return bankAccountNumber String - */ + **/ public String getBankAccountNumber() { return bankAccountNumber; } - /** - * The suppliers bank account number the payment is being made to - * - * @param bankAccountNumber String - */ + /** + * The suppliers bank account number the payment is being made to + * @param bankAccountNumber String + **/ + public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; } /** - * The suppliers bank account number the payment is being made to - * - * @param particulars String - * @return Payment - */ + * The suppliers bank account number the payment is being made to + * @param particulars String + * @return Payment + **/ public Payment particulars(String particulars) { this.particulars = particulars; return this; } - /** + /** * The suppliers bank account number the payment is being made to - * * @return particulars - */ + **/ @ApiModelProperty(value = "The suppliers bank account number the payment is being made to") - /** + /** * The suppliers bank account number the payment is being made to - * * @return particulars String - */ + **/ public String getParticulars() { return particulars; } - /** - * The suppliers bank account number the payment is being made to - * - * @param particulars String - */ + /** + * The suppliers bank account number the payment is being made to + * @param particulars String + **/ + public void setParticulars(String particulars) { this.particulars = particulars; } /** - * The information to appear on the supplier's bank account - * - * @param details String - * @return Payment - */ + * The information to appear on the supplier's bank account + * @param details String + * @return Payment + **/ public Payment details(String details) { this.details = details; return this; } - /** + /** * The information to appear on the supplier's bank account - * * @return details - */ + **/ @ApiModelProperty(value = "The information to appear on the supplier's bank account") - /** + /** * The information to appear on the supplier's bank account - * * @return details String - */ + **/ public String getDetails() { return details; } - /** - * The information to appear on the supplier's bank account - * - * @param details String - */ + /** + * The information to appear on the supplier's bank account + * @param details String + **/ + public void setDetails(String details) { this.details = details; } /** - * A boolean to indicate if a contact has an validation errors - * - * @param hasAccount Boolean - * @return Payment - */ + * A boolean to indicate if a contact has an validation errors + * @param hasAccount Boolean + * @return Payment + **/ public Payment hasAccount(Boolean hasAccount) { this.hasAccount = hasAccount; return this; } - /** + /** * A boolean to indicate if a contact has an validation errors - * * @return hasAccount - */ - @ApiModelProperty( - example = "false", - value = "A boolean to indicate if a contact has an validation errors") - /** + **/ + @ApiModelProperty(example = "false", value = "A boolean to indicate if a contact has an validation errors") + /** * A boolean to indicate if a contact has an validation errors - * * @return hasAccount Boolean - */ + **/ public Boolean getHasAccount() { return hasAccount; } - /** - * A boolean to indicate if a contact has an validation errors - * - * @param hasAccount Boolean - */ + /** + * A boolean to indicate if a contact has an validation errors + * @param hasAccount Boolean + **/ + public void setHasAccount(Boolean hasAccount) { this.hasAccount = hasAccount; } /** - * A boolean to indicate if a contact has an validation errors - * - * @param hasValidationErrors Boolean - * @return Payment - */ + * A boolean to indicate if a contact has an validation errors + * @param hasValidationErrors Boolean + * @return Payment + **/ public Payment hasValidationErrors(Boolean hasValidationErrors) { this.hasValidationErrors = hasValidationErrors; return this; } - /** + /** * A boolean to indicate if a contact has an validation errors - * * @return hasValidationErrors - */ - @ApiModelProperty( - example = "false", - value = "A boolean to indicate if a contact has an validation errors") - /** + **/ + @ApiModelProperty(example = "false", value = "A boolean to indicate if a contact has an validation errors") + /** * A boolean to indicate if a contact has an validation errors - * * @return hasValidationErrors Boolean - */ + **/ public Boolean getHasValidationErrors() { return hasValidationErrors; } - /** - * A boolean to indicate if a contact has an validation errors - * - * @param hasValidationErrors Boolean - */ + /** + * A boolean to indicate if a contact has an validation errors + * @param hasValidationErrors Boolean + **/ + public void setHasValidationErrors(Boolean hasValidationErrors) { this.hasValidationErrors = hasValidationErrors; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return Payment - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return Payment + **/ public Payment statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Payment - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Payment + **/ public Payment validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -1200,10 +1106,9 @@ public Payment validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Payment - */ + **/ public Payment addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -1212,36 +1117,33 @@ public Payment addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Payment - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Payment + **/ public Payment warnings(List warnings) { this.warnings = warnings; return this; @@ -1249,10 +1151,9 @@ public Payment warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Payment - */ + **/ public Payment addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -1261,30 +1162,29 @@ public Payment addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1294,69 +1194,42 @@ public boolean equals(java.lang.Object o) { return false; } Payment payment = (Payment) o; - return Objects.equals(this.invoice, payment.invoice) - && Objects.equals(this.creditNote, payment.creditNote) - && Objects.equals(this.prepayment, payment.prepayment) - && Objects.equals(this.overpayment, payment.overpayment) - && Objects.equals(this.invoiceNumber, payment.invoiceNumber) - && Objects.equals(this.creditNoteNumber, payment.creditNoteNumber) - && Objects.equals(this.batchPayment, payment.batchPayment) - && Objects.equals(this.account, payment.account) - && Objects.equals(this.code, payment.code) - && Objects.equals(this.date, payment.date) - && Objects.equals(this.currencyRate, payment.currencyRate) - && Objects.equals(this.amount, payment.amount) - && Objects.equals(this.bankAmount, payment.bankAmount) - && Objects.equals(this.reference, payment.reference) - && Objects.equals(this.isReconciled, payment.isReconciled) - && Objects.equals(this.status, payment.status) - && Objects.equals(this.paymentType, payment.paymentType) - && Objects.equals(this.updatedDateUTC, payment.updatedDateUTC) - && Objects.equals(this.paymentID, payment.paymentID) - && Objects.equals(this.batchPaymentID, payment.batchPaymentID) - && Objects.equals(this.bankAccountNumber, payment.bankAccountNumber) - && Objects.equals(this.particulars, payment.particulars) - && Objects.equals(this.details, payment.details) - && Objects.equals(this.hasAccount, payment.hasAccount) - && Objects.equals(this.hasValidationErrors, payment.hasValidationErrors) - && Objects.equals(this.statusAttributeString, payment.statusAttributeString) - && Objects.equals(this.validationErrors, payment.validationErrors) - && Objects.equals(this.warnings, payment.warnings); + return Objects.equals(this.invoice, payment.invoice) && + Objects.equals(this.creditNote, payment.creditNote) && + Objects.equals(this.prepayment, payment.prepayment) && + Objects.equals(this.overpayment, payment.overpayment) && + Objects.equals(this.invoiceNumber, payment.invoiceNumber) && + Objects.equals(this.creditNoteNumber, payment.creditNoteNumber) && + Objects.equals(this.batchPayment, payment.batchPayment) && + Objects.equals(this.account, payment.account) && + Objects.equals(this.code, payment.code) && + Objects.equals(this.date, payment.date) && + Objects.equals(this.currencyRate, payment.currencyRate) && + Objects.equals(this.amount, payment.amount) && + Objects.equals(this.bankAmount, payment.bankAmount) && + Objects.equals(this.reference, payment.reference) && + Objects.equals(this.isReconciled, payment.isReconciled) && + Objects.equals(this.status, payment.status) && + Objects.equals(this.paymentType, payment.paymentType) && + Objects.equals(this.updatedDateUTC, payment.updatedDateUTC) && + Objects.equals(this.paymentID, payment.paymentID) && + Objects.equals(this.batchPaymentID, payment.batchPaymentID) && + Objects.equals(this.bankAccountNumber, payment.bankAccountNumber) && + Objects.equals(this.particulars, payment.particulars) && + Objects.equals(this.details, payment.details) && + Objects.equals(this.hasAccount, payment.hasAccount) && + Objects.equals(this.hasValidationErrors, payment.hasValidationErrors) && + Objects.equals(this.statusAttributeString, payment.statusAttributeString) && + Objects.equals(this.validationErrors, payment.validationErrors) && + Objects.equals(this.warnings, payment.warnings); } @Override public int hashCode() { - return Objects.hash( - invoice, - creditNote, - prepayment, - overpayment, - invoiceNumber, - creditNoteNumber, - batchPayment, - account, - code, - date, - currencyRate, - amount, - bankAmount, - reference, - isReconciled, - status, - paymentType, - updatedDateUTC, - paymentID, - batchPaymentID, - bankAccountNumber, - particulars, - details, - hasAccount, - hasValidationErrors, - statusAttributeString, - validationErrors, - warnings); + return Objects.hash(invoice, creditNote, prepayment, overpayment, invoiceNumber, creditNoteNumber, batchPayment, account, code, date, currencyRate, amount, bankAmount, reference, isReconciled, status, paymentType, updatedDateUTC, paymentID, batchPaymentID, bankAccountNumber, particulars, details, hasAccount, hasValidationErrors, statusAttributeString, validationErrors, warnings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1385,12 +1258,8 @@ public String toString() { sb.append(" particulars: ").append(toIndentedString(particulars)).append("\n"); sb.append(" details: ").append(toIndentedString(details)).append("\n"); sb.append(" hasAccount: ").append(toIndentedString(hasAccount)).append("\n"); - sb.append(" hasValidationErrors: ") - .append(toIndentedString(hasValidationErrors)) - .append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" hasValidationErrors: ").append(toIndentedString(hasValidationErrors)).append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); sb.append("}"); @@ -1398,7 +1267,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1406,4 +1276,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/PaymentDelete.java b/src/main/java/com/xero/models/accounting/PaymentDelete.java index c00bc528e..4e03cecde 100644 --- a/src/main/java/com/xero/models/accounting/PaymentDelete.java +++ b/src/main/java/com/xero/models/accounting/PaymentDelete.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentDelete + */ -/** PaymentDelete */ public class PaymentDelete { StringUtil util = new StringUtil(); @JsonProperty("Status") private String status = "DELETED"; /** - * The status of the payment. - * - * @param status String - * @return PaymentDelete - */ + * The status of the payment. + * @param status String + * @return PaymentDelete + **/ public PaymentDelete status(String status) { this.status = status; return this; } - /** + /** * The status of the payment. - * * @return status - */ + **/ @ApiModelProperty(required = true, value = "The status of the payment.") - /** + /** * The status of the payment. - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * The status of the payment. - * - * @param status String - */ + /** + * The status of the payment. + * @param status String + **/ + public void setStatus(String status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/PaymentService.java b/src/main/java/com/xero/models/accounting/PaymentService.java index ed35f2b81..5ca1675de 100644 --- a/src/main/java/com/xero/models/accounting/PaymentService.java +++ b/src/main/java/com/xero/models/accounting/PaymentService.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentService + */ -/** PaymentService */ public class PaymentService { StringUtil util = new StringUtil(); @@ -41,193 +59,170 @@ public class PaymentService { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * Xero identifier - * - * @param paymentServiceID UUID - * @return PaymentService - */ + * Xero identifier + * @param paymentServiceID UUID + * @return PaymentService + **/ public PaymentService paymentServiceID(UUID paymentServiceID) { this.paymentServiceID = paymentServiceID; return this; } - /** + /** * Xero identifier - * * @return paymentServiceID - */ + **/ @ApiModelProperty(value = "Xero identifier") - /** + /** * Xero identifier - * * @return paymentServiceID UUID - */ + **/ public UUID getPaymentServiceID() { return paymentServiceID; } - /** - * Xero identifier - * - * @param paymentServiceID UUID - */ + /** + * Xero identifier + * @param paymentServiceID UUID + **/ + public void setPaymentServiceID(UUID paymentServiceID) { this.paymentServiceID = paymentServiceID; } /** - * Name of payment service - * - * @param paymentServiceName String - * @return PaymentService - */ + * Name of payment service + * @param paymentServiceName String + * @return PaymentService + **/ public PaymentService paymentServiceName(String paymentServiceName) { this.paymentServiceName = paymentServiceName; return this; } - /** + /** * Name of payment service - * * @return paymentServiceName - */ + **/ @ApiModelProperty(value = "Name of payment service") - /** + /** * Name of payment service - * * @return paymentServiceName String - */ + **/ public String getPaymentServiceName() { return paymentServiceName; } - /** - * Name of payment service - * - * @param paymentServiceName String - */ + /** + * Name of payment service + * @param paymentServiceName String + **/ + public void setPaymentServiceName(String paymentServiceName) { this.paymentServiceName = paymentServiceName; } /** - * The custom payment URL - * - * @param paymentServiceUrl String - * @return PaymentService - */ + * The custom payment URL + * @param paymentServiceUrl String + * @return PaymentService + **/ public PaymentService paymentServiceUrl(String paymentServiceUrl) { this.paymentServiceUrl = paymentServiceUrl; return this; } - /** + /** * The custom payment URL - * * @return paymentServiceUrl - */ + **/ @ApiModelProperty(value = "The custom payment URL") - /** + /** * The custom payment URL - * * @return paymentServiceUrl String - */ + **/ public String getPaymentServiceUrl() { return paymentServiceUrl; } - /** - * The custom payment URL - * - * @param paymentServiceUrl String - */ + /** + * The custom payment URL + * @param paymentServiceUrl String + **/ + public void setPaymentServiceUrl(String paymentServiceUrl) { this.paymentServiceUrl = paymentServiceUrl; } /** - * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will - * default to Pay by credit card - * - * @param payNowText String - * @return PaymentService - */ + * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card + * @param payNowText String + * @return PaymentService + **/ public PaymentService payNowText(String payNowText) { this.payNowText = payNowText; return this; } - /** - * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will - * default to Pay by credit card - * + /** + * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card * @return payNowText - */ - @ApiModelProperty( - value = - "The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set" - + " it will default to Pay by credit card") - /** - * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will - * default to Pay by credit card - * + **/ + @ApiModelProperty(value = "The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card") + /** + * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card * @return payNowText String - */ + **/ public String getPayNowText() { return payNowText; } - /** - * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will - * default to Pay by credit card - * - * @param payNowText String - */ + /** + * The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card + * @param payNowText String + **/ + public void setPayNowText(String payNowText) { this.payNowText = payNowText; } /** - * This will always be CUSTOM for payment services created via the API. - * - * @param paymentServiceType String - * @return PaymentService - */ + * This will always be CUSTOM for payment services created via the API. + * @param paymentServiceType String + * @return PaymentService + **/ public PaymentService paymentServiceType(String paymentServiceType) { this.paymentServiceType = paymentServiceType; return this; } - /** + /** * This will always be CUSTOM for payment services created via the API. - * * @return paymentServiceType - */ + **/ @ApiModelProperty(value = "This will always be CUSTOM for payment services created via the API.") - /** + /** * This will always be CUSTOM for payment services created via the API. - * * @return paymentServiceType String - */ + **/ public String getPaymentServiceType() { return paymentServiceType; } - /** - * This will always be CUSTOM for payment services created via the API. - * - * @param paymentServiceType String - */ + /** + * This will always be CUSTOM for payment services created via the API. + * @param paymentServiceType String + **/ + public void setPaymentServiceType(String paymentServiceType) { this.paymentServiceType = paymentServiceType; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return PaymentService - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return PaymentService + **/ public PaymentService validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -235,10 +230,9 @@ public PaymentService validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return PaymentService - */ + **/ public PaymentService addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -247,30 +241,29 @@ public PaymentService addValidationErrorsItem(ValidationError validationErrorsIt return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -280,25 +273,20 @@ public boolean equals(java.lang.Object o) { return false; } PaymentService paymentService = (PaymentService) o; - return Objects.equals(this.paymentServiceID, paymentService.paymentServiceID) - && Objects.equals(this.paymentServiceName, paymentService.paymentServiceName) - && Objects.equals(this.paymentServiceUrl, paymentService.paymentServiceUrl) - && Objects.equals(this.payNowText, paymentService.payNowText) - && Objects.equals(this.paymentServiceType, paymentService.paymentServiceType) - && Objects.equals(this.validationErrors, paymentService.validationErrors); + return Objects.equals(this.paymentServiceID, paymentService.paymentServiceID) && + Objects.equals(this.paymentServiceName, paymentService.paymentServiceName) && + Objects.equals(this.paymentServiceUrl, paymentService.paymentServiceUrl) && + Objects.equals(this.payNowText, paymentService.payNowText) && + Objects.equals(this.paymentServiceType, paymentService.paymentServiceType) && + Objects.equals(this.validationErrors, paymentService.validationErrors); } @Override public int hashCode() { - return Objects.hash( - paymentServiceID, - paymentServiceName, - paymentServiceUrl, - payNowText, - paymentServiceType, - validationErrors); + return Objects.hash(paymentServiceID, paymentServiceName, paymentServiceUrl, payNowText, paymentServiceType, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -314,7 +302,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -322,4 +311,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/PaymentServices.java b/src/main/java/com/xero/models/accounting/PaymentServices.java index 4296432e3..4ca8abd54 100644 --- a/src/main/java/com/xero/models/accounting/PaymentServices.java +++ b/src/main/java/com/xero/models/accounting/PaymentServices.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.PaymentService; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentServices + */ -/** PaymentServices */ public class PaymentServices { StringUtil util = new StringUtil(); @JsonProperty("PaymentServices") private List paymentServices = new ArrayList(); /** - * paymentServices - * - * @param paymentServices List<PaymentService> - * @return PaymentServices - */ + * paymentServices + * @param paymentServices List<PaymentService> + * @return PaymentServices + **/ public PaymentServices paymentServices(List paymentServices) { this.paymentServices = paymentServices; return this; @@ -37,10 +54,9 @@ public PaymentServices paymentServices(List paymentServices) { /** * paymentServices - * - * @param paymentServicesItem PaymentService + * @param paymentServicesItem PaymentService * @return PaymentServices - */ + **/ public PaymentServices addPaymentServicesItem(PaymentService paymentServicesItem) { if (this.paymentServices == null) { this.paymentServices = new ArrayList(); @@ -49,30 +65,29 @@ public PaymentServices addPaymentServicesItem(PaymentService paymentServicesItem return this; } - /** + /** * Get paymentServices - * * @return paymentServices - */ + **/ @ApiModelProperty(value = "") - /** + /** * paymentServices - * * @return paymentServices List - */ + **/ public List getPaymentServices() { return paymentServices; } - /** - * paymentServices - * - * @param paymentServices List<PaymentService> - */ + /** + * paymentServices + * @param paymentServices List<PaymentService> + **/ + public void setPaymentServices(List paymentServices) { this.paymentServices = paymentServices; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(paymentServices); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/PaymentTerm.java b/src/main/java/com/xero/models/accounting/PaymentTerm.java index 1b273ed0b..3aa2b61ec 100644 --- a/src/main/java/com/xero/models/accounting/PaymentTerm.java +++ b/src/main/java/com/xero/models/accounting/PaymentTerm.java @@ -9,14 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Bill; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentTerm + */ -/** PaymentTerm */ public class PaymentTerm { StringUtil util = new StringUtil(); @@ -26,75 +44,70 @@ public class PaymentTerm { @JsonProperty("Sales") private Bill sales; /** - * bills - * - * @param bills Bill - * @return PaymentTerm - */ + * bills + * @param bills Bill + * @return PaymentTerm + **/ public PaymentTerm bills(Bill bills) { this.bills = bills; return this; } - /** + /** * Get bills - * * @return bills - */ + **/ @ApiModelProperty(value = "") - /** + /** * bills - * * @return bills Bill - */ + **/ public Bill getBills() { return bills; } - /** - * bills - * - * @param bills Bill - */ + /** + * bills + * @param bills Bill + **/ + public void setBills(Bill bills) { this.bills = bills; } /** - * sales - * - * @param sales Bill - * @return PaymentTerm - */ + * sales + * @param sales Bill + * @return PaymentTerm + **/ public PaymentTerm sales(Bill sales) { this.sales = sales; return this; } - /** + /** * Get sales - * * @return sales - */ + **/ @ApiModelProperty(value = "") - /** + /** * sales - * * @return sales Bill - */ + **/ public Bill getSales() { return sales; } - /** - * sales - * - * @param sales Bill - */ + /** + * sales + * @param sales Bill + **/ + public void setSales(Bill sales) { this.sales = sales; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } PaymentTerm paymentTerm = (PaymentTerm) o; - return Objects.equals(this.bills, paymentTerm.bills) - && Objects.equals(this.sales, paymentTerm.sales); + return Objects.equals(this.bills, paymentTerm.bills) && + Objects.equals(this.sales, paymentTerm.sales); } @Override @@ -113,6 +126,7 @@ public int hashCode() { return Objects.hash(bills, sales); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/PaymentTermType.java b/src/main/java/com/xero/models/accounting/PaymentTermType.java index 3cb2eac9e..4334e7398 100644 --- a/src/main/java/com/xero/models/accounting/PaymentTermType.java +++ b/src/main/java/com/xero/models/accounting/PaymentTermType.java @@ -9,25 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets PaymentTermType */ +/** + * Gets or Sets PaymentTermType + */ public enum PaymentTermType { - - /** DAYSAFTERBILLDATE */ + + /** + * DAYSAFTERBILLDATE + */ DAYSAFTERBILLDATE("DAYSAFTERBILLDATE"), - - /** DAYSAFTERBILLMONTH */ + + /** + * DAYSAFTERBILLMONTH + */ DAYSAFTERBILLMONTH("DAYSAFTERBILLMONTH"), - - /** OFCURRENTMONTH */ + + /** + * OFCURRENTMONTH + */ OFCURRENTMONTH("OFCURRENTMONTH"), - - /** OFFOLLOWINGMONTH */ + + /** + * OFFOLLOWINGMONTH + */ OFFOLLOWINGMONTH("OFFOLLOWINGMONTH"); private String value; @@ -36,26 +55,24 @@ public enum PaymentTermType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static PaymentTermType fromValue(String value) { @@ -67,3 +84,4 @@ public static PaymentTermType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/Payments.java b/src/main/java/com/xero/models/accounting/Payments.java index c26d91661..728976cdd 100644 --- a/src/main/java/com/xero/models/accounting/Payments.java +++ b/src/main/java/com/xero/models/accounting/Payments.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.Payment; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Payments + */ -/** Payments */ public class Payments { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class Payments { @JsonProperty("Payments") private List payments = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Payments - */ + * pagination + * @param pagination Pagination + * @return Payments + **/ public Payments pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Payments - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Payments + **/ public Payments warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public Payments warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Payments - */ + **/ public Payments addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public Payments addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * payments - * - * @param payments List<Payment> - * @return Payments - */ + * payments + * @param payments List<Payment> + * @return Payments + **/ public Payments payments(List payments) { this.payments = payments; return this; @@ -127,10 +139,9 @@ public Payments payments(List payments) { /** * payments - * - * @param paymentsItem Payment + * @param paymentsItem Payment * @return Payments - */ + **/ public Payments addPaymentsItem(Payment paymentsItem) { if (this.payments == null) { this.payments = new ArrayList(); @@ -139,30 +150,29 @@ public Payments addPaymentsItem(Payment paymentsItem) { return this; } - /** + /** * Get payments - * * @return payments - */ + **/ @ApiModelProperty(value = "") - /** + /** * payments - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** - * payments - * - * @param payments List<Payment> - */ + /** + * payments + * @param payments List<Payment> + **/ + public void setPayments(List payments) { this.payments = payments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } Payments payments = (Payments) o; - return Objects.equals(this.pagination, payments.pagination) - && Objects.equals(this.warnings, payments.warnings) - && Objects.equals(this.payments, payments.payments); + return Objects.equals(this.pagination, payments.pagination) && + Objects.equals(this.warnings, payments.warnings) && + Objects.equals(this.payments, payments.payments); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, payments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Phone.java b/src/main/java/com/xero/models/accounting/Phone.java index 6d8c2093d..01ae338a5 100644 --- a/src/main/java/com/xero/models/accounting/Phone.java +++ b/src/main/java/com/xero/models/accounting/Phone.java @@ -9,33 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Phone + */ -/** Phone */ public class Phone { StringUtil util = new StringUtil(); - /** Gets or Sets phoneType */ + /** + * Gets or Sets phoneType + */ public enum PhoneTypeEnum { - /** DEFAULT */ + /** + * DEFAULT + */ DEFAULT("DEFAULT"), - - /** DDI */ + + /** + * DDI + */ DDI("DDI"), - - /** MOBILE */ + + /** + * MOBILE + */ MOBILE("MOBILE"), - - /** FAX */ + + /** + * FAX + */ FAX("FAX"), - - /** OFFICE */ + + /** + * OFFICE + */ OFFICE("OFFICE"); private String value; @@ -44,31 +71,25 @@ public enum PhoneTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PhoneTypeEnum fromValue(String value) { for (PhoneTypeEnum b : PhoneTypeEnum.values()) { @@ -80,6 +101,7 @@ public static PhoneTypeEnum fromValue(String value) { } } + @JsonProperty("PhoneType") private PhoneTypeEnum phoneType; @@ -92,145 +114,134 @@ public static PhoneTypeEnum fromValue(String value) { @JsonProperty("PhoneCountryCode") private String phoneCountryCode; /** - * phoneType - * - * @param phoneType PhoneTypeEnum - * @return Phone - */ + * phoneType + * @param phoneType PhoneTypeEnum + * @return Phone + **/ public Phone phoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; return this; } - /** + /** * Get phoneType - * * @return phoneType - */ + **/ @ApiModelProperty(value = "") - /** + /** * phoneType - * * @return phoneType PhoneTypeEnum - */ + **/ public PhoneTypeEnum getPhoneType() { return phoneType; } - /** - * phoneType - * - * @param phoneType PhoneTypeEnum - */ + /** + * phoneType + * @param phoneType PhoneTypeEnum + **/ + public void setPhoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; } /** - * max length = 50 - * - * @param phoneNumber String - * @return Phone - */ + * max length = 50 + * @param phoneNumber String + * @return Phone + **/ public Phone phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; return this; } - /** + /** * max length = 50 - * * @return phoneNumber - */ + **/ @ApiModelProperty(value = "max length = 50") - /** + /** * max length = 50 - * * @return phoneNumber String - */ + **/ public String getPhoneNumber() { return phoneNumber; } - /** - * max length = 50 - * - * @param phoneNumber String - */ + /** + * max length = 50 + * @param phoneNumber String + **/ + public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } /** - * max length = 10 - * - * @param phoneAreaCode String - * @return Phone - */ + * max length = 10 + * @param phoneAreaCode String + * @return Phone + **/ public Phone phoneAreaCode(String phoneAreaCode) { this.phoneAreaCode = phoneAreaCode; return this; } - /** + /** * max length = 10 - * * @return phoneAreaCode - */ + **/ @ApiModelProperty(value = "max length = 10") - /** + /** * max length = 10 - * * @return phoneAreaCode String - */ + **/ public String getPhoneAreaCode() { return phoneAreaCode; } - /** - * max length = 10 - * - * @param phoneAreaCode String - */ + /** + * max length = 10 + * @param phoneAreaCode String + **/ + public void setPhoneAreaCode(String phoneAreaCode) { this.phoneAreaCode = phoneAreaCode; } /** - * max length = 20 - * - * @param phoneCountryCode String - * @return Phone - */ + * max length = 20 + * @param phoneCountryCode String + * @return Phone + **/ public Phone phoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; return this; } - /** + /** * max length = 20 - * * @return phoneCountryCode - */ + **/ @ApiModelProperty(value = "max length = 20") - /** + /** * max length = 20 - * * @return phoneCountryCode String - */ + **/ public String getPhoneCountryCode() { return phoneCountryCode; } - /** - * max length = 20 - * - * @param phoneCountryCode String - */ + /** + * max length = 20 + * @param phoneCountryCode String + **/ + public void setPhoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,10 +251,10 @@ public boolean equals(java.lang.Object o) { return false; } Phone phone = (Phone) o; - return Objects.equals(this.phoneType, phone.phoneType) - && Objects.equals(this.phoneNumber, phone.phoneNumber) - && Objects.equals(this.phoneAreaCode, phone.phoneAreaCode) - && Objects.equals(this.phoneCountryCode, phone.phoneCountryCode); + return Objects.equals(this.phoneType, phone.phoneType) && + Objects.equals(this.phoneNumber, phone.phoneNumber) && + Objects.equals(this.phoneAreaCode, phone.phoneAreaCode) && + Objects.equals(this.phoneCountryCode, phone.phoneCountryCode); } @Override @@ -251,6 +262,7 @@ public int hashCode() { return Objects.hash(phoneType, phoneNumber, phoneAreaCode, phoneCountryCode); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -264,7 +276,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -272,4 +285,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Prepayment.java b/src/main/java/com/xero/models/accounting/Prepayment.java index f1ca88e02..493954210 100644 --- a/src/main/java/com/xero/models/accounting/Prepayment.java +++ b/src/main/java/com/xero/models/accounting/Prepayment.java @@ -9,38 +9,65 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Allocation; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.Payment; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Prepayment + */ -/** Prepayment */ public class Prepayment { StringUtil util = new StringUtil(); - /** See Prepayment Types */ + /** + * See Prepayment Types + */ public enum TypeEnum { - /** RECEIVE_PREPAYMENT */ + /** + * RECEIVE_PREPAYMENT + */ RECEIVE_PREPAYMENT("RECEIVE-PREPAYMENT"), - - /** SPEND_PREPAYMENT */ + + /** + * SPEND_PREPAYMENT + */ SPEND_PREPAYMENT("SPEND-PREPAYMENT"), - - /** ARPREPAYMENT */ + + /** + * ARPREPAYMENT + */ ARPREPAYMENT("ARPREPAYMENT"), - - /** APPREPAYMENT */ + + /** + * APPREPAYMENT + */ APPREPAYMENT("APPREPAYMENT"); private String value; @@ -49,31 +76,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -85,6 +106,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -93,15 +115,23 @@ public static TypeEnum fromValue(String value) { @JsonProperty("Date") private String date; - /** See Prepayment Status Codes */ + /** + * See Prepayment Status Codes + */ public enum StatusEnum { - /** AUTHORISED */ + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** PAID */ + + /** + * PAID + */ PAID("PAID"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"); private String value; @@ -110,31 +140,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -146,6 +170,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -197,214 +222,196 @@ public static StatusEnum fromValue(String value) { @JsonProperty("Attachments") private List attachments = new ArrayList(); /** - * See Prepayment Types - * - * @param type TypeEnum - * @return Prepayment - */ + * See Prepayment Types + * @param type TypeEnum + * @return Prepayment + **/ public Prepayment type(TypeEnum type) { this.type = type; return this; } - /** + /** * See Prepayment Types - * * @return type - */ + **/ @ApiModelProperty(value = "See Prepayment Types") - /** + /** * See Prepayment Types - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * See Prepayment Types - * - * @param type TypeEnum - */ + /** + * See Prepayment Types + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * contact - * - * @param contact Contact - * @return Prepayment - */ + * contact + * @param contact Contact + * @return Prepayment + **/ public Prepayment contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * The date the prepayment is created YYYY-MM-DD - * - * @param date String - * @return Prepayment - */ + * The date the prepayment is created YYYY-MM-DD + * @param date String + * @return Prepayment + **/ public Prepayment date(String date) { this.date = date; return this; } - /** + /** * The date the prepayment is created YYYY-MM-DD - * * @return date - */ + **/ @ApiModelProperty(value = "The date the prepayment is created YYYY-MM-DD") - /** + /** * The date the prepayment is created YYYY-MM-DD - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * The date the prepayment is created YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The date the prepayment is created YYYY-MM-DD - * - * @param date String - */ + /** + * The date the prepayment is created YYYY-MM-DD + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * The date the prepayment is created YYYY-MM-DD - * - * @param date LocalDateTime - */ + /** + * The date the prepayment is created YYYY-MM-DD + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * See Prepayment Status Codes - * - * @param status StatusEnum - * @return Prepayment - */ + * See Prepayment Status Codes + * @param status StatusEnum + * @return Prepayment + **/ public Prepayment status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Prepayment Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Prepayment Status Codes") - /** + /** * See Prepayment Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Prepayment Status Codes - * - * @param status StatusEnum - */ + /** + * See Prepayment Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return Prepayment - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return Prepayment + **/ public Prepayment lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * See Prepayment Line Items - * - * @param lineItems List<LineItem> - * @return Prepayment - */ + * See Prepayment Line Items + * @param lineItems List<LineItem> + * @return Prepayment + **/ public Prepayment lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -412,10 +419,9 @@ public Prepayment lineItems(List lineItems) { /** * See Prepayment Line Items - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return Prepayment - */ + **/ public Prepayment addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -424,335 +430,297 @@ public Prepayment addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * See Prepayment Line Items - * * @return lineItems - */ + **/ @ApiModelProperty(value = "See Prepayment Line Items") - /** + /** * See Prepayment Line Items - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See Prepayment Line Items - * - * @param lineItems List<LineItem> - */ + /** + * See Prepayment Line Items + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * The subtotal of the prepayment excluding taxes - * - * @param subTotal Double - * @return Prepayment - */ + * The subtotal of the prepayment excluding taxes + * @param subTotal Double + * @return Prepayment + **/ public Prepayment subTotal(Double subTotal) { this.subTotal = subTotal; return this; } - /** + /** * The subtotal of the prepayment excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "The subtotal of the prepayment excluding taxes") - /** + /** * The subtotal of the prepayment excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** - * The subtotal of the prepayment excluding taxes - * - * @param subTotal Double - */ + /** + * The subtotal of the prepayment excluding taxes + * @param subTotal Double + **/ + public void setSubTotal(Double subTotal) { this.subTotal = subTotal; } /** - * The total tax on the prepayment - * - * @param totalTax Double - * @return Prepayment - */ + * The total tax on the prepayment + * @param totalTax Double + * @return Prepayment + **/ public Prepayment totalTax(Double totalTax) { this.totalTax = totalTax; return this; } - /** + /** * The total tax on the prepayment - * * @return totalTax - */ + **/ @ApiModelProperty(value = "The total tax on the prepayment") - /** + /** * The total tax on the prepayment - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * The total tax on the prepayment - * - * @param totalTax Double - */ + /** + * The total tax on the prepayment + * @param totalTax Double + **/ + public void setTotalTax(Double totalTax) { this.totalTax = totalTax; } /** - * The total of the prepayment(subtotal + total tax) - * - * @param total Double - * @return Prepayment - */ + * The total of the prepayment(subtotal + total tax) + * @param total Double + * @return Prepayment + **/ public Prepayment total(Double total) { this.total = total; return this; } - /** + /** * The total of the prepayment(subtotal + total tax) - * * @return total - */ + **/ @ApiModelProperty(value = "The total of the prepayment(subtotal + total tax)") - /** + /** * The total of the prepayment(subtotal + total tax) - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * The total of the prepayment(subtotal + total tax) - * - * @param total Double - */ + /** + * The total of the prepayment(subtotal + total tax) + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } - /** + /** * Returns Invoice number field. Reference field isn't available. - * * @return reference - */ + **/ @ApiModelProperty(value = "Returns Invoice number field. Reference field isn't available.") - /** + /** * Returns Invoice number field. Reference field isn't available. - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** + /** * UTC timestamp of last update to the prepayment - * * @return updatedDateUTC - */ - @ApiModelProperty( - example = "/Date(1573755038314)/", - value = "UTC timestamp of last update to the prepayment") - /** + **/ + @ApiModelProperty(example = "/Date(1573755038314)/", value = "UTC timestamp of last update to the prepayment") + /** * UTC timestamp of last update to the prepayment - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * UTC timestamp of last update to the prepayment - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return Prepayment - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return Prepayment + **/ public Prepayment currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * Xero generated unique identifier - * - * @param prepaymentID UUID - * @return Prepayment - */ + * Xero generated unique identifier + * @param prepaymentID UUID + * @return Prepayment + **/ public Prepayment prepaymentID(UUID prepaymentID) { this.prepaymentID = prepaymentID; return this; } - /** + /** * Xero generated unique identifier - * * @return prepaymentID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier") - /** + /** * Xero generated unique identifier - * * @return prepaymentID UUID - */ + **/ public UUID getPrepaymentID() { return prepaymentID; } - /** - * Xero generated unique identifier - * - * @param prepaymentID UUID - */ + /** + * Xero generated unique identifier + * @param prepaymentID UUID + **/ + public void setPrepaymentID(UUID prepaymentID) { this.prepaymentID = prepaymentID; } /** - * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate - * is used - * - * @param currencyRate Double - * @return Prepayment - */ + * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used + * @param currencyRate Double + * @return Prepayment + **/ public Prepayment currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate - * is used - * + /** + * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used * @return currencyRate - */ - @ApiModelProperty( - value = - "The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com" - + " day rate is used") - /** - * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate - * is used - * + **/ + @ApiModelProperty(value = "The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used") + /** + * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate - * is used - * - * @param currencyRate Double - */ + /** + * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } /** - * The remaining credit balance on the prepayment - * - * @param remainingCredit Double - * @return Prepayment - */ + * The remaining credit balance on the prepayment + * @param remainingCredit Double + * @return Prepayment + **/ public Prepayment remainingCredit(Double remainingCredit) { this.remainingCredit = remainingCredit; return this; } - /** + /** * The remaining credit balance on the prepayment - * * @return remainingCredit - */ + **/ @ApiModelProperty(value = "The remaining credit balance on the prepayment") - /** + /** * The remaining credit balance on the prepayment - * * @return remainingCredit Double - */ + **/ public Double getRemainingCredit() { return remainingCredit; } - /** - * The remaining credit balance on the prepayment - * - * @param remainingCredit Double - */ + /** + * The remaining credit balance on the prepayment + * @param remainingCredit Double + **/ + public void setRemainingCredit(Double remainingCredit) { this.remainingCredit = remainingCredit; } /** - * See Allocations - * - * @param allocations List<Allocation> - * @return Prepayment - */ + * See Allocations + * @param allocations List<Allocation> + * @return Prepayment + **/ public Prepayment allocations(List allocations) { this.allocations = allocations; return this; @@ -760,10 +728,9 @@ public Prepayment allocations(List allocations) { /** * See Allocations - * - * @param allocationsItem Allocation + * @param allocationsItem Allocation * @return Prepayment - */ + **/ public Prepayment addAllocationsItem(Allocation allocationsItem) { if (this.allocations == null) { this.allocations = new ArrayList(); @@ -772,36 +739,33 @@ public Prepayment addAllocationsItem(Allocation allocationsItem) { return this; } - /** + /** * See Allocations - * * @return allocations - */ + **/ @ApiModelProperty(value = "See Allocations") - /** + /** * See Allocations - * * @return allocations List - */ + **/ public List getAllocations() { return allocations; } - /** - * See Allocations - * - * @param allocations List<Allocation> - */ + /** + * See Allocations + * @param allocations List<Allocation> + **/ + public void setAllocations(List allocations) { this.allocations = allocations; } /** - * See Payments - * - * @param payments List<Payment> - * @return Prepayment - */ + * See Payments + * @param payments List<Payment> + * @return Prepayment + **/ public Prepayment payments(List payments) { this.payments = payments; return this; @@ -809,10 +773,9 @@ public Prepayment payments(List payments) { /** * See Payments - * - * @param paymentsItem Payment + * @param paymentsItem Payment * @return Prepayment - */ + **/ public Prepayment addPaymentsItem(Payment paymentsItem) { if (this.payments == null) { this.payments = new ArrayList(); @@ -821,88 +784,78 @@ public Prepayment addPaymentsItem(Payment paymentsItem) { return this; } - /** + /** * See Payments - * * @return payments - */ + **/ @ApiModelProperty(value = "See Payments") - /** + /** * See Payments - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** - * See Payments - * - * @param payments List<Payment> - */ + /** + * See Payments + * @param payments List<Payment> + **/ + public void setPayments(List payments) { this.payments = payments; } /** - * The amount of applied to an invoice - * - * @param appliedAmount Double - * @return Prepayment - */ + * The amount of applied to an invoice + * @param appliedAmount Double + * @return Prepayment + **/ public Prepayment appliedAmount(Double appliedAmount) { this.appliedAmount = appliedAmount; return this; } - /** + /** * The amount of applied to an invoice - * * @return appliedAmount - */ + **/ @ApiModelProperty(example = "2.0", value = "The amount of applied to an invoice") - /** + /** * The amount of applied to an invoice - * * @return appliedAmount Double - */ + **/ public Double getAppliedAmount() { return appliedAmount; } - /** - * The amount of applied to an invoice - * - * @param appliedAmount Double - */ + /** + * The amount of applied to an invoice + * @param appliedAmount Double + **/ + public void setAppliedAmount(Double appliedAmount) { this.appliedAmount = appliedAmount; } - /** + /** * boolean to indicate if a prepayment has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "boolean to indicate if a prepayment has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "boolean to indicate if a prepayment has an attachment") + /** * boolean to indicate if a prepayment has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } /** - * See Attachments - * - * @param attachments List<Attachment> - * @return Prepayment - */ + * See Attachments + * @param attachments List<Attachment> + * @return Prepayment + **/ public Prepayment attachments(List attachments) { this.attachments = attachments; return this; @@ -910,10 +863,9 @@ public Prepayment attachments(List attachments) { /** * See Attachments - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return Prepayment - */ + **/ public Prepayment addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -922,30 +874,29 @@ public Prepayment addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * See Attachments - * * @return attachments - */ + **/ @ApiModelProperty(value = "See Attachments") - /** + /** * See Attachments - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * See Attachments - * - * @param attachments List<Attachment> - */ + /** + * See Attachments + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -955,53 +906,34 @@ public boolean equals(java.lang.Object o) { return false; } Prepayment prepayment = (Prepayment) o; - return Objects.equals(this.type, prepayment.type) - && Objects.equals(this.contact, prepayment.contact) - && Objects.equals(this.date, prepayment.date) - && Objects.equals(this.status, prepayment.status) - && Objects.equals(this.lineAmountTypes, prepayment.lineAmountTypes) - && Objects.equals(this.lineItems, prepayment.lineItems) - && Objects.equals(this.subTotal, prepayment.subTotal) - && Objects.equals(this.totalTax, prepayment.totalTax) - && Objects.equals(this.total, prepayment.total) - && Objects.equals(this.reference, prepayment.reference) - && Objects.equals(this.updatedDateUTC, prepayment.updatedDateUTC) - && Objects.equals(this.currencyCode, prepayment.currencyCode) - && Objects.equals(this.prepaymentID, prepayment.prepaymentID) - && Objects.equals(this.currencyRate, prepayment.currencyRate) - && Objects.equals(this.remainingCredit, prepayment.remainingCredit) - && Objects.equals(this.allocations, prepayment.allocations) - && Objects.equals(this.payments, prepayment.payments) - && Objects.equals(this.appliedAmount, prepayment.appliedAmount) - && Objects.equals(this.hasAttachments, prepayment.hasAttachments) - && Objects.equals(this.attachments, prepayment.attachments); + return Objects.equals(this.type, prepayment.type) && + Objects.equals(this.contact, prepayment.contact) && + Objects.equals(this.date, prepayment.date) && + Objects.equals(this.status, prepayment.status) && + Objects.equals(this.lineAmountTypes, prepayment.lineAmountTypes) && + Objects.equals(this.lineItems, prepayment.lineItems) && + Objects.equals(this.subTotal, prepayment.subTotal) && + Objects.equals(this.totalTax, prepayment.totalTax) && + Objects.equals(this.total, prepayment.total) && + Objects.equals(this.reference, prepayment.reference) && + Objects.equals(this.updatedDateUTC, prepayment.updatedDateUTC) && + Objects.equals(this.currencyCode, prepayment.currencyCode) && + Objects.equals(this.prepaymentID, prepayment.prepaymentID) && + Objects.equals(this.currencyRate, prepayment.currencyRate) && + Objects.equals(this.remainingCredit, prepayment.remainingCredit) && + Objects.equals(this.allocations, prepayment.allocations) && + Objects.equals(this.payments, prepayment.payments) && + Objects.equals(this.appliedAmount, prepayment.appliedAmount) && + Objects.equals(this.hasAttachments, prepayment.hasAttachments) && + Objects.equals(this.attachments, prepayment.attachments); } @Override public int hashCode() { - return Objects.hash( - type, - contact, - date, - status, - lineAmountTypes, - lineItems, - subTotal, - totalTax, - total, - reference, - updatedDateUTC, - currencyCode, - prepaymentID, - currencyRate, - remainingCredit, - allocations, - payments, - appliedAmount, - hasAttachments, - attachments); + return Objects.hash(type, contact, date, status, lineAmountTypes, lineItems, subTotal, totalTax, total, reference, updatedDateUTC, currencyCode, prepaymentID, currencyRate, remainingCredit, allocations, payments, appliedAmount, hasAttachments, attachments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1031,7 +963,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1039,4 +972,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Prepayments.java b/src/main/java/com/xero/models/accounting/Prepayments.java index b67a6838d..151355e37 100644 --- a/src/main/java/com/xero/models/accounting/Prepayments.java +++ b/src/main/java/com/xero/models/accounting/Prepayments.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.Prepayment; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Prepayments + */ -/** Prepayments */ public class Prepayments { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class Prepayments { @JsonProperty("Prepayments") private List prepayments = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Prepayments - */ + * pagination + * @param pagination Pagination + * @return Prepayments + **/ public Prepayments pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Prepayments - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Prepayments + **/ public Prepayments warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public Prepayments warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Prepayments - */ + **/ public Prepayments addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public Prepayments addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * prepayments - * - * @param prepayments List<Prepayment> - * @return Prepayments - */ + * prepayments + * @param prepayments List<Prepayment> + * @return Prepayments + **/ public Prepayments prepayments(List prepayments) { this.prepayments = prepayments; return this; @@ -127,10 +139,9 @@ public Prepayments prepayments(List prepayments) { /** * prepayments - * - * @param prepaymentsItem Prepayment + * @param prepaymentsItem Prepayment * @return Prepayments - */ + **/ public Prepayments addPrepaymentsItem(Prepayment prepaymentsItem) { if (this.prepayments == null) { this.prepayments = new ArrayList(); @@ -139,30 +150,29 @@ public Prepayments addPrepaymentsItem(Prepayment prepaymentsItem) { return this; } - /** + /** * Get prepayments - * * @return prepayments - */ + **/ @ApiModelProperty(value = "") - /** + /** * prepayments - * * @return prepayments List - */ + **/ public List getPrepayments() { return prepayments; } - /** - * prepayments - * - * @param prepayments List<Prepayment> - */ + /** + * prepayments + * @param prepayments List<Prepayment> + **/ + public void setPrepayments(List prepayments) { this.prepayments = prepayments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } Prepayments prepayments = (Prepayments) o; - return Objects.equals(this.pagination, prepayments.pagination) - && Objects.equals(this.warnings, prepayments.warnings) - && Objects.equals(this.prepayments, prepayments.prepayments); + return Objects.equals(this.pagination, prepayments.pagination) && + Objects.equals(this.warnings, prepayments.warnings) && + Objects.equals(this.prepayments, prepayments.prepayments); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, prepayments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Purchase.java b/src/main/java/com/xero/models/accounting/Purchase.java index 67b3f460b..55506f165 100644 --- a/src/main/java/com/xero/models/accounting/Purchase.java +++ b/src/main/java/com/xero/models/accounting/Purchase.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Purchase + */ -/** Purchase */ public class Purchase { StringUtil util = new StringUtil(); @@ -32,162 +49,134 @@ public class Purchase { @JsonProperty("TaxType") private String taxType; /** - * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 - * decimal places by adding the unitdp=4 querystring parameter to your request. - * - * @param unitPrice Double - * @return Purchase - */ + * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. + * @param unitPrice Double + * @return Purchase + **/ public Purchase unitPrice(Double unitPrice) { this.unitPrice = unitPrice; return this; } - /** - * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 - * decimal places by adding the unitdp=4 querystring parameter to your request. - * + /** + * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. * @return unitPrice - */ - @ApiModelProperty( - value = - "Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can" - + " use 4 decimal places by adding the unitdp=4 querystring parameter to your" - + " request.") - /** - * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 - * decimal places by adding the unitdp=4 querystring parameter to your request. - * + **/ + @ApiModelProperty(value = "Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request.") + /** + * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. * @return unitPrice Double - */ + **/ public Double getUnitPrice() { return unitPrice; } - /** - * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 - * decimal places by adding the unitdp=4 querystring parameter to your request. - * - * @param unitPrice Double - */ + /** + * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. + * @param unitPrice Double + **/ + public void setUnitPrice(Double unitPrice) { this.unitPrice = unitPrice; } /** - * Default account code to be used for purchased/sale. Not applicable to the purchase details of - * tracked items - * - * @param accountCode String - * @return Purchase - */ + * Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items + * @param accountCode String + * @return Purchase + **/ public Purchase accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** - * Default account code to be used for purchased/sale. Not applicable to the purchase details of - * tracked items - * + /** + * Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items * @return accountCode - */ - @ApiModelProperty( - value = - "Default account code to be used for purchased/sale. Not applicable to the purchase" - + " details of tracked items") - /** - * Default account code to be used for purchased/sale. Not applicable to the purchase details of - * tracked items - * + **/ + @ApiModelProperty(value = "Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items") + /** + * Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * Default account code to be used for purchased/sale. Not applicable to the purchase details of - * tracked items - * - * @param accountCode String - */ + /** + * Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * Cost of goods sold account. Only applicable to the purchase details of tracked items. - * - * @param coGSAccountCode String - * @return Purchase - */ + * Cost of goods sold account. Only applicable to the purchase details of tracked items. + * @param coGSAccountCode String + * @return Purchase + **/ public Purchase coGSAccountCode(String coGSAccountCode) { this.coGSAccountCode = coGSAccountCode; return this; } - /** + /** * Cost of goods sold account. Only applicable to the purchase details of tracked items. - * * @return coGSAccountCode - */ - @ApiModelProperty( - value = - "Cost of goods sold account. Only applicable to the purchase details of tracked items.") - /** + **/ + @ApiModelProperty(value = "Cost of goods sold account. Only applicable to the purchase details of tracked items.") + /** * Cost of goods sold account. Only applicable to the purchase details of tracked items. - * * @return coGSAccountCode String - */ + **/ public String getCoGSAccountCode() { return coGSAccountCode; } - /** - * Cost of goods sold account. Only applicable to the purchase details of tracked items. - * - * @param coGSAccountCode String - */ + /** + * Cost of goods sold account. Only applicable to the purchase details of tracked items. + * @param coGSAccountCode String + **/ + public void setCoGSAccountCode(String coGSAccountCode) { this.coGSAccountCode = coGSAccountCode; } /** - * The tax type from TaxRates - * - * @param taxType String - * @return Purchase - */ + * The tax type from TaxRates + * @param taxType String + * @return Purchase + **/ public Purchase taxType(String taxType) { this.taxType = taxType; return this; } - /** + /** * The tax type from TaxRates - * * @return taxType - */ + **/ @ApiModelProperty(value = "The tax type from TaxRates") - /** + /** * The tax type from TaxRates - * * @return taxType String - */ + **/ public String getTaxType() { return taxType; } - /** - * The tax type from TaxRates - * - * @param taxType String - */ + /** + * The tax type from TaxRates + * @param taxType String + **/ + public void setTaxType(String taxType) { this.taxType = taxType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -197,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } Purchase purchase = (Purchase) o; - return Objects.equals(this.unitPrice, purchase.unitPrice) - && Objects.equals(this.accountCode, purchase.accountCode) - && Objects.equals(this.coGSAccountCode, purchase.coGSAccountCode) - && Objects.equals(this.taxType, purchase.taxType); + return Objects.equals(this.unitPrice, purchase.unitPrice) && + Objects.equals(this.accountCode, purchase.accountCode) && + Objects.equals(this.coGSAccountCode, purchase.coGSAccountCode) && + Objects.equals(this.taxType, purchase.taxType); } @Override @@ -208,6 +197,7 @@ public int hashCode() { return Objects.hash(unitPrice, accountCode, coGSAccountCode, taxType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -221,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -229,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/PurchaseOrder.java b/src/main/java/com/xero/models/accounting/PurchaseOrder.java index 0c2e5015f..d18f431cc 100644 --- a/src/main/java/com/xero/models/accounting/PurchaseOrder.java +++ b/src/main/java/com/xero/models/accounting/PurchaseOrder.java @@ -9,24 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PurchaseOrder + */ -/** PurchaseOrder */ public class PurchaseOrder { StringUtil util = new StringUtil(); @@ -56,21 +72,33 @@ public class PurchaseOrder { @JsonProperty("CurrencyCode") private CurrencyCode currencyCode; - /** See Purchase Order Status Codes */ + /** + * See Purchase Order Status Codes + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** SUBMITTED */ + + /** + * SUBMITTED + */ SUBMITTED("SUBMITTED"), - - /** AUTHORISED */ + + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** BILLED */ + + /** + * BILLED + */ BILLED("BILLED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -79,31 +107,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -115,6 +137,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -172,46 +195,42 @@ public static StatusEnum fromValue(String value) { @JsonProperty("Attachments") private List attachments = new ArrayList(); /** - * contact - * - * @param contact Contact - * @return PurchaseOrder - */ + * contact + * @param contact Contact + * @return PurchaseOrder + **/ public PurchaseOrder contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * See LineItems - * - * @param lineItems List<LineItem> - * @return PurchaseOrder - */ + * See LineItems + * @param lineItems List<LineItem> + * @return PurchaseOrder + **/ public PurchaseOrder lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -219,10 +238,9 @@ public PurchaseOrder lineItems(List lineItems) { /** * See LineItems - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return PurchaseOrder - */ + **/ public PurchaseOrder addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -231,853 +249,747 @@ public PurchaseOrder addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * See LineItems - * * @return lineItems - */ + **/ @ApiModelProperty(value = "See LineItems") - /** + /** * See LineItems - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See LineItems - * - * @param lineItems List<LineItem> - */ + /** + * See LineItems + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will - * default to the current date based on the timezone setting of the organisation - * - * @param date String - * @return PurchaseOrder - */ + * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * @param date String + * @return PurchaseOrder + **/ public PurchaseOrder date(String date) { this.date = date; return this; } - /** - * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will - * default to the current date based on the timezone setting of the organisation - * + /** + * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation * @return date - */ - @ApiModelProperty( - value = - "Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then" - + " it will default to the current date based on the timezone setting of the" - + " organisation") - /** - * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will - * default to the current date based on the timezone setting of the organisation - * + **/ + @ApiModelProperty(value = "Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation") + /** + * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation * @return date String - */ + **/ public String getDate() { return date; } - /** - * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will - * default to the current date based on the timezone setting of the organisation - * + /** + * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will - * default to the current date based on the timezone setting of the organisation - * - * @param date String - */ + /** + * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will - * default to the current date based on the timezone setting of the organisation - * - * @param date LocalDateTime - */ + /** + * Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Date the goods are to be delivered – YYYY-MM-DD - * - * @param deliveryDate String - * @return PurchaseOrder - */ + * Date the goods are to be delivered – YYYY-MM-DD + * @param deliveryDate String + * @return PurchaseOrder + **/ public PurchaseOrder deliveryDate(String deliveryDate) { this.deliveryDate = deliveryDate; return this; } - /** + /** * Date the goods are to be delivered – YYYY-MM-DD - * * @return deliveryDate - */ + **/ @ApiModelProperty(value = "Date the goods are to be delivered – YYYY-MM-DD") - /** + /** * Date the goods are to be delivered – YYYY-MM-DD - * * @return deliveryDate String - */ + **/ public String getDeliveryDate() { return deliveryDate; } - /** + /** * Date the goods are to be delivered – YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDeliveryDateAsDate() { if (this.deliveryDate != null) { try { return util.convertStringToDate(this.deliveryDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date the goods are to be delivered – YYYY-MM-DD - * - * @param deliveryDate String - */ + /** + * Date the goods are to be delivered – YYYY-MM-DD + * @param deliveryDate String + **/ + public void setDeliveryDate(String deliveryDate) { this.deliveryDate = deliveryDate; } - /** - * Date the goods are to be delivered – YYYY-MM-DD - * - * @param deliveryDate LocalDateTime - */ + /** + * Date the goods are to be delivered – YYYY-MM-DD + * @param deliveryDate LocalDateTime + **/ public void setDeliveryDate(LocalDate deliveryDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = deliveryDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = deliveryDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.deliveryDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return PurchaseOrder - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return PurchaseOrder + **/ public PurchaseOrder lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your - * Organisation Invoice Settings) - * - * @param purchaseOrderNumber String - * @return PurchaseOrder - */ + * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) + * @param purchaseOrderNumber String + * @return PurchaseOrder + **/ public PurchaseOrder purchaseOrderNumber(String purchaseOrderNumber) { this.purchaseOrderNumber = purchaseOrderNumber; return this; } - /** - * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your - * Organisation Invoice Settings) - * + /** + * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) * @return purchaseOrderNumber - */ - @ApiModelProperty( - value = - "Unique alpha numeric code identifying purchase order (when missing will auto-generate" - + " from your Organisation Invoice Settings)") - /** - * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your - * Organisation Invoice Settings) - * + **/ + @ApiModelProperty(value = "Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings)") + /** + * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) * @return purchaseOrderNumber String - */ + **/ public String getPurchaseOrderNumber() { return purchaseOrderNumber; } - /** - * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your - * Organisation Invoice Settings) - * - * @param purchaseOrderNumber String - */ + /** + * Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) + * @param purchaseOrderNumber String + **/ + public void setPurchaseOrderNumber(String purchaseOrderNumber) { this.purchaseOrderNumber = purchaseOrderNumber; } /** - * Additional reference number - * - * @param reference String - * @return PurchaseOrder - */ + * Additional reference number + * @param reference String + * @return PurchaseOrder + **/ public PurchaseOrder reference(String reference) { this.reference = reference; return this; } - /** + /** * Additional reference number - * * @return reference - */ + **/ @ApiModelProperty(value = "Additional reference number") - /** + /** * Additional reference number - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Additional reference number - * - * @param reference String - */ + /** + * Additional reference number + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * See BrandingThemes - * - * @param brandingThemeID UUID - * @return PurchaseOrder - */ + * See BrandingThemes + * @param brandingThemeID UUID + * @return PurchaseOrder + **/ public PurchaseOrder brandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; return this; } - /** + /** * See BrandingThemes - * * @return brandingThemeID - */ + **/ @ApiModelProperty(value = "See BrandingThemes") - /** + /** * See BrandingThemes - * * @return brandingThemeID UUID - */ + **/ public UUID getBrandingThemeID() { return brandingThemeID; } - /** - * See BrandingThemes - * - * @param brandingThemeID UUID - */ + /** + * See BrandingThemes + * @param brandingThemeID UUID + **/ + public void setBrandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return PurchaseOrder - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return PurchaseOrder + **/ public PurchaseOrder currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * See Purchase Order Status Codes - * - * @param status StatusEnum - * @return PurchaseOrder - */ + * See Purchase Order Status Codes + * @param status StatusEnum + * @return PurchaseOrder + **/ public PurchaseOrder status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Purchase Order Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Purchase Order Status Codes") - /** + /** * See Purchase Order Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Purchase Order Status Codes - * - * @param status StatusEnum - */ + /** + * See Purchase Order Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on - * purchase orders that have been approved or billed - * - * @param sentToContact Boolean - * @return PurchaseOrder - */ + * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed + * @param sentToContact Boolean + * @return PurchaseOrder + **/ public PurchaseOrder sentToContact(Boolean sentToContact) { this.sentToContact = sentToContact; return this; } - /** - * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on - * purchase orders that have been approved or billed - * + /** + * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed * @return sentToContact - */ - @ApiModelProperty( - value = - "Boolean to set whether the purchase order should be marked as “sent”. This can be set" - + " only on purchase orders that have been approved or billed") - /** - * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on - * purchase orders that have been approved or billed - * + **/ + @ApiModelProperty(value = "Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed") + /** + * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed * @return sentToContact Boolean - */ + **/ public Boolean getSentToContact() { return sentToContact; } - /** - * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on - * purchase orders that have been approved or billed - * - * @param sentToContact Boolean - */ + /** + * Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed + * @param sentToContact Boolean + **/ + public void setSentToContact(Boolean sentToContact) { this.sentToContact = sentToContact; } /** - * The address the goods are to be delivered to - * - * @param deliveryAddress String - * @return PurchaseOrder - */ + * The address the goods are to be delivered to + * @param deliveryAddress String + * @return PurchaseOrder + **/ public PurchaseOrder deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; return this; } - /** + /** * The address the goods are to be delivered to - * * @return deliveryAddress - */ + **/ @ApiModelProperty(value = "The address the goods are to be delivered to") - /** + /** * The address the goods are to be delivered to - * * @return deliveryAddress String - */ + **/ public String getDeliveryAddress() { return deliveryAddress; } - /** - * The address the goods are to be delivered to - * - * @param deliveryAddress String - */ + /** + * The address the goods are to be delivered to + * @param deliveryAddress String + **/ + public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; } /** - * The person that the delivery is going to - * - * @param attentionTo String - * @return PurchaseOrder - */ + * The person that the delivery is going to + * @param attentionTo String + * @return PurchaseOrder + **/ public PurchaseOrder attentionTo(String attentionTo) { this.attentionTo = attentionTo; return this; } - /** + /** * The person that the delivery is going to - * * @return attentionTo - */ + **/ @ApiModelProperty(value = "The person that the delivery is going to") - /** + /** * The person that the delivery is going to - * * @return attentionTo String - */ + **/ public String getAttentionTo() { return attentionTo; } - /** - * The person that the delivery is going to - * - * @param attentionTo String - */ + /** + * The person that the delivery is going to + * @param attentionTo String + **/ + public void setAttentionTo(String attentionTo) { this.attentionTo = attentionTo; } /** - * The phone number for the person accepting the delivery - * - * @param telephone String - * @return PurchaseOrder - */ + * The phone number for the person accepting the delivery + * @param telephone String + * @return PurchaseOrder + **/ public PurchaseOrder telephone(String telephone) { this.telephone = telephone; return this; } - /** + /** * The phone number for the person accepting the delivery - * * @return telephone - */ + **/ @ApiModelProperty(value = "The phone number for the person accepting the delivery") - /** + /** * The phone number for the person accepting the delivery - * * @return telephone String - */ + **/ public String getTelephone() { return telephone; } - /** - * The phone number for the person accepting the delivery - * - * @param telephone String - */ + /** + * The phone number for the person accepting the delivery + * @param telephone String + **/ + public void setTelephone(String telephone) { this.telephone = telephone; } /** - * A free text feild for instructions (500 characters max) - * - * @param deliveryInstructions String - * @return PurchaseOrder - */ + * A free text feild for instructions (500 characters max) + * @param deliveryInstructions String + * @return PurchaseOrder + **/ public PurchaseOrder deliveryInstructions(String deliveryInstructions) { this.deliveryInstructions = deliveryInstructions; return this; } - /** + /** * A free text feild for instructions (500 characters max) - * * @return deliveryInstructions - */ + **/ @ApiModelProperty(value = "A free text feild for instructions (500 characters max)") - /** + /** * A free text feild for instructions (500 characters max) - * * @return deliveryInstructions String - */ + **/ public String getDeliveryInstructions() { return deliveryInstructions; } - /** - * A free text feild for instructions (500 characters max) - * - * @param deliveryInstructions String - */ + /** + * A free text feild for instructions (500 characters max) + * @param deliveryInstructions String + **/ + public void setDeliveryInstructions(String deliveryInstructions) { this.deliveryInstructions = deliveryInstructions; } /** - * The date the goods are expected to arrive. - * - * @param expectedArrivalDate String - * @return PurchaseOrder - */ + * The date the goods are expected to arrive. + * @param expectedArrivalDate String + * @return PurchaseOrder + **/ public PurchaseOrder expectedArrivalDate(String expectedArrivalDate) { this.expectedArrivalDate = expectedArrivalDate; return this; } - /** + /** * The date the goods are expected to arrive. - * * @return expectedArrivalDate - */ + **/ @ApiModelProperty(value = "The date the goods are expected to arrive.") - /** + /** * The date the goods are expected to arrive. - * * @return expectedArrivalDate String - */ + **/ public String getExpectedArrivalDate() { return expectedArrivalDate; } - /** + /** * The date the goods are expected to arrive. - * * @return LocalDate - */ + **/ public LocalDate getExpectedArrivalDateAsDate() { if (this.expectedArrivalDate != null) { try { return util.convertStringToDate(this.expectedArrivalDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The date the goods are expected to arrive. - * - * @param expectedArrivalDate String - */ + /** + * The date the goods are expected to arrive. + * @param expectedArrivalDate String + **/ + public void setExpectedArrivalDate(String expectedArrivalDate) { this.expectedArrivalDate = expectedArrivalDate; } - /** - * The date the goods are expected to arrive. - * - * @param expectedArrivalDate LocalDateTime - */ + /** + * The date the goods are expected to arrive. + * @param expectedArrivalDate LocalDateTime + **/ public void setExpectedArrivalDate(LocalDate expectedArrivalDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = expectedArrivalDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = expectedArrivalDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.expectedArrivalDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Xero generated unique identifier for purchase order - * - * @param purchaseOrderID UUID - * @return PurchaseOrder - */ + * Xero generated unique identifier for purchase order + * @param purchaseOrderID UUID + * @return PurchaseOrder + **/ public PurchaseOrder purchaseOrderID(UUID purchaseOrderID) { this.purchaseOrderID = purchaseOrderID; return this; } - /** + /** * Xero generated unique identifier for purchase order - * * @return purchaseOrderID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier for purchase order") - /** + /** * Xero generated unique identifier for purchase order - * * @return purchaseOrderID UUID - */ + **/ public UUID getPurchaseOrderID() { return purchaseOrderID; } - /** - * Xero generated unique identifier for purchase order - * - * @param purchaseOrderID UUID - */ + /** + * Xero generated unique identifier for purchase order + * @param purchaseOrderID UUID + **/ + public void setPurchaseOrderID(UUID purchaseOrderID) { this.purchaseOrderID = purchaseOrderID; } /** - * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day - * rate is used. - * - * @param currencyRate Double - * @return PurchaseOrder - */ + * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. + * @param currencyRate Double + * @return PurchaseOrder + **/ public PurchaseOrder currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day - * rate is used. - * + /** + * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. * @return currencyRate - */ - @ApiModelProperty( - value = - "The currency rate for a multicurrency purchase order. If no rate is specified, the" - + " XE.com day rate is used.") - /** - * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day - * rate is used. - * + **/ + @ApiModelProperty(value = "The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used.") + /** + * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day - * rate is used. - * - * @param currencyRate Double - */ + /** + * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } - /** + /** * Total of purchase order excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "Total of purchase order excluding taxes") - /** + /** * Total of purchase order excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** + /** * Total tax on purchase order - * * @return totalTax - */ + **/ @ApiModelProperty(value = "Total tax on purchase order") - /** + /** * Total tax on purchase order - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** + /** * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) - * * @return total - */ + **/ @ApiModelProperty(value = "Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax)") - /** + /** * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** + /** * Total of discounts applied on the purchase order line items - * * @return totalDiscount - */ + **/ @ApiModelProperty(value = "Total of discounts applied on the purchase order line items") - /** + /** * Total of discounts applied on the purchase order line items - * * @return totalDiscount Double - */ + **/ public Double getTotalDiscount() { return totalDiscount; } - /** + /** * boolean to indicate if a purchase order has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "boolean to indicate if a purchase order has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "boolean to indicate if a purchase order has an attachment") + /** * boolean to indicate if a purchase order has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return PurchaseOrder - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return PurchaseOrder + **/ public PurchaseOrder statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return PurchaseOrder - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return PurchaseOrder + **/ public PurchaseOrder validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -1085,10 +997,9 @@ public PurchaseOrder validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return PurchaseOrder - */ + **/ public PurchaseOrder addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -1097,36 +1008,33 @@ public PurchaseOrder addValidationErrorsItem(ValidationError validationErrorsIte return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return PurchaseOrder - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return PurchaseOrder + **/ public PurchaseOrder warnings(List warnings) { this.warnings = warnings; return this; @@ -1134,10 +1042,9 @@ public PurchaseOrder warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return PurchaseOrder - */ + **/ public PurchaseOrder addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -1146,36 +1053,33 @@ public PurchaseOrder addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - * @return PurchaseOrder - */ + * Displays array of attachments from the API + * @param attachments List<Attachment> + * @return PurchaseOrder + **/ public PurchaseOrder attachments(List attachments) { this.attachments = attachments; return this; @@ -1183,10 +1087,9 @@ public PurchaseOrder attachments(List attachments) { /** * Displays array of attachments from the API - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return PurchaseOrder - */ + **/ public PurchaseOrder addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -1195,30 +1098,29 @@ public PurchaseOrder addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * Displays array of attachments from the API - * * @return attachments - */ + **/ @ApiModelProperty(value = "Displays array of attachments from the API") - /** + /** * Displays array of attachments from the API - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - */ + /** + * Displays array of attachments from the API + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1228,69 +1130,42 @@ public boolean equals(java.lang.Object o) { return false; } PurchaseOrder purchaseOrder = (PurchaseOrder) o; - return Objects.equals(this.contact, purchaseOrder.contact) - && Objects.equals(this.lineItems, purchaseOrder.lineItems) - && Objects.equals(this.date, purchaseOrder.date) - && Objects.equals(this.deliveryDate, purchaseOrder.deliveryDate) - && Objects.equals(this.lineAmountTypes, purchaseOrder.lineAmountTypes) - && Objects.equals(this.purchaseOrderNumber, purchaseOrder.purchaseOrderNumber) - && Objects.equals(this.reference, purchaseOrder.reference) - && Objects.equals(this.brandingThemeID, purchaseOrder.brandingThemeID) - && Objects.equals(this.currencyCode, purchaseOrder.currencyCode) - && Objects.equals(this.status, purchaseOrder.status) - && Objects.equals(this.sentToContact, purchaseOrder.sentToContact) - && Objects.equals(this.deliveryAddress, purchaseOrder.deliveryAddress) - && Objects.equals(this.attentionTo, purchaseOrder.attentionTo) - && Objects.equals(this.telephone, purchaseOrder.telephone) - && Objects.equals(this.deliveryInstructions, purchaseOrder.deliveryInstructions) - && Objects.equals(this.expectedArrivalDate, purchaseOrder.expectedArrivalDate) - && Objects.equals(this.purchaseOrderID, purchaseOrder.purchaseOrderID) - && Objects.equals(this.currencyRate, purchaseOrder.currencyRate) - && Objects.equals(this.subTotal, purchaseOrder.subTotal) - && Objects.equals(this.totalTax, purchaseOrder.totalTax) - && Objects.equals(this.total, purchaseOrder.total) - && Objects.equals(this.totalDiscount, purchaseOrder.totalDiscount) - && Objects.equals(this.hasAttachments, purchaseOrder.hasAttachments) - && Objects.equals(this.updatedDateUTC, purchaseOrder.updatedDateUTC) - && Objects.equals(this.statusAttributeString, purchaseOrder.statusAttributeString) - && Objects.equals(this.validationErrors, purchaseOrder.validationErrors) - && Objects.equals(this.warnings, purchaseOrder.warnings) - && Objects.equals(this.attachments, purchaseOrder.attachments); + return Objects.equals(this.contact, purchaseOrder.contact) && + Objects.equals(this.lineItems, purchaseOrder.lineItems) && + Objects.equals(this.date, purchaseOrder.date) && + Objects.equals(this.deliveryDate, purchaseOrder.deliveryDate) && + Objects.equals(this.lineAmountTypes, purchaseOrder.lineAmountTypes) && + Objects.equals(this.purchaseOrderNumber, purchaseOrder.purchaseOrderNumber) && + Objects.equals(this.reference, purchaseOrder.reference) && + Objects.equals(this.brandingThemeID, purchaseOrder.brandingThemeID) && + Objects.equals(this.currencyCode, purchaseOrder.currencyCode) && + Objects.equals(this.status, purchaseOrder.status) && + Objects.equals(this.sentToContact, purchaseOrder.sentToContact) && + Objects.equals(this.deliveryAddress, purchaseOrder.deliveryAddress) && + Objects.equals(this.attentionTo, purchaseOrder.attentionTo) && + Objects.equals(this.telephone, purchaseOrder.telephone) && + Objects.equals(this.deliveryInstructions, purchaseOrder.deliveryInstructions) && + Objects.equals(this.expectedArrivalDate, purchaseOrder.expectedArrivalDate) && + Objects.equals(this.purchaseOrderID, purchaseOrder.purchaseOrderID) && + Objects.equals(this.currencyRate, purchaseOrder.currencyRate) && + Objects.equals(this.subTotal, purchaseOrder.subTotal) && + Objects.equals(this.totalTax, purchaseOrder.totalTax) && + Objects.equals(this.total, purchaseOrder.total) && + Objects.equals(this.totalDiscount, purchaseOrder.totalDiscount) && + Objects.equals(this.hasAttachments, purchaseOrder.hasAttachments) && + Objects.equals(this.updatedDateUTC, purchaseOrder.updatedDateUTC) && + Objects.equals(this.statusAttributeString, purchaseOrder.statusAttributeString) && + Objects.equals(this.validationErrors, purchaseOrder.validationErrors) && + Objects.equals(this.warnings, purchaseOrder.warnings) && + Objects.equals(this.attachments, purchaseOrder.attachments); } @Override public int hashCode() { - return Objects.hash( - contact, - lineItems, - date, - deliveryDate, - lineAmountTypes, - purchaseOrderNumber, - reference, - brandingThemeID, - currencyCode, - status, - sentToContact, - deliveryAddress, - attentionTo, - telephone, - deliveryInstructions, - expectedArrivalDate, - purchaseOrderID, - currencyRate, - subTotal, - totalTax, - total, - totalDiscount, - hasAttachments, - updatedDateUTC, - statusAttributeString, - validationErrors, - warnings, - attachments); + return Objects.hash(contact, lineItems, date, deliveryDate, lineAmountTypes, purchaseOrderNumber, reference, brandingThemeID, currencyCode, status, sentToContact, deliveryAddress, attentionTo, telephone, deliveryInstructions, expectedArrivalDate, purchaseOrderID, currencyRate, subTotal, totalTax, total, totalDiscount, hasAttachments, updatedDateUTC, statusAttributeString, validationErrors, warnings, attachments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1300,9 +1175,7 @@ public String toString() { sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" deliveryDate: ").append(toIndentedString(deliveryDate)).append("\n"); sb.append(" lineAmountTypes: ").append(toIndentedString(lineAmountTypes)).append("\n"); - sb.append(" purchaseOrderNumber: ") - .append(toIndentedString(purchaseOrderNumber)) - .append("\n"); + sb.append(" purchaseOrderNumber: ").append(toIndentedString(purchaseOrderNumber)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" brandingThemeID: ").append(toIndentedString(brandingThemeID)).append("\n"); sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).append("\n"); @@ -1311,12 +1184,8 @@ public String toString() { sb.append(" deliveryAddress: ").append(toIndentedString(deliveryAddress)).append("\n"); sb.append(" attentionTo: ").append(toIndentedString(attentionTo)).append("\n"); sb.append(" telephone: ").append(toIndentedString(telephone)).append("\n"); - sb.append(" deliveryInstructions: ") - .append(toIndentedString(deliveryInstructions)) - .append("\n"); - sb.append(" expectedArrivalDate: ") - .append(toIndentedString(expectedArrivalDate)) - .append("\n"); + sb.append(" deliveryInstructions: ").append(toIndentedString(deliveryInstructions)).append("\n"); + sb.append(" expectedArrivalDate: ").append(toIndentedString(expectedArrivalDate)).append("\n"); sb.append(" purchaseOrderID: ").append(toIndentedString(purchaseOrderID)).append("\n"); sb.append(" currencyRate: ").append(toIndentedString(currencyRate)).append("\n"); sb.append(" subTotal: ").append(toIndentedString(subTotal)).append("\n"); @@ -1325,9 +1194,7 @@ public String toString() { sb.append(" totalDiscount: ").append(toIndentedString(totalDiscount)).append("\n"); sb.append(" hasAttachments: ").append(toIndentedString(hasAttachments)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); @@ -1336,7 +1203,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1344,4 +1212,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/PurchaseOrders.java b/src/main/java/com/xero/models/accounting/PurchaseOrders.java index ddcc12bf3..7d96b9d2c 100644 --- a/src/main/java/com/xero/models/accounting/PurchaseOrders.java +++ b/src/main/java/com/xero/models/accounting/PurchaseOrders.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Pagination; +import com.xero.models.accounting.PurchaseOrder; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PurchaseOrders + */ -/** PurchaseOrders */ public class PurchaseOrders { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class PurchaseOrders { @JsonProperty("PurchaseOrders") private List purchaseOrders = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return PurchaseOrders - */ + * pagination + * @param pagination Pagination + * @return PurchaseOrders + **/ public PurchaseOrders pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return PurchaseOrders - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return PurchaseOrders + **/ public PurchaseOrders warnings(List warnings) { this.warnings = warnings; return this; @@ -78,10 +94,9 @@ public PurchaseOrders warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return PurchaseOrders - */ + **/ public PurchaseOrders addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -90,36 +105,33 @@ public PurchaseOrders addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * purchaseOrders - * - * @param purchaseOrders List<PurchaseOrder> - * @return PurchaseOrders - */ + * purchaseOrders + * @param purchaseOrders List<PurchaseOrder> + * @return PurchaseOrders + **/ public PurchaseOrders purchaseOrders(List purchaseOrders) { this.purchaseOrders = purchaseOrders; return this; @@ -127,10 +139,9 @@ public PurchaseOrders purchaseOrders(List purchaseOrders) { /** * purchaseOrders - * - * @param purchaseOrdersItem PurchaseOrder + * @param purchaseOrdersItem PurchaseOrder * @return PurchaseOrders - */ + **/ public PurchaseOrders addPurchaseOrdersItem(PurchaseOrder purchaseOrdersItem) { if (this.purchaseOrders == null) { this.purchaseOrders = new ArrayList(); @@ -139,30 +150,29 @@ public PurchaseOrders addPurchaseOrdersItem(PurchaseOrder purchaseOrdersItem) { return this; } - /** + /** * Get purchaseOrders - * * @return purchaseOrders - */ + **/ @ApiModelProperty(value = "") - /** + /** * purchaseOrders - * * @return purchaseOrders List - */ + **/ public List getPurchaseOrders() { return purchaseOrders; } - /** - * purchaseOrders - * - * @param purchaseOrders List<PurchaseOrder> - */ + /** + * purchaseOrders + * @param purchaseOrders List<PurchaseOrder> + **/ + public void setPurchaseOrders(List purchaseOrders) { this.purchaseOrders = purchaseOrders; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -172,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } PurchaseOrders purchaseOrders = (PurchaseOrders) o; - return Objects.equals(this.pagination, purchaseOrders.pagination) - && Objects.equals(this.warnings, purchaseOrders.warnings) - && Objects.equals(this.purchaseOrders, purchaseOrders.purchaseOrders); + return Objects.equals(this.pagination, purchaseOrders.pagination) && + Objects.equals(this.warnings, purchaseOrders.warnings) && + Objects.equals(this.purchaseOrders, purchaseOrders.purchaseOrders); } @Override @@ -182,6 +192,7 @@ public int hashCode() { return Objects.hash(pagination, warnings, purchaseOrders); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Quote.java b/src/main/java/com/xero/models/accounting/Quote.java index dff65a47a..417fd31a3 100644 --- a/src/main/java/com/xero/models/accounting/Quote.java +++ b/src/main/java/com/xero/models/accounting/Quote.java @@ -9,22 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.QuoteLineAmountTypes; +import com.xero.models.accounting.QuoteStatusCodes; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Quote + */ -/** Quote */ public class Quote { StringUtil util = new StringUtil(); @@ -100,187 +118,170 @@ public class Quote { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * QuoteID GUID is automatically generated and is returned after create or GET. - * - * @param quoteID UUID - * @return Quote - */ + * QuoteID GUID is automatically generated and is returned after create or GET. + * @param quoteID UUID + * @return Quote + **/ public Quote quoteID(UUID quoteID) { this.quoteID = quoteID; return this; } - /** + /** * QuoteID GUID is automatically generated and is returned after create or GET. - * * @return quoteID - */ - @ApiModelProperty( - value = "QuoteID GUID is automatically generated and is returned after create or GET.") - /** + **/ + @ApiModelProperty(value = "QuoteID GUID is automatically generated and is returned after create or GET.") + /** * QuoteID GUID is automatically generated and is returned after create or GET. - * * @return quoteID UUID - */ + **/ public UUID getQuoteID() { return quoteID; } - /** - * QuoteID GUID is automatically generated and is returned after create or GET. - * - * @param quoteID UUID - */ + /** + * QuoteID GUID is automatically generated and is returned after create or GET. + * @param quoteID UUID + **/ + public void setQuoteID(UUID quoteID) { this.quoteID = quoteID; } /** - * Unique alpha numeric code identifying a quote (Max Length = 255) - * - * @param quoteNumber String - * @return Quote - */ + * Unique alpha numeric code identifying a quote (Max Length = 255) + * @param quoteNumber String + * @return Quote + **/ public Quote quoteNumber(String quoteNumber) { this.quoteNumber = quoteNumber; return this; } - /** + /** * Unique alpha numeric code identifying a quote (Max Length = 255) - * * @return quoteNumber - */ + **/ @ApiModelProperty(value = "Unique alpha numeric code identifying a quote (Max Length = 255)") - /** + /** * Unique alpha numeric code identifying a quote (Max Length = 255) - * * @return quoteNumber String - */ + **/ public String getQuoteNumber() { return quoteNumber; } - /** - * Unique alpha numeric code identifying a quote (Max Length = 255) - * - * @param quoteNumber String - */ + /** + * Unique alpha numeric code identifying a quote (Max Length = 255) + * @param quoteNumber String + **/ + public void setQuoteNumber(String quoteNumber) { this.quoteNumber = quoteNumber; } /** - * Additional reference number - * - * @param reference String - * @return Quote - */ + * Additional reference number + * @param reference String + * @return Quote + **/ public Quote reference(String reference) { this.reference = reference; return this; } - /** + /** * Additional reference number - * * @return reference - */ + **/ @ApiModelProperty(value = "Additional reference number") - /** + /** * Additional reference number - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Additional reference number - * - * @param reference String - */ + /** + * Additional reference number + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * Terms of the quote - * - * @param terms String - * @return Quote - */ + * Terms of the quote + * @param terms String + * @return Quote + **/ public Quote terms(String terms) { this.terms = terms; return this; } - /** + /** * Terms of the quote - * * @return terms - */ + **/ @ApiModelProperty(value = "Terms of the quote") - /** + /** * Terms of the quote - * * @return terms String - */ + **/ public String getTerms() { return terms; } - /** - * Terms of the quote - * - * @param terms String - */ + /** + * Terms of the quote + * @param terms String + **/ + public void setTerms(String terms) { this.terms = terms; } /** - * contact - * - * @param contact Contact - * @return Quote - */ + * contact + * @param contact Contact + * @return Quote + **/ public Quote contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * See LineItems - * - * @param lineItems List<LineItem> - * @return Quote - */ + * See LineItems + * @param lineItems List<LineItem> + * @return Quote + **/ public Quote lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -288,10 +289,9 @@ public Quote lineItems(List lineItems) { /** * See LineItems - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return Quote - */ + **/ public Quote addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -300,616 +300,548 @@ public Quote addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * See LineItems - * * @return lineItems - */ + **/ @ApiModelProperty(value = "See LineItems") - /** + /** * See LineItems - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See LineItems - * - * @param lineItems List<LineItem> - */ + /** + * See LineItems + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the - * current date based on the timezone setting of the organisation - * - * @param date String - * @return Quote - */ + * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * @param date String + * @return Quote + **/ public Quote date(String date) { this.date = date; return this; } - /** - * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the - * current date based on the timezone setting of the organisation - * + /** + * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation * @return date - */ - @ApiModelProperty( - value = - "Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will" - + " default to the current date based on the timezone setting of the organisation") - /** - * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the - * current date based on the timezone setting of the organisation - * + **/ + @ApiModelProperty(value = "Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation") + /** + * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation * @return date String - */ + **/ public String getDate() { return date; } - /** - * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the - * current date based on the timezone setting of the organisation - * + /** + * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the - * current date based on the timezone setting of the organisation - * - * @param date String - */ + /** + * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the - * current date based on the timezone setting of the organisation - * - * @param date LocalDateTime - */ + /** + * Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Date the quote was issued (YYYY-MM-DD) - * - * @param dateString String - * @return Quote - */ + * Date the quote was issued (YYYY-MM-DD) + * @param dateString String + * @return Quote + **/ public Quote dateString(String dateString) { this.dateString = dateString; return this; } - /** + /** * Date the quote was issued (YYYY-MM-DD) - * * @return dateString - */ + **/ @ApiModelProperty(value = "Date the quote was issued (YYYY-MM-DD)") - /** + /** * Date the quote was issued (YYYY-MM-DD) - * * @return dateString String - */ + **/ public String getDateString() { return dateString; } - /** - * Date the quote was issued (YYYY-MM-DD) - * - * @param dateString String - */ + /** + * Date the quote was issued (YYYY-MM-DD) + * @param dateString String + **/ + public void setDateString(String dateString) { this.dateString = dateString; } /** - * Date the quote expires – YYYY-MM-DD. - * - * @param expiryDate String - * @return Quote - */ + * Date the quote expires – YYYY-MM-DD. + * @param expiryDate String + * @return Quote + **/ public Quote expiryDate(String expiryDate) { this.expiryDate = expiryDate; return this; } - /** + /** * Date the quote expires – YYYY-MM-DD. - * * @return expiryDate - */ + **/ @ApiModelProperty(value = "Date the quote expires – YYYY-MM-DD.") - /** + /** * Date the quote expires – YYYY-MM-DD. - * * @return expiryDate String - */ + **/ public String getExpiryDate() { return expiryDate; } - /** + /** * Date the quote expires – YYYY-MM-DD. - * * @return LocalDate - */ + **/ public LocalDate getExpiryDateAsDate() { if (this.expiryDate != null) { try { return util.convertStringToDate(this.expiryDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date the quote expires – YYYY-MM-DD. - * - * @param expiryDate String - */ + /** + * Date the quote expires – YYYY-MM-DD. + * @param expiryDate String + **/ + public void setExpiryDate(String expiryDate) { this.expiryDate = expiryDate; } - /** - * Date the quote expires – YYYY-MM-DD. - * - * @param expiryDate LocalDateTime - */ + /** + * Date the quote expires – YYYY-MM-DD. + * @param expiryDate LocalDateTime + **/ public void setExpiryDate(LocalDate expiryDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = expiryDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = expiryDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.expiryDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Date the quote expires – YYYY-MM-DD. - * - * @param expiryDateString String - * @return Quote - */ + * Date the quote expires – YYYY-MM-DD. + * @param expiryDateString String + * @return Quote + **/ public Quote expiryDateString(String expiryDateString) { this.expiryDateString = expiryDateString; return this; } - /** + /** * Date the quote expires – YYYY-MM-DD. - * * @return expiryDateString - */ + **/ @ApiModelProperty(value = "Date the quote expires – YYYY-MM-DD.") - /** + /** * Date the quote expires – YYYY-MM-DD. - * * @return expiryDateString String - */ + **/ public String getExpiryDateString() { return expiryDateString; } - /** - * Date the quote expires – YYYY-MM-DD. - * - * @param expiryDateString String - */ + /** + * Date the quote expires – YYYY-MM-DD. + * @param expiryDateString String + **/ + public void setExpiryDateString(String expiryDateString) { this.expiryDateString = expiryDateString; } /** - * status - * - * @param status QuoteStatusCodes - * @return Quote - */ + * status + * @param status QuoteStatusCodes + * @return Quote + **/ public Quote status(QuoteStatusCodes status) { this.status = status; return this; } - /** + /** * Get status - * * @return status - */ + **/ @ApiModelProperty(value = "") - /** + /** * status - * * @return status QuoteStatusCodes - */ + **/ public QuoteStatusCodes getStatus() { return status; } - /** - * status - * - * @param status QuoteStatusCodes - */ + /** + * status + * @param status QuoteStatusCodes + **/ + public void setStatus(QuoteStatusCodes status) { this.status = status; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return Quote - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return Quote + **/ public Quote currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * The currency rate for a multicurrency quote - * - * @param currencyRate Double - * @return Quote - */ + * The currency rate for a multicurrency quote + * @param currencyRate Double + * @return Quote + **/ public Quote currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** + /** * The currency rate for a multicurrency quote - * * @return currencyRate - */ + **/ @ApiModelProperty(value = "The currency rate for a multicurrency quote") - /** + /** * The currency rate for a multicurrency quote - * * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * The currency rate for a multicurrency quote - * - * @param currencyRate Double - */ + /** + * The currency rate for a multicurrency quote + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } - /** + /** * Total of quote excluding taxes. - * * @return subTotal - */ + **/ @ApiModelProperty(value = "Total of quote excluding taxes.") - /** + /** * Total of quote excluding taxes. - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** + /** * Total tax on quote - * * @return totalTax - */ + **/ @ApiModelProperty(value = "Total tax on quote") - /** + /** * Total tax on quote - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t - * equal the sum of the LineAmounts - * + /** + * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts * @return total - */ - @ApiModelProperty( - value = - "Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it" - + " doesn’t equal the sum of the LineAmounts") - /** - * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t - * equal the sum of the LineAmounts - * + **/ + @ApiModelProperty(value = "Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts") + /** + * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts * @return total Double - */ + **/ public Double getTotal() { return total; } - /** + /** * Total of discounts applied on the quote line items - * * @return totalDiscount - */ + **/ @ApiModelProperty(value = "Total of discounts applied on the quote line items") - /** + /** * Total of discounts applied on the quote line items - * * @return totalDiscount Double - */ + **/ public Double getTotalDiscount() { return totalDiscount; } /** - * Title text for the quote - * - * @param title String - * @return Quote - */ + * Title text for the quote + * @param title String + * @return Quote + **/ public Quote title(String title) { this.title = title; return this; } - /** + /** * Title text for the quote - * * @return title - */ + **/ @ApiModelProperty(value = "Title text for the quote") - /** + /** * Title text for the quote - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Title text for the quote - * - * @param title String - */ + /** + * Title text for the quote + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * Summary text for the quote - * - * @param summary String - * @return Quote - */ + * Summary text for the quote + * @param summary String + * @return Quote + **/ public Quote summary(String summary) { this.summary = summary; return this; } - /** + /** * Summary text for the quote - * * @return summary - */ + **/ @ApiModelProperty(value = "Summary text for the quote") - /** + /** * Summary text for the quote - * * @return summary String - */ + **/ public String getSummary() { return summary; } - /** - * Summary text for the quote - * - * @param summary String - */ + /** + * Summary text for the quote + * @param summary String + **/ + public void setSummary(String summary) { this.summary = summary; } /** - * See BrandingThemes - * - * @param brandingThemeID UUID - * @return Quote - */ + * See BrandingThemes + * @param brandingThemeID UUID + * @return Quote + **/ public Quote brandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; return this; } - /** + /** * See BrandingThemes - * * @return brandingThemeID - */ + **/ @ApiModelProperty(value = "See BrandingThemes") - /** + /** * See BrandingThemes - * * @return brandingThemeID UUID - */ + **/ public UUID getBrandingThemeID() { return brandingThemeID; } - /** - * See BrandingThemes - * - * @param brandingThemeID UUID - */ + /** + * See BrandingThemes + * @param brandingThemeID UUID + **/ + public void setBrandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * lineAmountTypes - * - * @param lineAmountTypes QuoteLineAmountTypes - * @return Quote - */ + * lineAmountTypes + * @param lineAmountTypes QuoteLineAmountTypes + * @return Quote + **/ public Quote lineAmountTypes(QuoteLineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes QuoteLineAmountTypes - */ + **/ public QuoteLineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes QuoteLineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes QuoteLineAmountTypes + **/ + public void setLineAmountTypes(QuoteLineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - * @return Quote - */ + * A string to indicate if a invoice status + * @param statusAttributeString String + * @return Quote + **/ public Quote statusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; return this; } - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString - */ + **/ @ApiModelProperty(value = "A string to indicate if a invoice status") - /** + /** * A string to indicate if a invoice status - * * @return statusAttributeString String - */ + **/ public String getStatusAttributeString() { return statusAttributeString; } - /** - * A string to indicate if a invoice status - * - * @param statusAttributeString String - */ + /** + * A string to indicate if a invoice status + * @param statusAttributeString String + **/ + public void setStatusAttributeString(String statusAttributeString) { this.statusAttributeString = statusAttributeString; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Quote - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Quote + **/ public Quote validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -917,10 +849,9 @@ public Quote validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Quote - */ + **/ public Quote addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -929,30 +860,29 @@ public Quote addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -962,61 +892,38 @@ public boolean equals(java.lang.Object o) { return false; } Quote quote = (Quote) o; - return Objects.equals(this.quoteID, quote.quoteID) - && Objects.equals(this.quoteNumber, quote.quoteNumber) - && Objects.equals(this.reference, quote.reference) - && Objects.equals(this.terms, quote.terms) - && Objects.equals(this.contact, quote.contact) - && Objects.equals(this.lineItems, quote.lineItems) - && Objects.equals(this.date, quote.date) - && Objects.equals(this.dateString, quote.dateString) - && Objects.equals(this.expiryDate, quote.expiryDate) - && Objects.equals(this.expiryDateString, quote.expiryDateString) - && Objects.equals(this.status, quote.status) - && Objects.equals(this.currencyCode, quote.currencyCode) - && Objects.equals(this.currencyRate, quote.currencyRate) - && Objects.equals(this.subTotal, quote.subTotal) - && Objects.equals(this.totalTax, quote.totalTax) - && Objects.equals(this.total, quote.total) - && Objects.equals(this.totalDiscount, quote.totalDiscount) - && Objects.equals(this.title, quote.title) - && Objects.equals(this.summary, quote.summary) - && Objects.equals(this.brandingThemeID, quote.brandingThemeID) - && Objects.equals(this.updatedDateUTC, quote.updatedDateUTC) - && Objects.equals(this.lineAmountTypes, quote.lineAmountTypes) - && Objects.equals(this.statusAttributeString, quote.statusAttributeString) - && Objects.equals(this.validationErrors, quote.validationErrors); + return Objects.equals(this.quoteID, quote.quoteID) && + Objects.equals(this.quoteNumber, quote.quoteNumber) && + Objects.equals(this.reference, quote.reference) && + Objects.equals(this.terms, quote.terms) && + Objects.equals(this.contact, quote.contact) && + Objects.equals(this.lineItems, quote.lineItems) && + Objects.equals(this.date, quote.date) && + Objects.equals(this.dateString, quote.dateString) && + Objects.equals(this.expiryDate, quote.expiryDate) && + Objects.equals(this.expiryDateString, quote.expiryDateString) && + Objects.equals(this.status, quote.status) && + Objects.equals(this.currencyCode, quote.currencyCode) && + Objects.equals(this.currencyRate, quote.currencyRate) && + Objects.equals(this.subTotal, quote.subTotal) && + Objects.equals(this.totalTax, quote.totalTax) && + Objects.equals(this.total, quote.total) && + Objects.equals(this.totalDiscount, quote.totalDiscount) && + Objects.equals(this.title, quote.title) && + Objects.equals(this.summary, quote.summary) && + Objects.equals(this.brandingThemeID, quote.brandingThemeID) && + Objects.equals(this.updatedDateUTC, quote.updatedDateUTC) && + Objects.equals(this.lineAmountTypes, quote.lineAmountTypes) && + Objects.equals(this.statusAttributeString, quote.statusAttributeString) && + Objects.equals(this.validationErrors, quote.validationErrors); } @Override public int hashCode() { - return Objects.hash( - quoteID, - quoteNumber, - reference, - terms, - contact, - lineItems, - date, - dateString, - expiryDate, - expiryDateString, - status, - currencyCode, - currencyRate, - subTotal, - totalTax, - total, - totalDiscount, - title, - summary, - brandingThemeID, - updatedDateUTC, - lineAmountTypes, - statusAttributeString, - validationErrors); + return Objects.hash(quoteID, quoteNumber, reference, terms, contact, lineItems, date, dateString, expiryDate, expiryDateString, status, currencyCode, currencyRate, subTotal, totalTax, total, totalDiscount, title, summary, brandingThemeID, updatedDateUTC, lineAmountTypes, statusAttributeString, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1043,16 +950,15 @@ public String toString() { sb.append(" brandingThemeID: ").append(toIndentedString(brandingThemeID)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" lineAmountTypes: ").append(toIndentedString(lineAmountTypes)).append("\n"); - sb.append(" statusAttributeString: ") - .append(toIndentedString(statusAttributeString)) - .append("\n"); + sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1060,4 +966,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/QuoteLineAmountTypes.java b/src/main/java/com/xero/models/accounting/QuoteLineAmountTypes.java index 13efc8e24..5d0616425 100644 --- a/src/main/java/com/xero/models/accounting/QuoteLineAmountTypes.java +++ b/src/main/java/com/xero/models/accounting/QuoteLineAmountTypes.java @@ -9,25 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount - * Types + * Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types */ public enum QuoteLineAmountTypes { - - /** EXCLUSIVE */ + + /** + * EXCLUSIVE + */ EXCLUSIVE("EXCLUSIVE"), - - /** INCLUSIVE */ + + /** + * INCLUSIVE + */ INCLUSIVE("INCLUSIVE"), - - /** NOTAX */ + + /** + * NOTAX + */ NOTAX("NOTAX"); private String value; @@ -36,26 +51,24 @@ public enum QuoteLineAmountTypes { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static QuoteLineAmountTypes fromValue(String value) { @@ -67,3 +80,4 @@ public static QuoteLineAmountTypes fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/QuoteStatusCodes.java b/src/main/java/com/xero/models/accounting/QuoteStatusCodes.java index 97a2731f3..bae4c9f2f 100644 --- a/src/main/java/com/xero/models/accounting/QuoteStatusCodes.java +++ b/src/main/java/com/xero/models/accounting/QuoteStatusCodes.java @@ -9,31 +9,55 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The status of the quote. */ +/** + * The status of the quote. + */ public enum QuoteStatusCodes { - - /** DRAFT */ + + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** SENT */ + + /** + * SENT + */ SENT("SENT"), - - /** DECLINED */ + + /** + * DECLINED + */ DECLINED("DECLINED"), - - /** ACCEPTED */ + + /** + * ACCEPTED + */ ACCEPTED("ACCEPTED"), - - /** INVOICED */ + + /** + * INVOICED + */ INVOICED("INVOICED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -42,26 +66,24 @@ public enum QuoteStatusCodes { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static QuoteStatusCodes fromValue(String value) { @@ -73,3 +95,4 @@ public static QuoteStatusCodes fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/Quotes.java b/src/main/java/com/xero/models/accounting/Quotes.java index e210bab44..f607956d4 100644 --- a/src/main/java/com/xero/models/accounting/Quotes.java +++ b/src/main/java/com/xero/models/accounting/Quotes.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Quote; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Quotes + */ -/** Quotes */ public class Quotes { StringUtil util = new StringUtil(); @JsonProperty("Quotes") private List quotes = new ArrayList(); /** - * quotes - * - * @param quotes List<Quote> - * @return Quotes - */ + * quotes + * @param quotes List<Quote> + * @return Quotes + **/ public Quotes quotes(List quotes) { this.quotes = quotes; return this; @@ -37,10 +54,9 @@ public Quotes quotes(List quotes) { /** * quotes - * - * @param quotesItem Quote + * @param quotesItem Quote * @return Quotes - */ + **/ public Quotes addQuotesItem(Quote quotesItem) { if (this.quotes == null) { this.quotes = new ArrayList(); @@ -49,30 +65,29 @@ public Quotes addQuotesItem(Quote quotesItem) { return this; } - /** + /** * Get quotes - * * @return quotes - */ + **/ @ApiModelProperty(value = "") - /** + /** * quotes - * * @return quotes List - */ + **/ public List getQuotes() { return quotes; } - /** - * quotes - * - * @param quotes List<Quote> - */ + /** + * quotes + * @param quotes List<Quote> + **/ + public void setQuotes(List quotes) { this.quotes = quotes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(quotes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Receipt.java b/src/main/java/com/xero/models/accounting/Receipt.java index 8275cbd43..f1f382060 100644 --- a/src/main/java/com/xero/models/accounting/Receipt.java +++ b/src/main/java/com/xero/models/accounting/Receipt.java @@ -9,24 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.User; +import com.xero.models.accounting.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Receipt + */ -/** Receipt */ public class Receipt { StringUtil util = new StringUtil(); @@ -59,21 +75,33 @@ public class Receipt { @JsonProperty("ReceiptID") private UUID receiptID; - /** Current status of receipt – see status types */ + /** + * Current status of receipt – see status types + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** SUBMITTED */ + + /** + * SUBMITTED + */ SUBMITTED("SUBMITTED"), - - /** AUTHORISED */ + + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** DECLINED */ + + /** + * DECLINED + */ DECLINED("DECLINED"), - - /** VOIDED */ + + /** + * VOIDED + */ VOIDED("VOIDED"); private String value; @@ -82,31 +110,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -118,6 +140,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -142,109 +165,100 @@ public static StatusEnum fromValue(String value) { @JsonProperty("Attachments") private List attachments = new ArrayList(); /** - * Date of receipt – YYYY-MM-DD - * - * @param date String - * @return Receipt - */ + * Date of receipt – YYYY-MM-DD + * @param date String + * @return Receipt + **/ public Receipt date(String date) { this.date = date; return this; } - /** + /** * Date of receipt – YYYY-MM-DD - * * @return date - */ + **/ @ApiModelProperty(value = "Date of receipt – YYYY-MM-DD") - /** + /** * Date of receipt – YYYY-MM-DD - * * @return date String - */ + **/ public String getDate() { return date; } - /** + /** * Date of receipt – YYYY-MM-DD - * * @return LocalDate - */ + **/ public LocalDate getDateAsDate() { if (this.date != null) { try { return util.convertStringToDate(this.date); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date of receipt – YYYY-MM-DD - * - * @param date String - */ + /** + * Date of receipt – YYYY-MM-DD + * @param date String + **/ + public void setDate(String date) { this.date = date; } - /** - * Date of receipt – YYYY-MM-DD - * - * @param date LocalDateTime - */ + /** + * Date of receipt – YYYY-MM-DD + * @param date LocalDateTime + **/ public void setDate(LocalDate date) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = date.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * contact - * - * @param contact Contact - * @return Receipt - */ + * contact + * @param contact Contact + * @return Receipt + **/ public Receipt contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * lineItems - * - * @param lineItems List<LineItem> - * @return Receipt - */ + * lineItems + * @param lineItems List<LineItem> + * @return Receipt + **/ public Receipt lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -252,10 +266,9 @@ public Receipt lineItems(List lineItems) { /** * lineItems - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return Receipt - */ + **/ public Receipt addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -264,393 +277,355 @@ public Receipt addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * Get lineItems - * * @return lineItems - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineItems - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * lineItems - * - * @param lineItems List<LineItem> - */ + /** + * lineItems + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * user - * - * @param user User - * @return Receipt - */ + * user + * @param user User + * @return Receipt + **/ public Receipt user(User user) { this.user = user; return this; } - /** + /** * Get user - * * @return user - */ + **/ @ApiModelProperty(value = "") - /** + /** * user - * * @return user User - */ + **/ public User getUser() { return user; } - /** - * user - * - * @param user User - */ + /** + * user + * @param user User + **/ + public void setUser(User user) { this.user = user; } /** - * Additional reference number - * - * @param reference String - * @return Receipt - */ + * Additional reference number + * @param reference String + * @return Receipt + **/ public Receipt reference(String reference) { this.reference = reference; return this; } - /** + /** * Additional reference number - * * @return reference - */ + **/ @ApiModelProperty(value = "Additional reference number") - /** + /** * Additional reference number - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Additional reference number - * - * @param reference String - */ + /** + * Additional reference number + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return Receipt - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return Receipt + **/ public Receipt lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * Total of receipt excluding taxes - * - * @param subTotal Double - * @return Receipt - */ + * Total of receipt excluding taxes + * @param subTotal Double + * @return Receipt + **/ public Receipt subTotal(Double subTotal) { this.subTotal = subTotal; return this; } - /** + /** * Total of receipt excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "Total of receipt excluding taxes") - /** + /** * Total of receipt excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** - * Total of receipt excluding taxes - * - * @param subTotal Double - */ + /** + * Total of receipt excluding taxes + * @param subTotal Double + **/ + public void setSubTotal(Double subTotal) { this.subTotal = subTotal; } /** - * Total tax on receipt - * - * @param totalTax Double - * @return Receipt - */ + * Total tax on receipt + * @param totalTax Double + * @return Receipt + **/ public Receipt totalTax(Double totalTax) { this.totalTax = totalTax; return this; } - /** + /** * Total tax on receipt - * * @return totalTax - */ + **/ @ApiModelProperty(value = "Total tax on receipt") - /** + /** * Total tax on receipt - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * Total tax on receipt - * - * @param totalTax Double - */ + /** + * Total tax on receipt + * @param totalTax Double + **/ + public void setTotalTax(Double totalTax) { this.totalTax = totalTax; } /** - * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - * - * @param total Double - * @return Receipt - */ + * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) + * @param total Double + * @return Receipt + **/ public Receipt total(Double total) { this.total = total; return this; } - /** + /** * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - * * @return total - */ + **/ @ApiModelProperty(value = "Total of receipt tax inclusive (i.e. SubTotal + TotalTax)") - /** + /** * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - * - * @param total Double - */ + /** + * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Xero generated unique identifier for receipt - * - * @param receiptID UUID - * @return Receipt - */ + * Xero generated unique identifier for receipt + * @param receiptID UUID + * @return Receipt + **/ public Receipt receiptID(UUID receiptID) { this.receiptID = receiptID; return this; } - /** + /** * Xero generated unique identifier for receipt - * * @return receiptID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier for receipt") - /** + /** * Xero generated unique identifier for receipt - * * @return receiptID UUID - */ + **/ public UUID getReceiptID() { return receiptID; } - /** - * Xero generated unique identifier for receipt - * - * @param receiptID UUID - */ + /** + * Xero generated unique identifier for receipt + * @param receiptID UUID + **/ + public void setReceiptID(UUID receiptID) { this.receiptID = receiptID; } /** - * Current status of receipt – see status types - * - * @param status StatusEnum - * @return Receipt - */ + * Current status of receipt – see status types + * @param status StatusEnum + * @return Receipt + **/ public Receipt status(StatusEnum status) { this.status = status; return this; } - /** + /** * Current status of receipt – see status types - * * @return status - */ + **/ @ApiModelProperty(value = "Current status of receipt – see status types") - /** + /** * Current status of receipt – see status types - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Current status of receipt – see status types - * - * @param status StatusEnum - */ + /** + * Current status of receipt – see status types + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } - /** + /** * Xero generated sequence number for receipt in current claim for a given user - * * @return receiptNumber - */ - @ApiModelProperty( - value = "Xero generated sequence number for receipt in current claim for a given user") - /** + **/ + @ApiModelProperty(value = "Xero generated sequence number for receipt in current claim for a given user") + /** * Xero generated sequence number for receipt in current claim for a given user - * * @return receiptNumber String - */ + **/ public String getReceiptNumber() { return receiptNumber; } - /** + /** * Last modified date UTC format - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified date UTC format - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** + /** * boolean to indicate if a receipt has an attachment - * * @return hasAttachments - */ + **/ @ApiModelProperty(example = "false", value = "boolean to indicate if a receipt has an attachment") - /** + /** * boolean to indicate if a receipt has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } - /** + /** * URL link to a source document – shown as “Go to [appName]” in the Xero app - * * @return url - */ - @ApiModelProperty( - value = "URL link to a source document – shown as “Go to [appName]” in the Xero app") - /** + **/ + @ApiModelProperty(value = "URL link to a source document – shown as “Go to [appName]” in the Xero app") + /** * URL link to a source document – shown as “Go to [appName]” in the Xero app - * * @return url String - */ + **/ public String getUrl() { return url; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Receipt - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Receipt + **/ public Receipt validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -658,10 +633,9 @@ public Receipt validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Receipt - */ + **/ public Receipt addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -670,36 +644,33 @@ public Receipt addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - * @return Receipt - */ + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + * @return Receipt + **/ public Receipt warnings(List warnings) { this.warnings = warnings; return this; @@ -707,10 +678,9 @@ public Receipt warnings(List warnings) { /** * Displays array of warning messages from the API - * - * @param warningsItem ValidationError + * @param warningsItem ValidationError * @return Receipt - */ + **/ public Receipt addWarningsItem(ValidationError warningsItem) { if (this.warnings == null) { this.warnings = new ArrayList(); @@ -719,36 +689,33 @@ public Receipt addWarningsItem(ValidationError warningsItem) { return this; } - /** + /** * Displays array of warning messages from the API - * * @return warnings - */ + **/ @ApiModelProperty(value = "Displays array of warning messages from the API") - /** + /** * Displays array of warning messages from the API - * * @return warnings List - */ + **/ public List getWarnings() { return warnings; } - /** - * Displays array of warning messages from the API - * - * @param warnings List<ValidationError> - */ + /** + * Displays array of warning messages from the API + * @param warnings List<ValidationError> + **/ + public void setWarnings(List warnings) { this.warnings = warnings; } /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - * @return Receipt - */ + * Displays array of attachments from the API + * @param attachments List<Attachment> + * @return Receipt + **/ public Receipt attachments(List attachments) { this.attachments = attachments; return this; @@ -756,10 +723,9 @@ public Receipt attachments(List attachments) { /** * Displays array of attachments from the API - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return Receipt - */ + **/ public Receipt addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -768,30 +734,29 @@ public Receipt addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * Displays array of attachments from the API - * * @return attachments - */ + **/ @ApiModelProperty(value = "Displays array of attachments from the API") - /** + /** * Displays array of attachments from the API - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - */ + /** + * Displays array of attachments from the API + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -801,49 +766,32 @@ public boolean equals(java.lang.Object o) { return false; } Receipt receipt = (Receipt) o; - return Objects.equals(this.date, receipt.date) - && Objects.equals(this.contact, receipt.contact) - && Objects.equals(this.lineItems, receipt.lineItems) - && Objects.equals(this.user, receipt.user) - && Objects.equals(this.reference, receipt.reference) - && Objects.equals(this.lineAmountTypes, receipt.lineAmountTypes) - && Objects.equals(this.subTotal, receipt.subTotal) - && Objects.equals(this.totalTax, receipt.totalTax) - && Objects.equals(this.total, receipt.total) - && Objects.equals(this.receiptID, receipt.receiptID) - && Objects.equals(this.status, receipt.status) - && Objects.equals(this.receiptNumber, receipt.receiptNumber) - && Objects.equals(this.updatedDateUTC, receipt.updatedDateUTC) - && Objects.equals(this.hasAttachments, receipt.hasAttachments) - && Objects.equals(this.url, receipt.url) - && Objects.equals(this.validationErrors, receipt.validationErrors) - && Objects.equals(this.warnings, receipt.warnings) - && Objects.equals(this.attachments, receipt.attachments); + return Objects.equals(this.date, receipt.date) && + Objects.equals(this.contact, receipt.contact) && + Objects.equals(this.lineItems, receipt.lineItems) && + Objects.equals(this.user, receipt.user) && + Objects.equals(this.reference, receipt.reference) && + Objects.equals(this.lineAmountTypes, receipt.lineAmountTypes) && + Objects.equals(this.subTotal, receipt.subTotal) && + Objects.equals(this.totalTax, receipt.totalTax) && + Objects.equals(this.total, receipt.total) && + Objects.equals(this.receiptID, receipt.receiptID) && + Objects.equals(this.status, receipt.status) && + Objects.equals(this.receiptNumber, receipt.receiptNumber) && + Objects.equals(this.updatedDateUTC, receipt.updatedDateUTC) && + Objects.equals(this.hasAttachments, receipt.hasAttachments) && + Objects.equals(this.url, receipt.url) && + Objects.equals(this.validationErrors, receipt.validationErrors) && + Objects.equals(this.warnings, receipt.warnings) && + Objects.equals(this.attachments, receipt.attachments); } @Override public int hashCode() { - return Objects.hash( - date, - contact, - lineItems, - user, - reference, - lineAmountTypes, - subTotal, - totalTax, - total, - receiptID, - status, - receiptNumber, - updatedDateUTC, - hasAttachments, - url, - validationErrors, - warnings, - attachments); + return Objects.hash(date, contact, lineItems, user, reference, lineAmountTypes, subTotal, totalTax, total, receiptID, status, receiptNumber, updatedDateUTC, hasAttachments, url, validationErrors, warnings, attachments); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -871,7 +819,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -879,4 +828,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Receipts.java b/src/main/java/com/xero/models/accounting/Receipts.java index 155f8a932..fb7eddcc7 100644 --- a/src/main/java/com/xero/models/accounting/Receipts.java +++ b/src/main/java/com/xero/models/accounting/Receipts.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Receipt; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Receipts + */ -/** Receipts */ public class Receipts { StringUtil util = new StringUtil(); @JsonProperty("Receipts") private List receipts = new ArrayList(); /** - * receipts - * - * @param receipts List<Receipt> - * @return Receipts - */ + * receipts + * @param receipts List<Receipt> + * @return Receipts + **/ public Receipts receipts(List receipts) { this.receipts = receipts; return this; @@ -37,10 +54,9 @@ public Receipts receipts(List receipts) { /** * receipts - * - * @param receiptsItem Receipt + * @param receiptsItem Receipt * @return Receipts - */ + **/ public Receipts addReceiptsItem(Receipt receiptsItem) { if (this.receipts == null) { this.receipts = new ArrayList(); @@ -49,30 +65,29 @@ public Receipts addReceiptsItem(Receipt receiptsItem) { return this; } - /** + /** * Get receipts - * * @return receipts - */ + **/ @ApiModelProperty(value = "") - /** + /** * receipts - * * @return receipts List - */ + **/ public List getReceipts() { return receipts; } - /** - * receipts - * - * @param receipts List<Receipt> - */ + /** + * receipts + * @param receipts List<Receipt> + **/ + public void setReceipts(List receipts) { this.receipts = receipts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(receipts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/RepeatingInvoice.java b/src/main/java/com/xero/models/accounting/RepeatingInvoice.java index 9d9994acc..c6de431c9 100644 --- a/src/main/java/com/xero/models/accounting/RepeatingInvoice.java +++ b/src/main/java/com/xero/models/accounting/RepeatingInvoice.java @@ -9,27 +9,54 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.Attachment; +import com.xero.models.accounting.Contact; +import com.xero.models.accounting.CurrencyCode; +import com.xero.models.accounting.LineAmountTypes; +import com.xero.models.accounting.LineItem; +import com.xero.models.accounting.Schedule; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * RepeatingInvoice + */ -/** RepeatingInvoice */ public class RepeatingInvoice { StringUtil util = new StringUtil(); - /** See Invoice Types */ + /** + * See Invoice Types + */ public enum TypeEnum { - /** ACCPAY */ + /** + * ACCPAY + */ ACCPAY("ACCPAY"), - - /** ACCREC */ + + /** + * ACCREC + */ ACCREC("ACCREC"); private String value; @@ -38,31 +65,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -74,6 +95,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -97,15 +119,23 @@ public static TypeEnum fromValue(String value) { @JsonProperty("CurrencyCode") private CurrencyCode currencyCode; - /** One of the following - DRAFT or AUTHORISED – See Invoice Status Codes */ + /** + * One of the following - DRAFT or AUTHORISED – See Invoice Status Codes + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** AUTHORISED */ + + /** + * AUTHORISED + */ AUTHORISED("AUTHORISED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -114,31 +144,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -150,6 +174,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @@ -186,116 +211,106 @@ public static StatusEnum fromValue(String value) { @JsonProperty("IncludePDF") private Boolean includePDF = false; /** - * See Invoice Types - * - * @param type TypeEnum - * @return RepeatingInvoice - */ + * See Invoice Types + * @param type TypeEnum + * @return RepeatingInvoice + **/ public RepeatingInvoice type(TypeEnum type) { this.type = type; return this; } - /** + /** * See Invoice Types - * * @return type - */ + **/ @ApiModelProperty(value = "See Invoice Types") - /** + /** * See Invoice Types - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * See Invoice Types - * - * @param type TypeEnum - */ + /** + * See Invoice Types + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * contact - * - * @param contact Contact - * @return RepeatingInvoice - */ + * contact + * @param contact Contact + * @return RepeatingInvoice + **/ public RepeatingInvoice contact(Contact contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact Contact - */ + **/ public Contact getContact() { return contact; } - /** - * contact - * - * @param contact Contact - */ + /** + * contact + * @param contact Contact + **/ + public void setContact(Contact contact) { this.contact = contact; } /** - * schedule - * - * @param schedule Schedule - * @return RepeatingInvoice - */ + * schedule + * @param schedule Schedule + * @return RepeatingInvoice + **/ public RepeatingInvoice schedule(Schedule schedule) { this.schedule = schedule; return this; } - /** + /** * Get schedule - * * @return schedule - */ + **/ @ApiModelProperty(value = "") - /** + /** * schedule - * * @return schedule Schedule - */ + **/ public Schedule getSchedule() { return schedule; } - /** - * schedule - * - * @param schedule Schedule - */ + /** + * schedule + * @param schedule Schedule + **/ + public void setSchedule(Schedule schedule) { this.schedule = schedule; } /** - * See LineItems - * - * @param lineItems List<LineItem> - * @return RepeatingInvoice - */ + * See LineItems + * @param lineItems List<LineItem> + * @return RepeatingInvoice + **/ public RepeatingInvoice lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -303,10 +318,9 @@ public RepeatingInvoice lineItems(List lineItems) { /** * See LineItems - * - * @param lineItemsItem LineItem + * @param lineItemsItem LineItem * @return RepeatingInvoice - */ + **/ public RepeatingInvoice addLineItemsItem(LineItem lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -315,403 +329,366 @@ public RepeatingInvoice addLineItemsItem(LineItem lineItemsItem) { return this; } - /** + /** * See LineItems - * * @return lineItems - */ + **/ @ApiModelProperty(value = "See LineItems") - /** + /** * See LineItems - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * See LineItems - * - * @param lineItems List<LineItem> - */ + /** + * See LineItems + * @param lineItems List<LineItem> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - * @return RepeatingInvoice - */ + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + * @return RepeatingInvoice + **/ public RepeatingInvoice lineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; return this; } - /** + /** * Get lineAmountTypes - * * @return lineAmountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * lineAmountTypes - * * @return lineAmountTypes LineAmountTypes - */ + **/ public LineAmountTypes getLineAmountTypes() { return lineAmountTypes; } - /** - * lineAmountTypes - * - * @param lineAmountTypes LineAmountTypes - */ + /** + * lineAmountTypes + * @param lineAmountTypes LineAmountTypes + **/ + public void setLineAmountTypes(LineAmountTypes lineAmountTypes) { this.lineAmountTypes = lineAmountTypes; } /** - * ACCREC only – additional reference number - * - * @param reference String - * @return RepeatingInvoice - */ + * ACCREC only – additional reference number + * @param reference String + * @return RepeatingInvoice + **/ public RepeatingInvoice reference(String reference) { this.reference = reference; return this; } - /** + /** * ACCREC only – additional reference number - * * @return reference - */ + **/ @ApiModelProperty(value = "ACCREC only – additional reference number") - /** + /** * ACCREC only – additional reference number - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * ACCREC only – additional reference number - * - * @param reference String - */ + /** + * ACCREC only – additional reference number + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * See BrandingThemes - * - * @param brandingThemeID UUID - * @return RepeatingInvoice - */ + * See BrandingThemes + * @param brandingThemeID UUID + * @return RepeatingInvoice + **/ public RepeatingInvoice brandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; return this; } - /** + /** * See BrandingThemes - * * @return brandingThemeID - */ + **/ @ApiModelProperty(value = "See BrandingThemes") - /** + /** * See BrandingThemes - * * @return brandingThemeID UUID - */ + **/ public UUID getBrandingThemeID() { return brandingThemeID; } - /** - * See BrandingThemes - * - * @param brandingThemeID UUID - */ + /** + * See BrandingThemes + * @param brandingThemeID UUID + **/ + public void setBrandingThemeID(UUID brandingThemeID) { this.brandingThemeID = brandingThemeID; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return RepeatingInvoice - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return RepeatingInvoice + **/ public RepeatingInvoice currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * One of the following - DRAFT or AUTHORISED – See Invoice Status Codes - * - * @param status StatusEnum - * @return RepeatingInvoice - */ + * One of the following - DRAFT or AUTHORISED – See Invoice Status Codes + * @param status StatusEnum + * @return RepeatingInvoice + **/ public RepeatingInvoice status(StatusEnum status) { this.status = status; return this; } - /** + /** * One of the following - DRAFT or AUTHORISED – See Invoice Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "One of the following - DRAFT or AUTHORISED – See Invoice Status Codes") - /** + /** * One of the following - DRAFT or AUTHORISED – See Invoice Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * One of the following - DRAFT or AUTHORISED – See Invoice Status Codes - * - * @param status StatusEnum - */ + /** + * One of the following - DRAFT or AUTHORISED – See Invoice Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Total of invoice excluding taxes - * - * @param subTotal Double - * @return RepeatingInvoice - */ + * Total of invoice excluding taxes + * @param subTotal Double + * @return RepeatingInvoice + **/ public RepeatingInvoice subTotal(Double subTotal) { this.subTotal = subTotal; return this; } - /** + /** * Total of invoice excluding taxes - * * @return subTotal - */ + **/ @ApiModelProperty(value = "Total of invoice excluding taxes") - /** + /** * Total of invoice excluding taxes - * * @return subTotal Double - */ + **/ public Double getSubTotal() { return subTotal; } - /** - * Total of invoice excluding taxes - * - * @param subTotal Double - */ + /** + * Total of invoice excluding taxes + * @param subTotal Double + **/ + public void setSubTotal(Double subTotal) { this.subTotal = subTotal; } /** - * Total tax on invoice - * - * @param totalTax Double - * @return RepeatingInvoice - */ + * Total tax on invoice + * @param totalTax Double + * @return RepeatingInvoice + **/ public RepeatingInvoice totalTax(Double totalTax) { this.totalTax = totalTax; return this; } - /** + /** * Total tax on invoice - * * @return totalTax - */ + **/ @ApiModelProperty(value = "Total tax on invoice") - /** + /** * Total tax on invoice - * * @return totalTax Double - */ + **/ public Double getTotalTax() { return totalTax; } - /** - * Total tax on invoice - * - * @param totalTax Double - */ + /** + * Total tax on invoice + * @param totalTax Double + **/ + public void setTotalTax(Double totalTax) { this.totalTax = totalTax; } /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - * - * @param total Double - * @return RepeatingInvoice - */ + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) + * @param total Double + * @return RepeatingInvoice + **/ public RepeatingInvoice total(Double total) { this.total = total; return this; } - /** + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - * * @return total - */ + **/ @ApiModelProperty(value = "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax)") - /** + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - * - * @param total Double - */ + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Xero generated unique identifier for repeating invoice template - * - * @param repeatingInvoiceID UUID - * @return RepeatingInvoice - */ + * Xero generated unique identifier for repeating invoice template + * @param repeatingInvoiceID UUID + * @return RepeatingInvoice + **/ public RepeatingInvoice repeatingInvoiceID(UUID repeatingInvoiceID) { this.repeatingInvoiceID = repeatingInvoiceID; return this; } - /** + /** * Xero generated unique identifier for repeating invoice template - * * @return repeatingInvoiceID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier for repeating invoice template") - /** + /** * Xero generated unique identifier for repeating invoice template - * * @return repeatingInvoiceID UUID - */ + **/ public UUID getRepeatingInvoiceID() { return repeatingInvoiceID; } - /** - * Xero generated unique identifier for repeating invoice template - * - * @param repeatingInvoiceID UUID - */ + /** + * Xero generated unique identifier for repeating invoice template + * @param repeatingInvoiceID UUID + **/ + public void setRepeatingInvoiceID(UUID repeatingInvoiceID) { this.repeatingInvoiceID = repeatingInvoiceID; } /** - * Xero generated unique identifier for repeating invoice template - * - * @param ID UUID - * @return RepeatingInvoice - */ + * Xero generated unique identifier for repeating invoice template + * @param ID UUID + * @return RepeatingInvoice + **/ public RepeatingInvoice ID(UUID ID) { this.ID = ID; return this; } - /** + /** * Xero generated unique identifier for repeating invoice template - * * @return ID - */ + **/ @ApiModelProperty(value = "Xero generated unique identifier for repeating invoice template") - /** + /** * Xero generated unique identifier for repeating invoice template - * * @return ID UUID - */ + **/ public UUID getID() { return ID; } - /** - * Xero generated unique identifier for repeating invoice template - * - * @param ID UUID - */ + /** + * Xero generated unique identifier for repeating invoice template + * @param ID UUID + **/ + public void setID(UUID ID) { this.ID = ID; } - /** + /** * Boolean to indicate if an invoice has an attachment - * * @return hasAttachments - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate if an invoice has an attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate if an invoice has an attachment") + /** * Boolean to indicate if an invoice has an attachment - * * @return hasAttachments Boolean - */ + **/ public Boolean getHasAttachments() { return hasAttachments; } /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - * @return RepeatingInvoice - */ + * Displays array of attachments from the API + * @param attachments List<Attachment> + * @return RepeatingInvoice + **/ public RepeatingInvoice attachments(List attachments) { this.attachments = attachments; return this; @@ -719,10 +696,9 @@ public RepeatingInvoice attachments(List attachments) { /** * Displays array of attachments from the API - * - * @param attachmentsItem Attachment + * @param attachmentsItem Attachment * @return RepeatingInvoice - */ + **/ public RepeatingInvoice addAttachmentsItem(Attachment attachmentsItem) { if (this.attachments == null) { this.attachments = new ArrayList(); @@ -731,178 +707,157 @@ public RepeatingInvoice addAttachmentsItem(Attachment attachmentsItem) { return this; } - /** + /** * Displays array of attachments from the API - * * @return attachments - */ + **/ @ApiModelProperty(value = "Displays array of attachments from the API") - /** + /** * Displays array of attachments from the API - * * @return attachments List - */ + **/ public List getAttachments() { return attachments; } - /** - * Displays array of attachments from the API - * - * @param attachments List<Attachment> - */ + /** + * Displays array of attachments from the API + * @param attachments List<Attachment> + **/ + public void setAttachments(List attachments) { this.attachments = attachments; } /** - * Boolean to indicate whether the invoice has been approved for sending - * - * @param approvedForSending Boolean - * @return RepeatingInvoice - */ + * Boolean to indicate whether the invoice has been approved for sending + * @param approvedForSending Boolean + * @return RepeatingInvoice + **/ public RepeatingInvoice approvedForSending(Boolean approvedForSending) { this.approvedForSending = approvedForSending; return this; } - /** + /** * Boolean to indicate whether the invoice has been approved for sending - * * @return approvedForSending - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate whether the invoice has been approved for sending") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate whether the invoice has been approved for sending") + /** * Boolean to indicate whether the invoice has been approved for sending - * * @return approvedForSending Boolean - */ + **/ public Boolean getApprovedForSending() { return approvedForSending; } - /** - * Boolean to indicate whether the invoice has been approved for sending - * - * @param approvedForSending Boolean - */ + /** + * Boolean to indicate whether the invoice has been approved for sending + * @param approvedForSending Boolean + **/ + public void setApprovedForSending(Boolean approvedForSending) { this.approvedForSending = approvedForSending; } /** - * Boolean to indicate whether a copy is sent to sender's email - * - * @param sendCopy Boolean - * @return RepeatingInvoice - */ + * Boolean to indicate whether a copy is sent to sender's email + * @param sendCopy Boolean + * @return RepeatingInvoice + **/ public RepeatingInvoice sendCopy(Boolean sendCopy) { this.sendCopy = sendCopy; return this; } - /** + /** * Boolean to indicate whether a copy is sent to sender's email - * * @return sendCopy - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate whether a copy is sent to sender's email") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate whether a copy is sent to sender's email") + /** * Boolean to indicate whether a copy is sent to sender's email - * * @return sendCopy Boolean - */ + **/ public Boolean getSendCopy() { return sendCopy; } - /** - * Boolean to indicate whether a copy is sent to sender's email - * - * @param sendCopy Boolean - */ + /** + * Boolean to indicate whether a copy is sent to sender's email + * @param sendCopy Boolean + **/ + public void setSendCopy(Boolean sendCopy) { this.sendCopy = sendCopy; } /** - * Boolean to indicate whether the invoice in the Xero app displays as \"sent\" - * - * @param markAsSent Boolean - * @return RepeatingInvoice - */ + * Boolean to indicate whether the invoice in the Xero app displays as \"sent\" + * @param markAsSent Boolean + * @return RepeatingInvoice + **/ public RepeatingInvoice markAsSent(Boolean markAsSent) { this.markAsSent = markAsSent; return this; } - /** + /** * Boolean to indicate whether the invoice in the Xero app displays as \"sent\" - * * @return markAsSent - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate whether the invoice in the Xero app displays as \"sent\"") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate whether the invoice in the Xero app displays as \"sent\"") + /** * Boolean to indicate whether the invoice in the Xero app displays as \"sent\" - * * @return markAsSent Boolean - */ + **/ public Boolean getMarkAsSent() { return markAsSent; } - /** - * Boolean to indicate whether the invoice in the Xero app displays as \"sent\" - * - * @param markAsSent Boolean - */ + /** + * Boolean to indicate whether the invoice in the Xero app displays as \"sent\" + * @param markAsSent Boolean + **/ + public void setMarkAsSent(Boolean markAsSent) { this.markAsSent = markAsSent; } /** - * Boolean to indicate whether to include PDF attachment - * - * @param includePDF Boolean - * @return RepeatingInvoice - */ + * Boolean to indicate whether to include PDF attachment + * @param includePDF Boolean + * @return RepeatingInvoice + **/ public RepeatingInvoice includePDF(Boolean includePDF) { this.includePDF = includePDF; return this; } - /** + /** * Boolean to indicate whether to include PDF attachment - * * @return includePDF - */ - @ApiModelProperty( - example = "false", - value = "Boolean to indicate whether to include PDF attachment") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to indicate whether to include PDF attachment") + /** * Boolean to indicate whether to include PDF attachment - * * @return includePDF Boolean - */ + **/ public Boolean getIncludePDF() { return includePDF; } - /** - * Boolean to indicate whether to include PDF attachment - * - * @param includePDF Boolean - */ + /** + * Boolean to indicate whether to include PDF attachment + * @param includePDF Boolean + **/ + public void setIncludePDF(Boolean includePDF) { this.includePDF = includePDF; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -912,53 +867,34 @@ public boolean equals(java.lang.Object o) { return false; } RepeatingInvoice repeatingInvoice = (RepeatingInvoice) o; - return Objects.equals(this.type, repeatingInvoice.type) - && Objects.equals(this.contact, repeatingInvoice.contact) - && Objects.equals(this.schedule, repeatingInvoice.schedule) - && Objects.equals(this.lineItems, repeatingInvoice.lineItems) - && Objects.equals(this.lineAmountTypes, repeatingInvoice.lineAmountTypes) - && Objects.equals(this.reference, repeatingInvoice.reference) - && Objects.equals(this.brandingThemeID, repeatingInvoice.brandingThemeID) - && Objects.equals(this.currencyCode, repeatingInvoice.currencyCode) - && Objects.equals(this.status, repeatingInvoice.status) - && Objects.equals(this.subTotal, repeatingInvoice.subTotal) - && Objects.equals(this.totalTax, repeatingInvoice.totalTax) - && Objects.equals(this.total, repeatingInvoice.total) - && Objects.equals(this.repeatingInvoiceID, repeatingInvoice.repeatingInvoiceID) - && Objects.equals(this.ID, repeatingInvoice.ID) - && Objects.equals(this.hasAttachments, repeatingInvoice.hasAttachments) - && Objects.equals(this.attachments, repeatingInvoice.attachments) - && Objects.equals(this.approvedForSending, repeatingInvoice.approvedForSending) - && Objects.equals(this.sendCopy, repeatingInvoice.sendCopy) - && Objects.equals(this.markAsSent, repeatingInvoice.markAsSent) - && Objects.equals(this.includePDF, repeatingInvoice.includePDF); + return Objects.equals(this.type, repeatingInvoice.type) && + Objects.equals(this.contact, repeatingInvoice.contact) && + Objects.equals(this.schedule, repeatingInvoice.schedule) && + Objects.equals(this.lineItems, repeatingInvoice.lineItems) && + Objects.equals(this.lineAmountTypes, repeatingInvoice.lineAmountTypes) && + Objects.equals(this.reference, repeatingInvoice.reference) && + Objects.equals(this.brandingThemeID, repeatingInvoice.brandingThemeID) && + Objects.equals(this.currencyCode, repeatingInvoice.currencyCode) && + Objects.equals(this.status, repeatingInvoice.status) && + Objects.equals(this.subTotal, repeatingInvoice.subTotal) && + Objects.equals(this.totalTax, repeatingInvoice.totalTax) && + Objects.equals(this.total, repeatingInvoice.total) && + Objects.equals(this.repeatingInvoiceID, repeatingInvoice.repeatingInvoiceID) && + Objects.equals(this.ID, repeatingInvoice.ID) && + Objects.equals(this.hasAttachments, repeatingInvoice.hasAttachments) && + Objects.equals(this.attachments, repeatingInvoice.attachments) && + Objects.equals(this.approvedForSending, repeatingInvoice.approvedForSending) && + Objects.equals(this.sendCopy, repeatingInvoice.sendCopy) && + Objects.equals(this.markAsSent, repeatingInvoice.markAsSent) && + Objects.equals(this.includePDF, repeatingInvoice.includePDF); } @Override public int hashCode() { - return Objects.hash( - type, - contact, - schedule, - lineItems, - lineAmountTypes, - reference, - brandingThemeID, - currencyCode, - status, - subTotal, - totalTax, - total, - repeatingInvoiceID, - ID, - hasAttachments, - attachments, - approvedForSending, - sendCopy, - markAsSent, - includePDF); + return Objects.hash(type, contact, schedule, lineItems, lineAmountTypes, reference, brandingThemeID, currencyCode, status, subTotal, totalTax, total, repeatingInvoiceID, ID, hasAttachments, attachments, approvedForSending, sendCopy, markAsSent, includePDF); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -988,7 +924,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -996,4 +933,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/RepeatingInvoices.java b/src/main/java/com/xero/models/accounting/RepeatingInvoices.java index e07303794..5cd3027e5 100644 --- a/src/main/java/com/xero/models/accounting/RepeatingInvoices.java +++ b/src/main/java/com/xero/models/accounting/RepeatingInvoices.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.RepeatingInvoice; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * RepeatingInvoices + */ -/** RepeatingInvoices */ public class RepeatingInvoices { StringUtil util = new StringUtil(); @JsonProperty("RepeatingInvoices") private List repeatingInvoices = new ArrayList(); /** - * repeatingInvoices - * - * @param repeatingInvoices List<RepeatingInvoice> - * @return RepeatingInvoices - */ + * repeatingInvoices + * @param repeatingInvoices List<RepeatingInvoice> + * @return RepeatingInvoices + **/ public RepeatingInvoices repeatingInvoices(List repeatingInvoices) { this.repeatingInvoices = repeatingInvoices; return this; @@ -37,10 +54,9 @@ public RepeatingInvoices repeatingInvoices(List repeatingInvoi /** * repeatingInvoices - * - * @param repeatingInvoicesItem RepeatingInvoice + * @param repeatingInvoicesItem RepeatingInvoice * @return RepeatingInvoices - */ + **/ public RepeatingInvoices addRepeatingInvoicesItem(RepeatingInvoice repeatingInvoicesItem) { if (this.repeatingInvoices == null) { this.repeatingInvoices = new ArrayList(); @@ -49,30 +65,29 @@ public RepeatingInvoices addRepeatingInvoicesItem(RepeatingInvoice repeatingInvo return this; } - /** + /** * Get repeatingInvoices - * * @return repeatingInvoices - */ + **/ @ApiModelProperty(value = "") - /** + /** * repeatingInvoices - * * @return repeatingInvoices List - */ + **/ public List getRepeatingInvoices() { return repeatingInvoices; } - /** - * repeatingInvoices - * - * @param repeatingInvoices List<RepeatingInvoice> - */ + /** + * repeatingInvoices + * @param repeatingInvoices List<RepeatingInvoice> + **/ + public void setRepeatingInvoices(List repeatingInvoices) { this.repeatingInvoices = repeatingInvoices; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(repeatingInvoices); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Report.java b/src/main/java/com/xero/models/accounting/Report.java index 09623b7c3..a95ad2b32 100644 --- a/src/main/java/com/xero/models/accounting/Report.java +++ b/src/main/java/com/xero/models/accounting/Report.java @@ -9,28 +9,46 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.TenNinetyNineContact; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Report + */ -/** Report */ public class Report { StringUtil util = new StringUtil(); @JsonProperty("ReportName") private String reportName; - /** See Prepayment Types */ + /** + * See Prepayment Types + */ public enum ReportTypeEnum { - /** AGEDPAYABLESBYCONTACT */ + /** + * AGEDPAYABLESBYCONTACT + */ AGEDPAYABLESBYCONTACT("AgedPayablesByContact"); private String value; @@ -39,31 +57,25 @@ public enum ReportTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static ReportTypeEnum fromValue(String value) { for (ReportTypeEnum b : ReportTypeEnum.values()) { @@ -75,6 +87,7 @@ public static ReportTypeEnum fromValue(String value) { } } + @JsonProperty("ReportType") private ReportTypeEnum reportType; @@ -90,181 +103,165 @@ public static ReportTypeEnum fromValue(String value) { @JsonProperty("Contacts") private List contacts = new ArrayList(); /** - * See Prepayment Types - * - * @param reportName String - * @return Report - */ + * See Prepayment Types + * @param reportName String + * @return Report + **/ public Report reportName(String reportName) { this.reportName = reportName; return this; } - /** + /** * See Prepayment Types - * * @return reportName - */ + **/ @ApiModelProperty(value = "See Prepayment Types") - /** + /** * See Prepayment Types - * * @return reportName String - */ + **/ public String getReportName() { return reportName; } - /** - * See Prepayment Types - * - * @param reportName String - */ + /** + * See Prepayment Types + * @param reportName String + **/ + public void setReportName(String reportName) { this.reportName = reportName; } /** - * See Prepayment Types - * - * @param reportType ReportTypeEnum - * @return Report - */ + * See Prepayment Types + * @param reportType ReportTypeEnum + * @return Report + **/ public Report reportType(ReportTypeEnum reportType) { this.reportType = reportType; return this; } - /** + /** * See Prepayment Types - * * @return reportType - */ + **/ @ApiModelProperty(value = "See Prepayment Types") - /** + /** * See Prepayment Types - * * @return reportType ReportTypeEnum - */ + **/ public ReportTypeEnum getReportType() { return reportType; } - /** - * See Prepayment Types - * - * @param reportType ReportTypeEnum - */ + /** + * See Prepayment Types + * @param reportType ReportTypeEnum + **/ + public void setReportType(ReportTypeEnum reportType) { this.reportType = reportType; } /** - * See Prepayment Types - * - * @param reportTitle String - * @return Report - */ + * See Prepayment Types + * @param reportTitle String + * @return Report + **/ public Report reportTitle(String reportTitle) { this.reportTitle = reportTitle; return this; } - /** + /** * See Prepayment Types - * * @return reportTitle - */ + **/ @ApiModelProperty(value = "See Prepayment Types") - /** + /** * See Prepayment Types - * * @return reportTitle String - */ + **/ public String getReportTitle() { return reportTitle; } - /** - * See Prepayment Types - * - * @param reportTitle String - */ + /** + * See Prepayment Types + * @param reportTitle String + **/ + public void setReportTitle(String reportTitle) { this.reportTitle = reportTitle; } /** - * Date of report - * - * @param reportDate String - * @return Report - */ + * Date of report + * @param reportDate String + * @return Report + **/ public Report reportDate(String reportDate) { this.reportDate = reportDate; return this; } - /** + /** * Date of report - * * @return reportDate - */ + **/ @ApiModelProperty(value = "Date of report") - /** + /** * Date of report - * * @return reportDate String - */ + **/ public String getReportDate() { return reportDate; } - /** - * Date of report - * - * @param reportDate String - */ + /** + * Date of report + * @param reportDate String + **/ + public void setReportDate(String reportDate) { this.reportDate = reportDate; } - /** + /** * Updated Date - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Updated Date") - /** + /** * Updated Date - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Updated Date - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * contacts - * - * @param contacts List<TenNinetyNineContact> - * @return Report - */ + * contacts + * @param contacts List<TenNinetyNineContact> + * @return Report + **/ public Report contacts(List contacts) { this.contacts = contacts; return this; @@ -272,10 +269,9 @@ public Report contacts(List contacts) { /** * contacts - * - * @param contactsItem TenNinetyNineContact + * @param contactsItem TenNinetyNineContact * @return Report - */ + **/ public Report addContactsItem(TenNinetyNineContact contactsItem) { if (this.contacts == null) { this.contacts = new ArrayList(); @@ -284,30 +280,29 @@ public Report addContactsItem(TenNinetyNineContact contactsItem) { return this; } - /** + /** * Get contacts - * * @return contacts - */ + **/ @ApiModelProperty(value = "") - /** + /** * contacts - * * @return contacts List - */ + **/ public List getContacts() { return contacts; } - /** - * contacts - * - * @param contacts List<TenNinetyNineContact> - */ + /** + * contacts + * @param contacts List<TenNinetyNineContact> + **/ + public void setContacts(List contacts) { this.contacts = contacts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -317,12 +312,12 @@ public boolean equals(java.lang.Object o) { return false; } Report report = (Report) o; - return Objects.equals(this.reportName, report.reportName) - && Objects.equals(this.reportType, report.reportType) - && Objects.equals(this.reportTitle, report.reportTitle) - && Objects.equals(this.reportDate, report.reportDate) - && Objects.equals(this.updatedDateUTC, report.updatedDateUTC) - && Objects.equals(this.contacts, report.contacts); + return Objects.equals(this.reportName, report.reportName) && + Objects.equals(this.reportType, report.reportType) && + Objects.equals(this.reportTitle, report.reportTitle) && + Objects.equals(this.reportDate, report.reportDate) && + Objects.equals(this.updatedDateUTC, report.updatedDateUTC) && + Objects.equals(this.contacts, report.contacts); } @Override @@ -330,6 +325,7 @@ public int hashCode() { return Objects.hash(reportName, reportType, reportTitle, reportDate, updatedDateUTC, contacts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -345,7 +341,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -353,4 +350,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ReportAttribute.java b/src/main/java/com/xero/models/accounting/ReportAttribute.java index 483044b7e..374f7077b 100644 --- a/src/main/java/com/xero/models/accounting/ReportAttribute.java +++ b/src/main/java/com/xero/models/accounting/ReportAttribute.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportAttribute + */ -/** ReportAttribute */ public class ReportAttribute { StringUtil util = new StringUtil(); @@ -26,75 +43,70 @@ public class ReportAttribute { @JsonProperty("Value") private String value; /** - * id - * - * @param id String - * @return ReportAttribute - */ + * id + * @param id String + * @return ReportAttribute + **/ public ReportAttribute id(String id) { this.id = id; return this; } - /** + /** * Get id - * * @return id - */ + **/ @ApiModelProperty(value = "") - /** + /** * id - * * @return id String - */ + **/ public String getId() { return id; } - /** - * id - * - * @param id String - */ + /** + * id + * @param id String + **/ + public void setId(String id) { this.id = id; } /** - * value - * - * @param value String - * @return ReportAttribute - */ + * value + * @param value String + * @return ReportAttribute + **/ public ReportAttribute value(String value) { this.value = value; return this; } - /** + /** * Get value - * * @return value - */ + **/ @ApiModelProperty(value = "") - /** + /** * value - * * @return value String - */ + **/ public String getValue() { return value; } - /** - * value - * - * @param value String - */ + /** + * value + * @param value String + **/ + public void setValue(String value) { this.value = value; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } ReportAttribute reportAttribute = (ReportAttribute) o; - return Objects.equals(this.id, reportAttribute.id) - && Objects.equals(this.value, reportAttribute.value); + return Objects.equals(this.id, reportAttribute.id) && + Objects.equals(this.value, reportAttribute.value); } @Override @@ -113,6 +125,7 @@ public int hashCode() { return Objects.hash(id, value); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ReportCell.java b/src/main/java/com/xero/models/accounting/ReportCell.java index 7713f6d13..59f3fdecc 100644 --- a/src/main/java/com/xero/models/accounting/ReportCell.java +++ b/src/main/java/com/xero/models/accounting/ReportCell.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ReportAttribute; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportCell + */ -/** ReportCell */ public class ReportCell { StringUtil util = new StringUtil(); @@ -28,46 +46,42 @@ public class ReportCell { @JsonProperty("Attributes") private List attributes = new ArrayList(); /** - * value - * - * @param value String - * @return ReportCell - */ + * value + * @param value String + * @return ReportCell + **/ public ReportCell value(String value) { this.value = value; return this; } - /** + /** * Get value - * * @return value - */ + **/ @ApiModelProperty(value = "") - /** + /** * value - * * @return value String - */ + **/ public String getValue() { return value; } - /** - * value - * - * @param value String - */ + /** + * value + * @param value String + **/ + public void setValue(String value) { this.value = value; } /** - * attributes - * - * @param attributes List<ReportAttribute> - * @return ReportCell - */ + * attributes + * @param attributes List<ReportAttribute> + * @return ReportCell + **/ public ReportCell attributes(List attributes) { this.attributes = attributes; return this; @@ -75,10 +89,9 @@ public ReportCell attributes(List attributes) { /** * attributes - * - * @param attributesItem ReportAttribute + * @param attributesItem ReportAttribute * @return ReportCell - */ + **/ public ReportCell addAttributesItem(ReportAttribute attributesItem) { if (this.attributes == null) { this.attributes = new ArrayList(); @@ -87,30 +100,29 @@ public ReportCell addAttributesItem(ReportAttribute attributesItem) { return this; } - /** + /** * Get attributes - * * @return attributes - */ + **/ @ApiModelProperty(value = "") - /** + /** * attributes - * * @return attributes List - */ + **/ public List getAttributes() { return attributes; } - /** - * attributes - * - * @param attributes List<ReportAttribute> - */ + /** + * attributes + * @param attributes List<ReportAttribute> + **/ + public void setAttributes(List attributes) { this.attributes = attributes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +132,8 @@ public boolean equals(java.lang.Object o) { return false; } ReportCell reportCell = (ReportCell) o; - return Objects.equals(this.value, reportCell.value) - && Objects.equals(this.attributes, reportCell.attributes); + return Objects.equals(this.value, reportCell.value) && + Objects.equals(this.attributes, reportCell.attributes); } @Override @@ -129,6 +141,7 @@ public int hashCode() { return Objects.hash(value, attributes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +153,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +162,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ReportFields.java b/src/main/java/com/xero/models/accounting/ReportFields.java index ecb338189..9c96fc681 100644 --- a/src/main/java/com/xero/models/accounting/ReportFields.java +++ b/src/main/java/com/xero/models/accounting/ReportFields.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportFields + */ -/** ReportFields */ public class ReportFields { StringUtil util = new StringUtil(); @@ -29,110 +46,102 @@ public class ReportFields { @JsonProperty("Value") private String value; /** - * fieldID - * - * @param fieldID String - * @return ReportFields - */ + * fieldID + * @param fieldID String + * @return ReportFields + **/ public ReportFields fieldID(String fieldID) { this.fieldID = fieldID; return this; } - /** + /** * Get fieldID - * * @return fieldID - */ + **/ @ApiModelProperty(value = "") - /** + /** * fieldID - * * @return fieldID String - */ + **/ public String getFieldID() { return fieldID; } - /** - * fieldID - * - * @param fieldID String - */ + /** + * fieldID + * @param fieldID String + **/ + public void setFieldID(String fieldID) { this.fieldID = fieldID; } /** - * description - * - * @param description String - * @return ReportFields - */ + * description + * @param description String + * @return ReportFields + **/ public ReportFields description(String description) { this.description = description; return this; } - /** + /** * Get description - * * @return description - */ + **/ @ApiModelProperty(value = "") - /** + /** * description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * description - * - * @param description String - */ + /** + * description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * value - * - * @param value String - * @return ReportFields - */ + * value + * @param value String + * @return ReportFields + **/ public ReportFields value(String value) { this.value = value; return this; } - /** + /** * Get value - * * @return value - */ + **/ @ApiModelProperty(value = "") - /** + /** * value - * * @return value String - */ + **/ public String getValue() { return value; } - /** - * value - * - * @param value String - */ + /** + * value + * @param value String + **/ + public void setValue(String value) { this.value = value; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +151,9 @@ public boolean equals(java.lang.Object o) { return false; } ReportFields reportFields = (ReportFields) o; - return Objects.equals(this.fieldID, reportFields.fieldID) - && Objects.equals(this.description, reportFields.description) - && Objects.equals(this.value, reportFields.value); + return Objects.equals(this.fieldID, reportFields.fieldID) && + Objects.equals(this.description, reportFields.description) && + Objects.equals(this.value, reportFields.value); } @Override @@ -152,6 +161,7 @@ public int hashCode() { return Objects.hash(fieldID, description, value); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +174,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +183,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ReportRow.java b/src/main/java/com/xero/models/accounting/ReportRow.java index 0053e686d..f9d9c775f 100644 --- a/src/main/java/com/xero/models/accounting/ReportRow.java +++ b/src/main/java/com/xero/models/accounting/ReportRow.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ReportCell; +import com.xero.models.accounting.RowType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportRow + */ -/** ReportRow */ public class ReportRow { StringUtil util = new StringUtil(); @@ -31,81 +50,74 @@ public class ReportRow { @JsonProperty("Cells") private List cells = new ArrayList(); /** - * rowType - * - * @param rowType RowType - * @return ReportRow - */ + * rowType + * @param rowType RowType + * @return ReportRow + **/ public ReportRow rowType(RowType rowType) { this.rowType = rowType; return this; } - /** + /** * Get rowType - * * @return rowType - */ + **/ @ApiModelProperty(value = "") - /** + /** * rowType - * * @return rowType RowType - */ + **/ public RowType getRowType() { return rowType; } - /** - * rowType - * - * @param rowType RowType - */ + /** + * rowType + * @param rowType RowType + **/ + public void setRowType(RowType rowType) { this.rowType = rowType; } /** - * title - * - * @param title String - * @return ReportRow - */ + * title + * @param title String + * @return ReportRow + **/ public ReportRow title(String title) { this.title = title; return this; } - /** + /** * Get title - * * @return title - */ + **/ @ApiModelProperty(value = "") - /** + /** * title - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * title - * - * @param title String - */ + /** + * title + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * cells - * - * @param cells List<ReportCell> - * @return ReportRow - */ + * cells + * @param cells List<ReportCell> + * @return ReportRow + **/ public ReportRow cells(List cells) { this.cells = cells; return this; @@ -113,10 +125,9 @@ public ReportRow cells(List cells) { /** * cells - * - * @param cellsItem ReportCell + * @param cellsItem ReportCell * @return ReportRow - */ + **/ public ReportRow addCellsItem(ReportCell cellsItem) { if (this.cells == null) { this.cells = new ArrayList(); @@ -125,30 +136,29 @@ public ReportRow addCellsItem(ReportCell cellsItem) { return this; } - /** + /** * Get cells - * * @return cells - */ + **/ @ApiModelProperty(value = "") - /** + /** * cells - * * @return cells List - */ + **/ public List getCells() { return cells; } - /** - * cells - * - * @param cells List<ReportCell> - */ + /** + * cells + * @param cells List<ReportCell> + **/ + public void setCells(List cells) { this.cells = cells; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +168,9 @@ public boolean equals(java.lang.Object o) { return false; } ReportRow reportRow = (ReportRow) o; - return Objects.equals(this.rowType, reportRow.rowType) - && Objects.equals(this.title, reportRow.title) - && Objects.equals(this.cells, reportRow.cells); + return Objects.equals(this.rowType, reportRow.rowType) && + Objects.equals(this.title, reportRow.title) && + Objects.equals(this.cells, reportRow.cells); } @Override @@ -168,6 +178,7 @@ public int hashCode() { return Objects.hash(rowType, title, cells); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +191,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +200,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ReportRows.java b/src/main/java/com/xero/models/accounting/ReportRows.java index 2c91f50da..d7205a437 100644 --- a/src/main/java/com/xero/models/accounting/ReportRows.java +++ b/src/main/java/com/xero/models/accounting/ReportRows.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ReportCell; +import com.xero.models.accounting.ReportRow; +import com.xero.models.accounting.RowType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportRows + */ -/** ReportRows */ public class ReportRows { StringUtil util = new StringUtil(); @@ -34,81 +54,74 @@ public class ReportRows { @JsonProperty("Rows") private List rows = new ArrayList(); /** - * rowType - * - * @param rowType RowType - * @return ReportRows - */ + * rowType + * @param rowType RowType + * @return ReportRows + **/ public ReportRows rowType(RowType rowType) { this.rowType = rowType; return this; } - /** + /** * Get rowType - * * @return rowType - */ + **/ @ApiModelProperty(value = "") - /** + /** * rowType - * * @return rowType RowType - */ + **/ public RowType getRowType() { return rowType; } - /** - * rowType - * - * @param rowType RowType - */ + /** + * rowType + * @param rowType RowType + **/ + public void setRowType(RowType rowType) { this.rowType = rowType; } /** - * title - * - * @param title String - * @return ReportRows - */ + * title + * @param title String + * @return ReportRows + **/ public ReportRows title(String title) { this.title = title; return this; } - /** + /** * Get title - * * @return title - */ + **/ @ApiModelProperty(value = "") - /** + /** * title - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * title - * - * @param title String - */ + /** + * title + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * cells - * - * @param cells List<ReportCell> - * @return ReportRows - */ + * cells + * @param cells List<ReportCell> + * @return ReportRows + **/ public ReportRows cells(List cells) { this.cells = cells; return this; @@ -116,10 +129,9 @@ public ReportRows cells(List cells) { /** * cells - * - * @param cellsItem ReportCell + * @param cellsItem ReportCell * @return ReportRows - */ + **/ public ReportRows addCellsItem(ReportCell cellsItem) { if (this.cells == null) { this.cells = new ArrayList(); @@ -128,36 +140,33 @@ public ReportRows addCellsItem(ReportCell cellsItem) { return this; } - /** + /** * Get cells - * * @return cells - */ + **/ @ApiModelProperty(value = "") - /** + /** * cells - * * @return cells List - */ + **/ public List getCells() { return cells; } - /** - * cells - * - * @param cells List<ReportCell> - */ + /** + * cells + * @param cells List<ReportCell> + **/ + public void setCells(List cells) { this.cells = cells; } /** - * rows - * - * @param rows List<ReportRow> - * @return ReportRows - */ + * rows + * @param rows List<ReportRow> + * @return ReportRows + **/ public ReportRows rows(List rows) { this.rows = rows; return this; @@ -165,10 +174,9 @@ public ReportRows rows(List rows) { /** * rows - * - * @param rowsItem ReportRow + * @param rowsItem ReportRow * @return ReportRows - */ + **/ public ReportRows addRowsItem(ReportRow rowsItem) { if (this.rows == null) { this.rows = new ArrayList(); @@ -177,30 +185,29 @@ public ReportRows addRowsItem(ReportRow rowsItem) { return this; } - /** + /** * Get rows - * * @return rows - */ + **/ @ApiModelProperty(value = "") - /** + /** * rows - * * @return rows List - */ + **/ public List getRows() { return rows; } - /** - * rows - * - * @param rows List<ReportRow> - */ + /** + * rows + * @param rows List<ReportRow> + **/ + public void setRows(List rows) { this.rows = rows; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -210,10 +217,10 @@ public boolean equals(java.lang.Object o) { return false; } ReportRows reportRows = (ReportRows) o; - return Objects.equals(this.rowType, reportRows.rowType) - && Objects.equals(this.title, reportRows.title) - && Objects.equals(this.cells, reportRows.cells) - && Objects.equals(this.rows, reportRows.rows); + return Objects.equals(this.rowType, reportRows.rowType) && + Objects.equals(this.title, reportRows.title) && + Objects.equals(this.cells, reportRows.cells) && + Objects.equals(this.rows, reportRows.rows); } @Override @@ -221,6 +228,7 @@ public int hashCode() { return Objects.hash(rowType, title, cells, rows); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -234,7 +242,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -242,4 +251,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ReportWithRow.java b/src/main/java/com/xero/models/accounting/ReportWithRow.java index ae5521fe5..14a2077cf 100644 --- a/src/main/java/com/xero/models/accounting/ReportWithRow.java +++ b/src/main/java/com/xero/models/accounting/ReportWithRow.java @@ -9,18 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ReportFields; +import com.xero.models.accounting.ReportRows; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportWithRow + */ -/** ReportWithRow */ public class ReportWithRow { StringUtil util = new StringUtil(); @@ -51,164 +68,148 @@ public class ReportWithRow { @JsonProperty("Fields") private List fields = new ArrayList(); /** - * ID of the Report - * - * @param reportID String - * @return ReportWithRow - */ + * ID of the Report + * @param reportID String + * @return ReportWithRow + **/ public ReportWithRow reportID(String reportID) { this.reportID = reportID; return this; } - /** + /** * ID of the Report - * * @return reportID - */ + **/ @ApiModelProperty(value = "ID of the Report") - /** + /** * ID of the Report - * * @return reportID String - */ + **/ public String getReportID() { return reportID; } - /** - * ID of the Report - * - * @param reportID String - */ + /** + * ID of the Report + * @param reportID String + **/ + public void setReportID(String reportID) { this.reportID = reportID; } /** - * Name of the report - * - * @param reportName String - * @return ReportWithRow - */ + * Name of the report + * @param reportName String + * @return ReportWithRow + **/ public ReportWithRow reportName(String reportName) { this.reportName = reportName; return this; } - /** + /** * Name of the report - * * @return reportName - */ + **/ @ApiModelProperty(value = "Name of the report") - /** + /** * Name of the report - * * @return reportName String - */ + **/ public String getReportName() { return reportName; } - /** - * Name of the report - * - * @param reportName String - */ + /** + * Name of the report + * @param reportName String + **/ + public void setReportName(String reportName) { this.reportName = reportName; } /** - * Title of the report - * - * @param reportTitle String - * @return ReportWithRow - */ + * Title of the report + * @param reportTitle String + * @return ReportWithRow + **/ public ReportWithRow reportTitle(String reportTitle) { this.reportTitle = reportTitle; return this; } - /** + /** * Title of the report - * * @return reportTitle - */ + **/ @ApiModelProperty(value = "Title of the report") - /** + /** * Title of the report - * * @return reportTitle String - */ + **/ public String getReportTitle() { return reportTitle; } - /** - * Title of the report - * - * @param reportTitle String - */ + /** + * Title of the report + * @param reportTitle String + **/ + public void setReportTitle(String reportTitle) { this.reportTitle = reportTitle; } /** - * The type of report (BalanceSheet,ProfitLoss, etc) - * - * @param reportType String - * @return ReportWithRow - */ + * The type of report (BalanceSheet,ProfitLoss, etc) + * @param reportType String + * @return ReportWithRow + **/ public ReportWithRow reportType(String reportType) { this.reportType = reportType; return this; } - /** + /** * The type of report (BalanceSheet,ProfitLoss, etc) - * * @return reportType - */ + **/ @ApiModelProperty(value = "The type of report (BalanceSheet,ProfitLoss, etc)") - /** + /** * The type of report (BalanceSheet,ProfitLoss, etc) - * * @return reportType String - */ + **/ public String getReportType() { return reportType; } - /** - * The type of report (BalanceSheet,ProfitLoss, etc) - * - * @param reportType String - */ + /** + * The type of report (BalanceSheet,ProfitLoss, etc) + * @param reportType String + **/ + public void setReportType(String reportType) { this.reportType = reportType; } /** - * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of - * report) - * - * @param reportTitles List<> - * @return ReportWithRow - */ + * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) + * @param reportTitles List<> + * @return ReportWithRow + **/ public ReportWithRow reportTitles(List reportTitles) { this.reportTitles = reportTitles; return this; } /** - * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of - * report) - * - * @param reportTitlesItem String + * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) + * @param reportTitlesItem String * @return ReportWithRow - */ + **/ public ReportWithRow addReportTitlesItem(String reportTitlesItem) { if (this.reportTitles == null) { this.reportTitles = new ArrayList(); @@ -217,77 +218,65 @@ public ReportWithRow addReportTitlesItem(String reportTitlesItem) { return this; } - /** - * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of - * report) - * + /** + * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) * @return reportTitles - */ - @ApiModelProperty( - value = - "Report titles array (3 to 4 strings with the report name, orgnisation name and time" - + " frame of report)") - /** - * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of - * report) - * + **/ + @ApiModelProperty(value = "Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report)") + /** + * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) * @return reportTitles List - */ + **/ public List getReportTitles() { return reportTitles; } - /** - * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of - * report) - * - * @param reportTitles List<> - */ + /** + * Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) + * @param reportTitles List<> + **/ + public void setReportTitles(List reportTitles) { this.reportTitles = reportTitles; } /** - * Date of report - * - * @param reportDate String - * @return ReportWithRow - */ + * Date of report + * @param reportDate String + * @return ReportWithRow + **/ public ReportWithRow reportDate(String reportDate) { this.reportDate = reportDate; return this; } - /** + /** * Date of report - * * @return reportDate - */ + **/ @ApiModelProperty(value = "Date of report") - /** + /** * Date of report - * * @return reportDate String - */ + **/ public String getReportDate() { return reportDate; } - /** - * Date of report - * - * @param reportDate String - */ + /** + * Date of report + * @param reportDate String + **/ + public void setReportDate(String reportDate) { this.reportDate = reportDate; } /** - * rows - * - * @param rows List<ReportRows> - * @return ReportWithRow - */ + * rows + * @param rows List<ReportRows> + * @return ReportWithRow + **/ public ReportWithRow rows(List rows) { this.rows = rows; return this; @@ -295,10 +284,9 @@ public ReportWithRow rows(List rows) { /** * rows - * - * @param rowsItem ReportRows + * @param rowsItem ReportRows * @return ReportWithRow - */ + **/ public ReportWithRow addRowsItem(ReportRows rowsItem) { if (this.rows == null) { this.rows = new ArrayList(); @@ -307,66 +295,60 @@ public ReportWithRow addRowsItem(ReportRows rowsItem) { return this; } - /** + /** * Get rows - * * @return rows - */ + **/ @ApiModelProperty(value = "") - /** + /** * rows - * * @return rows List - */ + **/ public List getRows() { return rows; } - /** - * rows - * - * @param rows List<ReportRows> - */ + /** + * rows + * @param rows List<ReportRows> + **/ + public void setRows(List rows) { this.rows = rows; } - /** + /** * Updated Date - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Updated Date") - /** + /** * Updated Date - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Updated Date - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * fields - * - * @param fields List<ReportFields> - * @return ReportWithRow - */ + * fields + * @param fields List<ReportFields> + * @return ReportWithRow + **/ public ReportWithRow fields(List fields) { this.fields = fields; return this; @@ -374,10 +356,9 @@ public ReportWithRow fields(List fields) { /** * fields - * - * @param fieldsItem ReportFields + * @param fieldsItem ReportFields * @return ReportWithRow - */ + **/ public ReportWithRow addFieldsItem(ReportFields fieldsItem) { if (this.fields == null) { this.fields = new ArrayList(); @@ -386,30 +367,29 @@ public ReportWithRow addFieldsItem(ReportFields fieldsItem) { return this; } - /** + /** * Get fields - * * @return fields - */ + **/ @ApiModelProperty(value = "") - /** + /** * fields - * * @return fields List - */ + **/ public List getFields() { return fields; } - /** - * fields - * - * @param fields List<ReportFields> - */ + /** + * fields + * @param fields List<ReportFields> + **/ + public void setFields(List fields) { this.fields = fields; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -419,31 +399,23 @@ public boolean equals(java.lang.Object o) { return false; } ReportWithRow reportWithRow = (ReportWithRow) o; - return Objects.equals(this.reportID, reportWithRow.reportID) - && Objects.equals(this.reportName, reportWithRow.reportName) - && Objects.equals(this.reportTitle, reportWithRow.reportTitle) - && Objects.equals(this.reportType, reportWithRow.reportType) - && Objects.equals(this.reportTitles, reportWithRow.reportTitles) - && Objects.equals(this.reportDate, reportWithRow.reportDate) - && Objects.equals(this.rows, reportWithRow.rows) - && Objects.equals(this.updatedDateUTC, reportWithRow.updatedDateUTC) - && Objects.equals(this.fields, reportWithRow.fields); + return Objects.equals(this.reportID, reportWithRow.reportID) && + Objects.equals(this.reportName, reportWithRow.reportName) && + Objects.equals(this.reportTitle, reportWithRow.reportTitle) && + Objects.equals(this.reportType, reportWithRow.reportType) && + Objects.equals(this.reportTitles, reportWithRow.reportTitles) && + Objects.equals(this.reportDate, reportWithRow.reportDate) && + Objects.equals(this.rows, reportWithRow.rows) && + Objects.equals(this.updatedDateUTC, reportWithRow.updatedDateUTC) && + Objects.equals(this.fields, reportWithRow.fields); } @Override public int hashCode() { - return Objects.hash( - reportID, - reportName, - reportTitle, - reportType, - reportTitles, - reportDate, - rows, - updatedDateUTC, - fields); + return Objects.hash(reportID, reportName, reportTitle, reportType, reportTitles, reportDate, rows, updatedDateUTC, fields); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -462,7 +434,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -470,4 +443,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ReportWithRows.java b/src/main/java/com/xero/models/accounting/ReportWithRows.java index 8a644ad41..347608f3b 100644 --- a/src/main/java/com/xero/models/accounting/ReportWithRows.java +++ b/src/main/java/com/xero/models/accounting/ReportWithRows.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.ReportWithRow; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportWithRows + */ -/** ReportWithRows */ public class ReportWithRows { StringUtil util = new StringUtil(); @JsonProperty("Reports") private List reports = new ArrayList(); /** - * reports - * - * @param reports List<ReportWithRow> - * @return ReportWithRows - */ + * reports + * @param reports List<ReportWithRow> + * @return ReportWithRows + **/ public ReportWithRows reports(List reports) { this.reports = reports; return this; @@ -37,10 +54,9 @@ public ReportWithRows reports(List reports) { /** * reports - * - * @param reportsItem ReportWithRow + * @param reportsItem ReportWithRow * @return ReportWithRows - */ + **/ public ReportWithRows addReportsItem(ReportWithRow reportsItem) { if (this.reports == null) { this.reports = new ArrayList(); @@ -49,30 +65,29 @@ public ReportWithRows addReportsItem(ReportWithRow reportsItem) { return this; } - /** + /** * Get reports - * * @return reports - */ + **/ @ApiModelProperty(value = "") - /** + /** * reports - * * @return reports List - */ + **/ public List getReports() { return reports; } - /** - * reports - * - * @param reports List<ReportWithRow> - */ + /** + * reports + * @param reports List<ReportWithRow> + **/ + public void setReports(List reports) { this.reports = reports; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(reports); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Reports.java b/src/main/java/com/xero/models/accounting/Reports.java index 6629506b5..fce5cd664 100644 --- a/src/main/java/com/xero/models/accounting/Reports.java +++ b/src/main/java/com/xero/models/accounting/Reports.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Report; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Reports + */ -/** Reports */ public class Reports { StringUtil util = new StringUtil(); @JsonProperty("Reports") private List reports = new ArrayList(); /** - * reports - * - * @param reports List<Report> - * @return Reports - */ + * reports + * @param reports List<Report> + * @return Reports + **/ public Reports reports(List reports) { this.reports = reports; return this; @@ -37,10 +54,9 @@ public Reports reports(List reports) { /** * reports - * - * @param reportsItem Report + * @param reportsItem Report * @return Reports - */ + **/ public Reports addReportsItem(Report reportsItem) { if (this.reports == null) { this.reports = new ArrayList(); @@ -49,30 +65,29 @@ public Reports addReportsItem(Report reportsItem) { return this; } - /** + /** * Get reports - * * @return reports - */ + **/ @ApiModelProperty(value = "") - /** + /** * reports - * * @return reports List - */ + **/ public List getReports() { return reports; } - /** - * reports - * - * @param reports List<Report> - */ + /** + * reports + * @param reports List<Report> + **/ + public void setReports(List reports) { this.reports = reports; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(reports); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/RequestEmpty.java b/src/main/java/com/xero/models/accounting/RequestEmpty.java index 088a720d0..333b0bbfc 100644 --- a/src/main/java/com/xero/models/accounting/RequestEmpty.java +++ b/src/main/java/com/xero/models/accounting/RequestEmpty.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * RequestEmpty + */ -/** RequestEmpty */ public class RequestEmpty { StringUtil util = new StringUtil(); @JsonProperty("Status") private String status; /** - * Need at least one field to create an empty JSON payload - * - * @param status String - * @return RequestEmpty - */ + * Need at least one field to create an empty JSON payload + * @param status String + * @return RequestEmpty + **/ public RequestEmpty status(String status) { this.status = status; return this; } - /** + /** * Need at least one field to create an empty JSON payload - * * @return status - */ + **/ @ApiModelProperty(value = "Need at least one field to create an empty JSON payload") - /** + /** * Need at least one field to create an empty JSON payload - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * Need at least one field to create an empty JSON payload - * - * @param status String - */ + /** + * Need at least one field to create an empty JSON payload + * @param status String + **/ + public void setStatus(String status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/RowType.java b/src/main/java/com/xero/models/accounting/RowType.java index 5c48346ce..c69529473 100644 --- a/src/main/java/com/xero/models/accounting/RowType.java +++ b/src/main/java/com/xero/models/accounting/RowType.java @@ -9,25 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets RowType */ +/** + * Gets or Sets RowType + */ public enum RowType { - - /** HEADER */ + + /** + * HEADER + */ HEADER("Header"), - - /** SECTION */ + + /** + * SECTION + */ SECTION("Section"), - - /** ROW */ + + /** + * ROW + */ ROW("Row"), - - /** SUMMARYROW */ + + /** + * SUMMARYROW + */ SUMMARYROW("SummaryRow"); private String value; @@ -36,26 +55,24 @@ public enum RowType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static RowType fromValue(String value) { @@ -67,3 +84,4 @@ public static RowType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/SalesTrackingCategory.java b/src/main/java/com/xero/models/accounting/SalesTrackingCategory.java index ae7b91bd4..860cbb708 100644 --- a/src/main/java/com/xero/models/accounting/SalesTrackingCategory.java +++ b/src/main/java/com/xero/models/accounting/SalesTrackingCategory.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SalesTrackingCategory + */ -/** SalesTrackingCategory */ public class SalesTrackingCategory { StringUtil util = new StringUtil(); @@ -26,75 +43,70 @@ public class SalesTrackingCategory { @JsonProperty("TrackingOptionName") private String trackingOptionName; /** - * The default sales tracking category name for contacts - * - * @param trackingCategoryName String - * @return SalesTrackingCategory - */ + * The default sales tracking category name for contacts + * @param trackingCategoryName String + * @return SalesTrackingCategory + **/ public SalesTrackingCategory trackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; return this; } - /** + /** * The default sales tracking category name for contacts - * * @return trackingCategoryName - */ + **/ @ApiModelProperty(value = "The default sales tracking category name for contacts") - /** + /** * The default sales tracking category name for contacts - * * @return trackingCategoryName String - */ + **/ public String getTrackingCategoryName() { return trackingCategoryName; } - /** - * The default sales tracking category name for contacts - * - * @param trackingCategoryName String - */ + /** + * The default sales tracking category name for contacts + * @param trackingCategoryName String + **/ + public void setTrackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; } /** - * The default purchase tracking category name for contacts - * - * @param trackingOptionName String - * @return SalesTrackingCategory - */ + * The default purchase tracking category name for contacts + * @param trackingOptionName String + * @return SalesTrackingCategory + **/ public SalesTrackingCategory trackingOptionName(String trackingOptionName) { this.trackingOptionName = trackingOptionName; return this; } - /** + /** * The default purchase tracking category name for contacts - * * @return trackingOptionName - */ + **/ @ApiModelProperty(value = "The default purchase tracking category name for contacts") - /** + /** * The default purchase tracking category name for contacts - * * @return trackingOptionName String - */ + **/ public String getTrackingOptionName() { return trackingOptionName; } - /** - * The default purchase tracking category name for contacts - * - * @param trackingOptionName String - */ + /** + * The default purchase tracking category name for contacts + * @param trackingOptionName String + **/ + public void setTrackingOptionName(String trackingOptionName) { this.trackingOptionName = trackingOptionName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } SalesTrackingCategory salesTrackingCategory = (SalesTrackingCategory) o; - return Objects.equals(this.trackingCategoryName, salesTrackingCategory.trackingCategoryName) - && Objects.equals(this.trackingOptionName, salesTrackingCategory.trackingOptionName); + return Objects.equals(this.trackingCategoryName, salesTrackingCategory.trackingCategoryName) && + Objects.equals(this.trackingOptionName, salesTrackingCategory.trackingOptionName); } @Override @@ -113,20 +125,20 @@ public int hashCode() { return Objects.hash(trackingCategoryName, trackingOptionName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SalesTrackingCategory {\n"); - sb.append(" trackingCategoryName: ") - .append(toIndentedString(trackingCategoryName)) - .append("\n"); + sb.append(" trackingCategoryName: ").append(toIndentedString(trackingCategoryName)).append("\n"); sb.append(" trackingOptionName: ").append(toIndentedString(trackingOptionName)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -134,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Schedule.java b/src/main/java/com/xero/models/accounting/Schedule.java index 880405eb4..952475ad1 100644 --- a/src/main/java/com/xero/models/accounting/Schedule.java +++ b/src/main/java/com/xero/models/accounting/Schedule.java @@ -9,31 +9,48 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Objects; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; import org.threeten.bp.Instant; import org.threeten.bp.LocalDate; -import org.threeten.bp.ZoneId; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Schedule + */ -/** Schedule */ public class Schedule { StringUtil util = new StringUtil(); @JsonProperty("Period") private Integer period; - /** One of the following - WEEKLY or MONTHLY */ + /** + * One of the following - WEEKLY or MONTHLY + */ public enum UnitEnum { - /** WEEKLY */ + /** + * WEEKLY + */ WEEKLY("WEEKLY"), - - /** MONTHLY */ + + /** + * MONTHLY + */ MONTHLY("MONTHLY"); private String value; @@ -42,31 +59,25 @@ public enum UnitEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static UnitEnum fromValue(String value) { for (UnitEnum b : UnitEnum.values()) { @@ -78,29 +89,44 @@ public static UnitEnum fromValue(String value) { } } + @JsonProperty("Unit") private UnitEnum unit; @JsonProperty("DueDate") private Integer dueDate; - /** the payment terms */ + /** + * the payment terms + */ public enum DueDateTypeEnum { - /** DAYSAFTERBILLDATE */ + /** + * DAYSAFTERBILLDATE + */ DAYSAFTERBILLDATE("DAYSAFTERBILLDATE"), - - /** DAYSAFTERBILLMONTH */ + + /** + * DAYSAFTERBILLMONTH + */ DAYSAFTERBILLMONTH("DAYSAFTERBILLMONTH"), - - /** DAYSAFTERINVOICEDATE */ + + /** + * DAYSAFTERINVOICEDATE + */ DAYSAFTERINVOICEDATE("DAYSAFTERINVOICEDATE"), - - /** DAYSAFTERINVOICEMONTH */ + + /** + * DAYSAFTERINVOICEMONTH + */ DAYSAFTERINVOICEMONTH("DAYSAFTERINVOICEMONTH"), - - /** OFCURRENTMONTH */ + + /** + * OFCURRENTMONTH + */ OFCURRENTMONTH("OFCURRENTMONTH"), - - /** OFFOLLOWINGMONTH */ + + /** + * OFFOLLOWINGMONTH + */ OFFOLLOWINGMONTH("OFFOLLOWINGMONTH"); private String value; @@ -109,31 +135,25 @@ public enum DueDateTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static DueDateTypeEnum fromValue(String value) { for (DueDateTypeEnum b : DueDateTypeEnum.values()) { @@ -145,6 +165,7 @@ public static DueDateTypeEnum fromValue(String value) { } } + @JsonProperty("DueDateType") private DueDateTypeEnum dueDateType; @@ -157,344 +178,308 @@ public static DueDateTypeEnum fromValue(String value) { @JsonProperty("EndDate") private String endDate; /** - * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - * - * @param period Integer - * @return Schedule - */ + * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) + * @param period Integer + * @return Schedule + **/ public Schedule period(Integer period) { this.period = period; return this; } - /** + /** * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - * * @return period - */ + **/ @ApiModelProperty(value = "Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months)") - /** + /** * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - * * @return period Integer - */ + **/ public Integer getPeriod() { return period; } - /** - * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - * - * @param period Integer - */ + /** + * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) + * @param period Integer + **/ + public void setPeriod(Integer period) { this.period = period; } /** - * One of the following - WEEKLY or MONTHLY - * - * @param unit UnitEnum - * @return Schedule - */ + * One of the following - WEEKLY or MONTHLY + * @param unit UnitEnum + * @return Schedule + **/ public Schedule unit(UnitEnum unit) { this.unit = unit; return this; } - /** + /** * One of the following - WEEKLY or MONTHLY - * * @return unit - */ + **/ @ApiModelProperty(value = "One of the following - WEEKLY or MONTHLY") - /** + /** * One of the following - WEEKLY or MONTHLY - * * @return unit UnitEnum - */ + **/ public UnitEnum getUnit() { return unit; } - /** - * One of the following - WEEKLY or MONTHLY - * - * @param unit UnitEnum - */ + /** + * One of the following - WEEKLY or MONTHLY + * @param unit UnitEnum + **/ + public void setUnit(UnitEnum unit) { this.unit = unit; } /** - * Integer used with due date type e.g 20 (of following month), 31 (of current month) - * - * @param dueDate Integer - * @return Schedule - */ + * Integer used with due date type e.g 20 (of following month), 31 (of current month) + * @param dueDate Integer + * @return Schedule + **/ public Schedule dueDate(Integer dueDate) { this.dueDate = dueDate; return this; } - /** + /** * Integer used with due date type e.g 20 (of following month), 31 (of current month) - * * @return dueDate - */ - @ApiModelProperty( - value = "Integer used with due date type e.g 20 (of following month), 31 (of current month)") - /** + **/ + @ApiModelProperty(value = "Integer used with due date type e.g 20 (of following month), 31 (of current month)") + /** * Integer used with due date type e.g 20 (of following month), 31 (of current month) - * * @return dueDate Integer - */ + **/ public Integer getDueDate() { return dueDate; } - /** - * Integer used with due date type e.g 20 (of following month), 31 (of current month) - * - * @param dueDate Integer - */ + /** + * Integer used with due date type e.g 20 (of following month), 31 (of current month) + * @param dueDate Integer + **/ + public void setDueDate(Integer dueDate) { this.dueDate = dueDate; } /** - * the payment terms - * - * @param dueDateType DueDateTypeEnum - * @return Schedule - */ + * the payment terms + * @param dueDateType DueDateTypeEnum + * @return Schedule + **/ public Schedule dueDateType(DueDateTypeEnum dueDateType) { this.dueDateType = dueDateType; return this; } - /** + /** * the payment terms - * * @return dueDateType - */ + **/ @ApiModelProperty(value = "the payment terms") - /** + /** * the payment terms - * * @return dueDateType DueDateTypeEnum - */ + **/ public DueDateTypeEnum getDueDateType() { return dueDateType; } - /** - * the payment terms - * - * @param dueDateType DueDateTypeEnum - */ + /** + * the payment terms + * @param dueDateType DueDateTypeEnum + **/ + public void setDueDateType(DueDateTypeEnum dueDateType) { this.dueDateType = dueDateType; } /** - * Date the first invoice of the current version of the repeating schedule was generated (changes - * when repeating invoice is edited) - * - * @param startDate String - * @return Schedule - */ + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) + * @param startDate String + * @return Schedule + **/ public Schedule startDate(String startDate) { this.startDate = startDate; return this; } - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes - * when repeating invoice is edited) - * + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) * @return startDate - */ - @ApiModelProperty( - value = - "Date the first invoice of the current version of the repeating schedule was generated" - + " (changes when repeating invoice is edited)") - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes - * when repeating invoice is edited) - * + **/ + @ApiModelProperty(value = "Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited)") + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) * @return startDate String - */ + **/ public String getStartDate() { return startDate; } - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes - * when repeating invoice is edited) - * + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) * @return LocalDate - */ + **/ public LocalDate getStartDateAsDate() { if (this.startDate != null) { try { return util.convertStringToDate(this.startDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes - * when repeating invoice is edited) - * - * @param startDate String - */ + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) + * @param startDate String + **/ + public void setStartDate(String startDate) { this.startDate = startDate; } - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes - * when repeating invoice is edited) - * - * @param startDate LocalDateTime - */ + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) + * @param startDate LocalDateTime + **/ public void setStartDate(LocalDate startDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.startDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * The calendar date of the next invoice in the schedule to be generated - * - * @param nextScheduledDate String - * @return Schedule - */ + * The calendar date of the next invoice in the schedule to be generated + * @param nextScheduledDate String + * @return Schedule + **/ public Schedule nextScheduledDate(String nextScheduledDate) { this.nextScheduledDate = nextScheduledDate; return this; } - /** + /** * The calendar date of the next invoice in the schedule to be generated - * * @return nextScheduledDate - */ + **/ @ApiModelProperty(value = "The calendar date of the next invoice in the schedule to be generated") - /** + /** * The calendar date of the next invoice in the schedule to be generated - * * @return nextScheduledDate String - */ + **/ public String getNextScheduledDate() { return nextScheduledDate; } - /** + /** * The calendar date of the next invoice in the schedule to be generated - * * @return LocalDate - */ + **/ public LocalDate getNextScheduledDateAsDate() { if (this.nextScheduledDate != null) { try { return util.convertStringToDate(this.nextScheduledDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The calendar date of the next invoice in the schedule to be generated - * - * @param nextScheduledDate String - */ + /** + * The calendar date of the next invoice in the schedule to be generated + * @param nextScheduledDate String + **/ + public void setNextScheduledDate(String nextScheduledDate) { this.nextScheduledDate = nextScheduledDate; } - /** - * The calendar date of the next invoice in the schedule to be generated - * - * @param nextScheduledDate LocalDateTime - */ + /** + * The calendar date of the next invoice in the schedule to be generated + * @param nextScheduledDate LocalDateTime + **/ public void setNextScheduledDate(LocalDate nextScheduledDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = nextScheduledDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = nextScheduledDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.nextScheduledDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Invoice end date – only returned if the template has an end date set - * - * @param endDate String - * @return Schedule - */ + * Invoice end date – only returned if the template has an end date set + * @param endDate String + * @return Schedule + **/ public Schedule endDate(String endDate) { this.endDate = endDate; return this; } - /** + /** * Invoice end date – only returned if the template has an end date set - * * @return endDate - */ + **/ @ApiModelProperty(value = "Invoice end date – only returned if the template has an end date set") - /** + /** * Invoice end date – only returned if the template has an end date set - * * @return endDate String - */ + **/ public String getEndDate() { return endDate; } - /** + /** * Invoice end date – only returned if the template has an end date set - * * @return LocalDate - */ + **/ public LocalDate getEndDateAsDate() { if (this.endDate != null) { try { return util.convertStringToDate(this.endDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Invoice end date – only returned if the template has an end date set - * - * @param endDate String - */ + /** + * Invoice end date – only returned if the template has an end date set + * @param endDate String + **/ + public void setEndDate(String endDate) { this.endDate = endDate; } - /** - * Invoice end date – only returned if the template has an end date set - * - * @param endDate LocalDateTime - */ + /** + * Invoice end date – only returned if the template has an end date set + * @param endDate LocalDateTime + **/ public void setEndDate(LocalDate endDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = endDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = endDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.endDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -504,13 +489,13 @@ public boolean equals(java.lang.Object o) { return false; } Schedule schedule = (Schedule) o; - return Objects.equals(this.period, schedule.period) - && Objects.equals(this.unit, schedule.unit) - && Objects.equals(this.dueDate, schedule.dueDate) - && Objects.equals(this.dueDateType, schedule.dueDateType) - && Objects.equals(this.startDate, schedule.startDate) - && Objects.equals(this.nextScheduledDate, schedule.nextScheduledDate) - && Objects.equals(this.endDate, schedule.endDate); + return Objects.equals(this.period, schedule.period) && + Objects.equals(this.unit, schedule.unit) && + Objects.equals(this.dueDate, schedule.dueDate) && + Objects.equals(this.dueDateType, schedule.dueDateType) && + Objects.equals(this.startDate, schedule.startDate) && + Objects.equals(this.nextScheduledDate, schedule.nextScheduledDate) && + Objects.equals(this.endDate, schedule.endDate); } @Override @@ -518,6 +503,7 @@ public int hashCode() { return Objects.hash(period, unit, dueDate, dueDateType, startDate, nextScheduledDate, endDate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -534,7 +520,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -542,4 +529,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Setup.java b/src/main/java/com/xero/models/accounting/Setup.java index 318dd926e..ef9d7c33e 100644 --- a/src/main/java/com/xero/models/accounting/Setup.java +++ b/src/main/java/com/xero/models/accounting/Setup.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.Account; +import com.xero.models.accounting.ConversionBalances; +import com.xero.models.accounting.ConversionDate; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Setup + */ -/** Setup */ public class Setup { StringUtil util = new StringUtil(); @@ -31,46 +51,42 @@ public class Setup { @JsonProperty("Accounts") private List accounts = new ArrayList(); /** - * conversionDate - * - * @param conversionDate ConversionDate - * @return Setup - */ + * conversionDate + * @param conversionDate ConversionDate + * @return Setup + **/ public Setup conversionDate(ConversionDate conversionDate) { this.conversionDate = conversionDate; return this; } - /** + /** * Get conversionDate - * * @return conversionDate - */ + **/ @ApiModelProperty(value = "") - /** + /** * conversionDate - * * @return conversionDate ConversionDate - */ + **/ public ConversionDate getConversionDate() { return conversionDate; } - /** - * conversionDate - * - * @param conversionDate ConversionDate - */ + /** + * conversionDate + * @param conversionDate ConversionDate + **/ + public void setConversionDate(ConversionDate conversionDate) { this.conversionDate = conversionDate; } /** - * Balance supplied for each account that has a value as at the conversion date. - * - * @param conversionBalances List<ConversionBalances> - * @return Setup - */ + * Balance supplied for each account that has a value as at the conversion date. + * @param conversionBalances List<ConversionBalances> + * @return Setup + **/ public Setup conversionBalances(List conversionBalances) { this.conversionBalances = conversionBalances; return this; @@ -78,10 +94,9 @@ public Setup conversionBalances(List conversionBalances) { /** * Balance supplied for each account that has a value as at the conversion date. - * - * @param conversionBalancesItem ConversionBalances + * @param conversionBalancesItem ConversionBalances * @return Setup - */ + **/ public Setup addConversionBalancesItem(ConversionBalances conversionBalancesItem) { if (this.conversionBalances == null) { this.conversionBalances = new ArrayList(); @@ -90,37 +105,33 @@ public Setup addConversionBalancesItem(ConversionBalances conversionBalancesItem return this; } - /** + /** * Balance supplied for each account that has a value as at the conversion date. - * * @return conversionBalances - */ - @ApiModelProperty( - value = "Balance supplied for each account that has a value as at the conversion date.") - /** + **/ + @ApiModelProperty(value = "Balance supplied for each account that has a value as at the conversion date.") + /** * Balance supplied for each account that has a value as at the conversion date. - * * @return conversionBalances List - */ + **/ public List getConversionBalances() { return conversionBalances; } - /** - * Balance supplied for each account that has a value as at the conversion date. - * - * @param conversionBalances List<ConversionBalances> - */ + /** + * Balance supplied for each account that has a value as at the conversion date. + * @param conversionBalances List<ConversionBalances> + **/ + public void setConversionBalances(List conversionBalances) { this.conversionBalances = conversionBalances; } /** - * accounts - * - * @param accounts List<Account> - * @return Setup - */ + * accounts + * @param accounts List<Account> + * @return Setup + **/ public Setup accounts(List accounts) { this.accounts = accounts; return this; @@ -128,10 +139,9 @@ public Setup accounts(List accounts) { /** * accounts - * - * @param accountsItem Account + * @param accountsItem Account * @return Setup - */ + **/ public Setup addAccountsItem(Account accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -140,30 +150,29 @@ public Setup addAccountsItem(Account accountsItem) { return this; } - /** + /** * Get accounts - * * @return accounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * accounts - * * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * accounts - * - * @param accounts List<Account> - */ + /** + * accounts + * @param accounts List<Account> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,9 +182,9 @@ public boolean equals(java.lang.Object o) { return false; } Setup setup = (Setup) o; - return Objects.equals(this.conversionDate, setup.conversionDate) - && Objects.equals(this.conversionBalances, setup.conversionBalances) - && Objects.equals(this.accounts, setup.accounts); + return Objects.equals(this.conversionDate, setup.conversionDate) && + Objects.equals(this.conversionBalances, setup.conversionBalances) && + Objects.equals(this.accounts, setup.accounts); } @Override @@ -183,6 +192,7 @@ public int hashCode() { return Objects.hash(conversionDate, conversionBalances, accounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -195,7 +205,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -203,4 +214,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TaxBreakdownComponent.java b/src/main/java/com/xero/models/accounting/TaxBreakdownComponent.java index afb2834a8..eb9be98d1 100644 --- a/src/main/java/com/xero/models/accounting/TaxBreakdownComponent.java +++ b/src/main/java/com/xero/models/accounting/TaxBreakdownComponent.java @@ -9,38 +9,65 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxBreakdownComponent + */ -/** TaxBreakdownComponent */ public class TaxBreakdownComponent { StringUtil util = new StringUtil(); @JsonProperty("TaxComponentId") private UUID taxComponentId; - /** The type of the jurisdiction */ + /** + * The type of the jurisdiction + */ public enum TypeEnum { - /** USCOUNTRY */ + /** + * USCOUNTRY + */ USCOUNTRY("SYSGST/USCOUNTRY"), - - /** USSTATE */ + + /** + * USSTATE + */ USSTATE("SYSGST/USSTATE"), - - /** USCOUNTY */ + + /** + * USCOUNTY + */ USCOUNTY("SYSGST/USCOUNTY"), - - /** USCITY */ + + /** + * USCITY + */ USCITY("SYSGST/USCITY"), - - /** USSPECIAL */ + + /** + * USSPECIAL + */ USSPECIAL("SYSGST/USSPECIAL"); private String value; @@ -49,31 +76,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -85,6 +106,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("Type") private TypeEnum type; @@ -112,355 +134,326 @@ public static TypeEnum fromValue(String value) { @JsonProperty("JurisdictionRegion") private String jurisdictionRegion; /** - * The unique ID number of this component - * - * @param taxComponentId UUID - * @return TaxBreakdownComponent - */ + * The unique ID number of this component + * @param taxComponentId UUID + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent taxComponentId(UUID taxComponentId) { this.taxComponentId = taxComponentId; return this; } - /** + /** * The unique ID number of this component - * * @return taxComponentId - */ + **/ @ApiModelProperty(value = "The unique ID number of this component") - /** + /** * The unique ID number of this component - * * @return taxComponentId UUID - */ + **/ public UUID getTaxComponentId() { return taxComponentId; } - /** - * The unique ID number of this component - * - * @param taxComponentId UUID - */ + /** + * The unique ID number of this component + * @param taxComponentId UUID + **/ + public void setTaxComponentId(UUID taxComponentId) { this.taxComponentId = taxComponentId; } /** - * The type of the jurisdiction - * - * @param type TypeEnum - * @return TaxBreakdownComponent - */ + * The type of the jurisdiction + * @param type TypeEnum + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent type(TypeEnum type) { this.type = type; return this; } - /** + /** * The type of the jurisdiction - * * @return type - */ + **/ @ApiModelProperty(value = "The type of the jurisdiction") - /** + /** * The type of the jurisdiction - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * The type of the jurisdiction - * - * @param type TypeEnum - */ + /** + * The type of the jurisdiction + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * The name of the jurisdiction - * - * @param name String - * @return TaxBreakdownComponent - */ + * The name of the jurisdiction + * @param name String + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent name(String name) { this.name = name; return this; } - /** + /** * The name of the jurisdiction - * * @return name - */ + **/ @ApiModelProperty(value = "The name of the jurisdiction") - /** + /** * The name of the jurisdiction - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the jurisdiction - * - * @param name String - */ + /** + * The name of the jurisdiction + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The percentage of the tax - * - * @param taxPercentage BigDecimal - * @return TaxBreakdownComponent - */ + * The percentage of the tax + * @param taxPercentage BigDecimal + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent taxPercentage(BigDecimal taxPercentage) { this.taxPercentage = taxPercentage; return this; } - /** + /** * The percentage of the tax - * * @return taxPercentage - */ + **/ @ApiModelProperty(value = "The percentage of the tax") - /** + /** * The percentage of the tax - * * @return taxPercentage BigDecimal - */ + **/ public BigDecimal getTaxPercentage() { return taxPercentage; } - /** - * The percentage of the tax - * - * @param taxPercentage BigDecimal - */ + /** + * The percentage of the tax + * @param taxPercentage BigDecimal + **/ + public void setTaxPercentage(BigDecimal taxPercentage) { this.taxPercentage = taxPercentage; } /** - * The amount of the tax - * - * @param taxAmount BigDecimal - * @return TaxBreakdownComponent - */ + * The amount of the tax + * @param taxAmount BigDecimal + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent taxAmount(BigDecimal taxAmount) { this.taxAmount = taxAmount; return this; } - /** + /** * The amount of the tax - * * @return taxAmount - */ + **/ @ApiModelProperty(value = "The amount of the tax") - /** + /** * The amount of the tax - * * @return taxAmount BigDecimal - */ + **/ public BigDecimal getTaxAmount() { return taxAmount; } - /** - * The amount of the tax - * - * @param taxAmount BigDecimal - */ + /** + * The amount of the tax + * @param taxAmount BigDecimal + **/ + public void setTaxAmount(BigDecimal taxAmount) { this.taxAmount = taxAmount; } /** - * The amount that is taxable - * - * @param taxableAmount BigDecimal - * @return TaxBreakdownComponent - */ + * The amount that is taxable + * @param taxableAmount BigDecimal + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent taxableAmount(BigDecimal taxableAmount) { this.taxableAmount = taxableAmount; return this; } - /** + /** * The amount that is taxable - * * @return taxableAmount - */ + **/ @ApiModelProperty(value = "The amount that is taxable") - /** + /** * The amount that is taxable - * * @return taxableAmount BigDecimal - */ + **/ public BigDecimal getTaxableAmount() { return taxableAmount; } - /** - * The amount that is taxable - * - * @param taxableAmount BigDecimal - */ + /** + * The amount that is taxable + * @param taxableAmount BigDecimal + **/ + public void setTaxableAmount(BigDecimal taxableAmount) { this.taxableAmount = taxableAmount; } /** - * The amount that is not taxable - * - * @param nonTaxableAmount BigDecimal - * @return TaxBreakdownComponent - */ + * The amount that is not taxable + * @param nonTaxableAmount BigDecimal + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent nonTaxableAmount(BigDecimal nonTaxableAmount) { this.nonTaxableAmount = nonTaxableAmount; return this; } - /** + /** * The amount that is not taxable - * * @return nonTaxableAmount - */ + **/ @ApiModelProperty(value = "The amount that is not taxable") - /** + /** * The amount that is not taxable - * * @return nonTaxableAmount BigDecimal - */ + **/ public BigDecimal getNonTaxableAmount() { return nonTaxableAmount; } - /** - * The amount that is not taxable - * - * @param nonTaxableAmount BigDecimal - */ + /** + * The amount that is not taxable + * @param nonTaxableAmount BigDecimal + **/ + public void setNonTaxableAmount(BigDecimal nonTaxableAmount) { this.nonTaxableAmount = nonTaxableAmount; } /** - * The amount that is exempt - * - * @param exemptAmount BigDecimal - * @return TaxBreakdownComponent - */ + * The amount that is exempt + * @param exemptAmount BigDecimal + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent exemptAmount(BigDecimal exemptAmount) { this.exemptAmount = exemptAmount; return this; } - /** + /** * The amount that is exempt - * * @return exemptAmount - */ + **/ @ApiModelProperty(value = "The amount that is exempt") - /** + /** * The amount that is exempt - * * @return exemptAmount BigDecimal - */ + **/ public BigDecimal getExemptAmount() { return exemptAmount; } - /** - * The amount that is exempt - * - * @param exemptAmount BigDecimal - */ + /** + * The amount that is exempt + * @param exemptAmount BigDecimal + **/ + public void setExemptAmount(BigDecimal exemptAmount) { this.exemptAmount = exemptAmount; } /** - * The state assigned number of the jurisdiction - * - * @param stateAssignedNo String - * @return TaxBreakdownComponent - */ + * The state assigned number of the jurisdiction + * @param stateAssignedNo String + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent stateAssignedNo(String stateAssignedNo) { this.stateAssignedNo = stateAssignedNo; return this; } - /** + /** * The state assigned number of the jurisdiction - * * @return stateAssignedNo - */ + **/ @ApiModelProperty(value = "The state assigned number of the jurisdiction") - /** + /** * The state assigned number of the jurisdiction - * * @return stateAssignedNo String - */ + **/ public String getStateAssignedNo() { return stateAssignedNo; } - /** - * The state assigned number of the jurisdiction - * - * @param stateAssignedNo String - */ + /** + * The state assigned number of the jurisdiction + * @param stateAssignedNo String + **/ + public void setStateAssignedNo(String stateAssignedNo) { this.stateAssignedNo = stateAssignedNo; } /** - * Name identifying the region within the country - * - * @param jurisdictionRegion String - * @return TaxBreakdownComponent - */ + * Name identifying the region within the country + * @param jurisdictionRegion String + * @return TaxBreakdownComponent + **/ public TaxBreakdownComponent jurisdictionRegion(String jurisdictionRegion) { this.jurisdictionRegion = jurisdictionRegion; return this; } - /** + /** * Name identifying the region within the country - * * @return jurisdictionRegion - */ + **/ @ApiModelProperty(value = "Name identifying the region within the country") - /** + /** * Name identifying the region within the country - * * @return jurisdictionRegion String - */ + **/ public String getJurisdictionRegion() { return jurisdictionRegion; } - /** - * Name identifying the region within the country - * - * @param jurisdictionRegion String - */ + /** + * Name identifying the region within the country + * @param jurisdictionRegion String + **/ + public void setJurisdictionRegion(String jurisdictionRegion) { this.jurisdictionRegion = jurisdictionRegion; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -470,33 +463,24 @@ public boolean equals(java.lang.Object o) { return false; } TaxBreakdownComponent taxBreakdownComponent = (TaxBreakdownComponent) o; - return Objects.equals(this.taxComponentId, taxBreakdownComponent.taxComponentId) - && Objects.equals(this.type, taxBreakdownComponent.type) - && Objects.equals(this.name, taxBreakdownComponent.name) - && Objects.equals(this.taxPercentage, taxBreakdownComponent.taxPercentage) - && Objects.equals(this.taxAmount, taxBreakdownComponent.taxAmount) - && Objects.equals(this.taxableAmount, taxBreakdownComponent.taxableAmount) - && Objects.equals(this.nonTaxableAmount, taxBreakdownComponent.nonTaxableAmount) - && Objects.equals(this.exemptAmount, taxBreakdownComponent.exemptAmount) - && Objects.equals(this.stateAssignedNo, taxBreakdownComponent.stateAssignedNo) - && Objects.equals(this.jurisdictionRegion, taxBreakdownComponent.jurisdictionRegion); + return Objects.equals(this.taxComponentId, taxBreakdownComponent.taxComponentId) && + Objects.equals(this.type, taxBreakdownComponent.type) && + Objects.equals(this.name, taxBreakdownComponent.name) && + Objects.equals(this.taxPercentage, taxBreakdownComponent.taxPercentage) && + Objects.equals(this.taxAmount, taxBreakdownComponent.taxAmount) && + Objects.equals(this.taxableAmount, taxBreakdownComponent.taxableAmount) && + Objects.equals(this.nonTaxableAmount, taxBreakdownComponent.nonTaxableAmount) && + Objects.equals(this.exemptAmount, taxBreakdownComponent.exemptAmount) && + Objects.equals(this.stateAssignedNo, taxBreakdownComponent.stateAssignedNo) && + Objects.equals(this.jurisdictionRegion, taxBreakdownComponent.jurisdictionRegion); } @Override public int hashCode() { - return Objects.hash( - taxComponentId, - type, - name, - taxPercentage, - taxAmount, - taxableAmount, - nonTaxableAmount, - exemptAmount, - stateAssignedNo, - jurisdictionRegion); + return Objects.hash(taxComponentId, type, name, taxPercentage, taxAmount, taxableAmount, nonTaxableAmount, exemptAmount, stateAssignedNo, jurisdictionRegion); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -516,7 +500,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -524,4 +509,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TaxComponent.java b/src/main/java/com/xero/models/accounting/TaxComponent.java index 2b1266611..e5a17dce6 100644 --- a/src/main/java/com/xero/models/accounting/TaxComponent.java +++ b/src/main/java/com/xero/models/accounting/TaxComponent.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxComponent + */ -/** TaxComponent */ public class TaxComponent { StringUtil util = new StringUtil(); @@ -32,152 +49,134 @@ public class TaxComponent { @JsonProperty("IsNonRecoverable") private Boolean isNonRecoverable; /** - * Name of Tax Component - * - * @param name String - * @return TaxComponent - */ + * Name of Tax Component + * @param name String + * @return TaxComponent + **/ public TaxComponent name(String name) { this.name = name; return this; } - /** + /** * Name of Tax Component - * * @return name - */ + **/ @ApiModelProperty(value = "Name of Tax Component") - /** + /** * Name of Tax Component - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of Tax Component - * - * @param name String - */ + /** + * Name of Tax Component + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Tax Rate (up to 4dp) - * - * @param rate Double - * @return TaxComponent - */ + * Tax Rate (up to 4dp) + * @param rate Double + * @return TaxComponent + **/ public TaxComponent rate(Double rate) { this.rate = rate; return this; } - /** + /** * Tax Rate (up to 4dp) - * * @return rate - */ + **/ @ApiModelProperty(value = "Tax Rate (up to 4dp)") - /** + /** * Tax Rate (up to 4dp) - * * @return rate Double - */ + **/ public Double getRate() { return rate; } - /** - * Tax Rate (up to 4dp) - * - * @param rate Double - */ + /** + * Tax Rate (up to 4dp) + * @param rate Double + **/ + public void setRate(Double rate) { this.rate = rate; } /** - * Boolean to describe if Tax rate is compounded. - * - * @param isCompound Boolean - * @return TaxComponent - */ + * Boolean to describe if Tax rate is compounded. + * @param isCompound Boolean + * @return TaxComponent + **/ public TaxComponent isCompound(Boolean isCompound) { this.isCompound = isCompound; return this; } - /** + /** * Boolean to describe if Tax rate is compounded. - * * @return isCompound - */ + **/ @ApiModelProperty(value = "Boolean to describe if Tax rate is compounded.") - /** + /** * Boolean to describe if Tax rate is compounded. - * * @return isCompound Boolean - */ + **/ public Boolean getIsCompound() { return isCompound; } - /** - * Boolean to describe if Tax rate is compounded. - * - * @param isCompound Boolean - */ + /** + * Boolean to describe if Tax rate is compounded. + * @param isCompound Boolean + **/ + public void setIsCompound(Boolean isCompound) { this.isCompound = isCompound; } /** - * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable - * to Canadian organisations - * - * @param isNonRecoverable Boolean - * @return TaxComponent - */ + * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations + * @param isNonRecoverable Boolean + * @return TaxComponent + **/ public TaxComponent isNonRecoverable(Boolean isNonRecoverable) { this.isNonRecoverable = isNonRecoverable; return this; } - /** - * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable - * to Canadian organisations - * + /** + * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations * @return isNonRecoverable - */ - @ApiModelProperty( - value = - "Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only" - + " applicable to Canadian organisations") - /** - * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable - * to Canadian organisations - * + **/ + @ApiModelProperty(value = "Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations") + /** + * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations * @return isNonRecoverable Boolean - */ + **/ public Boolean getIsNonRecoverable() { return isNonRecoverable; } - /** - * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable - * to Canadian organisations - * - * @param isNonRecoverable Boolean - */ + /** + * Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations + * @param isNonRecoverable Boolean + **/ + public void setIsNonRecoverable(Boolean isNonRecoverable) { this.isNonRecoverable = isNonRecoverable; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -187,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } TaxComponent taxComponent = (TaxComponent) o; - return Objects.equals(this.name, taxComponent.name) - && Objects.equals(this.rate, taxComponent.rate) - && Objects.equals(this.isCompound, taxComponent.isCompound) - && Objects.equals(this.isNonRecoverable, taxComponent.isNonRecoverable); + return Objects.equals(this.name, taxComponent.name) && + Objects.equals(this.rate, taxComponent.rate) && + Objects.equals(this.isCompound, taxComponent.isCompound) && + Objects.equals(this.isNonRecoverable, taxComponent.isNonRecoverable); } @Override @@ -198,6 +197,7 @@ public int hashCode() { return Objects.hash(name, rate, isCompound, isNonRecoverable); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -219,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TaxRate.java b/src/main/java/com/xero/models/accounting/TaxRate.java index fb2b3b6fa..ccc33e1aa 100644 --- a/src/main/java/com/xero/models/accounting/TaxRate.java +++ b/src/main/java/com/xero/models/accounting/TaxRate.java @@ -9,18 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.TaxComponent; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxRate + */ -/** TaxRate */ public class TaxRate { StringUtil util = new StringUtil(); @@ -32,18 +48,28 @@ public class TaxRate { @JsonProperty("TaxComponents") private List taxComponents = new ArrayList(); - /** See Status Codes */ + /** + * See Status Codes + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"), - - /** ARCHIVED */ + + /** + * ARCHIVED + */ ARCHIVED("ARCHIVED"), - - /** PENDING */ + + /** + * PENDING + */ PENDING("PENDING"); private String value; @@ -52,31 +78,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -88,305 +108,506 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; - /** See ReportTaxTypes */ + /** + * See ReportTaxTypes + */ public enum ReportTaxTypeEnum { - /** AVALARA */ + /** + * AVALARA + */ AVALARA("AVALARA"), - - /** BASEXCLUDED */ + + /** + * BASEXCLUDED + */ BASEXCLUDED("BASEXCLUDED"), - - /** CAPITALSALESOUTPUT */ + + /** + * CAPITALSALESOUTPUT + */ CAPITALSALESOUTPUT("CAPITALSALESOUTPUT"), - - /** CAPITALEXPENSESINPUT */ + + /** + * CAPITALEXPENSESINPUT + */ CAPITALEXPENSESINPUT("CAPITALEXPENSESINPUT"), - - /** ECOUTPUT */ + + /** + * ECOUTPUT + */ ECOUTPUT("ECOUTPUT"), - - /** ECOUTPUTSERVICES */ + + /** + * ECOUTPUTSERVICES + */ ECOUTPUTSERVICES("ECOUTPUTSERVICES"), - - /** ECINPUT */ + + /** + * ECINPUT + */ ECINPUT("ECINPUT"), - - /** ECACQUISITIONS */ + + /** + * ECACQUISITIONS + */ ECACQUISITIONS("ECACQUISITIONS"), - - /** EXEMPTEXPENSES */ + + /** + * EXEMPTEXPENSES + */ EXEMPTEXPENSES("EXEMPTEXPENSES"), - - /** EXEMPTINPUT */ + + /** + * EXEMPTINPUT + */ EXEMPTINPUT("EXEMPTINPUT"), - - /** EXEMPTOUTPUT */ + + /** + * EXEMPTOUTPUT + */ EXEMPTOUTPUT("EXEMPTOUTPUT"), - - /** GSTONIMPORTS */ + + /** + * GSTONIMPORTS + */ GSTONIMPORTS("GSTONIMPORTS"), - - /** INPUT */ + + /** + * INPUT + */ INPUT("INPUT"), - - /** INPUTTAXED */ + + /** + * INPUTTAXED + */ INPUTTAXED("INPUTTAXED"), - - /** MOSSSALES */ + + /** + * MOSSSALES + */ MOSSSALES("MOSSSALES"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"), - - /** NONEOUTPUT */ + + /** + * NONEOUTPUT + */ NONEOUTPUT("NONEOUTPUT"), - - /** OUTPUT */ + + /** + * OUTPUT + */ OUTPUT("OUTPUT"), - - /** PURCHASESINPUT */ + + /** + * PURCHASESINPUT + */ PURCHASESINPUT("PURCHASESINPUT"), - - /** SALESOUTPUT */ + + /** + * SALESOUTPUT + */ SALESOUTPUT("SALESOUTPUT"), - - /** EXEMPTCAPITAL */ + + /** + * EXEMPTCAPITAL + */ EXEMPTCAPITAL("EXEMPTCAPITAL"), - - /** EXEMPTEXPORT */ + + /** + * EXEMPTEXPORT + */ EXEMPTEXPORT("EXEMPTEXPORT"), - - /** CAPITALEXINPUT */ + + /** + * CAPITALEXINPUT + */ CAPITALEXINPUT("CAPITALEXINPUT"), - - /** GSTONCAPIMPORTS */ + + /** + * GSTONCAPIMPORTS + */ GSTONCAPIMPORTS("GSTONCAPIMPORTS"), - - /** GSTONCAPITALIMPORTS */ + + /** + * GSTONCAPITALIMPORTS + */ GSTONCAPITALIMPORTS("GSTONCAPITALIMPORTS"), - - /** REVERSECHARGES */ + + /** + * REVERSECHARGES + */ REVERSECHARGES("REVERSECHARGES"), - - /** PAYMENTS */ + + /** + * PAYMENTS + */ PAYMENTS("PAYMENTS"), - - /** INVOICE */ + + /** + * INVOICE + */ INVOICE("INVOICE"), - - /** CASH */ + + /** + * CASH + */ CASH("CASH"), - - /** ACCRUAL */ + + /** + * ACCRUAL + */ ACCRUAL("ACCRUAL"), - - /** FLATRATECASH */ + + /** + * FLATRATECASH + */ FLATRATECASH("FLATRATECASH"), - - /** FLATRATEACCRUAL */ + + /** + * FLATRATEACCRUAL + */ FLATRATEACCRUAL("FLATRATEACCRUAL"), - - /** ACCRUALS */ + + /** + * ACCRUALS + */ ACCRUALS("ACCRUALS"), - - /** TXCA */ + + /** + * TXCA + */ TXCA("TXCA"), - - /** SRCAS */ + + /** + * SRCAS + */ SRCAS("SRCAS"), - - /** DSOUTPUT */ + + /** + * DSOUTPUT + */ DSOUTPUT("DSOUTPUT"), - - /** BLINPUT2 */ + + /** + * BLINPUT2 + */ BLINPUT2("BLINPUT2"), - - /** EPINPUT */ + + /** + * EPINPUT + */ EPINPUT("EPINPUT"), - - /** IMINPUT2 */ + + /** + * IMINPUT2 + */ IMINPUT2("IMINPUT2"), - - /** MEINPUT */ + + /** + * MEINPUT + */ MEINPUT("MEINPUT"), - - /** IGDSINPUT2 */ + + /** + * IGDSINPUT2 + */ IGDSINPUT2("IGDSINPUT2"), - - /** ESN33OUTPUT */ + + /** + * ESN33OUTPUT + */ ESN33OUTPUT("ESN33OUTPUT"), - - /** OPINPUT */ + + /** + * OPINPUT + */ OPINPUT("OPINPUT"), - - /** OSOUTPUT */ + + /** + * OSOUTPUT + */ OSOUTPUT("OSOUTPUT"), - - /** TXN33INPUT */ + + /** + * TXN33INPUT + */ TXN33INPUT("TXN33INPUT"), - - /** TXESSINPUT */ + + /** + * TXESSINPUT + */ TXESSINPUT("TXESSINPUT"), - - /** TXREINPUT */ + + /** + * TXREINPUT + */ TXREINPUT("TXREINPUT"), - - /** TXPETINPUT */ + + /** + * TXPETINPUT + */ TXPETINPUT("TXPETINPUT"), - - /** NRINPUT */ + + /** + * NRINPUT + */ NRINPUT("NRINPUT"), - - /** ES33OUTPUT */ + + /** + * ES33OUTPUT + */ ES33OUTPUT("ES33OUTPUT"), - - /** ZERORATEDINPUT */ + + /** + * ZERORATEDINPUT + */ ZERORATEDINPUT("ZERORATEDINPUT"), - - /** ZERORATEDOUTPUT */ + + /** + * ZERORATEDOUTPUT + */ ZERORATEDOUTPUT("ZERORATEDOUTPUT"), - - /** DRCHARGESUPPLY */ + + /** + * DRCHARGESUPPLY + */ DRCHARGESUPPLY("DRCHARGESUPPLY"), - - /** DRCHARGE */ + + /** + * DRCHARGE + */ DRCHARGE("DRCHARGE"), - - /** CAPINPUT */ + + /** + * CAPINPUT + */ CAPINPUT("CAPINPUT"), - - /** CAPIMPORTS */ + + /** + * CAPIMPORTS + */ CAPIMPORTS("CAPIMPORTS"), - - /** IMINPUT */ + + /** + * IMINPUT + */ IMINPUT("IMINPUT"), - - /** INPUT2 */ + + /** + * INPUT2 + */ INPUT2("INPUT2"), - - /** CIUINPUT */ + + /** + * CIUINPUT + */ CIUINPUT("CIUINPUT"), - - /** SRINPUT */ + + /** + * SRINPUT + */ SRINPUT("SRINPUT"), - - /** OUTPUT2 */ + + /** + * OUTPUT2 + */ OUTPUT2("OUTPUT2"), - - /** SROUTPUT */ + + /** + * SROUTPUT + */ SROUTPUT("SROUTPUT"), - - /** CAPOUTPUT */ + + /** + * CAPOUTPUT + */ CAPOUTPUT("CAPOUTPUT"), - - /** SROUTPUT2 */ + + /** + * SROUTPUT2 + */ SROUTPUT2("SROUTPUT2"), - - /** CIUOUTPUT */ + + /** + * CIUOUTPUT + */ CIUOUTPUT("CIUOUTPUT"), - - /** ZROUTPUT */ + + /** + * ZROUTPUT + */ ZROUTPUT("ZROUTPUT"), - - /** ZREXPORT */ + + /** + * ZREXPORT + */ ZREXPORT("ZREXPORT"), - - /** ACC28PLUS */ + + /** + * ACC28PLUS + */ ACC28PLUS("ACC28PLUS"), - - /** ACCUPTO28 */ + + /** + * ACCUPTO28 + */ ACCUPTO28("ACCUPTO28"), - - /** OTHEROUTPUT */ + + /** + * OTHEROUTPUT + */ OTHEROUTPUT("OTHEROUTPUT"), - - /** SHOUTPUT */ + + /** + * SHOUTPUT + */ SHOUTPUT("SHOUTPUT"), - - /** ZRINPUT */ + + /** + * ZRINPUT + */ ZRINPUT("ZRINPUT"), - - /** BADDEBT */ + + /** + * BADDEBT + */ BADDEBT("BADDEBT"), - - /** OTHERINPUT */ + + /** + * OTHERINPUT + */ OTHERINPUT("OTHERINPUT"), - - /** BADDEBTRELIEF */ + + /** + * BADDEBTRELIEF + */ BADDEBTRELIEF("BADDEBTRELIEF"), - - /** IGDSINPUT3 */ + + /** + * IGDSINPUT3 + */ IGDSINPUT3("IGDSINPUT3"), - - /** SROVR */ + + /** + * SROVR + */ SROVR("SROVR"), - - /** TOURISTREFUND */ + + /** + * TOURISTREFUND + */ TOURISTREFUND("TOURISTREFUND"), - - /** TXRCN33 */ + + /** + * TXRCN33 + */ TXRCN33("TXRCN33"), - - /** TXRCRE */ + + /** + * TXRCRE + */ TXRCRE("TXRCRE"), - - /** TXRCESS */ + + /** + * TXRCESS + */ TXRCESS("TXRCESS"), - - /** TXRCTS */ + + /** + * TXRCTS + */ TXRCTS("TXRCTS"), - - /** CAPEXINPUT */ + + /** + * CAPEXINPUT + */ CAPEXINPUT("CAPEXINPUT"), - - /** UNDEFINED */ + + /** + * UNDEFINED + */ UNDEFINED("UNDEFINED"), - - /** CAPEXOUTPUT */ + + /** + * CAPEXOUTPUT + */ CAPEXOUTPUT("CAPEXOUTPUT"), - - /** ZEROEXPOUTPUT */ + + /** + * ZEROEXPOUTPUT + */ ZEROEXPOUTPUT("ZEROEXPOUTPUT"), - - /** GOODSIMPORT */ + + /** + * GOODSIMPORT + */ GOODSIMPORT("GOODSIMPORT"), - - /** NONEINPUT */ + + /** + * NONEINPUT + */ NONEINPUT("NONEINPUT"), - - /** NOTREPORTED */ + + /** + * NOTREPORTED + */ NOTREPORTED("NOTREPORTED"), - - /** SROVRRS */ + + /** + * SROVRRS + */ SROVRRS("SROVRRS"), - - /** SROVRLVG */ + + /** + * SROVRLVG + */ SROVRLVG("SROVRLVG"), - - /** SRLVG */ + + /** + * SRLVG + */ SRLVG("SRLVG"), - - /** IM */ + + /** + * IM + */ IM("IM"), - - /** IMESS */ + + /** + * IMESS + */ IMESS("IMESS"), - - /** IMN33 */ + + /** + * IMN33 + */ IMN33("IMN33"), - - /** IMRE */ + + /** + * IMRE + */ IMRE("IMRE"), - - /** BADDEBTRECOVERY */ + + /** + * BADDEBTRECOVERY + */ BADDEBTRECOVERY("BADDEBTRECOVERY"), - - /** USSALESTAX */ + + /** + * USSALESTAX + */ USSALESTAX("USSALESTAX"), - - /** BLINPUT3 */ + + /** + * BLINPUT3 + */ BLINPUT3("BLINPUT3"); private String value; @@ -395,31 +616,25 @@ public enum ReportTaxTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static ReportTaxTypeEnum fromValue(String value) { for (ReportTaxTypeEnum b : ReportTaxTypeEnum.values()) { @@ -431,6 +646,7 @@ public static ReportTaxTypeEnum fromValue(String value) { } } + @JsonProperty("ReportTaxType") private ReportTaxTypeEnum reportTaxType; @@ -455,81 +671,74 @@ public static ReportTaxTypeEnum fromValue(String value) { @JsonProperty("EffectiveRate") private Double effectiveRate; /** - * Name of tax rate - * - * @param name String - * @return TaxRate - */ + * Name of tax rate + * @param name String + * @return TaxRate + **/ public TaxRate name(String name) { this.name = name; return this; } - /** + /** * Name of tax rate - * * @return name - */ + **/ @ApiModelProperty(value = "Name of tax rate") - /** + /** * Name of tax rate - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of tax rate - * - * @param name String - */ + /** + * Name of tax rate + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The tax type - * - * @param taxType String - * @return TaxRate - */ + * The tax type + * @param taxType String + * @return TaxRate + **/ public TaxRate taxType(String taxType) { this.taxType = taxType; return this; } - /** + /** * The tax type - * * @return taxType - */ + **/ @ApiModelProperty(value = "The tax type") - /** + /** * The tax type - * * @return taxType String - */ + **/ public String getTaxType() { return taxType; } - /** - * The tax type - * - * @param taxType String - */ + /** + * The tax type + * @param taxType String + **/ + public void setTaxType(String taxType) { this.taxType = taxType; } /** - * See TaxComponents - * - * @param taxComponents List<TaxComponent> - * @return TaxRate - */ + * See TaxComponents + * @param taxComponents List<TaxComponent> + * @return TaxRate + **/ public TaxRate taxComponents(List taxComponents) { this.taxComponents = taxComponents; return this; @@ -537,10 +746,9 @@ public TaxRate taxComponents(List taxComponents) { /** * See TaxComponents - * - * @param taxComponentsItem TaxComponent + * @param taxComponentsItem TaxComponent * @return TaxRate - */ + **/ public TaxRate addTaxComponentsItem(TaxComponent taxComponentsItem) { if (this.taxComponents == null) { this.taxComponents = new ArrayList(); @@ -549,210 +757,184 @@ public TaxRate addTaxComponentsItem(TaxComponent taxComponentsItem) { return this; } - /** + /** * See TaxComponents - * * @return taxComponents - */ + **/ @ApiModelProperty(value = "See TaxComponents") - /** + /** * See TaxComponents - * * @return taxComponents List - */ + **/ public List getTaxComponents() { return taxComponents; } - /** - * See TaxComponents - * - * @param taxComponents List<TaxComponent> - */ + /** + * See TaxComponents + * @param taxComponents List<TaxComponent> + **/ + public void setTaxComponents(List taxComponents) { this.taxComponents = taxComponents; } /** - * See Status Codes - * - * @param status StatusEnum - * @return TaxRate - */ + * See Status Codes + * @param status StatusEnum + * @return TaxRate + **/ public TaxRate status(StatusEnum status) { this.status = status; return this; } - /** + /** * See Status Codes - * * @return status - */ + **/ @ApiModelProperty(value = "See Status Codes") - /** + /** * See Status Codes - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * See Status Codes - * - * @param status StatusEnum - */ + /** + * See Status Codes + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * See ReportTaxTypes - * - * @param reportTaxType ReportTaxTypeEnum - * @return TaxRate - */ + * See ReportTaxTypes + * @param reportTaxType ReportTaxTypeEnum + * @return TaxRate + **/ public TaxRate reportTaxType(ReportTaxTypeEnum reportTaxType) { this.reportTaxType = reportTaxType; return this; } - /** + /** * See ReportTaxTypes - * * @return reportTaxType - */ + **/ @ApiModelProperty(value = "See ReportTaxTypes") - /** + /** * See ReportTaxTypes - * * @return reportTaxType ReportTaxTypeEnum - */ + **/ public ReportTaxTypeEnum getReportTaxType() { return reportTaxType; } - /** - * See ReportTaxTypes - * - * @param reportTaxType ReportTaxTypeEnum - */ + /** + * See ReportTaxTypes + * @param reportTaxType ReportTaxTypeEnum + **/ + public void setReportTaxType(ReportTaxTypeEnum reportTaxType) { this.reportTaxType = reportTaxType; } - /** - * Boolean to describe if tax rate can be used for asset accounts i.e. true,false - * + /** + * Boolean to describe if tax rate can be used for asset accounts i.e. true,false * @return canApplyToAssets - */ - @ApiModelProperty( - value = "Boolean to describe if tax rate can be used for asset accounts i.e. true,false") - /** - * Boolean to describe if tax rate can be used for asset accounts i.e. true,false - * + **/ + @ApiModelProperty(value = "Boolean to describe if tax rate can be used for asset accounts i.e. true,false") + /** + * Boolean to describe if tax rate can be used for asset accounts i.e. true,false * @return canApplyToAssets Boolean - */ + **/ public Boolean getCanApplyToAssets() { return canApplyToAssets; } - /** + /** * Boolean to describe if tax rate can be used for equity accounts i.e true,false - * * @return canApplyToEquity - */ - @ApiModelProperty( - value = "Boolean to describe if tax rate can be used for equity accounts i.e true,false") - /** + **/ + @ApiModelProperty(value = "Boolean to describe if tax rate can be used for equity accounts i.e true,false") + /** * Boolean to describe if tax rate can be used for equity accounts i.e true,false - * * @return canApplyToEquity Boolean - */ + **/ public Boolean getCanApplyToEquity() { return canApplyToEquity; } - /** - * Boolean to describe if tax rate can be used for expense accounts i.e. true,false - * + /** + * Boolean to describe if tax rate can be used for expense accounts i.e. true,false * @return canApplyToExpenses - */ - @ApiModelProperty( - value = "Boolean to describe if tax rate can be used for expense accounts i.e. true,false") - /** - * Boolean to describe if tax rate can be used for expense accounts i.e. true,false - * + **/ + @ApiModelProperty(value = "Boolean to describe if tax rate can be used for expense accounts i.e. true,false") + /** + * Boolean to describe if tax rate can be used for expense accounts i.e. true,false * @return canApplyToExpenses Boolean - */ + **/ public Boolean getCanApplyToExpenses() { return canApplyToExpenses; } - /** - * Boolean to describe if tax rate can be used for liability accounts i.e. true,false - * + /** + * Boolean to describe if tax rate can be used for liability accounts i.e. true,false * @return canApplyToLiabilities - */ - @ApiModelProperty( - value = "Boolean to describe if tax rate can be used for liability accounts i.e. true,false") - /** - * Boolean to describe if tax rate can be used for liability accounts i.e. true,false - * + **/ + @ApiModelProperty(value = "Boolean to describe if tax rate can be used for liability accounts i.e. true,false") + /** + * Boolean to describe if tax rate can be used for liability accounts i.e. true,false * @return canApplyToLiabilities Boolean - */ + **/ public Boolean getCanApplyToLiabilities() { return canApplyToLiabilities; } - /** + /** * Boolean to describe if tax rate can be used for revenue accounts i.e. true,false - * * @return canApplyToRevenue - */ - @ApiModelProperty( - value = "Boolean to describe if tax rate can be used for revenue accounts i.e. true,false") - /** + **/ + @ApiModelProperty(value = "Boolean to describe if tax rate can be used for revenue accounts i.e. true,false") + /** * Boolean to describe if tax rate can be used for revenue accounts i.e. true,false - * * @return canApplyToRevenue Boolean - */ + **/ public Boolean getCanApplyToRevenue() { return canApplyToRevenue; } - /** + /** * Tax Rate (decimal to 4dp) e.g 12.5000 - * * @return displayTaxRate - */ + **/ @ApiModelProperty(value = "Tax Rate (decimal to 4dp) e.g 12.5000") - /** + /** * Tax Rate (decimal to 4dp) e.g 12.5000 - * * @return displayTaxRate Double - */ + **/ public Double getDisplayTaxRate() { return displayTaxRate; } - /** + /** * Effective Tax Rate (decimal to 4dp) e.g 12.5000 - * * @return effectiveRate - */ + **/ @ApiModelProperty(value = "Effective Tax Rate (decimal to 4dp) e.g 12.5000") - /** + /** * Effective Tax Rate (decimal to 4dp) e.g 12.5000 - * * @return effectiveRate Double - */ + **/ public Double getEffectiveRate() { return effectiveRate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -762,37 +944,26 @@ public boolean equals(java.lang.Object o) { return false; } TaxRate taxRate = (TaxRate) o; - return Objects.equals(this.name, taxRate.name) - && Objects.equals(this.taxType, taxRate.taxType) - && Objects.equals(this.taxComponents, taxRate.taxComponents) - && Objects.equals(this.status, taxRate.status) - && Objects.equals(this.reportTaxType, taxRate.reportTaxType) - && Objects.equals(this.canApplyToAssets, taxRate.canApplyToAssets) - && Objects.equals(this.canApplyToEquity, taxRate.canApplyToEquity) - && Objects.equals(this.canApplyToExpenses, taxRate.canApplyToExpenses) - && Objects.equals(this.canApplyToLiabilities, taxRate.canApplyToLiabilities) - && Objects.equals(this.canApplyToRevenue, taxRate.canApplyToRevenue) - && Objects.equals(this.displayTaxRate, taxRate.displayTaxRate) - && Objects.equals(this.effectiveRate, taxRate.effectiveRate); + return Objects.equals(this.name, taxRate.name) && + Objects.equals(this.taxType, taxRate.taxType) && + Objects.equals(this.taxComponents, taxRate.taxComponents) && + Objects.equals(this.status, taxRate.status) && + Objects.equals(this.reportTaxType, taxRate.reportTaxType) && + Objects.equals(this.canApplyToAssets, taxRate.canApplyToAssets) && + Objects.equals(this.canApplyToEquity, taxRate.canApplyToEquity) && + Objects.equals(this.canApplyToExpenses, taxRate.canApplyToExpenses) && + Objects.equals(this.canApplyToLiabilities, taxRate.canApplyToLiabilities) && + Objects.equals(this.canApplyToRevenue, taxRate.canApplyToRevenue) && + Objects.equals(this.displayTaxRate, taxRate.displayTaxRate) && + Objects.equals(this.effectiveRate, taxRate.effectiveRate); } @Override public int hashCode() { - return Objects.hash( - name, - taxType, - taxComponents, - status, - reportTaxType, - canApplyToAssets, - canApplyToEquity, - canApplyToExpenses, - canApplyToLiabilities, - canApplyToRevenue, - displayTaxRate, - effectiveRate); + return Objects.hash(name, taxType, taxComponents, status, reportTaxType, canApplyToAssets, canApplyToEquity, canApplyToExpenses, canApplyToLiabilities, canApplyToRevenue, displayTaxRate, effectiveRate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -805,9 +976,7 @@ public String toString() { sb.append(" canApplyToAssets: ").append(toIndentedString(canApplyToAssets)).append("\n"); sb.append(" canApplyToEquity: ").append(toIndentedString(canApplyToEquity)).append("\n"); sb.append(" canApplyToExpenses: ").append(toIndentedString(canApplyToExpenses)).append("\n"); - sb.append(" canApplyToLiabilities: ") - .append(toIndentedString(canApplyToLiabilities)) - .append("\n"); + sb.append(" canApplyToLiabilities: ").append(toIndentedString(canApplyToLiabilities)).append("\n"); sb.append(" canApplyToRevenue: ").append(toIndentedString(canApplyToRevenue)).append("\n"); sb.append(" displayTaxRate: ").append(toIndentedString(displayTaxRate)).append("\n"); sb.append(" effectiveRate: ").append(toIndentedString(effectiveRate)).append("\n"); @@ -816,7 +985,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -824,4 +994,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TaxRates.java b/src/main/java/com/xero/models/accounting/TaxRates.java index e3d3d2ced..5a0d6fc3b 100644 --- a/src/main/java/com/xero/models/accounting/TaxRates.java +++ b/src/main/java/com/xero/models/accounting/TaxRates.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.TaxRate; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxRates + */ -/** TaxRates */ public class TaxRates { StringUtil util = new StringUtil(); @JsonProperty("TaxRates") private List taxRates = new ArrayList(); /** - * taxRates - * - * @param taxRates List<TaxRate> - * @return TaxRates - */ + * taxRates + * @param taxRates List<TaxRate> + * @return TaxRates + **/ public TaxRates taxRates(List taxRates) { this.taxRates = taxRates; return this; @@ -37,10 +54,9 @@ public TaxRates taxRates(List taxRates) { /** * taxRates - * - * @param taxRatesItem TaxRate + * @param taxRatesItem TaxRate * @return TaxRates - */ + **/ public TaxRates addTaxRatesItem(TaxRate taxRatesItem) { if (this.taxRates == null) { this.taxRates = new ArrayList(); @@ -49,30 +65,29 @@ public TaxRates addTaxRatesItem(TaxRate taxRatesItem) { return this; } - /** + /** * Get taxRates - * * @return taxRates - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxRates - * * @return taxRates List - */ + **/ public List getTaxRates() { return taxRates; } - /** - * taxRates - * - * @param taxRates List<TaxRate> - */ + /** + * taxRates + * @param taxRates List<TaxRate> + **/ + public void setTaxRates(List taxRates) { this.taxRates = taxRates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(taxRates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TaxType.java b/src/main/java/com/xero/models/accounting/TaxType.java index a11ef1a12..60040d371 100644 --- a/src/main/java/com/xero/models/accounting/TaxType.java +++ b/src/main/java/com/xero/models/accounting/TaxType.java @@ -9,382 +9,640 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; - +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** See Tax Types – can only be used on update calls */ +/** + * See Tax Types – can only be used on update calls + */ public enum TaxType { - - /** OUTPUT */ + + /** + * OUTPUT + */ OUTPUT("OUTPUT"), - - /** INPUT */ + + /** + * INPUT + */ INPUT("INPUT"), - - /** CAPEXINPUT */ + + /** + * CAPEXINPUT + */ CAPEXINPUT("CAPEXINPUT"), - - /** EXEMPTEXPORT */ + + /** + * EXEMPTEXPORT + */ EXEMPTEXPORT("EXEMPTEXPORT"), - - /** EXEMPTEXPENSES */ + + /** + * EXEMPTEXPENSES + */ EXEMPTEXPENSES("EXEMPTEXPENSES"), - - /** EXEMPTCAPITAL */ + + /** + * EXEMPTCAPITAL + */ EXEMPTCAPITAL("EXEMPTCAPITAL"), - - /** EXEMPTOUTPUT */ + + /** + * EXEMPTOUTPUT + */ EXEMPTOUTPUT("EXEMPTOUTPUT"), - - /** INPUTTAXED */ + + /** + * INPUTTAXED + */ INPUTTAXED("INPUTTAXED"), - - /** BASEXCLUDED */ + + /** + * BASEXCLUDED + */ BASEXCLUDED("BASEXCLUDED"), - - /** GSTONCAPIMPORTS */ + + /** + * GSTONCAPIMPORTS + */ GSTONCAPIMPORTS("GSTONCAPIMPORTS"), - - /** GSTONIMPORTS */ + + /** + * GSTONIMPORTS + */ GSTONIMPORTS("GSTONIMPORTS"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"), - - /** INPUT2 */ + + /** + * INPUT2 + */ INPUT2("INPUT2"), - - /** ZERORATED */ + + /** + * ZERORATED + */ ZERORATED("ZERORATED"), - - /** OUTPUT2 */ + + /** + * OUTPUT2 + */ OUTPUT2("OUTPUT2"), - - /** CAPEXINPUT2 */ + + /** + * CAPEXINPUT2 + */ CAPEXINPUT2("CAPEXINPUT2"), - - /** CAPEXOUTPUT */ + + /** + * CAPEXOUTPUT + */ CAPEXOUTPUT("CAPEXOUTPUT"), - - /** CAPEXOUTPUT2 */ + + /** + * CAPEXOUTPUT2 + */ CAPEXOUTPUT2("CAPEXOUTPUT2"), - - /** CAPEXSRINPUT */ + + /** + * CAPEXSRINPUT + */ CAPEXSRINPUT("CAPEXSRINPUT"), - - /** CAPEXSROUTPUT */ + + /** + * CAPEXSROUTPUT + */ CAPEXSROUTPUT("CAPEXSROUTPUT"), - - /** ECACQUISITIONS */ + + /** + * ECACQUISITIONS + */ ECACQUISITIONS("ECACQUISITIONS"), - - /** ECZRINPUT */ + + /** + * ECZRINPUT + */ ECZRINPUT("ECZRINPUT"), - - /** ECZROUTPUT */ + + /** + * ECZROUTPUT + */ ECZROUTPUT("ECZROUTPUT"), - - /** ECZROUTPUTSERVICES */ + + /** + * ECZROUTPUTSERVICES + */ ECZROUTPUTSERVICES("ECZROUTPUTSERVICES"), - - /** EXEMPTINPUT */ + + /** + * EXEMPTINPUT + */ EXEMPTINPUT("EXEMPTINPUT"), - - /** REVERSECHARGES */ + + /** + * REVERSECHARGES + */ REVERSECHARGES("REVERSECHARGES"), - - /** RRINPUT */ + + /** + * RRINPUT + */ RRINPUT("RRINPUT"), - - /** RROUTPUT */ + + /** + * RROUTPUT + */ RROUTPUT("RROUTPUT"), - - /** SRINPUT */ + + /** + * SRINPUT + */ SRINPUT("SRINPUT"), - - /** SROUTPUT */ + + /** + * SROUTPUT + */ SROUTPUT("SROUTPUT"), - - /** ZERORATEDINPUT */ + + /** + * ZERORATEDINPUT + */ ZERORATEDINPUT("ZERORATEDINPUT"), - - /** ZERORATEDOUTPUT */ + + /** + * ZERORATEDOUTPUT + */ ZERORATEDOUTPUT("ZERORATEDOUTPUT"), - - /** BLINPUT */ + + /** + * BLINPUT + */ BLINPUT("BLINPUT"), - - /** DSOUTPUT */ + + /** + * DSOUTPUT + */ DSOUTPUT("DSOUTPUT"), - - /** EPINPUT */ + + /** + * EPINPUT + */ EPINPUT("EPINPUT"), - - /** ES33OUTPUT */ + + /** + * ES33OUTPUT + */ ES33OUTPUT("ES33OUTPUT"), - - /** ESN33OUTPUT */ + + /** + * ESN33OUTPUT + */ ESN33OUTPUT("ESN33OUTPUT"), - - /** IGDSINPUT2 */ + + /** + * IGDSINPUT2 + */ IGDSINPUT2("IGDSINPUT2"), - - /** IMINPUT2 */ + + /** + * IMINPUT2 + */ IMINPUT2("IMINPUT2"), - - /** MEINPUT */ + + /** + * MEINPUT + */ MEINPUT("MEINPUT"), - - /** NRINPUT */ + + /** + * NRINPUT + */ NRINPUT("NRINPUT"), - - /** OPINPUT */ + + /** + * OPINPUT + */ OPINPUT("OPINPUT"), - - /** OSOUTPUT */ + + /** + * OSOUTPUT + */ OSOUTPUT("OSOUTPUT"), - - /** TXESSINPUT */ + + /** + * TXESSINPUT + */ TXESSINPUT("TXESSINPUT"), - - /** TXN33INPUT */ + + /** + * TXN33INPUT + */ TXN33INPUT("TXN33INPUT"), - - /** TXPETINPUT */ + + /** + * TXPETINPUT + */ TXPETINPUT("TXPETINPUT"), - - /** TXREINPUT */ + + /** + * TXREINPUT + */ TXREINPUT("TXREINPUT"), - - /** INPUT3 */ + + /** + * INPUT3 + */ INPUT3("INPUT3"), - - /** INPUT4 */ + + /** + * INPUT4 + */ INPUT4("INPUT4"), - - /** OUTPUT3 */ + + /** + * OUTPUT3 + */ OUTPUT3("OUTPUT3"), - - /** OUTPUT4 */ + + /** + * OUTPUT4 + */ OUTPUT4("OUTPUT4"), - - /** SROUTPUT2 */ + + /** + * SROUTPUT2 + */ SROUTPUT2("SROUTPUT2"), - - /** TXCA */ + + /** + * TXCA + */ TXCA("TXCA"), - - /** SRCAS */ + + /** + * SRCAS + */ SRCAS("SRCAS"), - - /** BLINPUT2 */ + + /** + * BLINPUT2 + */ BLINPUT2("BLINPUT2"), - - /** DRCHARGESUPPLY20 */ + + /** + * DRCHARGESUPPLY20 + */ DRCHARGESUPPLY20("DRCHARGESUPPLY20"), - - /** DRCHARGE20 */ + + /** + * DRCHARGE20 + */ DRCHARGE20("DRCHARGE20"), - - /** DRCHARGESUPPLY5 */ + + /** + * DRCHARGESUPPLY5 + */ DRCHARGESUPPLY5("DRCHARGESUPPLY5"), - - /** DRCHARGE5 */ + + /** + * DRCHARGE5 + */ DRCHARGE5("DRCHARGE5"), - - /** BADDEBTRELIEF */ + + /** + * BADDEBTRELIEF + */ BADDEBTRELIEF("BADDEBTRELIEF"), - - /** IGDSINPUT3 */ + + /** + * IGDSINPUT3 + */ IGDSINPUT3("IGDSINPUT3"), - - /** SROVR */ + + /** + * SROVR + */ SROVR("SROVR"), - - /** TOURISTREFUND */ + + /** + * TOURISTREFUND + */ TOURISTREFUND("TOURISTREFUND"), - - /** TXRCN33 */ + + /** + * TXRCN33 + */ TXRCN33("TXRCN33"), - - /** TXRCRE */ + + /** + * TXRCRE + */ TXRCRE("TXRCRE"), - - /** TXRCESS */ + + /** + * TXRCESS + */ TXRCESS("TXRCESS"), - - /** TXRCTS */ + + /** + * TXRCTS + */ TXRCTS("TXRCTS"), - - /** OUTPUTY23 */ + + /** + * OUTPUTY23 + */ OUTPUTY23("OUTPUTY23"), - - /** DSOUTPUTY23 */ + + /** + * DSOUTPUTY23 + */ DSOUTPUTY23("DSOUTPUTY23"), - - /** INPUTY23 */ + + /** + * INPUTY23 + */ INPUTY23("INPUTY23"), - - /** IMINPUT2Y23 */ + + /** + * IMINPUT2Y23 + */ IMINPUT2Y23("IMINPUT2Y23"), - - /** IGDSINPUT2Y23 */ + + /** + * IGDSINPUT2Y23 + */ IGDSINPUT2Y23("IGDSINPUT2Y23"), - - /** TXPETINPUTY23 */ + + /** + * TXPETINPUTY23 + */ TXPETINPUTY23("TXPETINPUTY23"), - - /** TXESSINPUTY23 */ + + /** + * TXESSINPUTY23 + */ TXESSINPUTY23("TXESSINPUTY23"), - - /** TXN33INPUTY23 */ + + /** + * TXN33INPUTY23 + */ TXN33INPUTY23("TXN33INPUTY23"), - - /** TXREINPUTY23 */ + + /** + * TXREINPUTY23 + */ TXREINPUTY23("TXREINPUTY23"), - - /** TXCAY23 */ + + /** + * TXCAY23 + */ TXCAY23("TXCAY23"), - - /** BADDEBTRELIEFY23 */ + + /** + * BADDEBTRELIEFY23 + */ BADDEBTRELIEFY23("BADDEBTRELIEFY23"), - - /** IGDSINPUT3Y23 */ + + /** + * IGDSINPUT3Y23 + */ IGDSINPUT3Y23("IGDSINPUT3Y23"), - - /** SROVRRSY23 */ + + /** + * SROVRRSY23 + */ SROVRRSY23("SROVRRSY23"), - - /** SROVRLVGY23 */ + + /** + * SROVRLVGY23 + */ SROVRLVGY23("SROVRLVGY23"), - - /** SRLVGY23 */ + + /** + * SRLVGY23 + */ SRLVGY23("SRLVGY23"), - - /** TXRCN33Y23 */ + + /** + * TXRCN33Y23 + */ TXRCN33Y23("TXRCN33Y23"), - - /** TXRCREY23 */ + + /** + * TXRCREY23 + */ TXRCREY23("TXRCREY23"), - - /** TXRCESSY23 */ + + /** + * TXRCESSY23 + */ TXRCESSY23("TXRCESSY23"), - - /** TXRCTSY23 */ + + /** + * TXRCTSY23 + */ TXRCTSY23("TXRCTSY23"), - - /** IM */ + + /** + * IM + */ IM("IM"), - - /** IMY23 */ + + /** + * IMY23 + */ IMY23("IMY23"), - - /** IMESS */ + + /** + * IMESS + */ IMESS("IMESS"), - - /** IMESSY23 */ + + /** + * IMESSY23 + */ IMESSY23("IMESSY23"), - - /** IMN33 */ + + /** + * IMN33 + */ IMN33("IMN33"), - - /** IMN33Y23 */ + + /** + * IMN33Y23 + */ IMN33Y23("IMN33Y23"), - - /** IMRE */ + + /** + * IMRE + */ IMRE("IMRE"), - - /** IMREY23 */ + + /** + * IMREY23 + */ IMREY23("IMREY23"), - - /** BADDEBTRECOVERY */ + + /** + * BADDEBTRECOVERY + */ BADDEBTRECOVERY("BADDEBTRECOVERY"), - - /** BADDEBTRECOVERYY23 */ + + /** + * BADDEBTRECOVERYY23 + */ BADDEBTRECOVERYY23("BADDEBTRECOVERYY23"), - - /** OUTPUTY24 */ + + /** + * OUTPUTY24 + */ OUTPUTY24("OUTPUTY24"), - - /** DSOUTPUTY24 */ + + /** + * DSOUTPUTY24 + */ DSOUTPUTY24("DSOUTPUTY24"), - - /** INPUTY24 */ + + /** + * INPUTY24 + */ INPUTY24("INPUTY24"), - - /** IGDSINPUT2Y24 */ + + /** + * IGDSINPUT2Y24 + */ IGDSINPUT2Y24("IGDSINPUT2Y24"), - - /** TXPETINPUTY24 */ + + /** + * TXPETINPUTY24 + */ TXPETINPUTY24("TXPETINPUTY24"), - - /** TXESSINPUTY24 */ + + /** + * TXESSINPUTY24 + */ TXESSINPUTY24("TXESSINPUTY24"), - - /** TXN33INPUTY24 */ + + /** + * TXN33INPUTY24 + */ TXN33INPUTY24("TXN33INPUTY24"), - - /** TXREINPUTY24 */ + + /** + * TXREINPUTY24 + */ TXREINPUTY24("TXREINPUTY24"), - - /** TXCAY24 */ + + /** + * TXCAY24 + */ TXCAY24("TXCAY24"), - - /** BADDEBTRELIEFY24 */ + + /** + * BADDEBTRELIEFY24 + */ BADDEBTRELIEFY24("BADDEBTRELIEFY24"), - - /** IGDSINPUT3Y24 */ + + /** + * IGDSINPUT3Y24 + */ IGDSINPUT3Y24("IGDSINPUT3Y24"), - - /** SROVRRSY24 */ + + /** + * SROVRRSY24 + */ SROVRRSY24("SROVRRSY24"), - - /** SROVRLVGY24 */ + + /** + * SROVRLVGY24 + */ SROVRLVGY24("SROVRLVGY24"), - - /** SRLVGY24 */ + + /** + * SRLVGY24 + */ SRLVGY24("SRLVGY24"), - - /** TXRCTSY24 */ + + /** + * TXRCTSY24 + */ TXRCTSY24("TXRCTSY24"), - - /** TXRCESSY24 */ + + /** + * TXRCESSY24 + */ TXRCESSY24("TXRCESSY24"), - - /** TXRCN33Y24 */ + + /** + * TXRCN33Y24 + */ TXRCN33Y24("TXRCN33Y24"), - - /** TXRCREY24 */ + + /** + * TXRCREY24 + */ TXRCREY24("TXRCREY24"), - - /** IMY24 */ + + /** + * IMY24 + */ IMY24("IMY24"), - - /** IMESSY24 */ + + /** + * IMESSY24 + */ IMESSY24("IMESSY24"), - - /** IMN33Y24 */ + + /** + * IMN33Y24 + */ IMN33Y24("IMN33Y24"), - - /** IMREY24 */ + + /** + * IMREY24 + */ IMREY24("IMREY24"), - - /** BADDEBTRECOVERYY24 */ + + /** + * BADDEBTRECOVERYY24 + */ BADDEBTRECOVERYY24("BADDEBTRECOVERYY24"), - - /** OSOUTPUT2 */ + + /** + * OSOUTPUT2 + */ OSOUTPUT2("OSOUTPUT2"), - - /** BLINPUT3 */ + + /** + * BLINPUT3 + */ BLINPUT3("BLINPUT3"), - - /** BLINPUT3Y23 */ + + /** + * BLINPUT3Y23 + */ BLINPUT3Y23("BLINPUT3Y23"), - - /** BLINPUT3Y24 */ + + /** + * BLINPUT3Y24 + */ BLINPUT3Y24("BLINPUT3Y24"); private String value; @@ -393,26 +651,24 @@ public enum TaxType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static TaxType fromValue(String value) { @@ -424,3 +680,4 @@ public static TaxType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/TenNinetyNineContact.java b/src/main/java/com/xero/models/accounting/TenNinetyNineContact.java index 07d0a77e7..0b6758719 100644 --- a/src/main/java/com/xero/models/accounting/TenNinetyNineContact.java +++ b/src/main/java/com/xero/models/accounting/TenNinetyNineContact.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TenNinetyNineContact + */ -/** TenNinetyNineContact */ public class TenNinetyNineContact { StringUtil util = new StringUtil(); @@ -94,27 +109,43 @@ public class TenNinetyNineContact { @JsonProperty("BusinessName") private String businessName; - /** Contact federal tax classification */ + /** + * Contact federal tax classification + */ public enum FederalTaxClassificationEnum { - /** SOLE_PROPRIETOR */ + /** + * SOLE_PROPRIETOR + */ SOLE_PROPRIETOR("SOLE_PROPRIETOR"), - - /** PARTNERSHIP */ + + /** + * PARTNERSHIP + */ PARTNERSHIP("PARTNERSHIP"), - - /** TRUST_OR_ESTATE */ + + /** + * TRUST_OR_ESTATE + */ TRUST_OR_ESTATE("TRUST_OR_ESTATE"), - - /** NONPROFIT */ + + /** + * NONPROFIT + */ NONPROFIT("NONPROFIT"), - - /** C_CORP */ + + /** + * C_CORP + */ C_CORP("C_CORP"), - - /** S_CORP */ + + /** + * S_CORP + */ S_CORP("S_CORP"), - - /** OTHER */ + + /** + * OTHER + */ OTHER("OTHER"); private String value; @@ -123,31 +154,25 @@ public enum FederalTaxClassificationEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static FederalTaxClassificationEnum fromValue(String value) { for (FederalTaxClassificationEnum b : FederalTaxClassificationEnum.values()) { @@ -159,884 +184,810 @@ public static FederalTaxClassificationEnum fromValue(String value) { } } + @JsonProperty("FederalTaxClassification") private FederalTaxClassificationEnum federalTaxClassification; /** - * Box 1 on 1099 Form - * - * @param box1 Double - * @return TenNinetyNineContact - */ + * Box 1 on 1099 Form + * @param box1 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box1(Double box1) { this.box1 = box1; return this; } - /** + /** * Box 1 on 1099 Form - * * @return box1 - */ + **/ @ApiModelProperty(value = "Box 1 on 1099 Form") - /** + /** * Box 1 on 1099 Form - * * @return box1 Double - */ + **/ public Double getBox1() { return box1; } - /** - * Box 1 on 1099 Form - * - * @param box1 Double - */ + /** + * Box 1 on 1099 Form + * @param box1 Double + **/ + public void setBox1(Double box1) { this.box1 = box1; } /** - * Box 2 on 1099 Form - * - * @param box2 Double - * @return TenNinetyNineContact - */ + * Box 2 on 1099 Form + * @param box2 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box2(Double box2) { this.box2 = box2; return this; } - /** + /** * Box 2 on 1099 Form - * * @return box2 - */ + **/ @ApiModelProperty(value = "Box 2 on 1099 Form") - /** + /** * Box 2 on 1099 Form - * * @return box2 Double - */ + **/ public Double getBox2() { return box2; } - /** - * Box 2 on 1099 Form - * - * @param box2 Double - */ + /** + * Box 2 on 1099 Form + * @param box2 Double + **/ + public void setBox2(Double box2) { this.box2 = box2; } /** - * Box 3 on 1099 Form - * - * @param box3 Double - * @return TenNinetyNineContact - */ + * Box 3 on 1099 Form + * @param box3 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box3(Double box3) { this.box3 = box3; return this; } - /** + /** * Box 3 on 1099 Form - * * @return box3 - */ + **/ @ApiModelProperty(value = "Box 3 on 1099 Form") - /** + /** * Box 3 on 1099 Form - * * @return box3 Double - */ + **/ public Double getBox3() { return box3; } - /** - * Box 3 on 1099 Form - * - * @param box3 Double - */ + /** + * Box 3 on 1099 Form + * @param box3 Double + **/ + public void setBox3(Double box3) { this.box3 = box3; } /** - * Box 4 on 1099 Form - * - * @param box4 Double - * @return TenNinetyNineContact - */ + * Box 4 on 1099 Form + * @param box4 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box4(Double box4) { this.box4 = box4; return this; } - /** + /** * Box 4 on 1099 Form - * * @return box4 - */ + **/ @ApiModelProperty(value = "Box 4 on 1099 Form") - /** + /** * Box 4 on 1099 Form - * * @return box4 Double - */ + **/ public Double getBox4() { return box4; } - /** - * Box 4 on 1099 Form - * - * @param box4 Double - */ + /** + * Box 4 on 1099 Form + * @param box4 Double + **/ + public void setBox4(Double box4) { this.box4 = box4; } /** - * Box 5 on 1099 Form - * - * @param box5 Double - * @return TenNinetyNineContact - */ + * Box 5 on 1099 Form + * @param box5 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box5(Double box5) { this.box5 = box5; return this; } - /** + /** * Box 5 on 1099 Form - * * @return box5 - */ + **/ @ApiModelProperty(value = "Box 5 on 1099 Form") - /** + /** * Box 5 on 1099 Form - * * @return box5 Double - */ + **/ public Double getBox5() { return box5; } - /** - * Box 5 on 1099 Form - * - * @param box5 Double - */ + /** + * Box 5 on 1099 Form + * @param box5 Double + **/ + public void setBox5(Double box5) { this.box5 = box5; } /** - * Box 6 on 1099 Form - * - * @param box6 Double - * @return TenNinetyNineContact - */ + * Box 6 on 1099 Form + * @param box6 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box6(Double box6) { this.box6 = box6; return this; } - /** + /** * Box 6 on 1099 Form - * * @return box6 - */ + **/ @ApiModelProperty(value = "Box 6 on 1099 Form") - /** + /** * Box 6 on 1099 Form - * * @return box6 Double - */ + **/ public Double getBox6() { return box6; } - /** - * Box 6 on 1099 Form - * - * @param box6 Double - */ + /** + * Box 6 on 1099 Form + * @param box6 Double + **/ + public void setBox6(Double box6) { this.box6 = box6; } /** - * Box 7 on 1099 Form - * - * @param box7 Double - * @return TenNinetyNineContact - */ + * Box 7 on 1099 Form + * @param box7 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box7(Double box7) { this.box7 = box7; return this; } - /** + /** * Box 7 on 1099 Form - * * @return box7 - */ + **/ @ApiModelProperty(value = "Box 7 on 1099 Form") - /** + /** * Box 7 on 1099 Form - * * @return box7 Double - */ + **/ public Double getBox7() { return box7; } - /** - * Box 7 on 1099 Form - * - * @param box7 Double - */ + /** + * Box 7 on 1099 Form + * @param box7 Double + **/ + public void setBox7(Double box7) { this.box7 = box7; } /** - * Box 8 on 1099 Form - * - * @param box8 Double - * @return TenNinetyNineContact - */ + * Box 8 on 1099 Form + * @param box8 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box8(Double box8) { this.box8 = box8; return this; } - /** + /** * Box 8 on 1099 Form - * * @return box8 - */ + **/ @ApiModelProperty(value = "Box 8 on 1099 Form") - /** + /** * Box 8 on 1099 Form - * * @return box8 Double - */ + **/ public Double getBox8() { return box8; } - /** - * Box 8 on 1099 Form - * - * @param box8 Double - */ + /** + * Box 8 on 1099 Form + * @param box8 Double + **/ + public void setBox8(Double box8) { this.box8 = box8; } /** - * Box 9 on 1099 Form - * - * @param box9 Double - * @return TenNinetyNineContact - */ + * Box 9 on 1099 Form + * @param box9 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box9(Double box9) { this.box9 = box9; return this; } - /** + /** * Box 9 on 1099 Form - * * @return box9 - */ + **/ @ApiModelProperty(value = "Box 9 on 1099 Form") - /** + /** * Box 9 on 1099 Form - * * @return box9 Double - */ + **/ public Double getBox9() { return box9; } - /** - * Box 9 on 1099 Form - * - * @param box9 Double - */ + /** + * Box 9 on 1099 Form + * @param box9 Double + **/ + public void setBox9(Double box9) { this.box9 = box9; } /** - * Box 10 on 1099 Form - * - * @param box10 Double - * @return TenNinetyNineContact - */ + * Box 10 on 1099 Form + * @param box10 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box10(Double box10) { this.box10 = box10; return this; } - /** + /** * Box 10 on 1099 Form - * * @return box10 - */ + **/ @ApiModelProperty(value = "Box 10 on 1099 Form") - /** + /** * Box 10 on 1099 Form - * * @return box10 Double - */ + **/ public Double getBox10() { return box10; } - /** - * Box 10 on 1099 Form - * - * @param box10 Double - */ + /** + * Box 10 on 1099 Form + * @param box10 Double + **/ + public void setBox10(Double box10) { this.box10 = box10; } /** - * Box 11 on 1099 Form - * - * @param box11 Double - * @return TenNinetyNineContact - */ + * Box 11 on 1099 Form + * @param box11 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box11(Double box11) { this.box11 = box11; return this; } - /** + /** * Box 11 on 1099 Form - * * @return box11 - */ + **/ @ApiModelProperty(value = "Box 11 on 1099 Form") - /** + /** * Box 11 on 1099 Form - * * @return box11 Double - */ + **/ public Double getBox11() { return box11; } - /** - * Box 11 on 1099 Form - * - * @param box11 Double - */ + /** + * Box 11 on 1099 Form + * @param box11 Double + **/ + public void setBox11(Double box11) { this.box11 = box11; } /** - * Box 13 on 1099 Form - * - * @param box13 Double - * @return TenNinetyNineContact - */ + * Box 13 on 1099 Form + * @param box13 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box13(Double box13) { this.box13 = box13; return this; } - /** + /** * Box 13 on 1099 Form - * * @return box13 - */ + **/ @ApiModelProperty(value = "Box 13 on 1099 Form") - /** + /** * Box 13 on 1099 Form - * * @return box13 Double - */ + **/ public Double getBox13() { return box13; } - /** - * Box 13 on 1099 Form - * - * @param box13 Double - */ + /** + * Box 13 on 1099 Form + * @param box13 Double + **/ + public void setBox13(Double box13) { this.box13 = box13; } /** - * Box 14 on 1099 Form - * - * @param box14 Double - * @return TenNinetyNineContact - */ + * Box 14 on 1099 Form + * @param box14 Double + * @return TenNinetyNineContact + **/ public TenNinetyNineContact box14(Double box14) { this.box14 = box14; return this; } - /** + /** * Box 14 on 1099 Form - * * @return box14 - */ + **/ @ApiModelProperty(value = "Box 14 on 1099 Form") - /** + /** * Box 14 on 1099 Form - * * @return box14 Double - */ + **/ public Double getBox14() { return box14; } - /** - * Box 14 on 1099 Form - * - * @param box14 Double - */ + /** + * Box 14 on 1099 Form + * @param box14 Double + **/ + public void setBox14(Double box14) { this.box14 = box14; } /** - * Contact name on 1099 Form - * - * @param name String - * @return TenNinetyNineContact - */ + * Contact name on 1099 Form + * @param name String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact name(String name) { this.name = name; return this; } - /** + /** * Contact name on 1099 Form - * * @return name - */ + **/ @ApiModelProperty(value = "Contact name on 1099 Form") - /** + /** * Contact name on 1099 Form - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Contact name on 1099 Form - * - * @param name String - */ + /** + * Contact name on 1099 Form + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Contact Fed Tax ID type - * - * @param federalTaxIDType String - * @return TenNinetyNineContact - */ + * Contact Fed Tax ID type + * @param federalTaxIDType String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact federalTaxIDType(String federalTaxIDType) { this.federalTaxIDType = federalTaxIDType; return this; } - /** + /** * Contact Fed Tax ID type - * * @return federalTaxIDType - */ + **/ @ApiModelProperty(value = "Contact Fed Tax ID type") - /** + /** * Contact Fed Tax ID type - * * @return federalTaxIDType String - */ + **/ public String getFederalTaxIDType() { return federalTaxIDType; } - /** - * Contact Fed Tax ID type - * - * @param federalTaxIDType String - */ + /** + * Contact Fed Tax ID type + * @param federalTaxIDType String + **/ + public void setFederalTaxIDType(String federalTaxIDType) { this.federalTaxIDType = federalTaxIDType; } /** - * Contact city on 1099 Form - * - * @param city String - * @return TenNinetyNineContact - */ + * Contact city on 1099 Form + * @param city String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact city(String city) { this.city = city; return this; } - /** + /** * Contact city on 1099 Form - * * @return city - */ + **/ @ApiModelProperty(value = "Contact city on 1099 Form") - /** + /** * Contact city on 1099 Form - * * @return city String - */ + **/ public String getCity() { return city; } - /** - * Contact city on 1099 Form - * - * @param city String - */ + /** + * Contact city on 1099 Form + * @param city String + **/ + public void setCity(String city) { this.city = city; } /** - * Contact zip on 1099 Form - * - * @param zip String - * @return TenNinetyNineContact - */ + * Contact zip on 1099 Form + * @param zip String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact zip(String zip) { this.zip = zip; return this; } - /** + /** * Contact zip on 1099 Form - * * @return zip - */ + **/ @ApiModelProperty(value = "Contact zip on 1099 Form") - /** + /** * Contact zip on 1099 Form - * * @return zip String - */ + **/ public String getZip() { return zip; } - /** - * Contact zip on 1099 Form - * - * @param zip String - */ + /** + * Contact zip on 1099 Form + * @param zip String + **/ + public void setZip(String zip) { this.zip = zip; } /** - * Contact State on 1099 Form - * - * @param state String - * @return TenNinetyNineContact - */ + * Contact State on 1099 Form + * @param state String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact state(String state) { this.state = state; return this; } - /** + /** * Contact State on 1099 Form - * * @return state - */ + **/ @ApiModelProperty(value = "Contact State on 1099 Form") - /** + /** * Contact State on 1099 Form - * * @return state String - */ + **/ public String getState() { return state; } - /** - * Contact State on 1099 Form - * - * @param state String - */ + /** + * Contact State on 1099 Form + * @param state String + **/ + public void setState(String state) { this.state = state; } /** - * Contact email on 1099 Form - * - * @param email String - * @return TenNinetyNineContact - */ + * Contact email on 1099 Form + * @param email String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact email(String email) { this.email = email; return this; } - /** + /** * Contact email on 1099 Form - * * @return email - */ + **/ @ApiModelProperty(value = "Contact email on 1099 Form") - /** + /** * Contact email on 1099 Form - * * @return email String - */ + **/ public String getEmail() { return email; } - /** - * Contact email on 1099 Form - * - * @param email String - */ + /** + * Contact email on 1099 Form + * @param email String + **/ + public void setEmail(String email) { this.email = email; } /** - * Contact address on 1099 Form - * - * @param streetAddress String - * @return TenNinetyNineContact - */ + * Contact address on 1099 Form + * @param streetAddress String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact streetAddress(String streetAddress) { this.streetAddress = streetAddress; return this; } - /** + /** * Contact address on 1099 Form - * * @return streetAddress - */ + **/ @ApiModelProperty(value = "Contact address on 1099 Form") - /** + /** * Contact address on 1099 Form - * * @return streetAddress String - */ + **/ public String getStreetAddress() { return streetAddress; } - /** - * Contact address on 1099 Form - * - * @param streetAddress String - */ + /** + * Contact address on 1099 Form + * @param streetAddress String + **/ + public void setStreetAddress(String streetAddress) { this.streetAddress = streetAddress; } /** - * Contact tax id on 1099 Form - * - * @param taxID String - * @return TenNinetyNineContact - */ + * Contact tax id on 1099 Form + * @param taxID String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact taxID(String taxID) { this.taxID = taxID; return this; } - /** + /** * Contact tax id on 1099 Form - * * @return taxID - */ + **/ @ApiModelProperty(value = "Contact tax id on 1099 Form") - /** + /** * Contact tax id on 1099 Form - * * @return taxID String - */ + **/ public String getTaxID() { return taxID; } - /** - * Contact tax id on 1099 Form - * - * @param taxID String - */ + /** + * Contact tax id on 1099 Form + * @param taxID String + **/ + public void setTaxID(String taxID) { this.taxID = taxID; } /** - * Contact contact id - * - * @param contactId UUID - * @return TenNinetyNineContact - */ + * Contact contact id + * @param contactId UUID + * @return TenNinetyNineContact + **/ public TenNinetyNineContact contactId(UUID contactId) { this.contactId = contactId; return this; } - /** + /** * Contact contact id - * * @return contactId - */ + **/ @ApiModelProperty(value = "Contact contact id") - /** + /** * Contact contact id - * * @return contactId UUID - */ + **/ public UUID getContactId() { return contactId; } - /** - * Contact contact id - * - * @param contactId UUID - */ + /** + * Contact contact id + * @param contactId UUID + **/ + public void setContactId(UUID contactId) { this.contactId = contactId; } /** - * Contact legal name - * - * @param legalName String - * @return TenNinetyNineContact - */ + * Contact legal name + * @param legalName String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact legalName(String legalName) { this.legalName = legalName; return this; } - /** + /** * Contact legal name - * * @return legalName - */ + **/ @ApiModelProperty(value = "Contact legal name") - /** + /** * Contact legal name - * * @return legalName String - */ + **/ public String getLegalName() { return legalName; } - /** - * Contact legal name - * - * @param legalName String - */ + /** + * Contact legal name + * @param legalName String + **/ + public void setLegalName(String legalName) { this.legalName = legalName; } /** - * Contact business name - * - * @param businessName String - * @return TenNinetyNineContact - */ + * Contact business name + * @param businessName String + * @return TenNinetyNineContact + **/ public TenNinetyNineContact businessName(String businessName) { this.businessName = businessName; return this; } - /** + /** * Contact business name - * * @return businessName - */ + **/ @ApiModelProperty(value = "Contact business name") - /** + /** * Contact business name - * * @return businessName String - */ + **/ public String getBusinessName() { return businessName; } - /** - * Contact business name - * - * @param businessName String - */ + /** + * Contact business name + * @param businessName String + **/ + public void setBusinessName(String businessName) { this.businessName = businessName; } /** - * Contact federal tax classification - * - * @param federalTaxClassification FederalTaxClassificationEnum - * @return TenNinetyNineContact - */ - public TenNinetyNineContact federalTaxClassification( - FederalTaxClassificationEnum federalTaxClassification) { + * Contact federal tax classification + * @param federalTaxClassification FederalTaxClassificationEnum + * @return TenNinetyNineContact + **/ + public TenNinetyNineContact federalTaxClassification(FederalTaxClassificationEnum federalTaxClassification) { this.federalTaxClassification = federalTaxClassification; return this; } - /** + /** * Contact federal tax classification - * * @return federalTaxClassification - */ + **/ @ApiModelProperty(value = "Contact federal tax classification") - /** + /** * Contact federal tax classification - * * @return federalTaxClassification FederalTaxClassificationEnum - */ + **/ public FederalTaxClassificationEnum getFederalTaxClassification() { return federalTaxClassification; } - /** - * Contact federal tax classification - * - * @param federalTaxClassification FederalTaxClassificationEnum - */ + /** + * Contact federal tax classification + * @param federalTaxClassification FederalTaxClassificationEnum + **/ + public void setFederalTaxClassification(FederalTaxClassificationEnum federalTaxClassification) { this.federalTaxClassification = federalTaxClassification; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1046,64 +997,39 @@ public boolean equals(java.lang.Object o) { return false; } TenNinetyNineContact tenNinetyNineContact = (TenNinetyNineContact) o; - return Objects.equals(this.box1, tenNinetyNineContact.box1) - && Objects.equals(this.box2, tenNinetyNineContact.box2) - && Objects.equals(this.box3, tenNinetyNineContact.box3) - && Objects.equals(this.box4, tenNinetyNineContact.box4) - && Objects.equals(this.box5, tenNinetyNineContact.box5) - && Objects.equals(this.box6, tenNinetyNineContact.box6) - && Objects.equals(this.box7, tenNinetyNineContact.box7) - && Objects.equals(this.box8, tenNinetyNineContact.box8) - && Objects.equals(this.box9, tenNinetyNineContact.box9) - && Objects.equals(this.box10, tenNinetyNineContact.box10) - && Objects.equals(this.box11, tenNinetyNineContact.box11) - && Objects.equals(this.box13, tenNinetyNineContact.box13) - && Objects.equals(this.box14, tenNinetyNineContact.box14) - && Objects.equals(this.name, tenNinetyNineContact.name) - && Objects.equals(this.federalTaxIDType, tenNinetyNineContact.federalTaxIDType) - && Objects.equals(this.city, tenNinetyNineContact.city) - && Objects.equals(this.zip, tenNinetyNineContact.zip) - && Objects.equals(this.state, tenNinetyNineContact.state) - && Objects.equals(this.email, tenNinetyNineContact.email) - && Objects.equals(this.streetAddress, tenNinetyNineContact.streetAddress) - && Objects.equals(this.taxID, tenNinetyNineContact.taxID) - && Objects.equals(this.contactId, tenNinetyNineContact.contactId) - && Objects.equals(this.legalName, tenNinetyNineContact.legalName) - && Objects.equals(this.businessName, tenNinetyNineContact.businessName) - && Objects.equals( - this.federalTaxClassification, tenNinetyNineContact.federalTaxClassification); + return Objects.equals(this.box1, tenNinetyNineContact.box1) && + Objects.equals(this.box2, tenNinetyNineContact.box2) && + Objects.equals(this.box3, tenNinetyNineContact.box3) && + Objects.equals(this.box4, tenNinetyNineContact.box4) && + Objects.equals(this.box5, tenNinetyNineContact.box5) && + Objects.equals(this.box6, tenNinetyNineContact.box6) && + Objects.equals(this.box7, tenNinetyNineContact.box7) && + Objects.equals(this.box8, tenNinetyNineContact.box8) && + Objects.equals(this.box9, tenNinetyNineContact.box9) && + Objects.equals(this.box10, tenNinetyNineContact.box10) && + Objects.equals(this.box11, tenNinetyNineContact.box11) && + Objects.equals(this.box13, tenNinetyNineContact.box13) && + Objects.equals(this.box14, tenNinetyNineContact.box14) && + Objects.equals(this.name, tenNinetyNineContact.name) && + Objects.equals(this.federalTaxIDType, tenNinetyNineContact.federalTaxIDType) && + Objects.equals(this.city, tenNinetyNineContact.city) && + Objects.equals(this.zip, tenNinetyNineContact.zip) && + Objects.equals(this.state, tenNinetyNineContact.state) && + Objects.equals(this.email, tenNinetyNineContact.email) && + Objects.equals(this.streetAddress, tenNinetyNineContact.streetAddress) && + Objects.equals(this.taxID, tenNinetyNineContact.taxID) && + Objects.equals(this.contactId, tenNinetyNineContact.contactId) && + Objects.equals(this.legalName, tenNinetyNineContact.legalName) && + Objects.equals(this.businessName, tenNinetyNineContact.businessName) && + Objects.equals(this.federalTaxClassification, tenNinetyNineContact.federalTaxClassification); } @Override public int hashCode() { - return Objects.hash( - box1, - box2, - box3, - box4, - box5, - box6, - box7, - box8, - box9, - box10, - box11, - box13, - box14, - name, - federalTaxIDType, - city, - zip, - state, - email, - streetAddress, - taxID, - contactId, - legalName, - businessName, - federalTaxClassification); + return Objects.hash(box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11, box13, box14, name, federalTaxIDType, city, zip, state, email, streetAddress, taxID, contactId, legalName, businessName, federalTaxClassification); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1132,15 +1058,14 @@ public String toString() { sb.append(" contactId: ").append(toIndentedString(contactId)).append("\n"); sb.append(" legalName: ").append(toIndentedString(legalName)).append("\n"); sb.append(" businessName: ").append(toIndentedString(businessName)).append("\n"); - sb.append(" federalTaxClassification: ") - .append(toIndentedString(federalTaxClassification)) - .append("\n"); + sb.append(" federalTaxClassification: ").append(toIndentedString(federalTaxClassification)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1148,4 +1073,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TimeZone.java b/src/main/java/com/xero/models/accounting/TimeZone.java index 2c40ffa3e..1861f8b47 100644 --- a/src/main/java/com/xero/models/accounting/TimeZone.java +++ b/src/main/java/com/xero/models/accounting/TimeZone.java @@ -9,436 +9,730 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; - +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Timezone specifications */ +/** + * Timezone specifications + */ public enum TimeZone { - - /** AFGHANISTANSTANDARDTIME */ + + /** + * AFGHANISTANSTANDARDTIME + */ AFGHANISTANSTANDARDTIME("AFGHANISTANSTANDARDTIME"), - - /** ALASKANSTANDARDTIME */ + + /** + * ALASKANSTANDARDTIME + */ ALASKANSTANDARDTIME("ALASKANSTANDARDTIME"), - - /** ALEUTIANSTANDARDTIME */ + + /** + * ALEUTIANSTANDARDTIME + */ ALEUTIANSTANDARDTIME("ALEUTIANSTANDARDTIME"), - - /** ALTAISTANDARDTIME */ + + /** + * ALTAISTANDARDTIME + */ ALTAISTANDARDTIME("ALTAISTANDARDTIME"), - - /** ARABIANSTANDARDTIME */ + + /** + * ARABIANSTANDARDTIME + */ ARABIANSTANDARDTIME("ARABIANSTANDARDTIME"), - - /** ARABICSTANDARDTIME */ + + /** + * ARABICSTANDARDTIME + */ ARABICSTANDARDTIME("ARABICSTANDARDTIME"), - - /** ARABSTANDARDTIME */ + + /** + * ARABSTANDARDTIME + */ ARABSTANDARDTIME("ARABSTANDARDTIME"), - - /** ARGENTINASTANDARDTIME */ + + /** + * ARGENTINASTANDARDTIME + */ ARGENTINASTANDARDTIME("ARGENTINASTANDARDTIME"), - - /** ASTRAKHANSTANDARDTIME */ + + /** + * ASTRAKHANSTANDARDTIME + */ ASTRAKHANSTANDARDTIME("ASTRAKHANSTANDARDTIME"), - - /** ATLANTICSTANDARDTIME */ + + /** + * ATLANTICSTANDARDTIME + */ ATLANTICSTANDARDTIME("ATLANTICSTANDARDTIME"), - - /** AUSCENTRALSTANDARDTIME */ + + /** + * AUSCENTRALSTANDARDTIME + */ AUSCENTRALSTANDARDTIME("AUSCENTRALSTANDARDTIME"), - - /** AUSCENTRALWSTANDARDTIME */ + + /** + * AUSCENTRALWSTANDARDTIME + */ AUSCENTRALWSTANDARDTIME("AUSCENTRALWSTANDARDTIME"), - - /** AUSEASTERNSTANDARDTIME */ + + /** + * AUSEASTERNSTANDARDTIME + */ AUSEASTERNSTANDARDTIME("AUSEASTERNSTANDARDTIME"), - - /** AZERBAIJANSTANDARDTIME */ + + /** + * AZERBAIJANSTANDARDTIME + */ AZERBAIJANSTANDARDTIME("AZERBAIJANSTANDARDTIME"), - - /** AZORESSTANDARDTIME */ + + /** + * AZORESSTANDARDTIME + */ AZORESSTANDARDTIME("AZORESSTANDARDTIME"), - - /** BAHIASTANDARDTIME */ + + /** + * BAHIASTANDARDTIME + */ BAHIASTANDARDTIME("BAHIASTANDARDTIME"), - - /** BANGLADESHSTANDARDTIME */ + + /** + * BANGLADESHSTANDARDTIME + */ BANGLADESHSTANDARDTIME("BANGLADESHSTANDARDTIME"), - - /** BELARUSSTANDARDTIME */ + + /** + * BELARUSSTANDARDTIME + */ BELARUSSTANDARDTIME("BELARUSSTANDARDTIME"), - - /** BOUGAINVILLESTANDARDTIME */ + + /** + * BOUGAINVILLESTANDARDTIME + */ BOUGAINVILLESTANDARDTIME("BOUGAINVILLESTANDARDTIME"), - - /** CANADACENTRALSTANDARDTIME */ + + /** + * CANADACENTRALSTANDARDTIME + */ CANADACENTRALSTANDARDTIME("CANADACENTRALSTANDARDTIME"), - - /** CAPEVERDESTANDARDTIME */ + + /** + * CAPEVERDESTANDARDTIME + */ CAPEVERDESTANDARDTIME("CAPEVERDESTANDARDTIME"), - - /** CAUCASUSSTANDARDTIME */ + + /** + * CAUCASUSSTANDARDTIME + */ CAUCASUSSTANDARDTIME("CAUCASUSSTANDARDTIME"), - - /** CENAUSTRALIASTANDARDTIME */ + + /** + * CENAUSTRALIASTANDARDTIME + */ CENAUSTRALIASTANDARDTIME("CENAUSTRALIASTANDARDTIME"), - - /** CENTRALAMERICASTANDARDTIME */ + + /** + * CENTRALAMERICASTANDARDTIME + */ CENTRALAMERICASTANDARDTIME("CENTRALAMERICASTANDARDTIME"), - - /** CENTRALASIASTANDARDTIME */ + + /** + * CENTRALASIASTANDARDTIME + */ CENTRALASIASTANDARDTIME("CENTRALASIASTANDARDTIME"), - - /** CENTRALBRAZILIANSTANDARDTIME */ + + /** + * CENTRALBRAZILIANSTANDARDTIME + */ CENTRALBRAZILIANSTANDARDTIME("CENTRALBRAZILIANSTANDARDTIME"), - - /** CENTRALEUROPEANSTANDARDTIME */ + + /** + * CENTRALEUROPEANSTANDARDTIME + */ CENTRALEUROPEANSTANDARDTIME("CENTRALEUROPEANSTANDARDTIME"), - - /** CENTRALEUROPESTANDARDTIME */ + + /** + * CENTRALEUROPESTANDARDTIME + */ CENTRALEUROPESTANDARDTIME("CENTRALEUROPESTANDARDTIME"), - - /** CENTRALPACIFICSTANDARDTIME */ + + /** + * CENTRALPACIFICSTANDARDTIME + */ CENTRALPACIFICSTANDARDTIME("CENTRALPACIFICSTANDARDTIME"), - - /** CENTRALSTANDARDTIME */ + + /** + * CENTRALSTANDARDTIME + */ CENTRALSTANDARDTIME("CENTRALSTANDARDTIME"), - - /** CENTRALSTANDARDTIME_MEXICO_ */ + + /** + * CENTRALSTANDARDTIME_MEXICO_ + */ CENTRALSTANDARDTIME_MEXICO_("CENTRALSTANDARDTIME(MEXICO)"), - - /** CHATHAMISLANDSSTANDARDTIME */ + + /** + * CHATHAMISLANDSSTANDARDTIME + */ CHATHAMISLANDSSTANDARDTIME("CHATHAMISLANDSSTANDARDTIME"), - - /** CHINASTANDARDTIME */ + + /** + * CHINASTANDARDTIME + */ CHINASTANDARDTIME("CHINASTANDARDTIME"), - - /** CUBASTANDARDTIME */ + + /** + * CUBASTANDARDTIME + */ CUBASTANDARDTIME("CUBASTANDARDTIME"), - - /** DATELINESTANDARDTIME */ + + /** + * DATELINESTANDARDTIME + */ DATELINESTANDARDTIME("DATELINESTANDARDTIME"), - - /** EAFRICASTANDARDTIME */ + + /** + * EAFRICASTANDARDTIME + */ EAFRICASTANDARDTIME("EAFRICASTANDARDTIME"), - - /** EASTERISLANDSTANDARDTIME */ + + /** + * EASTERISLANDSTANDARDTIME + */ EASTERISLANDSTANDARDTIME("EASTERISLANDSTANDARDTIME"), - - /** EASTERNSTANDARDTIME */ + + /** + * EASTERNSTANDARDTIME + */ EASTERNSTANDARDTIME("EASTERNSTANDARDTIME"), - - /** EASTERNSTANDARDTIME_MEXICO_ */ + + /** + * EASTERNSTANDARDTIME_MEXICO_ + */ EASTERNSTANDARDTIME_MEXICO_("EASTERNSTANDARDTIME(MEXICO)"), - - /** EAUSTRALIASTANDARDTIME */ + + /** + * EAUSTRALIASTANDARDTIME + */ EAUSTRALIASTANDARDTIME("EAUSTRALIASTANDARDTIME"), - - /** EEUROPESTANDARDTIME */ + + /** + * EEUROPESTANDARDTIME + */ EEUROPESTANDARDTIME("EEUROPESTANDARDTIME"), - - /** EGYPTSTANDARDTIME */ + + /** + * EGYPTSTANDARDTIME + */ EGYPTSTANDARDTIME("EGYPTSTANDARDTIME"), - - /** EKATERINBURGSTANDARDTIME */ + + /** + * EKATERINBURGSTANDARDTIME + */ EKATERINBURGSTANDARDTIME("EKATERINBURGSTANDARDTIME"), - - /** ESOUTHAMERICASTANDARDTIME */ + + /** + * ESOUTHAMERICASTANDARDTIME + */ ESOUTHAMERICASTANDARDTIME("ESOUTHAMERICASTANDARDTIME"), - - /** FIJISTANDARDTIME */ + + /** + * FIJISTANDARDTIME + */ FIJISTANDARDTIME("FIJISTANDARDTIME"), - - /** FLESTANDARDTIME */ + + /** + * FLESTANDARDTIME + */ FLESTANDARDTIME("FLESTANDARDTIME"), - - /** GEORGIANSTANDARDTIME */ + + /** + * GEORGIANSTANDARDTIME + */ GEORGIANSTANDARDTIME("GEORGIANSTANDARDTIME"), - - /** GMTSTANDARDTIME */ + + /** + * GMTSTANDARDTIME + */ GMTSTANDARDTIME("GMTSTANDARDTIME"), - - /** GREENLANDSTANDARDTIME */ + + /** + * GREENLANDSTANDARDTIME + */ GREENLANDSTANDARDTIME("GREENLANDSTANDARDTIME"), - - /** GREENWICHSTANDARDTIME */ + + /** + * GREENWICHSTANDARDTIME + */ GREENWICHSTANDARDTIME("GREENWICHSTANDARDTIME"), - - /** GTBSTANDARDTIME */ + + /** + * GTBSTANDARDTIME + */ GTBSTANDARDTIME("GTBSTANDARDTIME"), - - /** HAITISTANDARDTIME */ + + /** + * HAITISTANDARDTIME + */ HAITISTANDARDTIME("HAITISTANDARDTIME"), - - /** HAWAIIANSTANDARDTIME */ + + /** + * HAWAIIANSTANDARDTIME + */ HAWAIIANSTANDARDTIME("HAWAIIANSTANDARDTIME"), - - /** INDIASTANDARDTIME */ + + /** + * INDIASTANDARDTIME + */ INDIASTANDARDTIME("INDIASTANDARDTIME"), - - /** IRANSTANDARDTIME */ + + /** + * IRANSTANDARDTIME + */ IRANSTANDARDTIME("IRANSTANDARDTIME"), - - /** ISRAELSTANDARDTIME */ + + /** + * ISRAELSTANDARDTIME + */ ISRAELSTANDARDTIME("ISRAELSTANDARDTIME"), - - /** JORDANSTANDARDTIME */ + + /** + * JORDANSTANDARDTIME + */ JORDANSTANDARDTIME("JORDANSTANDARDTIME"), - - /** KALININGRADSTANDARDTIME */ + + /** + * KALININGRADSTANDARDTIME + */ KALININGRADSTANDARDTIME("KALININGRADSTANDARDTIME"), - - /** KAMCHATKASTANDARDTIME */ + + /** + * KAMCHATKASTANDARDTIME + */ KAMCHATKASTANDARDTIME("KAMCHATKASTANDARDTIME"), - - /** KOREASTANDARDTIME */ + + /** + * KOREASTANDARDTIME + */ KOREASTANDARDTIME("KOREASTANDARDTIME"), - - /** LIBYASTANDARDTIME */ + + /** + * LIBYASTANDARDTIME + */ LIBYASTANDARDTIME("LIBYASTANDARDTIME"), - - /** LINEISLANDSSTANDARDTIME */ + + /** + * LINEISLANDSSTANDARDTIME + */ LINEISLANDSSTANDARDTIME("LINEISLANDSSTANDARDTIME"), - - /** LORDHOWESTANDARDTIME */ + + /** + * LORDHOWESTANDARDTIME + */ LORDHOWESTANDARDTIME("LORDHOWESTANDARDTIME"), - - /** MAGADANSTANDARDTIME */ + + /** + * MAGADANSTANDARDTIME + */ MAGADANSTANDARDTIME("MAGADANSTANDARDTIME"), - - /** MAGALLANESSTANDARDTIME */ + + /** + * MAGALLANESSTANDARDTIME + */ MAGALLANESSTANDARDTIME("MAGALLANESSTANDARDTIME"), - - /** MARQUESASSTANDARDTIME */ + + /** + * MARQUESASSTANDARDTIME + */ MARQUESASSTANDARDTIME("MARQUESASSTANDARDTIME"), - - /** MAURITIUSSTANDARDTIME */ + + /** + * MAURITIUSSTANDARDTIME + */ MAURITIUSSTANDARDTIME("MAURITIUSSTANDARDTIME"), - - /** MIDATLANTICSTANDARDTIME */ + + /** + * MIDATLANTICSTANDARDTIME + */ MIDATLANTICSTANDARDTIME("MIDATLANTICSTANDARDTIME"), - - /** MIDDLEEASTSTANDARDTIME */ + + /** + * MIDDLEEASTSTANDARDTIME + */ MIDDLEEASTSTANDARDTIME("MIDDLEEASTSTANDARDTIME"), - - /** MONTEVIDEOSTANDARDTIME */ + + /** + * MONTEVIDEOSTANDARDTIME + */ MONTEVIDEOSTANDARDTIME("MONTEVIDEOSTANDARDTIME"), - - /** MOROCCOSTANDARDTIME */ + + /** + * MOROCCOSTANDARDTIME + */ MOROCCOSTANDARDTIME("MOROCCOSTANDARDTIME"), - - /** MOUNTAINSTANDARDTIME */ + + /** + * MOUNTAINSTANDARDTIME + */ MOUNTAINSTANDARDTIME("MOUNTAINSTANDARDTIME"), - - /** MOUNTAINSTANDARDTIME_MEXICO_ */ + + /** + * MOUNTAINSTANDARDTIME_MEXICO_ + */ MOUNTAINSTANDARDTIME_MEXICO_("MOUNTAINSTANDARDTIME(MEXICO)"), - - /** MYANMARSTANDARDTIME */ + + /** + * MYANMARSTANDARDTIME + */ MYANMARSTANDARDTIME("MYANMARSTANDARDTIME"), - - /** NAMIBIASTANDARDTIME */ + + /** + * NAMIBIASTANDARDTIME + */ NAMIBIASTANDARDTIME("NAMIBIASTANDARDTIME"), - - /** NCENTRALASIASTANDARDTIME */ + + /** + * NCENTRALASIASTANDARDTIME + */ NCENTRALASIASTANDARDTIME("NCENTRALASIASTANDARDTIME"), - - /** NEPALSTANDARDTIME */ + + /** + * NEPALSTANDARDTIME + */ NEPALSTANDARDTIME("NEPALSTANDARDTIME"), - - /** NEWFOUNDLANDSTANDARDTIME */ + + /** + * NEWFOUNDLANDSTANDARDTIME + */ NEWFOUNDLANDSTANDARDTIME("NEWFOUNDLANDSTANDARDTIME"), - - /** NEWZEALANDSTANDARDTIME */ + + /** + * NEWZEALANDSTANDARDTIME + */ NEWZEALANDSTANDARDTIME("NEWZEALANDSTANDARDTIME"), - - /** NORFOLKSTANDARDTIME */ + + /** + * NORFOLKSTANDARDTIME + */ NORFOLKSTANDARDTIME("NORFOLKSTANDARDTIME"), - - /** NORTHASIAEASTSTANDARDTIME */ + + /** + * NORTHASIAEASTSTANDARDTIME + */ NORTHASIAEASTSTANDARDTIME("NORTHASIAEASTSTANDARDTIME"), - - /** NORTHASIASTANDARDTIME */ + + /** + * NORTHASIASTANDARDTIME + */ NORTHASIASTANDARDTIME("NORTHASIASTANDARDTIME"), - - /** NORTHKOREASTANDARDTIME */ + + /** + * NORTHKOREASTANDARDTIME + */ NORTHKOREASTANDARDTIME("NORTHKOREASTANDARDTIME"), - - /** OMSKSTANDARDTIME */ + + /** + * OMSKSTANDARDTIME + */ OMSKSTANDARDTIME("OMSKSTANDARDTIME"), - - /** PACIFICSASTANDARDTIME */ + + /** + * PACIFICSASTANDARDTIME + */ PACIFICSASTANDARDTIME("PACIFICSASTANDARDTIME"), - - /** PACIFICSTANDARDTIME */ + + /** + * PACIFICSTANDARDTIME + */ PACIFICSTANDARDTIME("PACIFICSTANDARDTIME"), - - /** PACIFICSTANDARDTIME_MEXICO_ */ + + /** + * PACIFICSTANDARDTIME_MEXICO_ + */ PACIFICSTANDARDTIME_MEXICO_("PACIFICSTANDARDTIME(MEXICO)"), - - /** PAKISTANSTANDARDTIME */ + + /** + * PAKISTANSTANDARDTIME + */ PAKISTANSTANDARDTIME("PAKISTANSTANDARDTIME"), - - /** PARAGUAYSTANDARDTIME */ + + /** + * PARAGUAYSTANDARDTIME + */ PARAGUAYSTANDARDTIME("PARAGUAYSTANDARDTIME"), - - /** QYZYLORDASTANDARDTIME */ + + /** + * QYZYLORDASTANDARDTIME + */ QYZYLORDASTANDARDTIME("QYZYLORDASTANDARDTIME"), - - /** ROMANCESTANDARDTIME */ + + /** + * ROMANCESTANDARDTIME + */ ROMANCESTANDARDTIME("ROMANCESTANDARDTIME"), - - /** RUSSIANSTANDARDTIME */ + + /** + * RUSSIANSTANDARDTIME + */ RUSSIANSTANDARDTIME("RUSSIANSTANDARDTIME"), - - /** RUSSIATIMEZONE10 */ + + /** + * RUSSIATIMEZONE10 + */ RUSSIATIMEZONE10("RUSSIATIMEZONE10"), - - /** RUSSIATIMEZONE11 */ + + /** + * RUSSIATIMEZONE11 + */ RUSSIATIMEZONE11("RUSSIATIMEZONE11"), - - /** RUSSIATIMEZONE3 */ + + /** + * RUSSIATIMEZONE3 + */ RUSSIATIMEZONE3("RUSSIATIMEZONE3"), - - /** SAEASTERNSTANDARDTIME */ + + /** + * SAEASTERNSTANDARDTIME + */ SAEASTERNSTANDARDTIME("SAEASTERNSTANDARDTIME"), - - /** SAINTPIERRESTANDARDTIME */ + + /** + * SAINTPIERRESTANDARDTIME + */ SAINTPIERRESTANDARDTIME("SAINTPIERRESTANDARDTIME"), - - /** SAKHALINSTANDARDTIME */ + + /** + * SAKHALINSTANDARDTIME + */ SAKHALINSTANDARDTIME("SAKHALINSTANDARDTIME"), - - /** SAMOASTANDARDTIME */ + + /** + * SAMOASTANDARDTIME + */ SAMOASTANDARDTIME("SAMOASTANDARDTIME"), - - /** SAOTOMESTANDARDTIME */ + + /** + * SAOTOMESTANDARDTIME + */ SAOTOMESTANDARDTIME("SAOTOMESTANDARDTIME"), - - /** SAPACIFICSTANDARDTIME */ + + /** + * SAPACIFICSTANDARDTIME + */ SAPACIFICSTANDARDTIME("SAPACIFICSTANDARDTIME"), - - /** SARATOVSTANDARDTIME */ + + /** + * SARATOVSTANDARDTIME + */ SARATOVSTANDARDTIME("SARATOVSTANDARDTIME"), - - /** SAWESTERNSTANDARDTIME */ + + /** + * SAWESTERNSTANDARDTIME + */ SAWESTERNSTANDARDTIME("SAWESTERNSTANDARDTIME"), - - /** SEASIASTANDARDTIME */ + + /** + * SEASIASTANDARDTIME + */ SEASIASTANDARDTIME("SEASIASTANDARDTIME"), - - /** SINGAPORESTANDARDTIME */ + + /** + * SINGAPORESTANDARDTIME + */ SINGAPORESTANDARDTIME("SINGAPORESTANDARDTIME"), - - /** SOUTHAFRICASTANDARDTIME */ + + /** + * SOUTHAFRICASTANDARDTIME + */ SOUTHAFRICASTANDARDTIME("SOUTHAFRICASTANDARDTIME"), - - /** SOUTHSUDANSTANDARDTIME */ + + /** + * SOUTHSUDANSTANDARDTIME + */ SOUTHSUDANSTANDARDTIME("SOUTHSUDANSTANDARDTIME"), - - /** SRILANKASTANDARDTIME */ + + /** + * SRILANKASTANDARDTIME + */ SRILANKASTANDARDTIME("SRILANKASTANDARDTIME"), - - /** SUDANSTANDARDTIME */ + + /** + * SUDANSTANDARDTIME + */ SUDANSTANDARDTIME("SUDANSTANDARDTIME"), - - /** SYRIASTANDARDTIME */ + + /** + * SYRIASTANDARDTIME + */ SYRIASTANDARDTIME("SYRIASTANDARDTIME"), - - /** TAIPEISTANDARDTIME */ + + /** + * TAIPEISTANDARDTIME + */ TAIPEISTANDARDTIME("TAIPEISTANDARDTIME"), - - /** TASMANIASTANDARDTIME */ + + /** + * TASMANIASTANDARDTIME + */ TASMANIASTANDARDTIME("TASMANIASTANDARDTIME"), - - /** TOCANTINSSTANDARDTIME */ + + /** + * TOCANTINSSTANDARDTIME + */ TOCANTINSSTANDARDTIME("TOCANTINSSTANDARDTIME"), - - /** TOKYOSTANDARDTIME */ + + /** + * TOKYOSTANDARDTIME + */ TOKYOSTANDARDTIME("TOKYOSTANDARDTIME"), - - /** TOMSKSTANDARDTIME */ + + /** + * TOMSKSTANDARDTIME + */ TOMSKSTANDARDTIME("TOMSKSTANDARDTIME"), - - /** TONGASTANDARDTIME */ + + /** + * TONGASTANDARDTIME + */ TONGASTANDARDTIME("TONGASTANDARDTIME"), - - /** TRANSBAIKALSTANDARDTIME */ + + /** + * TRANSBAIKALSTANDARDTIME + */ TRANSBAIKALSTANDARDTIME("TRANSBAIKALSTANDARDTIME"), - - /** TURKEYSTANDARDTIME */ + + /** + * TURKEYSTANDARDTIME + */ TURKEYSTANDARDTIME("TURKEYSTANDARDTIME"), - - /** TURKSANDCAICOSSTANDARDTIME */ + + /** + * TURKSANDCAICOSSTANDARDTIME + */ TURKSANDCAICOSSTANDARDTIME("TURKSANDCAICOSSTANDARDTIME"), - - /** ULAANBAATARSTANDARDTIME */ + + /** + * ULAANBAATARSTANDARDTIME + */ ULAANBAATARSTANDARDTIME("ULAANBAATARSTANDARDTIME"), - - /** USEASTERNSTANDARDTIME */ + + /** + * USEASTERNSTANDARDTIME + */ USEASTERNSTANDARDTIME("USEASTERNSTANDARDTIME"), - - /** USMOUNTAINSTANDARDTIME */ + + /** + * USMOUNTAINSTANDARDTIME + */ USMOUNTAINSTANDARDTIME("USMOUNTAINSTANDARDTIME"), - - /** UTC */ + + /** + * UTC + */ UTC("UTC"), - - /** UTC_12 */ + + /** + * UTC_12 + */ UTC_12("UTC+12"), - - /** UTC_13 */ + + /** + * UTC_13 + */ UTC_13("UTC+13"), - - /** UTC02 */ + + /** + * UTC02 + */ UTC02("UTC02"), - - /** UTC08 */ + + /** + * UTC08 + */ UTC08("UTC08"), - - /** UTC09 */ + + /** + * UTC09 + */ UTC09("UTC09"), - - /** UTC11 */ + + /** + * UTC11 + */ UTC11("UTC11"), - - /** VENEZUELASTANDARDTIME */ + + /** + * VENEZUELASTANDARDTIME + */ VENEZUELASTANDARDTIME("VENEZUELASTANDARDTIME"), - - /** VLADIVOSTOKSTANDARDTIME */ + + /** + * VLADIVOSTOKSTANDARDTIME + */ VLADIVOSTOKSTANDARDTIME("VLADIVOSTOKSTANDARDTIME"), - - /** VOLGOGRADSTANDARDTIME */ + + /** + * VOLGOGRADSTANDARDTIME + */ VOLGOGRADSTANDARDTIME("VOLGOGRADSTANDARDTIME"), - - /** WAUSTRALIASTANDARDTIME */ + + /** + * WAUSTRALIASTANDARDTIME + */ WAUSTRALIASTANDARDTIME("WAUSTRALIASTANDARDTIME"), - - /** WCENTRALAFRICASTANDARDTIME */ + + /** + * WCENTRALAFRICASTANDARDTIME + */ WCENTRALAFRICASTANDARDTIME("WCENTRALAFRICASTANDARDTIME"), - - /** WESTASIASTANDARDTIME */ + + /** + * WESTASIASTANDARDTIME + */ WESTASIASTANDARDTIME("WESTASIASTANDARDTIME"), - - /** WESTBANKSTANDARDTIME */ + + /** + * WESTBANKSTANDARDTIME + */ WESTBANKSTANDARDTIME("WESTBANKSTANDARDTIME"), - - /** WESTPACIFICSTANDARDTIME */ + + /** + * WESTPACIFICSTANDARDTIME + */ WESTPACIFICSTANDARDTIME("WESTPACIFICSTANDARDTIME"), - - /** WEUROPESTANDARDTIME */ + + /** + * WEUROPESTANDARDTIME + */ WEUROPESTANDARDTIME("WEUROPESTANDARDTIME"), - - /** WMONGOLIASTANDARDTIME */ + + /** + * WMONGOLIASTANDARDTIME + */ WMONGOLIASTANDARDTIME("WMONGOLIASTANDARDTIME"), - - /** YAKUTSKSTANDARDTIME */ + + /** + * YAKUTSKSTANDARDTIME + */ YAKUTSKSTANDARDTIME("YAKUTSKSTANDARDTIME"), - - /** YUKONSTANDARDTIME */ + + /** + * YUKONSTANDARDTIME + */ YUKONSTANDARDTIME("YUKONSTANDARDTIME"); private String value; @@ -447,26 +741,24 @@ public enum TimeZone { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static TimeZone fromValue(String value) { @@ -478,3 +770,4 @@ public static TimeZone fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/accounting/TrackingCategories.java b/src/main/java/com/xero/models/accounting/TrackingCategories.java index ce506d088..aeee50ad7 100644 --- a/src/main/java/com/xero/models/accounting/TrackingCategories.java +++ b/src/main/java/com/xero/models/accounting/TrackingCategories.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.TrackingCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingCategories + */ -/** TrackingCategories */ public class TrackingCategories { StringUtil util = new StringUtil(); @JsonProperty("TrackingCategories") private List trackingCategories = new ArrayList(); /** - * trackingCategories - * - * @param trackingCategories List<TrackingCategory> - * @return TrackingCategories - */ + * trackingCategories + * @param trackingCategories List<TrackingCategory> + * @return TrackingCategories + **/ public TrackingCategories trackingCategories(List trackingCategories) { this.trackingCategories = trackingCategories; return this; @@ -37,10 +54,9 @@ public TrackingCategories trackingCategories(List trackingCate /** * trackingCategories - * - * @param trackingCategoriesItem TrackingCategory + * @param trackingCategoriesItem TrackingCategory * @return TrackingCategories - */ + **/ public TrackingCategories addTrackingCategoriesItem(TrackingCategory trackingCategoriesItem) { if (this.trackingCategories == null) { this.trackingCategories = new ArrayList(); @@ -49,30 +65,29 @@ public TrackingCategories addTrackingCategoriesItem(TrackingCategory trackingCat return this; } - /** + /** * Get trackingCategories - * * @return trackingCategories - */ + **/ @ApiModelProperty(value = "") - /** + /** * trackingCategories - * * @return trackingCategories List - */ + **/ public List getTrackingCategories() { return trackingCategories; } - /** - * trackingCategories - * - * @param trackingCategories List<TrackingCategory> - */ + /** + * trackingCategories + * @param trackingCategories List<TrackingCategory> + **/ + public void setTrackingCategories(List trackingCategories) { this.trackingCategories = trackingCategories; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(trackingCategories); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TrackingCategory.java b/src/main/java/com/xero/models/accounting/TrackingCategory.java index 528c08124..59d494728 100644 --- a/src/main/java/com/xero/models/accounting/TrackingCategory.java +++ b/src/main/java/com/xero/models/accounting/TrackingCategory.java @@ -9,19 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.accounting.TrackingOption; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingCategory + */ -/** TrackingCategory */ public class TrackingCategory { StringUtil util = new StringUtil(); @@ -36,15 +52,23 @@ public class TrackingCategory { @JsonProperty("Option") private String option; - /** The status of a tracking category */ + /** + * The status of a tracking category + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** ARCHIVED */ + + /** + * ARCHIVED + */ ARCHIVED("ARCHIVED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -53,31 +77,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -89,197 +107,177 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @JsonProperty("Options") private List options = new ArrayList(); /** - * The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param trackingCategoryID UUID - * @return TrackingCategory - */ + * The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param trackingCategoryID UUID + * @return TrackingCategory + **/ public TrackingCategory trackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; return this; } - /** + /** * The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return trackingCategoryID - */ - @ApiModelProperty( - value = - "The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") - /** + **/ + @ApiModelProperty(value = "The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") + /** * The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return trackingCategoryID UUID - */ + **/ public UUID getTrackingCategoryID() { return trackingCategoryID; } - /** - * The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param trackingCategoryID UUID - */ + /** + * The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param trackingCategoryID UUID + **/ + public void setTrackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; } /** - * The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f - * - * @param trackingOptionID UUID - * @return TrackingCategory - */ + * The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f + * @param trackingOptionID UUID + * @return TrackingCategory + **/ public TrackingCategory trackingOptionID(UUID trackingOptionID) { this.trackingOptionID = trackingOptionID; return this; } - /** + /** * The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f - * * @return trackingOptionID - */ - @ApiModelProperty( - value = "The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f") - /** + **/ + @ApiModelProperty(value = "The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f") + /** * The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f - * * @return trackingOptionID UUID - */ + **/ public UUID getTrackingOptionID() { return trackingOptionID; } - /** - * The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f - * - * @param trackingOptionID UUID - */ + /** + * The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f + * @param trackingOptionID UUID + **/ + public void setTrackingOptionID(UUID trackingOptionID) { this.trackingOptionID = trackingOptionID; } /** - * The name of the tracking category e.g. Department, Region (max length = 100) - * - * @param name String - * @return TrackingCategory - */ + * The name of the tracking category e.g. Department, Region (max length = 100) + * @param name String + * @return TrackingCategory + **/ public TrackingCategory name(String name) { this.name = name; return this; } - /** + /** * The name of the tracking category e.g. Department, Region (max length = 100) - * * @return name - */ - @ApiModelProperty( - value = "The name of the tracking category e.g. Department, Region (max length = 100)") - /** + **/ + @ApiModelProperty(value = "The name of the tracking category e.g. Department, Region (max length = 100)") + /** * The name of the tracking category e.g. Department, Region (max length = 100) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the tracking category e.g. Department, Region (max length = 100) - * - * @param name String - */ + /** + * The name of the tracking category e.g. Department, Region (max length = 100) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The option name of the tracking option e.g. East, West (max length = 100) - * - * @param option String - * @return TrackingCategory - */ + * The option name of the tracking option e.g. East, West (max length = 100) + * @param option String + * @return TrackingCategory + **/ public TrackingCategory option(String option) { this.option = option; return this; } - /** + /** * The option name of the tracking option e.g. East, West (max length = 100) - * * @return option - */ - @ApiModelProperty( - value = "The option name of the tracking option e.g. East, West (max length = 100)") - /** + **/ + @ApiModelProperty(value = "The option name of the tracking option e.g. East, West (max length = 100)") + /** * The option name of the tracking option e.g. East, West (max length = 100) - * * @return option String - */ + **/ public String getOption() { return option; } - /** - * The option name of the tracking option e.g. East, West (max length = 100) - * - * @param option String - */ + /** + * The option name of the tracking option e.g. East, West (max length = 100) + * @param option String + **/ + public void setOption(String option) { this.option = option; } /** - * The status of a tracking category - * - * @param status StatusEnum - * @return TrackingCategory - */ + * The status of a tracking category + * @param status StatusEnum + * @return TrackingCategory + **/ public TrackingCategory status(StatusEnum status) { this.status = status; return this; } - /** + /** * The status of a tracking category - * * @return status - */ + **/ @ApiModelProperty(value = "The status of a tracking category") - /** + /** * The status of a tracking category - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The status of a tracking category - * - * @param status StatusEnum - */ + /** + * The status of a tracking category + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * See Tracking Options - * - * @param options List<TrackingOption> - * @return TrackingCategory - */ + * See Tracking Options + * @param options List<TrackingOption> + * @return TrackingCategory + **/ public TrackingCategory options(List options) { this.options = options; return this; @@ -287,10 +285,9 @@ public TrackingCategory options(List options) { /** * See Tracking Options - * - * @param optionsItem TrackingOption + * @param optionsItem TrackingOption * @return TrackingCategory - */ + **/ public TrackingCategory addOptionsItem(TrackingOption optionsItem) { if (this.options == null) { this.options = new ArrayList(); @@ -299,30 +296,29 @@ public TrackingCategory addOptionsItem(TrackingOption optionsItem) { return this; } - /** + /** * See Tracking Options - * * @return options - */ + **/ @ApiModelProperty(value = "See Tracking Options") - /** + /** * See Tracking Options - * * @return options List - */ + **/ public List getOptions() { return options; } - /** - * See Tracking Options - * - * @param options List<TrackingOption> - */ + /** + * See Tracking Options + * @param options List<TrackingOption> + **/ + public void setOptions(List options) { this.options = options; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -332,12 +328,12 @@ public boolean equals(java.lang.Object o) { return false; } TrackingCategory trackingCategory = (TrackingCategory) o; - return Objects.equals(this.trackingCategoryID, trackingCategory.trackingCategoryID) - && Objects.equals(this.trackingOptionID, trackingCategory.trackingOptionID) - && Objects.equals(this.name, trackingCategory.name) - && Objects.equals(this.option, trackingCategory.option) - && Objects.equals(this.status, trackingCategory.status) - && Objects.equals(this.options, trackingCategory.options); + return Objects.equals(this.trackingCategoryID, trackingCategory.trackingCategoryID) && + Objects.equals(this.trackingOptionID, trackingCategory.trackingOptionID) && + Objects.equals(this.name, trackingCategory.name) && + Objects.equals(this.option, trackingCategory.option) && + Objects.equals(this.status, trackingCategory.status) && + Objects.equals(this.options, trackingCategory.options); } @Override @@ -345,6 +341,7 @@ public int hashCode() { return Objects.hash(trackingCategoryID, trackingOptionID, name, option, status, options); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -360,7 +357,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -368,4 +366,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TrackingOption.java b/src/main/java/com/xero/models/accounting/TrackingOption.java index 6a00d5a21..b3dd7a05d 100644 --- a/src/main/java/com/xero/models/accounting/TrackingOption.java +++ b/src/main/java/com/xero/models/accounting/TrackingOption.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingOption + */ -/** TrackingOption */ public class TrackingOption { StringUtil util = new StringUtil(); @@ -28,15 +43,23 @@ public class TrackingOption { @JsonProperty("Name") private String name; - /** The status of a tracking option */ + /** + * The status of a tracking option + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** ARCHIVED */ + + /** + * ARCHIVED + */ ARCHIVED("ARCHIVED"), - - /** DELETED */ + + /** + * DELETED + */ DELETED("DELETED"); private String value; @@ -45,31 +68,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -81,154 +98,141 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("Status") private StatusEnum status; @JsonProperty("TrackingCategoryID") private UUID trackingCategoryID; /** - * The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a - * - * @param trackingOptionID UUID - * @return TrackingOption - */ + * The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a + * @param trackingOptionID UUID + * @return TrackingOption + **/ public TrackingOption trackingOptionID(UUID trackingOptionID) { this.trackingOptionID = trackingOptionID; return this; } - /** + /** * The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a - * * @return trackingOptionID - */ - @ApiModelProperty( - value = "The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a") - /** + **/ + @ApiModelProperty(value = "The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a") + /** * The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a - * * @return trackingOptionID UUID - */ + **/ public UUID getTrackingOptionID() { return trackingOptionID; } - /** - * The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a - * - * @param trackingOptionID UUID - */ + /** + * The Xero identifier for a tracking option e.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a + * @param trackingOptionID UUID + **/ + public void setTrackingOptionID(UUID trackingOptionID) { this.trackingOptionID = trackingOptionID; } /** - * The name of the tracking option e.g. Marketing, East (max length = 100) - * - * @param name String - * @return TrackingOption - */ + * The name of the tracking option e.g. Marketing, East (max length = 100) + * @param name String + * @return TrackingOption + **/ public TrackingOption name(String name) { this.name = name; return this; } - /** + /** * The name of the tracking option e.g. Marketing, East (max length = 100) - * * @return name - */ - @ApiModelProperty( - value = "The name of the tracking option e.g. Marketing, East (max length = 100)") - /** + **/ + @ApiModelProperty(value = "The name of the tracking option e.g. Marketing, East (max length = 100)") + /** * The name of the tracking option e.g. Marketing, East (max length = 100) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the tracking option e.g. Marketing, East (max length = 100) - * - * @param name String - */ + /** + * The name of the tracking option e.g. Marketing, East (max length = 100) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The status of a tracking option - * - * @param status StatusEnum - * @return TrackingOption - */ + * The status of a tracking option + * @param status StatusEnum + * @return TrackingOption + **/ public TrackingOption status(StatusEnum status) { this.status = status; return this; } - /** + /** * The status of a tracking option - * * @return status - */ + **/ @ApiModelProperty(value = "The status of a tracking option") - /** + /** * The status of a tracking option - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The status of a tracking option - * - * @param status StatusEnum - */ + /** + * The status of a tracking option + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param trackingCategoryID UUID - * @return TrackingOption - */ + * Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param trackingCategoryID UUID + * @return TrackingOption + **/ public TrackingOption trackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; return this; } - /** + /** * Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return trackingCategoryID - */ - @ApiModelProperty( - value = "Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") - /** + **/ + @ApiModelProperty(value = "Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9") + /** * Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * * @return trackingCategoryID UUID - */ + **/ public UUID getTrackingCategoryID() { return trackingCategoryID; } - /** - * Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - * - * @param trackingCategoryID UUID - */ + /** + * Filter by a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + * @param trackingCategoryID UUID + **/ + public void setTrackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -238,10 +242,10 @@ public boolean equals(java.lang.Object o) { return false; } TrackingOption trackingOption = (TrackingOption) o; - return Objects.equals(this.trackingOptionID, trackingOption.trackingOptionID) - && Objects.equals(this.name, trackingOption.name) - && Objects.equals(this.status, trackingOption.status) - && Objects.equals(this.trackingCategoryID, trackingOption.trackingCategoryID); + return Objects.equals(this.trackingOptionID, trackingOption.trackingOptionID) && + Objects.equals(this.name, trackingOption.name) && + Objects.equals(this.status, trackingOption.status) && + Objects.equals(this.trackingCategoryID, trackingOption.trackingCategoryID); } @Override @@ -249,6 +253,7 @@ public int hashCode() { return Objects.hash(trackingOptionID, name, status, trackingCategoryID); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,7 +267,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -270,4 +276,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/TrackingOptions.java b/src/main/java/com/xero/models/accounting/TrackingOptions.java index 4722344a1..a8a09429a 100644 --- a/src/main/java/com/xero/models/accounting/TrackingOptions.java +++ b/src/main/java/com/xero/models/accounting/TrackingOptions.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.TrackingOption; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingOptions + */ -/** TrackingOptions */ public class TrackingOptions { StringUtil util = new StringUtil(); @JsonProperty("Options") private List options = new ArrayList(); /** - * options - * - * @param options List<TrackingOption> - * @return TrackingOptions - */ + * options + * @param options List<TrackingOption> + * @return TrackingOptions + **/ public TrackingOptions options(List options) { this.options = options; return this; @@ -37,10 +54,9 @@ public TrackingOptions options(List options) { /** * options - * - * @param optionsItem TrackingOption + * @param optionsItem TrackingOption * @return TrackingOptions - */ + **/ public TrackingOptions addOptionsItem(TrackingOption optionsItem) { if (this.options == null) { this.options = new ArrayList(); @@ -49,30 +65,29 @@ public TrackingOptions addOptionsItem(TrackingOption optionsItem) { return this; } - /** + /** * Get options - * * @return options - */ + **/ @ApiModelProperty(value = "") - /** + /** * options - * * @return options List - */ + **/ public List getOptions() { return options; } - /** - * options - * - * @param options List<TrackingOption> - */ + /** + * options + * @param options List<TrackingOption> + **/ + public void setOptions(List options) { this.options = options; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(options); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/User.java b/src/main/java/com/xero/models/accounting/User.java index 79bea1184..e23b415c2 100644 --- a/src/main/java/com/xero/models/accounting/User.java +++ b/src/main/java/com/xero/models/accounting/User.java @@ -9,19 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * User + */ -/** User */ public class User { StringUtil util = new StringUtil(); @@ -43,29 +56,42 @@ public class User { @JsonProperty("IsSubscriber") private Boolean isSubscriber; /** - * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, - * FINANCIALADVISER, etc) + * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) */ public enum OrganisationRoleEnum { - /** READONLY */ + /** + * READONLY + */ READONLY("READONLY"), - - /** INVOICEONLY */ + + /** + * INVOICEONLY + */ INVOICEONLY("INVOICEONLY"), - - /** STANDARD */ + + /** + * STANDARD + */ STANDARD("STANDARD"), - - /** FINANCIALADVISER */ + + /** + * FINANCIALADVISER + */ FINANCIALADVISER("FINANCIALADVISER"), - - /** MANAGEDCLIENT */ + + /** + * MANAGEDCLIENT + */ MANAGEDCLIENT("MANAGEDCLIENT"), - - /** CASHBOOKCLIENT */ + + /** + * CASHBOOKCLIENT + */ CASHBOOKCLIENT("CASHBOOKCLIENT"), - - /** UNKNOWN */ + + /** + * UNKNOWN + */ UNKNOWN("UNKNOWN"); private String value; @@ -74,31 +100,25 @@ public enum OrganisationRoleEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static OrganisationRoleEnum fromValue(String value) { for (OrganisationRoleEnum b : OrganisationRoleEnum.values()) { @@ -110,255 +130,229 @@ public static OrganisationRoleEnum fromValue(String value) { } } + @JsonProperty("OrganisationRole") private OrganisationRoleEnum organisationRole; /** - * Xero identifier - * - * @param userID UUID - * @return User - */ + * Xero identifier + * @param userID UUID + * @return User + **/ public User userID(UUID userID) { this.userID = userID; return this; } - /** + /** * Xero identifier - * * @return userID - */ + **/ @ApiModelProperty(value = "Xero identifier") - /** + /** * Xero identifier - * * @return userID UUID - */ + **/ public UUID getUserID() { return userID; } - /** - * Xero identifier - * - * @param userID UUID - */ + /** + * Xero identifier + * @param userID UUID + **/ + public void setUserID(UUID userID) { this.userID = userID; } /** - * Email address of user - * - * @param emailAddress String - * @return User - */ + * Email address of user + * @param emailAddress String + * @return User + **/ public User emailAddress(String emailAddress) { this.emailAddress = emailAddress; return this; } - /** + /** * Email address of user - * * @return emailAddress - */ + **/ @ApiModelProperty(value = "Email address of user") - /** + /** * Email address of user - * * @return emailAddress String - */ + **/ public String getEmailAddress() { return emailAddress; } - /** - * Email address of user - * - * @param emailAddress String - */ + /** + * Email address of user + * @param emailAddress String + **/ + public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } /** - * First name of user - * - * @param firstName String - * @return User - */ + * First name of user + * @param firstName String + * @return User + **/ public User firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of user - * * @return firstName - */ + **/ @ApiModelProperty(value = "First name of user") - /** + /** * First name of user - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of user - * - * @param firstName String - */ + /** + * First name of user + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of user - * - * @param lastName String - * @return User - */ + * Last name of user + * @param lastName String + * @return User + **/ public User lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of user - * * @return lastName - */ + **/ @ApiModelProperty(value = "Last name of user") - /** + /** * Last name of user - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of user - * - * @param lastName String - */ + /** + * Last name of user + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } - /** + /** * Timestamp of last change to user - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1573755038314)/", value = "Timestamp of last change to user") - /** + /** * Timestamp of last change to user - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Timestamp of last change to user - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Boolean to indicate if user is the subscriber - * - * @param isSubscriber Boolean - * @return User - */ + * Boolean to indicate if user is the subscriber + * @param isSubscriber Boolean + * @return User + **/ public User isSubscriber(Boolean isSubscriber) { this.isSubscriber = isSubscriber; return this; } - /** + /** * Boolean to indicate if user is the subscriber - * * @return isSubscriber - */ + **/ @ApiModelProperty(value = "Boolean to indicate if user is the subscriber") - /** + /** * Boolean to indicate if user is the subscriber - * * @return isSubscriber Boolean - */ + **/ public Boolean getIsSubscriber() { return isSubscriber; } - /** - * Boolean to indicate if user is the subscriber - * - * @param isSubscriber Boolean - */ + /** + * Boolean to indicate if user is the subscriber + * @param isSubscriber Boolean + **/ + public void setIsSubscriber(Boolean isSubscriber) { this.isSubscriber = isSubscriber; } /** - * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, - * FINANCIALADVISER, etc) - * - * @param organisationRole OrganisationRoleEnum - * @return User - */ + * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) + * @param organisationRole OrganisationRoleEnum + * @return User + **/ public User organisationRole(OrganisationRoleEnum organisationRole) { this.organisationRole = organisationRole; return this; } - /** - * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, - * FINANCIALADVISER, etc) - * + /** + * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) * @return organisationRole - */ - @ApiModelProperty( - value = - "User role that defines permissions in Xero and via API (READONLY, INVOICEONLY," - + " STANDARD, FINANCIALADVISER, etc)") - /** - * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, - * FINANCIALADVISER, etc) - * + **/ + @ApiModelProperty(value = "User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc)") + /** + * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) * @return organisationRole OrganisationRoleEnum - */ + **/ public OrganisationRoleEnum getOrganisationRole() { return organisationRole; } - /** - * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, - * FINANCIALADVISER, etc) - * - * @param organisationRole OrganisationRoleEnum - */ + /** + * User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) + * @param organisationRole OrganisationRoleEnum + **/ + public void setOrganisationRole(OrganisationRoleEnum organisationRole) { this.organisationRole = organisationRole; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -368,21 +362,21 @@ public boolean equals(java.lang.Object o) { return false; } User user = (User) o; - return Objects.equals(this.userID, user.userID) - && Objects.equals(this.emailAddress, user.emailAddress) - && Objects.equals(this.firstName, user.firstName) - && Objects.equals(this.lastName, user.lastName) - && Objects.equals(this.updatedDateUTC, user.updatedDateUTC) - && Objects.equals(this.isSubscriber, user.isSubscriber) - && Objects.equals(this.organisationRole, user.organisationRole); + return Objects.equals(this.userID, user.userID) && + Objects.equals(this.emailAddress, user.emailAddress) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.updatedDateUTC, user.updatedDateUTC) && + Objects.equals(this.isSubscriber, user.isSubscriber) && + Objects.equals(this.organisationRole, user.organisationRole); } @Override public int hashCode() { - return Objects.hash( - userID, emailAddress, firstName, lastName, updatedDateUTC, isSubscriber, organisationRole); + return Objects.hash(userID, emailAddress, firstName, lastName, updatedDateUTC, isSubscriber, organisationRole); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -399,7 +393,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -407,4 +402,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/Users.java b/src/main/java/com/xero/models/accounting/Users.java index a17e000af..eb7903edf 100644 --- a/src/main/java/com/xero/models/accounting/Users.java +++ b/src/main/java/com/xero/models/accounting/Users.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.accounting.User; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Users + */ -/** Users */ public class Users { StringUtil util = new StringUtil(); @JsonProperty("Users") private List users = new ArrayList(); /** - * users - * - * @param users List<User> - * @return Users - */ + * users + * @param users List<User> + * @return Users + **/ public Users users(List users) { this.users = users; return this; @@ -37,10 +54,9 @@ public Users users(List users) { /** * users - * - * @param usersItem User + * @param usersItem User * @return Users - */ + **/ public Users addUsersItem(User usersItem) { if (this.users == null) { this.users = new ArrayList(); @@ -49,30 +65,29 @@ public Users addUsersItem(User usersItem) { return this; } - /** + /** * Get users - * * @return users - */ + **/ @ApiModelProperty(value = "") - /** + /** * users - * * @return users List - */ + **/ public List getUsers() { return users; } - /** - * users - * - * @param users List<User> - */ + /** + * users + * @param users List<User> + **/ + public void setUsers(List users) { this.users = users; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(users); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/accounting/ValidationError.java b/src/main/java/com/xero/models/accounting/ValidationError.java index 9e35479c8..97415516b 100644 --- a/src/main/java/com/xero/models/accounting/ValidationError.java +++ b/src/main/java/com/xero/models/accounting/ValidationError.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.accounting; +package com.xero.models.accounting; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ValidationError + */ -/** ValidationError */ public class ValidationError { StringUtil util = new StringUtil(); @JsonProperty("Message") private String message; /** - * Validation error message - * - * @param message String - * @return ValidationError - */ + * Validation error message + * @param message String + * @return ValidationError + **/ public ValidationError message(String message) { this.message = message; return this; } - /** + /** * Validation error message - * * @return message - */ + **/ @ApiModelProperty(value = "Validation error message") - /** + /** * Validation error message - * * @return message String - */ + **/ public String getMessage() { return message; } - /** - * Validation error message - * - * @param message String - */ + /** + * Validation error message + * @param message String + **/ + public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(message); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/CreateUsageRecord.java b/src/main/java/com/xero/models/appstore/CreateUsageRecord.java index cee14d8ce..8f8f9b43a 100644 --- a/src/main/java/com/xero/models/appstore/CreateUsageRecord.java +++ b/src/main/java/com/xero/models/appstore/CreateUsageRecord.java @@ -9,17 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -/** Data transfer object for public create usage end point */ +/** + * Data transfer object for public create usage end point + */ @ApiModel(description = "Data transfer object for public create usage end point") + public class CreateUsageRecord { StringUtil util = new StringUtil(); @@ -29,85 +45,70 @@ public class CreateUsageRecord { @JsonProperty("timestamp") private LocalDateTime timestamp; /** - * The initial quantity for the usage record. Must be a whole number that is greater than or equal - * to 0 - * - * @param quantity Integer - * @return CreateUsageRecord - */ + * The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 + * @param quantity Integer + * @return CreateUsageRecord + **/ public CreateUsageRecord quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * The initial quantity for the usage record. Must be a whole number that is greater than or equal - * to 0 - * + /** + * The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 * @return quantity - */ - @ApiModelProperty( - required = true, - value = - "The initial quantity for the usage record. Must be a whole number that is greater than" - + " or equal to 0") - /** - * The initial quantity for the usage record. Must be a whole number that is greater than or equal - * to 0 - * + **/ + @ApiModelProperty(required = true, value = "The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0") + /** + * The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 * @return quantity Integer - */ + **/ public Integer getQuantity() { return quantity; } - /** - * The initial quantity for the usage record. Must be a whole number that is greater than or equal - * to 0 - * - * @param quantity Integer - */ + /** + * The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 + * @param quantity Integer + **/ + public void setQuantity(Integer quantity) { this.quantity = quantity; } /** - * DateTime in UTC of when the the product was consumed/used - * - * @param timestamp LocalDateTime - * @return CreateUsageRecord - */ + * DateTime in UTC of when the the product was consumed/used + * @param timestamp LocalDateTime + * @return CreateUsageRecord + **/ public CreateUsageRecord timestamp(LocalDateTime timestamp) { this.timestamp = timestamp; return this; } - /** + /** * DateTime in UTC of when the the product was consumed/used - * * @return timestamp - */ - @ApiModelProperty( - required = true, - value = "DateTime in UTC of when the the product was consumed/used") - /** + **/ + @ApiModelProperty(required = true, value = "DateTime in UTC of when the the product was consumed/used") + /** * DateTime in UTC of when the the product was consumed/used - * * @return timestamp LocalDateTime - */ + **/ public LocalDateTime getTimestamp() { return timestamp; } - /** - * DateTime in UTC of when the the product was consumed/used - * - * @param timestamp LocalDateTime - */ + /** + * DateTime in UTC of when the the product was consumed/used + * @param timestamp LocalDateTime + **/ + public void setTimestamp(LocalDateTime timestamp) { this.timestamp = timestamp; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -117,8 +118,8 @@ public boolean equals(java.lang.Object o) { return false; } CreateUsageRecord createUsageRecord = (CreateUsageRecord) o; - return Objects.equals(this.quantity, createUsageRecord.quantity) - && Objects.equals(this.timestamp, createUsageRecord.timestamp); + return Objects.equals(this.quantity, createUsageRecord.quantity) && + Objects.equals(this.timestamp, createUsageRecord.timestamp); } @Override @@ -126,6 +127,7 @@ public int hashCode() { return Objects.hash(quantity, timestamp); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -137,7 +139,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -145,4 +148,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/Plan.java b/src/main/java/com/xero/models/appstore/Plan.java index 80e70261d..93f9fc2c9 100644 --- a/src/main/java/com/xero/models/appstore/Plan.java +++ b/src/main/java/com/xero/models/appstore/Plan.java @@ -9,19 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.appstore.SubscriptionItem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Plan + */ -/** Plan */ public class Plan { StringUtil util = new StringUtil(); @@ -30,15 +46,23 @@ public class Plan { @JsonProperty("name") private String name; - /** Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. */ + /** + * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** CANCELED */ + + /** + * CANCELED + */ CANCELED("CANCELED"), - - /** PENDING_ACTIVATION */ + + /** + * PENDING_ACTIVATION + */ PENDING_ACTIVATION("PENDING_ACTIVATION"); private String value; @@ -47,31 +71,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -83,176 +101,151 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; @JsonProperty("subscriptionItems") private List subscriptionItems = new ArrayList(); /** - * The unique identifier of the plan - * - * @param id UUID - * @return Plan - */ + * The unique identifier of the plan + * @param id UUID + * @return Plan + **/ public Plan id(UUID id) { this.id = id; return this; } - /** + /** * The unique identifier of the plan - * * @return id - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the plan") - /** + /** * The unique identifier of the plan - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The unique identifier of the plan - * - * @param id UUID - */ + /** + * The unique identifier of the plan + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * The name of the plan. It is used in the invoice line item description. - * - * @param name String - * @return Plan - */ + * The name of the plan. It is used in the invoice line item description. + * @param name String + * @return Plan + **/ public Plan name(String name) { this.name = name; return this; } - /** - * The name of the plan. It is used in the invoice line item description. - * + /** + * The name of the plan. It is used in the invoice line item description. * @return name - */ - @ApiModelProperty( - required = true, - value = "The name of the plan. It is used in the invoice line item description. ") - /** - * The name of the plan. It is used in the invoice line item description. - * + **/ + @ApiModelProperty(required = true, value = "The name of the plan. It is used in the invoice line item description. ") + /** + * The name of the plan. It is used in the invoice line item description. * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the plan. It is used in the invoice line item description. - * - * @param name String - */ + /** + * The name of the plan. It is used in the invoice line item description. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. - * - * @param status StatusEnum - * @return Plan - */ + * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. + * @param status StatusEnum + * @return Plan + **/ public Plan status(StatusEnum status) { this.status = status; return this; } - /** - * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. - * + /** + * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. * @return status - */ - @ApiModelProperty( - required = true, - value = - "Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. ") - /** - * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. - * + **/ + @ApiModelProperty(required = true, value = "Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. ") + /** + * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. - * - * @param status StatusEnum - */ + /** + * Status of the plan. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * List of the subscription items belonging to the plan. It does not include cancelled - * subscription items. - * - * @param subscriptionItems List<SubscriptionItem> - * @return Plan - */ + * List of the subscription items belonging to the plan. It does not include cancelled subscription items. + * @param subscriptionItems List<SubscriptionItem> + * @return Plan + **/ public Plan subscriptionItems(List subscriptionItems) { this.subscriptionItems = subscriptionItems; return this; } /** - * List of the subscription items belonging to the plan. It does not include cancelled - * subscription items. - * - * @param subscriptionItemsItem SubscriptionItem + * List of the subscription items belonging to the plan. It does not include cancelled subscription items. + * @param subscriptionItemsItem SubscriptionItem * @return Plan - */ + **/ public Plan addSubscriptionItemsItem(SubscriptionItem subscriptionItemsItem) { this.subscriptionItems.add(subscriptionItemsItem); return this; } - /** - * List of the subscription items belonging to the plan. It does not include cancelled - * subscription items. - * + /** + * List of the subscription items belonging to the plan. It does not include cancelled subscription items. * @return subscriptionItems - */ - @ApiModelProperty( - required = true, - value = - "List of the subscription items belonging to the plan. It does not include cancelled" - + " subscription items. ") - /** - * List of the subscription items belonging to the plan. It does not include cancelled - * subscription items. - * + **/ + @ApiModelProperty(required = true, value = "List of the subscription items belonging to the plan. It does not include cancelled subscription items. ") + /** + * List of the subscription items belonging to the plan. It does not include cancelled subscription items. * @return subscriptionItems List - */ + **/ public List getSubscriptionItems() { return subscriptionItems; } - /** - * List of the subscription items belonging to the plan. It does not include cancelled - * subscription items. - * - * @param subscriptionItems List<SubscriptionItem> - */ + /** + * List of the subscription items belonging to the plan. It does not include cancelled subscription items. + * @param subscriptionItems List<SubscriptionItem> + **/ + public void setSubscriptionItems(List subscriptionItems) { this.subscriptionItems = subscriptionItems; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,10 +255,10 @@ public boolean equals(java.lang.Object o) { return false; } Plan plan = (Plan) o; - return Objects.equals(this.id, plan.id) - && Objects.equals(this.name, plan.name) - && Objects.equals(this.status, plan.status) - && Objects.equals(this.subscriptionItems, plan.subscriptionItems); + return Objects.equals(this.id, plan.id) && + Objects.equals(this.name, plan.name) && + Objects.equals(this.status, plan.status) && + Objects.equals(this.subscriptionItems, plan.subscriptionItems); } @Override @@ -273,6 +266,7 @@ public int hashCode() { return Objects.hash(id, name, status, subscriptionItems); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -286,7 +280,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -294,4 +289,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/Price.java b/src/main/java/com/xero/models/appstore/Price.java index ae575c448..150f838bb 100644 --- a/src/main/java/com/xero/models/appstore/Price.java +++ b/src/main/java/com/xero/models/appstore/Price.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Price + */ -/** Price */ public class Price { StringUtil util = new StringUtil(); @@ -30,110 +47,102 @@ public class Price { @JsonProperty("id") private UUID id; /** - * The net (before tax) amount. - * - * @param amount Double - * @return Price - */ + * The net (before tax) amount. + * @param amount Double + * @return Price + **/ public Price amount(Double amount) { this.amount = amount; return this; } - /** + /** * The net (before tax) amount. - * * @return amount - */ + **/ @ApiModelProperty(required = true, value = "The net (before tax) amount.") - /** + /** * The net (before tax) amount. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The net (before tax) amount. - * - * @param amount Double - */ + /** + * The net (before tax) amount. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The currency of the price. - * - * @param currency String - * @return Price - */ + * The currency of the price. + * @param currency String + * @return Price + **/ public Price currency(String currency) { this.currency = currency; return this; } - /** + /** * The currency of the price. - * * @return currency - */ + **/ @ApiModelProperty(required = true, value = "The currency of the price.") - /** + /** * The currency of the price. - * * @return currency String - */ + **/ public String getCurrency() { return currency; } - /** - * The currency of the price. - * - * @param currency String - */ + /** + * The currency of the price. + * @param currency String + **/ + public void setCurrency(String currency) { this.currency = currency; } /** - * The unique identifier of the price. - * - * @param id UUID - * @return Price - */ + * The unique identifier of the price. + * @param id UUID + * @return Price + **/ public Price id(UUID id) { this.id = id; return this; } - /** + /** * The unique identifier of the price. - * * @return id - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the price.") - /** + /** * The unique identifier of the price. - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The unique identifier of the price. - * - * @param id UUID - */ + /** + * The unique identifier of the price. + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -143,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } Price price = (Price) o; - return Objects.equals(this.amount, price.amount) - && Objects.equals(this.currency, price.currency) - && Objects.equals(this.id, price.id); + return Objects.equals(this.amount, price.amount) && + Objects.equals(this.currency, price.currency) && + Objects.equals(this.id, price.id); } @Override @@ -153,6 +162,7 @@ public int hashCode() { return Objects.hash(amount, currency, id); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -165,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -173,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/ProblemDetails.java b/src/main/java/com/xero/models/appstore/ProblemDetails.java index 3bab05c8a..8f50556e8 100644 --- a/src/main/java/com/xero/models/appstore/ProblemDetails.java +++ b/src/main/java/com/xero/models/appstore/ProblemDetails.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ProblemDetails + */ -/** ProblemDetails */ public class ProblemDetails { StringUtil util = new StringUtil(); @@ -38,215 +55,198 @@ public class ProblemDetails { @JsonProperty("type") private String type; /** - * detail - * - * @param detail String - * @return ProblemDetails - */ + * detail + * @param detail String + * @return ProblemDetails + **/ public ProblemDetails detail(String detail) { this.detail = detail; return this; } - /** + /** * Get detail - * * @return detail - */ + **/ @ApiModelProperty(value = "") - /** + /** * detail - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * detail - * - * @param detail String - */ + /** + * detail + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } /** - * extensions - * - * @param extensions Object - * @return ProblemDetails - */ + * extensions + * @param extensions Object + * @return ProblemDetails + **/ public ProblemDetails extensions(Object extensions) { this.extensions = extensions; return this; } - /** + /** * Get extensions - * * @return extensions - */ + **/ @ApiModelProperty(value = "") - /** + /** * extensions - * * @return extensions Object - */ + **/ public Object getExtensions() { return extensions; } - /** - * extensions - * - * @param extensions Object - */ + /** + * extensions + * @param extensions Object + **/ + public void setExtensions(Object extensions) { this.extensions = extensions; } /** - * instance - * - * @param instance String - * @return ProblemDetails - */ + * instance + * @param instance String + * @return ProblemDetails + **/ public ProblemDetails instance(String instance) { this.instance = instance; return this; } - /** + /** * Get instance - * * @return instance - */ + **/ @ApiModelProperty(value = "") - /** + /** * instance - * * @return instance String - */ + **/ public String getInstance() { return instance; } - /** - * instance - * - * @param instance String - */ + /** + * instance + * @param instance String + **/ + public void setInstance(String instance) { this.instance = instance; } /** - * status - * - * @param status Integer - * @return ProblemDetails - */ + * status + * @param status Integer + * @return ProblemDetails + **/ public ProblemDetails status(Integer status) { this.status = status; return this; } - /** + /** * Get status - * * @return status - */ + **/ @ApiModelProperty(value = "") - /** + /** * status - * * @return status Integer - */ + **/ public Integer getStatus() { return status; } - /** - * status - * - * @param status Integer - */ + /** + * status + * @param status Integer + **/ + public void setStatus(Integer status) { this.status = status; } /** - * title - * - * @param title String - * @return ProblemDetails - */ + * title + * @param title String + * @return ProblemDetails + **/ public ProblemDetails title(String title) { this.title = title; return this; } - /** + /** * Get title - * * @return title - */ + **/ @ApiModelProperty(value = "") - /** + /** * title - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * title - * - * @param title String - */ + /** + * title + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * type - * - * @param type String - * @return ProblemDetails - */ + * type + * @param type String + * @return ProblemDetails + **/ public ProblemDetails type(String type) { this.type = type; return this; } - /** + /** * Get type - * * @return type - */ + **/ @ApiModelProperty(value = "") - /** + /** * type - * * @return type String - */ + **/ public String getType() { return type; } - /** - * type - * - * @param type String - */ + /** + * type + * @param type String + **/ + public void setType(String type) { this.type = type; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -256,12 +256,12 @@ public boolean equals(java.lang.Object o) { return false; } ProblemDetails problemDetails = (ProblemDetails) o; - return Objects.equals(this.detail, problemDetails.detail) - && Objects.equals(this.extensions, problemDetails.extensions) - && Objects.equals(this.instance, problemDetails.instance) - && Objects.equals(this.status, problemDetails.status) - && Objects.equals(this.title, problemDetails.title) - && Objects.equals(this.type, problemDetails.type); + return Objects.equals(this.detail, problemDetails.detail) && + Objects.equals(this.extensions, problemDetails.extensions) && + Objects.equals(this.instance, problemDetails.instance) && + Objects.equals(this.status, problemDetails.status) && + Objects.equals(this.title, problemDetails.title) && + Objects.equals(this.type, problemDetails.type); } @Override @@ -269,6 +269,7 @@ public int hashCode() { return Objects.hash(detail, extensions, instance, status, title, type); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -284,7 +285,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -292,4 +294,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/Product.java b/src/main/java/com/xero/models/appstore/Product.java index 76f3852ed..d5cfc85fe 100644 --- a/src/main/java/com/xero/models/appstore/Product.java +++ b/src/main/java/com/xero/models/appstore/Product.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Product + */ -/** Product */ public class Product { StringUtil util = new StringUtil(); @@ -32,18 +47,22 @@ public class Product { @JsonProperty("seatUnit") private String seatUnit; /** - * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each - * billing period * PER_SEAT: Customers are charged based on the number of units they purchase * - * METERED: Customers are charged per use of this product + * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each billing period * PER_SEAT: Customers are charged based on the number of units they purchase * METERED: Customers are charged per use of this product */ public enum TypeEnum { - /** FIXED */ + /** + * FIXED + */ FIXED("FIXED"), - - /** PER_SEAT */ + + /** + * PER_SEAT + */ PER_SEAT("PER_SEAT"), - - /** METERED */ + + /** + * METERED + */ METERED("METERED"); private String value; @@ -52,31 +71,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -88,208 +101,173 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("type") private TypeEnum type; @JsonProperty("usageUnit") private String usageUnit; /** - * The unique identifier for the product - * - * @param id UUID - * @return Product - */ + * The unique identifier for the product + * @param id UUID + * @return Product + **/ public Product id(UUID id) { this.id = id; return this; } - /** + /** * The unique identifier for the product - * * @return id - */ + **/ @ApiModelProperty(value = "The unique identifier for the product") - /** + /** * The unique identifier for the product - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The unique identifier for the product - * - * @param id UUID - */ + /** + * The unique identifier for the product + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * The name of the product - * - * @param name String - * @return Product - */ + * The name of the product + * @param name String + * @return Product + **/ public Product name(String name) { this.name = name; return this; } - /** + /** * The name of the product - * * @return name - */ + **/ @ApiModelProperty(value = "The name of the product") - /** + /** * The name of the product - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the product - * - * @param name String - */ + /** + * The name of the product + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The unit of the per seat product. e.g. \"user\", \"organisation\", - * \"SMS\", etc - * - * @param seatUnit String - * @return Product - */ + * The unit of the per seat product. e.g. \"user\", \"organisation\", \"SMS\", etc + * @param seatUnit String + * @return Product + **/ public Product seatUnit(String seatUnit) { this.seatUnit = seatUnit; return this; } - /** - * The unit of the per seat product. e.g. \"user\", \"organisation\", - * \"SMS\", etc - * + /** + * The unit of the per seat product. e.g. \"user\", \"organisation\", \"SMS\", etc * @return seatUnit - */ - @ApiModelProperty( - value = "The unit of the per seat product. e.g. \"user\", \"organisation\", \"SMS\", etc") - /** - * The unit of the per seat product. e.g. \"user\", \"organisation\", - * \"SMS\", etc - * + **/ + @ApiModelProperty(value = "The unit of the per seat product. e.g. \"user\", \"organisation\", \"SMS\", etc") + /** + * The unit of the per seat product. e.g. \"user\", \"organisation\", \"SMS\", etc * @return seatUnit String - */ + **/ public String getSeatUnit() { return seatUnit; } - /** - * The unit of the per seat product. e.g. \"user\", \"organisation\", - * \"SMS\", etc - * - * @param seatUnit String - */ + /** + * The unit of the per seat product. e.g. \"user\", \"organisation\", \"SMS\", etc + * @param seatUnit String + **/ + public void setSeatUnit(String seatUnit) { this.seatUnit = seatUnit; } /** - * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each - * billing period * PER_SEAT: Customers are charged based on the number of units they purchase * - * METERED: Customers are charged per use of this product - * - * @param type TypeEnum - * @return Product - */ + * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each billing period * PER_SEAT: Customers are charged based on the number of units they purchase * METERED: Customers are charged per use of this product + * @param type TypeEnum + * @return Product + **/ public Product type(TypeEnum type) { this.type = type; return this; } - /** - * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each - * billing period * PER_SEAT: Customers are charged based on the number of units they purchase * - * METERED: Customers are charged per use of this product - * + /** + * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each billing period * PER_SEAT: Customers are charged based on the number of units they purchase * METERED: Customers are charged per use of this product * @return type - */ - @ApiModelProperty( - value = - "The pricing model of the product: * FIXED: Customers are charged a fixed amount for" - + " each billing period * PER_SEAT: Customers are charged based on the number of" - + " units they purchase * METERED: Customers are charged per use of this product ") - /** - * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each - * billing period * PER_SEAT: Customers are charged based on the number of units they purchase * - * METERED: Customers are charged per use of this product - * + **/ + @ApiModelProperty(value = "The pricing model of the product: * FIXED: Customers are charged a fixed amount for each billing period * PER_SEAT: Customers are charged based on the number of units they purchase * METERED: Customers are charged per use of this product ") + /** + * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each billing period * PER_SEAT: Customers are charged based on the number of units they purchase * METERED: Customers are charged per use of this product * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each - * billing period * PER_SEAT: Customers are charged based on the number of units they purchase * - * METERED: Customers are charged per use of this product - * - * @param type TypeEnum - */ + /** + * The pricing model of the product: * FIXED: Customers are charged a fixed amount for each billing period * PER_SEAT: Customers are charged based on the number of units they purchase * METERED: Customers are charged per use of this product + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * The unit of the usage product. e.g. \"user\", \"minutes\", - * \"SMS\", etc - * - * @param usageUnit String - * @return Product - */ + * The unit of the usage product. e.g. \"user\", \"minutes\", \"SMS\", etc + * @param usageUnit String + * @return Product + **/ public Product usageUnit(String usageUnit) { this.usageUnit = usageUnit; return this; } - /** - * The unit of the usage product. e.g. \"user\", \"minutes\", - * \"SMS\", etc - * + /** + * The unit of the usage product. e.g. \"user\", \"minutes\", \"SMS\", etc * @return usageUnit - */ - @ApiModelProperty( - value = "The unit of the usage product. e.g. \"user\", \"minutes\", \"SMS\", etc") - /** - * The unit of the usage product. e.g. \"user\", \"minutes\", - * \"SMS\", etc - * + **/ + @ApiModelProperty(value = "The unit of the usage product. e.g. \"user\", \"minutes\", \"SMS\", etc") + /** + * The unit of the usage product. e.g. \"user\", \"minutes\", \"SMS\", etc * @return usageUnit String - */ + **/ public String getUsageUnit() { return usageUnit; } - /** - * The unit of the usage product. e.g. \"user\", \"minutes\", - * \"SMS\", etc - * - * @param usageUnit String - */ + /** + * The unit of the usage product. e.g. \"user\", \"minutes\", \"SMS\", etc + * @param usageUnit String + **/ + public void setUsageUnit(String usageUnit) { this.usageUnit = usageUnit; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -299,11 +277,11 @@ public boolean equals(java.lang.Object o) { return false; } Product product = (Product) o; - return Objects.equals(this.id, product.id) - && Objects.equals(this.name, product.name) - && Objects.equals(this.seatUnit, product.seatUnit) - && Objects.equals(this.type, product.type) - && Objects.equals(this.usageUnit, product.usageUnit); + return Objects.equals(this.id, product.id) && + Objects.equals(this.name, product.name) && + Objects.equals(this.seatUnit, product.seatUnit) && + Objects.equals(this.type, product.type) && + Objects.equals(this.usageUnit, product.usageUnit); } @Override @@ -311,6 +289,7 @@ public int hashCode() { return Objects.hash(id, name, seatUnit, type, usageUnit); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -325,7 +304,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -333,4 +313,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/Subscription.java b/src/main/java/com/xero/models/appstore/Subscription.java index f39acafa6..b6d3f4a96 100644 --- a/src/main/java/com/xero/models/appstore/Subscription.java +++ b/src/main/java/com/xero/models/appstore/Subscription.java @@ -9,20 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.appstore.Plan; +import io.swagger.annotations.ApiModel; 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.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Subscription + */ -/** Subscription */ public class Subscription { StringUtil util = new StringUtil(); @@ -43,15 +59,23 @@ public class Subscription { @JsonProperty("startDate") private LocalDateTime startDate; - /** Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. */ + /** + * Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** CANCELED */ + + /** + * CANCELED + */ CANCELED("CANCELED"), - - /** PAST_DUE */ + + /** + * PAST_DUE + */ PAST_DUE("PAST_DUE"); private String value; @@ -60,31 +84,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -96,168 +114,145 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; @JsonProperty("testMode") private Boolean testMode; /** - * End of the current period that the subscription has been invoiced for. - * - * @param currentPeriodEnd LocalDateTime - * @return Subscription - */ + * End of the current period that the subscription has been invoiced for. + * @param currentPeriodEnd LocalDateTime + * @return Subscription + **/ public Subscription currentPeriodEnd(LocalDateTime currentPeriodEnd) { this.currentPeriodEnd = currentPeriodEnd; return this; } - /** - * End of the current period that the subscription has been invoiced for. - * + /** + * End of the current period that the subscription has been invoiced for. * @return currentPeriodEnd - */ - @ApiModelProperty( - required = true, - value = "End of the current period that the subscription has been invoiced for. ") - /** - * End of the current period that the subscription has been invoiced for. - * + **/ + @ApiModelProperty(required = true, value = "End of the current period that the subscription has been invoiced for. ") + /** + * End of the current period that the subscription has been invoiced for. * @return currentPeriodEnd LocalDateTime - */ + **/ public LocalDateTime getCurrentPeriodEnd() { return currentPeriodEnd; } - /** - * End of the current period that the subscription has been invoiced for. - * - * @param currentPeriodEnd LocalDateTime - */ + /** + * End of the current period that the subscription has been invoiced for. + * @param currentPeriodEnd LocalDateTime + **/ + public void setCurrentPeriodEnd(LocalDateTime currentPeriodEnd) { this.currentPeriodEnd = currentPeriodEnd; } /** - * If the subscription has been canceled, this is the date when the subscription ends. If null, - * the subscription is active and has not been cancelled - * - * @param endDate LocalDateTime - * @return Subscription - */ + * If the subscription has been canceled, this is the date when the subscription ends. If null, the subscription is active and has not been cancelled + * @param endDate LocalDateTime + * @return Subscription + **/ public Subscription endDate(LocalDateTime endDate) { this.endDate = endDate; return this; } - /** - * If the subscription has been canceled, this is the date when the subscription ends. If null, - * the subscription is active and has not been cancelled - * + /** + * If the subscription has been canceled, this is the date when the subscription ends. If null, the subscription is active and has not been cancelled * @return endDate - */ - @ApiModelProperty( - value = - "If the subscription has been canceled, this is the date when the subscription ends. If" - + " null, the subscription is active and has not been cancelled") - /** - * If the subscription has been canceled, this is the date when the subscription ends. If null, - * the subscription is active and has not been cancelled - * + **/ + @ApiModelProperty(value = "If the subscription has been canceled, this is the date when the subscription ends. If null, the subscription is active and has not been cancelled") + /** + * If the subscription has been canceled, this is the date when the subscription ends. If null, the subscription is active and has not been cancelled * @return endDate LocalDateTime - */ + **/ public LocalDateTime getEndDate() { return endDate; } - /** - * If the subscription has been canceled, this is the date when the subscription ends. If null, - * the subscription is active and has not been cancelled - * - * @param endDate LocalDateTime - */ + /** + * If the subscription has been canceled, this is the date when the subscription ends. If null, the subscription is active and has not been cancelled + * @param endDate LocalDateTime + **/ + public void setEndDate(LocalDateTime endDate) { this.endDate = endDate; } /** - * The unique identifier of the subscription - * - * @param id UUID - * @return Subscription - */ + * The unique identifier of the subscription + * @param id UUID + * @return Subscription + **/ public Subscription id(UUID id) { this.id = id; return this; } - /** + /** * The unique identifier of the subscription - * * @return id - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the subscription") - /** + /** * The unique identifier of the subscription - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The unique identifier of the subscription - * - * @param id UUID - */ + /** + * The unique identifier of the subscription + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * The Xero generated unique identifier for the organisation - * - * @param organisationId UUID - * @return Subscription - */ + * The Xero generated unique identifier for the organisation + * @param organisationId UUID + * @return Subscription + **/ public Subscription organisationId(UUID organisationId) { this.organisationId = organisationId; return this; } - /** + /** * The Xero generated unique identifier for the organisation - * * @return organisationId - */ - @ApiModelProperty( - required = true, - value = "The Xero generated unique identifier for the organisation") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero generated unique identifier for the organisation") + /** * The Xero generated unique identifier for the organisation - * * @return organisationId UUID - */ + **/ public UUID getOrganisationId() { return organisationId; } - /** - * The Xero generated unique identifier for the organisation - * - * @param organisationId UUID - */ + /** + * The Xero generated unique identifier for the organisation + * @param organisationId UUID + **/ + public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; } /** - * List of plans for the subscription. - * - * @param plans List<Plan> - * @return Subscription - */ + * List of plans for the subscription. + * @param plans List<Plan> + * @return Subscription + **/ public Subscription plans(List plans) { this.plans = plans; return this; @@ -265,146 +260,133 @@ public Subscription plans(List plans) { /** * List of plans for the subscription. - * - * @param plansItem Plan + * @param plansItem Plan * @return Subscription - */ + **/ public Subscription addPlansItem(Plan plansItem) { this.plans.add(plansItem); return this; } - /** + /** * List of plans for the subscription. - * * @return plans - */ + **/ @ApiModelProperty(required = true, value = "List of plans for the subscription.") - /** + /** * List of plans for the subscription. - * * @return plans List - */ + **/ public List getPlans() { return plans; } - /** - * List of plans for the subscription. - * - * @param plans List<Plan> - */ + /** + * List of plans for the subscription. + * @param plans List<Plan> + **/ + public void setPlans(List plans) { this.plans = plans; } /** - * Date when the subscription was first created. - * - * @param startDate LocalDateTime - * @return Subscription - */ + * Date when the subscription was first created. + * @param startDate LocalDateTime + * @return Subscription + **/ public Subscription startDate(LocalDateTime startDate) { this.startDate = startDate; return this; } - /** + /** * Date when the subscription was first created. - * * @return startDate - */ + **/ @ApiModelProperty(required = true, value = "Date when the subscription was first created.") - /** + /** * Date when the subscription was first created. - * * @return startDate LocalDateTime - */ + **/ public LocalDateTime getStartDate() { return startDate; } - /** - * Date when the subscription was first created. - * - * @param startDate LocalDateTime - */ + /** + * Date when the subscription was first created. + * @param startDate LocalDateTime + **/ + public void setStartDate(LocalDateTime startDate) { this.startDate = startDate; } /** - * Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. - * - * @param status StatusEnum - * @return Subscription - */ + * Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. + * @param status StatusEnum + * @return Subscription + **/ public Subscription status(StatusEnum status) { this.status = status; return this; } - /** + /** * Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. - * * @return status - */ - @ApiModelProperty( - required = true, - value = "Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE.") - /** + **/ + @ApiModelProperty(required = true, value = "Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE.") + /** * Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. - * - * @param status StatusEnum - */ + /** + * Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Boolean used to indicate if the subscription is in test mode - * - * @param testMode Boolean - * @return Subscription - */ + * Boolean used to indicate if the subscription is in test mode + * @param testMode Boolean + * @return Subscription + **/ public Subscription testMode(Boolean testMode) { this.testMode = testMode; return this; } - /** + /** * Boolean used to indicate if the subscription is in test mode - * * @return testMode - */ + **/ @ApiModelProperty(value = "Boolean used to indicate if the subscription is in test mode") - /** + /** * Boolean used to indicate if the subscription is in test mode - * * @return testMode Boolean - */ + **/ public Boolean getTestMode() { return testMode; } - /** - * Boolean used to indicate if the subscription is in test mode - * - * @param testMode Boolean - */ + /** + * Boolean used to indicate if the subscription is in test mode + * @param testMode Boolean + **/ + public void setTestMode(Boolean testMode) { this.testMode = testMode; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -414,22 +396,22 @@ public boolean equals(java.lang.Object o) { return false; } Subscription subscription = (Subscription) o; - return Objects.equals(this.currentPeriodEnd, subscription.currentPeriodEnd) - && Objects.equals(this.endDate, subscription.endDate) - && Objects.equals(this.id, subscription.id) - && Objects.equals(this.organisationId, subscription.organisationId) - && Objects.equals(this.plans, subscription.plans) - && Objects.equals(this.startDate, subscription.startDate) - && Objects.equals(this.status, subscription.status) - && Objects.equals(this.testMode, subscription.testMode); + return Objects.equals(this.currentPeriodEnd, subscription.currentPeriodEnd) && + Objects.equals(this.endDate, subscription.endDate) && + Objects.equals(this.id, subscription.id) && + Objects.equals(this.organisationId, subscription.organisationId) && + Objects.equals(this.plans, subscription.plans) && + Objects.equals(this.startDate, subscription.startDate) && + Objects.equals(this.status, subscription.status) && + Objects.equals(this.testMode, subscription.testMode); } @Override public int hashCode() { - return Objects.hash( - currentPeriodEnd, endDate, id, organisationId, plans, startDate, status, testMode); + return Objects.hash(currentPeriodEnd, endDate, id, organisationId, plans, startDate, status, testMode); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -447,7 +429,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -455,4 +438,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/SubscriptionItem.java b/src/main/java/com/xero/models/appstore/SubscriptionItem.java index 6701f4cbc..03cfd523f 100644 --- a/src/main/java/com/xero/models/appstore/SubscriptionItem.java +++ b/src/main/java/com/xero/models/appstore/SubscriptionItem.java @@ -9,18 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.appstore.Price; +import com.xero.models.appstore.Product; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SubscriptionItem + */ -/** SubscriptionItem */ public class SubscriptionItem { StringUtil util = new StringUtil(); @@ -42,17 +59,22 @@ public class SubscriptionItem { @JsonProperty("startDate") private LocalDateTime startDate; /** - * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and - * PENDING_ACTIVATION. + * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** CANCELED */ + + /** + * CANCELED + */ CANCELED("CANCELED"), - - /** PENDING_ACTIVATION */ + + /** + * PENDING_ACTIVATION + */ PENDING_ACTIVATION("PENDING_ACTIVATION"); private String value; @@ -61,31 +83,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -97,314 +113,269 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; @JsonProperty("testMode") private Boolean testMode; /** - * Date when the subscription to this product will end - * - * @param endDate LocalDateTime - * @return SubscriptionItem - */ + * Date when the subscription to this product will end + * @param endDate LocalDateTime + * @return SubscriptionItem + **/ public SubscriptionItem endDate(LocalDateTime endDate) { this.endDate = endDate; return this; } - /** + /** * Date when the subscription to this product will end - * * @return endDate - */ + **/ @ApiModelProperty(value = "Date when the subscription to this product will end") - /** + /** * Date when the subscription to this product will end - * * @return endDate LocalDateTime - */ + **/ public LocalDateTime getEndDate() { return endDate; } - /** - * Date when the subscription to this product will end - * - * @param endDate LocalDateTime - */ + /** + * Date when the subscription to this product will end + * @param endDate LocalDateTime + **/ + public void setEndDate(LocalDateTime endDate) { this.endDate = endDate; } /** - * The unique identifier of the subscription item. - * - * @param id UUID - * @return SubscriptionItem - */ + * The unique identifier of the subscription item. + * @param id UUID + * @return SubscriptionItem + **/ public SubscriptionItem id(UUID id) { this.id = id; return this; } - /** + /** * The unique identifier of the subscription item. - * * @return id - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the subscription item.") - /** + /** * The unique identifier of the subscription item. - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The unique identifier of the subscription item. - * - * @param id UUID - */ + /** + * The unique identifier of the subscription item. + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * price - * - * @param price Price - * @return SubscriptionItem - */ + * price + * @param price Price + * @return SubscriptionItem + **/ public SubscriptionItem price(Price price) { this.price = price; return this; } - /** + /** * Get price - * * @return price - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * price - * * @return price Price - */ + **/ public Price getPrice() { return price; } - /** - * price - * - * @param price Price - */ + /** + * price + * @param price Price + **/ + public void setPrice(Price price) { this.price = price; } /** - * product - * - * @param product Product - * @return SubscriptionItem - */ + * product + * @param product Product + * @return SubscriptionItem + **/ public SubscriptionItem product(Product product) { this.product = product; return this; } - /** + /** * Get product - * * @return product - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * product - * * @return product Product - */ + **/ public Product getProduct() { return product; } - /** - * product - * - * @param product Product - */ + /** + * product + * @param product Product + **/ + public void setProduct(Product product) { this.product = product; } /** - * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a - * positive integer. For metered products, it is always null. - * - * @param quantity Integer - * @return SubscriptionItem - */ + * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a positive integer. For metered products, it is always null. + * @param quantity Integer + * @return SubscriptionItem + **/ public SubscriptionItem quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a - * positive integer. For metered products, it is always null. - * + /** + * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a positive integer. For metered products, it is always null. * @return quantity - */ - @ApiModelProperty( - value = - "The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a" - + " positive integer. For metered products, it is always null.") - /** - * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a - * positive integer. For metered products, it is always null. - * + **/ + @ApiModelProperty(value = "The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a positive integer. For metered products, it is always null.") + /** + * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a positive integer. For metered products, it is always null. * @return quantity Integer - */ + **/ public Integer getQuantity() { return quantity; } - /** - * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a - * positive integer. For metered products, it is always null. - * - * @param quantity Integer - */ + /** + * The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a positive integer. For metered products, it is always null. + * @param quantity Integer + **/ + public void setQuantity(Integer quantity) { this.quantity = quantity; } /** - * Date the subscription started, or will start. Note: this could be in the future for downgrades - * or reduced number of seats that haven't taken effect yet. - * - * @param startDate LocalDateTime - * @return SubscriptionItem - */ + * Date the subscription started, or will start. Note: this could be in the future for downgrades or reduced number of seats that haven't taken effect yet. + * @param startDate LocalDateTime + * @return SubscriptionItem + **/ public SubscriptionItem startDate(LocalDateTime startDate) { this.startDate = startDate; return this; } - /** - * Date the subscription started, or will start. Note: this could be in the future for downgrades - * or reduced number of seats that haven't taken effect yet. - * + /** + * Date the subscription started, or will start. Note: this could be in the future for downgrades or reduced number of seats that haven't taken effect yet. * @return startDate - */ - @ApiModelProperty( - required = true, - value = - "Date the subscription started, or will start. Note: this could be in the future for" - + " downgrades or reduced number of seats that haven't taken effect yet. ") - /** - * Date the subscription started, or will start. Note: this could be in the future for downgrades - * or reduced number of seats that haven't taken effect yet. - * + **/ + @ApiModelProperty(required = true, value = "Date the subscription started, or will start. Note: this could be in the future for downgrades or reduced number of seats that haven't taken effect yet. ") + /** + * Date the subscription started, or will start. Note: this could be in the future for downgrades or reduced number of seats that haven't taken effect yet. * @return startDate LocalDateTime - */ + **/ public LocalDateTime getStartDate() { return startDate; } - /** - * Date the subscription started, or will start. Note: this could be in the future for downgrades - * or reduced number of seats that haven't taken effect yet. - * - * @param startDate LocalDateTime - */ + /** + * Date the subscription started, or will start. Note: this could be in the future for downgrades or reduced number of seats that haven't taken effect yet. + * @param startDate LocalDateTime + **/ + public void setStartDate(LocalDateTime startDate) { this.startDate = startDate; } /** - * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and - * PENDING_ACTIVATION. - * - * @param status StatusEnum - * @return SubscriptionItem - */ + * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. + * @param status StatusEnum + * @return SubscriptionItem + **/ public SubscriptionItem status(StatusEnum status) { this.status = status; return this; } - /** - * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and - * PENDING_ACTIVATION. - * + /** + * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. * @return status - */ - @ApiModelProperty( - required = true, - value = - "Status of the subscription item. Available statuses are ACTIVE, CANCELED, and" - + " PENDING_ACTIVATION. ") - /** - * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and - * PENDING_ACTIVATION. - * + **/ + @ApiModelProperty(required = true, value = "Status of the subscription item. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. ") + /** + * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and - * PENDING_ACTIVATION. - * - * @param status StatusEnum - */ + /** + * Status of the subscription item. Available statuses are ACTIVE, CANCELED, and PENDING_ACTIVATION. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * If the subscription is a test subscription - * - * @param testMode Boolean - * @return SubscriptionItem - */ + * If the subscription is a test subscription + * @param testMode Boolean + * @return SubscriptionItem + **/ public SubscriptionItem testMode(Boolean testMode) { this.testMode = testMode; return this; } - /** + /** * If the subscription is a test subscription - * * @return testMode - */ + **/ @ApiModelProperty(value = "If the subscription is a test subscription") - /** + /** * If the subscription is a test subscription - * * @return testMode Boolean - */ + **/ public Boolean getTestMode() { return testMode; } - /** - * If the subscription is a test subscription - * - * @param testMode Boolean - */ + /** + * If the subscription is a test subscription + * @param testMode Boolean + **/ + public void setTestMode(Boolean testMode) { this.testMode = testMode; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -414,14 +385,14 @@ public boolean equals(java.lang.Object o) { return false; } SubscriptionItem subscriptionItem = (SubscriptionItem) o; - return Objects.equals(this.endDate, subscriptionItem.endDate) - && Objects.equals(this.id, subscriptionItem.id) - && Objects.equals(this.price, subscriptionItem.price) - && Objects.equals(this.product, subscriptionItem.product) - && Objects.equals(this.quantity, subscriptionItem.quantity) - && Objects.equals(this.startDate, subscriptionItem.startDate) - && Objects.equals(this.status, subscriptionItem.status) - && Objects.equals(this.testMode, subscriptionItem.testMode); + return Objects.equals(this.endDate, subscriptionItem.endDate) && + Objects.equals(this.id, subscriptionItem.id) && + Objects.equals(this.price, subscriptionItem.price) && + Objects.equals(this.product, subscriptionItem.product) && + Objects.equals(this.quantity, subscriptionItem.quantity) && + Objects.equals(this.startDate, subscriptionItem.startDate) && + Objects.equals(this.status, subscriptionItem.status) && + Objects.equals(this.testMode, subscriptionItem.testMode); } @Override @@ -429,6 +400,7 @@ public int hashCode() { return Objects.hash(endDate, id, price, product, quantity, startDate, status, testMode); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -446,7 +418,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -454,4 +427,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/UpdateUsageRecord.java b/src/main/java/com/xero/models/appstore/UpdateUsageRecord.java index 0789671b6..a08edb62d 100644 --- a/src/main/java/com/xero/models/appstore/UpdateUsageRecord.java +++ b/src/main/java/com/xero/models/appstore/UpdateUsageRecord.java @@ -9,64 +9,70 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; -/** Data transfer object for public update usage end point */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Data transfer object for public update usage end point + */ @ApiModel(description = "Data transfer object for public update usage end point") + public class UpdateUsageRecord { StringUtil util = new StringUtil(); @JsonProperty("quantity") private Integer quantity; /** - * The new quantity for the usage record. Must be a whole number that is greater than or equal to - * 0 - * - * @param quantity Integer - * @return UpdateUsageRecord - */ + * The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 + * @param quantity Integer + * @return UpdateUsageRecord + **/ public UpdateUsageRecord quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * The new quantity for the usage record. Must be a whole number that is greater than or equal to - * 0 - * + /** + * The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 * @return quantity - */ - @ApiModelProperty( - required = true, - value = - "The new quantity for the usage record. Must be a whole number that is greater than or" - + " equal to 0") - /** - * The new quantity for the usage record. Must be a whole number that is greater than or equal to - * 0 - * + **/ + @ApiModelProperty(required = true, value = "The new quantity for the usage record. Must be a whole number that is greater than or equal to 0") + /** + * The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 * @return quantity Integer - */ + **/ public Integer getQuantity() { return quantity; } - /** - * The new quantity for the usage record. Must be a whole number that is greater than or equal to - * 0 - * - * @param quantity Integer - */ + /** + * The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 + * @param quantity Integer + **/ + public void setQuantity(Integer quantity) { this.quantity = quantity; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -84,6 +90,7 @@ public int hashCode() { return Objects.hash(quantity); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,7 +101,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -102,4 +110,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/UsageRecord.java b/src/main/java/com/xero/models/appstore/UsageRecord.java index 0e87e4c7d..10030968e 100644 --- a/src/main/java/com/xero/models/appstore/UsageRecord.java +++ b/src/main/java/com/xero/models/appstore/UsageRecord.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import java.util.Objects; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * UsageRecord + */ -/** UsageRecord */ public class UsageRecord { StringUtil util = new StringUtil(); @@ -46,285 +63,262 @@ public class UsageRecord { @JsonProperty("productId") private String productId; /** - * The quantity recorded - * - * @param quantity Integer - * @return UsageRecord - */ + * The quantity recorded + * @param quantity Integer + * @return UsageRecord + **/ public UsageRecord quantity(Integer quantity) { this.quantity = quantity; return this; } - /** + /** * The quantity recorded - * * @return quantity - */ + **/ @ApiModelProperty(required = true, value = "The quantity recorded") - /** + /** * The quantity recorded - * * @return quantity Integer - */ + **/ public Integer getQuantity() { return quantity; } - /** - * The quantity recorded - * - * @param quantity Integer - */ + /** + * The quantity recorded + * @param quantity Integer + **/ + public void setQuantity(Integer quantity) { this.quantity = quantity; } /** - * The unique identifier of the Subscription. - * - * @param subscriptionId String - * @return UsageRecord - */ + * The unique identifier of the Subscription. + * @param subscriptionId String + * @return UsageRecord + **/ public UsageRecord subscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } - /** + /** * The unique identifier of the Subscription. - * * @return subscriptionId - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the Subscription.") - /** + /** * The unique identifier of the Subscription. - * * @return subscriptionId String - */ + **/ public String getSubscriptionId() { return subscriptionId; } - /** - * The unique identifier of the Subscription. - * - * @param subscriptionId String - */ + /** + * The unique identifier of the Subscription. + * @param subscriptionId String + **/ + public void setSubscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; } /** - * The unique identifier of the SubscriptionItem. - * - * @param subscriptionItemId String - * @return UsageRecord - */ + * The unique identifier of the SubscriptionItem. + * @param subscriptionItemId String + * @return UsageRecord + **/ public UsageRecord subscriptionItemId(String subscriptionItemId) { this.subscriptionItemId = subscriptionItemId; return this; } - /** + /** * The unique identifier of the SubscriptionItem. - * * @return subscriptionItemId - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the SubscriptionItem.") - /** + /** * The unique identifier of the SubscriptionItem. - * * @return subscriptionItemId String - */ + **/ public String getSubscriptionItemId() { return subscriptionItemId; } - /** - * The unique identifier of the SubscriptionItem. - * - * @param subscriptionItemId String - */ + /** + * The unique identifier of the SubscriptionItem. + * @param subscriptionItemId String + **/ + public void setSubscriptionItemId(String subscriptionItemId) { this.subscriptionItemId = subscriptionItemId; } /** - * If the subscription is a test subscription - * - * @param testMode Boolean - * @return UsageRecord - */ + * If the subscription is a test subscription + * @param testMode Boolean + * @return UsageRecord + **/ public UsageRecord testMode(Boolean testMode) { this.testMode = testMode; return this; } - /** + /** * If the subscription is a test subscription - * * @return testMode - */ + **/ @ApiModelProperty(required = true, value = "If the subscription is a test subscription") - /** + /** * If the subscription is a test subscription - * * @return testMode Boolean - */ + **/ public Boolean getTestMode() { return testMode; } - /** - * If the subscription is a test subscription - * - * @param testMode Boolean - */ + /** + * If the subscription is a test subscription + * @param testMode Boolean + **/ + public void setTestMode(Boolean testMode) { this.testMode = testMode; } /** - * The time when this usage was recorded in UTC - * - * @param recordedAt LocalDateTime - * @return UsageRecord - */ + * The time when this usage was recorded in UTC + * @param recordedAt LocalDateTime + * @return UsageRecord + **/ public UsageRecord recordedAt(LocalDateTime recordedAt) { this.recordedAt = recordedAt; return this; } - /** + /** * The time when this usage was recorded in UTC - * * @return recordedAt - */ + **/ @ApiModelProperty(required = true, value = "The time when this usage was recorded in UTC") - /** + /** * The time when this usage was recorded in UTC - * * @return recordedAt LocalDateTime - */ + **/ public LocalDateTime getRecordedAt() { return recordedAt; } - /** - * The time when this usage was recorded in UTC - * - * @param recordedAt LocalDateTime - */ + /** + * The time when this usage was recorded in UTC + * @param recordedAt LocalDateTime + **/ + public void setRecordedAt(LocalDateTime recordedAt) { this.recordedAt = recordedAt; } /** - * The unique identifier of the usageRecord. - * - * @param usageRecordId String - * @return UsageRecord - */ + * The unique identifier of the usageRecord. + * @param usageRecordId String + * @return UsageRecord + **/ public UsageRecord usageRecordId(String usageRecordId) { this.usageRecordId = usageRecordId; return this; } - /** + /** * The unique identifier of the usageRecord. - * * @return usageRecordId - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the usageRecord.") - /** + /** * The unique identifier of the usageRecord. - * * @return usageRecordId String - */ + **/ public String getUsageRecordId() { return usageRecordId; } - /** - * The unique identifier of the usageRecord. - * - * @param usageRecordId String - */ + /** + * The unique identifier of the usageRecord. + * @param usageRecordId String + **/ + public void setUsageRecordId(String usageRecordId) { this.usageRecordId = usageRecordId; } /** - * The price per unit - * - * @param pricePerUnit BigDecimal - * @return UsageRecord - */ + * The price per unit + * @param pricePerUnit BigDecimal + * @return UsageRecord + **/ public UsageRecord pricePerUnit(BigDecimal pricePerUnit) { this.pricePerUnit = pricePerUnit; return this; } - /** + /** * The price per unit - * * @return pricePerUnit - */ + **/ @ApiModelProperty(required = true, value = "The price per unit") - /** + /** * The price per unit - * * @return pricePerUnit BigDecimal - */ + **/ public BigDecimal getPricePerUnit() { return pricePerUnit; } - /** - * The price per unit - * - * @param pricePerUnit BigDecimal - */ + /** + * The price per unit + * @param pricePerUnit BigDecimal + **/ + public void setPricePerUnit(BigDecimal pricePerUnit) { this.pricePerUnit = pricePerUnit; } /** - * The unique identifier of the linked Product - * - * @param productId String - * @return UsageRecord - */ + * The unique identifier of the linked Product + * @param productId String + * @return UsageRecord + **/ public UsageRecord productId(String productId) { this.productId = productId; return this; } - /** + /** * The unique identifier of the linked Product - * * @return productId - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier of the linked Product") - /** + /** * The unique identifier of the linked Product - * * @return productId String - */ + **/ public String getProductId() { return productId; } - /** - * The unique identifier of the linked Product - * - * @param productId String - */ + /** + * The unique identifier of the linked Product + * @param productId String + **/ + public void setProductId(String productId) { this.productId = productId; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -334,29 +328,22 @@ public boolean equals(java.lang.Object o) { return false; } UsageRecord usageRecord = (UsageRecord) o; - return Objects.equals(this.quantity, usageRecord.quantity) - && Objects.equals(this.subscriptionId, usageRecord.subscriptionId) - && Objects.equals(this.subscriptionItemId, usageRecord.subscriptionItemId) - && Objects.equals(this.testMode, usageRecord.testMode) - && Objects.equals(this.recordedAt, usageRecord.recordedAt) - && Objects.equals(this.usageRecordId, usageRecord.usageRecordId) - && Objects.equals(this.pricePerUnit, usageRecord.pricePerUnit) - && Objects.equals(this.productId, usageRecord.productId); + return Objects.equals(this.quantity, usageRecord.quantity) && + Objects.equals(this.subscriptionId, usageRecord.subscriptionId) && + Objects.equals(this.subscriptionItemId, usageRecord.subscriptionItemId) && + Objects.equals(this.testMode, usageRecord.testMode) && + Objects.equals(this.recordedAt, usageRecord.recordedAt) && + Objects.equals(this.usageRecordId, usageRecord.usageRecordId) && + Objects.equals(this.pricePerUnit, usageRecord.pricePerUnit) && + Objects.equals(this.productId, usageRecord.productId); } @Override public int hashCode() { - return Objects.hash( - quantity, - subscriptionId, - subscriptionItemId, - testMode, - recordedAt, - usageRecordId, - pricePerUnit, - productId); + return Objects.hash(quantity, subscriptionId, subscriptionItemId, testMode, recordedAt, usageRecordId, pricePerUnit, productId); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -374,7 +361,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -382,4 +370,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/appstore/UsageRecordsList.java b/src/main/java/com/xero/models/appstore/UsageRecordsList.java index f350613ed..83c058bb3 100644 --- a/src/main/java/com/xero/models/appstore/UsageRecordsList.java +++ b/src/main/java/com/xero/models/appstore/UsageRecordsList.java @@ -9,29 +9,45 @@ * Do not edit the class manually. */ -package com.xero.models.appstore; +package com.xero.models.appstore; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.appstore.UsageRecord; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -/** Response to get usage record */ +/** + * Response to get usage record + */ @ApiModel(description = "Response to get usage record") + public class UsageRecordsList { StringUtil util = new StringUtil(); @JsonProperty("usageRecords") private List usageRecords = new ArrayList(); /** - * A collection of usage records - * - * @param usageRecords List<UsageRecord> - * @return UsageRecordsList - */ + * A collection of usage records + * @param usageRecords List<UsageRecord> + * @return UsageRecordsList + **/ public UsageRecordsList usageRecords(List usageRecords) { this.usageRecords = usageRecords; return this; @@ -39,39 +55,37 @@ public UsageRecordsList usageRecords(List usageRecords) { /** * A collection of usage records - * - * @param usageRecordsItem UsageRecord + * @param usageRecordsItem UsageRecord * @return UsageRecordsList - */ + **/ public UsageRecordsList addUsageRecordsItem(UsageRecord usageRecordsItem) { this.usageRecords.add(usageRecordsItem); return this; } - /** + /** * A collection of usage records - * * @return usageRecords - */ + **/ @ApiModelProperty(required = true, value = "A collection of usage records") - /** + /** * A collection of usage records - * * @return usageRecords List - */ + **/ public List getUsageRecords() { return usageRecords; } - /** - * A collection of usage records - * - * @param usageRecords List<UsageRecord> - */ + /** + * A collection of usage records + * @param usageRecords List<UsageRecord> + **/ + public void setUsageRecords(List usageRecords) { this.usageRecords = usageRecords; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,6 +103,7 @@ public int hashCode() { return Objects.hash(usageRecords); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,7 +114,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -107,4 +123,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/Asset.java b/src/main/java/com/xero/models/assets/Asset.java index 87ea5966c..3348981ad 100644 --- a/src/main/java/com/xero/models/assets/Asset.java +++ b/src/main/java/com/xero/models/assets/Asset.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.assets.AssetStatus; +import com.xero.models.assets.BookDepreciationDetail; +import com.xero.models.assets.BookDepreciationSetting; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Asset + */ -/** Asset */ public class Asset { StringUtil util = new StringUtil(); @@ -70,586 +90,518 @@ public class Asset { @JsonProperty("isDeleteEnabledForDate") private Boolean isDeleteEnabledForDate; /** - * The Xero-generated Id for the asset - * - * @param assetId UUID - * @return Asset - */ + * The Xero-generated Id for the asset + * @param assetId UUID + * @return Asset + **/ public Asset assetId(UUID assetId) { this.assetId = assetId; return this; } - /** + /** * The Xero-generated Id for the asset - * * @return assetId - */ - @ApiModelProperty( - example = "3b5b3a38-5649-495f-87a1-14a4e5918634", - value = "The Xero-generated Id for the asset") - /** + **/ + @ApiModelProperty(example = "3b5b3a38-5649-495f-87a1-14a4e5918634", value = "The Xero-generated Id for the asset") + /** * The Xero-generated Id for the asset - * * @return assetId UUID - */ + **/ public UUID getAssetId() { return assetId; } - /** - * The Xero-generated Id for the asset - * - * @param assetId UUID - */ + /** + * The Xero-generated Id for the asset + * @param assetId UUID + **/ + public void setAssetId(UUID assetId) { this.assetId = assetId; } /** - * The name of the asset - * - * @param assetName String - * @return Asset - */ + * The name of the asset + * @param assetName String + * @return Asset + **/ public Asset assetName(String assetName) { this.assetName = assetName; return this; } - /** + /** * The name of the asset - * * @return assetName - */ + **/ @ApiModelProperty(example = "Awesome Truck 3", required = true, value = "The name of the asset") - /** + /** * The name of the asset - * * @return assetName String - */ + **/ public String getAssetName() { return assetName; } - /** - * The name of the asset - * - * @param assetName String - */ + /** + * The name of the asset + * @param assetName String + **/ + public void setAssetName(String assetName) { this.assetName = assetName; } /** - * The Xero-generated Id for the asset type - * - * @param assetTypeId UUID - * @return Asset - */ + * The Xero-generated Id for the asset type + * @param assetTypeId UUID + * @return Asset + **/ public Asset assetTypeId(UUID assetTypeId) { this.assetTypeId = assetTypeId; return this; } - /** + /** * The Xero-generated Id for the asset type - * * @return assetTypeId - */ - @ApiModelProperty( - example = "3b5b3a38-5649-495f-87a1-14a4e5918634", - value = "The Xero-generated Id for the asset type") - /** + **/ + @ApiModelProperty(example = "3b5b3a38-5649-495f-87a1-14a4e5918634", value = "The Xero-generated Id for the asset type") + /** * The Xero-generated Id for the asset type - * * @return assetTypeId UUID - */ + **/ public UUID getAssetTypeId() { return assetTypeId; } - /** - * The Xero-generated Id for the asset type - * - * @param assetTypeId UUID - */ + /** + * The Xero-generated Id for the asset type + * @param assetTypeId UUID + **/ + public void setAssetTypeId(UUID assetTypeId) { this.assetTypeId = assetTypeId; } /** - * Must be unique. - * - * @param assetNumber String - * @return Asset - */ + * Must be unique. + * @param assetNumber String + * @return Asset + **/ public Asset assetNumber(String assetNumber) { this.assetNumber = assetNumber; return this; } - /** + /** * Must be unique. - * * @return assetNumber - */ + **/ @ApiModelProperty(example = "FA-0013", value = "Must be unique.") - /** + /** * Must be unique. - * * @return assetNumber String - */ + **/ public String getAssetNumber() { return assetNumber; } - /** - * Must be unique. - * - * @param assetNumber String - */ + /** + * Must be unique. + * @param assetNumber String + **/ + public void setAssetNumber(String assetNumber) { this.assetNumber = assetNumber; } /** - * The date the asset was purchased YYYY-MM-DD - * - * @param purchaseDate LocalDate - * @return Asset - */ + * The date the asset was purchased YYYY-MM-DD + * @param purchaseDate LocalDate + * @return Asset + **/ public Asset purchaseDate(LocalDate purchaseDate) { this.purchaseDate = purchaseDate; return this; } - /** + /** * The date the asset was purchased YYYY-MM-DD - * * @return purchaseDate - */ + **/ @ApiModelProperty(value = "The date the asset was purchased YYYY-MM-DD") - /** + /** * The date the asset was purchased YYYY-MM-DD - * * @return purchaseDate LocalDate - */ + **/ public LocalDate getPurchaseDate() { return purchaseDate; } - /** - * The date the asset was purchased YYYY-MM-DD - * - * @param purchaseDate LocalDate - */ + /** + * The date the asset was purchased YYYY-MM-DD + * @param purchaseDate LocalDate + **/ + public void setPurchaseDate(LocalDate purchaseDate) { this.purchaseDate = purchaseDate; } /** - * The purchase price of the asset - * - * @param purchasePrice Double - * @return Asset - */ + * The purchase price of the asset + * @param purchasePrice Double + * @return Asset + **/ public Asset purchasePrice(Double purchasePrice) { this.purchasePrice = purchasePrice; return this; } - /** + /** * The purchase price of the asset - * * @return purchasePrice - */ + **/ @ApiModelProperty(example = "1000.0000", value = "The purchase price of the asset") - /** + /** * The purchase price of the asset - * * @return purchasePrice Double - */ + **/ public Double getPurchasePrice() { return purchasePrice; } - /** - * The purchase price of the asset - * - * @param purchasePrice Double - */ + /** + * The purchase price of the asset + * @param purchasePrice Double + **/ + public void setPurchasePrice(Double purchasePrice) { this.purchasePrice = purchasePrice; } /** - * The date the asset was disposed - * - * @param disposalDate LocalDate - * @return Asset - */ + * The date the asset was disposed + * @param disposalDate LocalDate + * @return Asset + **/ public Asset disposalDate(LocalDate disposalDate) { this.disposalDate = disposalDate; return this; } - /** + /** * The date the asset was disposed - * * @return disposalDate - */ + **/ @ApiModelProperty(value = "The date the asset was disposed") - /** + /** * The date the asset was disposed - * * @return disposalDate LocalDate - */ + **/ public LocalDate getDisposalDate() { return disposalDate; } - /** - * The date the asset was disposed - * - * @param disposalDate LocalDate - */ + /** + * The date the asset was disposed + * @param disposalDate LocalDate + **/ + public void setDisposalDate(LocalDate disposalDate) { this.disposalDate = disposalDate; } /** - * The price the asset was disposed at - * - * @param disposalPrice Double - * @return Asset - */ + * The price the asset was disposed at + * @param disposalPrice Double + * @return Asset + **/ public Asset disposalPrice(Double disposalPrice) { this.disposalPrice = disposalPrice; return this; } - /** + /** * The price the asset was disposed at - * * @return disposalPrice - */ + **/ @ApiModelProperty(example = "1.0000", value = "The price the asset was disposed at") - /** + /** * The price the asset was disposed at - * * @return disposalPrice Double - */ + **/ public Double getDisposalPrice() { return disposalPrice; } - /** - * The price the asset was disposed at - * - * @param disposalPrice Double - */ + /** + * The price the asset was disposed at + * @param disposalPrice Double + **/ + public void setDisposalPrice(Double disposalPrice) { this.disposalPrice = disposalPrice; } /** - * assetStatus - * - * @param assetStatus AssetStatus - * @return Asset - */ + * assetStatus + * @param assetStatus AssetStatus + * @return Asset + **/ public Asset assetStatus(AssetStatus assetStatus) { this.assetStatus = assetStatus; return this; } - /** + /** * Get assetStatus - * * @return assetStatus - */ + **/ @ApiModelProperty(value = "") - /** + /** * assetStatus - * * @return assetStatus AssetStatus - */ + **/ public AssetStatus getAssetStatus() { return assetStatus; } - /** - * assetStatus - * - * @param assetStatus AssetStatus - */ + /** + * assetStatus + * @param assetStatus AssetStatus + **/ + public void setAssetStatus(AssetStatus assetStatus) { this.assetStatus = assetStatus; } /** - * The date the asset’s warranty expires (if needed) YYYY-MM-DD - * - * @param warrantyExpiryDate String - * @return Asset - */ + * The date the asset’s warranty expires (if needed) YYYY-MM-DD + * @param warrantyExpiryDate String + * @return Asset + **/ public Asset warrantyExpiryDate(String warrantyExpiryDate) { this.warrantyExpiryDate = warrantyExpiryDate; return this; } - /** + /** * The date the asset’s warranty expires (if needed) YYYY-MM-DD - * * @return warrantyExpiryDate - */ - @ApiModelProperty( - example = "ca4c6b39-4f4f-43e8-98da-5e1f350a6694", - value = "The date the asset’s warranty expires (if needed) YYYY-MM-DD") - /** + **/ + @ApiModelProperty(example = "ca4c6b39-4f4f-43e8-98da-5e1f350a6694", value = "The date the asset’s warranty expires (if needed) YYYY-MM-DD") + /** * The date the asset’s warranty expires (if needed) YYYY-MM-DD - * * @return warrantyExpiryDate String - */ + **/ public String getWarrantyExpiryDate() { return warrantyExpiryDate; } - /** - * The date the asset’s warranty expires (if needed) YYYY-MM-DD - * - * @param warrantyExpiryDate String - */ + /** + * The date the asset’s warranty expires (if needed) YYYY-MM-DD + * @param warrantyExpiryDate String + **/ + public void setWarrantyExpiryDate(String warrantyExpiryDate) { this.warrantyExpiryDate = warrantyExpiryDate; } /** - * The asset's serial number - * - * @param serialNumber String - * @return Asset - */ + * The asset's serial number + * @param serialNumber String + * @return Asset + **/ public Asset serialNumber(String serialNumber) { this.serialNumber = serialNumber; return this; } - /** + /** * The asset's serial number - * * @return serialNumber - */ - @ApiModelProperty( - example = "ca4c6b39-4f4f-43e8-98da-5e1f350a6694", - value = "The asset's serial number") - /** + **/ + @ApiModelProperty(example = "ca4c6b39-4f4f-43e8-98da-5e1f350a6694", value = "The asset's serial number") + /** * The asset's serial number - * * @return serialNumber String - */ + **/ public String getSerialNumber() { return serialNumber; } - /** - * The asset's serial number - * - * @param serialNumber String - */ + /** + * The asset's serial number + * @param serialNumber String + **/ + public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } /** - * bookDepreciationSetting - * - * @param bookDepreciationSetting BookDepreciationSetting - * @return Asset - */ + * bookDepreciationSetting + * @param bookDepreciationSetting BookDepreciationSetting + * @return Asset + **/ public Asset bookDepreciationSetting(BookDepreciationSetting bookDepreciationSetting) { this.bookDepreciationSetting = bookDepreciationSetting; return this; } - /** + /** * Get bookDepreciationSetting - * * @return bookDepreciationSetting - */ + **/ @ApiModelProperty(value = "") - /** + /** * bookDepreciationSetting - * * @return bookDepreciationSetting BookDepreciationSetting - */ + **/ public BookDepreciationSetting getBookDepreciationSetting() { return bookDepreciationSetting; } - /** - * bookDepreciationSetting - * - * @param bookDepreciationSetting BookDepreciationSetting - */ + /** + * bookDepreciationSetting + * @param bookDepreciationSetting BookDepreciationSetting + **/ + public void setBookDepreciationSetting(BookDepreciationSetting bookDepreciationSetting) { this.bookDepreciationSetting = bookDepreciationSetting; } /** - * bookDepreciationDetail - * - * @param bookDepreciationDetail BookDepreciationDetail - * @return Asset - */ + * bookDepreciationDetail + * @param bookDepreciationDetail BookDepreciationDetail + * @return Asset + **/ public Asset bookDepreciationDetail(BookDepreciationDetail bookDepreciationDetail) { this.bookDepreciationDetail = bookDepreciationDetail; return this; } - /** + /** * Get bookDepreciationDetail - * * @return bookDepreciationDetail - */ + **/ @ApiModelProperty(value = "") - /** + /** * bookDepreciationDetail - * * @return bookDepreciationDetail BookDepreciationDetail - */ + **/ public BookDepreciationDetail getBookDepreciationDetail() { return bookDepreciationDetail; } - /** - * bookDepreciationDetail - * - * @param bookDepreciationDetail BookDepreciationDetail - */ + /** + * bookDepreciationDetail + * @param bookDepreciationDetail BookDepreciationDetail + **/ + public void setBookDepreciationDetail(BookDepreciationDetail bookDepreciationDetail) { this.bookDepreciationDetail = bookDepreciationDetail; } /** - * Boolean to indicate whether depreciation can be rolled back for this asset individually. This - * is true if it doesn't have 'legacy' journal entries and if there is no lock period - * that would prevent this asset from rolling back. - * - * @param canRollback Boolean - * @return Asset - */ + * Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. + * @param canRollback Boolean + * @return Asset + **/ public Asset canRollback(Boolean canRollback) { this.canRollback = canRollback; return this; } - /** - * Boolean to indicate whether depreciation can be rolled back for this asset individually. This - * is true if it doesn't have 'legacy' journal entries and if there is no lock period - * that would prevent this asset from rolling back. - * + /** + * Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. * @return canRollback - */ - @ApiModelProperty( - example = "true", - value = - "Boolean to indicate whether depreciation can be rolled back for this asset" - + " individually. This is true if it doesn't have 'legacy' journal entries and if" - + " there is no lock period that would prevent this asset from rolling back.") - /** - * Boolean to indicate whether depreciation can be rolled back for this asset individually. This - * is true if it doesn't have 'legacy' journal entries and if there is no lock period - * that would prevent this asset from rolling back. - * + **/ + @ApiModelProperty(example = "true", value = "Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back.") + /** + * Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. * @return canRollback Boolean - */ + **/ public Boolean getCanRollback() { return canRollback; } - /** - * Boolean to indicate whether depreciation can be rolled back for this asset individually. This - * is true if it doesn't have 'legacy' journal entries and if there is no lock period - * that would prevent this asset from rolling back. - * - * @param canRollback Boolean - */ + /** + * Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. + * @param canRollback Boolean + **/ + public void setCanRollback(Boolean canRollback) { this.canRollback = canRollback; } /** - * The accounting value of the asset - * - * @param accountingBookValue Double - * @return Asset - */ + * The accounting value of the asset + * @param accountingBookValue Double + * @return Asset + **/ public Asset accountingBookValue(Double accountingBookValue) { this.accountingBookValue = accountingBookValue; return this; } - /** + /** * The accounting value of the asset - * * @return accountingBookValue - */ + **/ @ApiModelProperty(example = "0", value = "The accounting value of the asset") - /** + /** * The accounting value of the asset - * * @return accountingBookValue Double - */ + **/ public Double getAccountingBookValue() { return accountingBookValue; } - /** - * The accounting value of the asset - * - * @param accountingBookValue Double - */ + /** + * The accounting value of the asset + * @param accountingBookValue Double + **/ + public void setAccountingBookValue(Double accountingBookValue) { this.accountingBookValue = accountingBookValue; } /** - * Boolean to indicate whether delete is enabled - * - * @param isDeleteEnabledForDate Boolean - * @return Asset - */ + * Boolean to indicate whether delete is enabled + * @param isDeleteEnabledForDate Boolean + * @return Asset + **/ public Asset isDeleteEnabledForDate(Boolean isDeleteEnabledForDate) { this.isDeleteEnabledForDate = isDeleteEnabledForDate; return this; } - /** + /** * Boolean to indicate whether delete is enabled - * * @return isDeleteEnabledForDate - */ + **/ @ApiModelProperty(example = "true", value = "Boolean to indicate whether delete is enabled") - /** + /** * Boolean to indicate whether delete is enabled - * * @return isDeleteEnabledForDate Boolean - */ + **/ public Boolean getIsDeleteEnabledForDate() { return isDeleteEnabledForDate; } - /** - * Boolean to indicate whether delete is enabled - * - * @param isDeleteEnabledForDate Boolean - */ + /** + * Boolean to indicate whether delete is enabled + * @param isDeleteEnabledForDate Boolean + **/ + public void setIsDeleteEnabledForDate(Boolean isDeleteEnabledForDate) { this.isDeleteEnabledForDate = isDeleteEnabledForDate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -659,45 +611,30 @@ public boolean equals(java.lang.Object o) { return false; } Asset asset = (Asset) o; - return Objects.equals(this.assetId, asset.assetId) - && Objects.equals(this.assetName, asset.assetName) - && Objects.equals(this.assetTypeId, asset.assetTypeId) - && Objects.equals(this.assetNumber, asset.assetNumber) - && Objects.equals(this.purchaseDate, asset.purchaseDate) - && Objects.equals(this.purchasePrice, asset.purchasePrice) - && Objects.equals(this.disposalDate, asset.disposalDate) - && Objects.equals(this.disposalPrice, asset.disposalPrice) - && Objects.equals(this.assetStatus, asset.assetStatus) - && Objects.equals(this.warrantyExpiryDate, asset.warrantyExpiryDate) - && Objects.equals(this.serialNumber, asset.serialNumber) - && Objects.equals(this.bookDepreciationSetting, asset.bookDepreciationSetting) - && Objects.equals(this.bookDepreciationDetail, asset.bookDepreciationDetail) - && Objects.equals(this.canRollback, asset.canRollback) - && Objects.equals(this.accountingBookValue, asset.accountingBookValue) - && Objects.equals(this.isDeleteEnabledForDate, asset.isDeleteEnabledForDate); + return Objects.equals(this.assetId, asset.assetId) && + Objects.equals(this.assetName, asset.assetName) && + Objects.equals(this.assetTypeId, asset.assetTypeId) && + Objects.equals(this.assetNumber, asset.assetNumber) && + Objects.equals(this.purchaseDate, asset.purchaseDate) && + Objects.equals(this.purchasePrice, asset.purchasePrice) && + Objects.equals(this.disposalDate, asset.disposalDate) && + Objects.equals(this.disposalPrice, asset.disposalPrice) && + Objects.equals(this.assetStatus, asset.assetStatus) && + Objects.equals(this.warrantyExpiryDate, asset.warrantyExpiryDate) && + Objects.equals(this.serialNumber, asset.serialNumber) && + Objects.equals(this.bookDepreciationSetting, asset.bookDepreciationSetting) && + Objects.equals(this.bookDepreciationDetail, asset.bookDepreciationDetail) && + Objects.equals(this.canRollback, asset.canRollback) && + Objects.equals(this.accountingBookValue, asset.accountingBookValue) && + Objects.equals(this.isDeleteEnabledForDate, asset.isDeleteEnabledForDate); } @Override public int hashCode() { - return Objects.hash( - assetId, - assetName, - assetTypeId, - assetNumber, - purchaseDate, - purchasePrice, - disposalDate, - disposalPrice, - assetStatus, - warrantyExpiryDate, - serialNumber, - bookDepreciationSetting, - bookDepreciationDetail, - canRollback, - accountingBookValue, - isDeleteEnabledForDate); + return Objects.hash(assetId, assetName, assetTypeId, assetNumber, purchaseDate, purchasePrice, disposalDate, disposalPrice, assetStatus, warrantyExpiryDate, serialNumber, bookDepreciationSetting, bookDepreciationDetail, canRollback, accountingBookValue, isDeleteEnabledForDate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -713,25 +650,18 @@ public String toString() { sb.append(" assetStatus: ").append(toIndentedString(assetStatus)).append("\n"); sb.append(" warrantyExpiryDate: ").append(toIndentedString(warrantyExpiryDate)).append("\n"); sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); - sb.append(" bookDepreciationSetting: ") - .append(toIndentedString(bookDepreciationSetting)) - .append("\n"); - sb.append(" bookDepreciationDetail: ") - .append(toIndentedString(bookDepreciationDetail)) - .append("\n"); + sb.append(" bookDepreciationSetting: ").append(toIndentedString(bookDepreciationSetting)).append("\n"); + sb.append(" bookDepreciationDetail: ").append(toIndentedString(bookDepreciationDetail)).append("\n"); sb.append(" canRollback: ").append(toIndentedString(canRollback)).append("\n"); - sb.append(" accountingBookValue: ") - .append(toIndentedString(accountingBookValue)) - .append("\n"); - sb.append(" isDeleteEnabledForDate: ") - .append(toIndentedString(isDeleteEnabledForDate)) - .append("\n"); + sb.append(" accountingBookValue: ").append(toIndentedString(accountingBookValue)).append("\n"); + sb.append(" isDeleteEnabledForDate: ").append(toIndentedString(isDeleteEnabledForDate)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -739,4 +669,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/AssetStatus.java b/src/main/java/com/xero/models/assets/AssetStatus.java index dc3438620..8be7c8db7 100644 --- a/src/main/java/com/xero/models/assets/AssetStatus.java +++ b/src/main/java/com/xero/models/assets/AssetStatus.java @@ -9,22 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** See Asset Status Codes. */ +/** + * See Asset Status Codes. + */ public enum AssetStatus { - - /** DRAFT */ + + /** + * DRAFT + */ DRAFT("Draft"), - - /** REGISTERED */ + + /** + * REGISTERED + */ REGISTERED("Registered"), - - /** DISPOSED */ + + /** + * DISPOSED + */ DISPOSED("Disposed"); private String value; @@ -33,26 +51,24 @@ public enum AssetStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static AssetStatus fromValue(String value) { @@ -64,3 +80,4 @@ public static AssetStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/assets/AssetStatusQueryParam.java b/src/main/java/com/xero/models/assets/AssetStatusQueryParam.java index cbf15350a..d8e514814 100644 --- a/src/main/java/com/xero/models/assets/AssetStatusQueryParam.java +++ b/src/main/java/com/xero/models/assets/AssetStatusQueryParam.java @@ -9,22 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** See Asset Status Codes. */ +/** + * See Asset Status Codes. + */ public enum AssetStatusQueryParam { - - /** DRAFT */ + + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** REGISTERED */ + + /** + * REGISTERED + */ REGISTERED("REGISTERED"), - - /** DISPOSED */ + + /** + * DISPOSED + */ DISPOSED("DISPOSED"); private String value; @@ -33,26 +51,24 @@ public enum AssetStatusQueryParam { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static AssetStatusQueryParam fromValue(String value) { @@ -64,3 +80,4 @@ public static AssetStatusQueryParam fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/assets/AssetType.java b/src/main/java/com/xero/models/assets/AssetType.java index 6b5bd4888..c6dfc6165 100644 --- a/src/main/java/com/xero/models/assets/AssetType.java +++ b/src/main/java/com/xero/models/assets/AssetType.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.assets.BookDepreciationSetting; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * AssetType + */ -/** AssetType */ public class AssetType { StringUtil util = new StringUtil(); @@ -42,269 +60,230 @@ public class AssetType { @JsonProperty("locks") private Integer locks; /** - * Xero generated unique identifier for asset types - * - * @param assetTypeId UUID - * @return AssetType - */ + * Xero generated unique identifier for asset types + * @param assetTypeId UUID + * @return AssetType + **/ public AssetType assetTypeId(UUID assetTypeId) { this.assetTypeId = assetTypeId; return this; } - /** + /** * Xero generated unique identifier for asset types - * * @return assetTypeId - */ - @ApiModelProperty( - example = "5da209c5-5e19-4a43-b925-71b776c49ced", - value = "Xero generated unique identifier for asset types") - /** + **/ + @ApiModelProperty(example = "5da209c5-5e19-4a43-b925-71b776c49ced", value = "Xero generated unique identifier for asset types") + /** * Xero generated unique identifier for asset types - * * @return assetTypeId UUID - */ + **/ public UUID getAssetTypeId() { return assetTypeId; } - /** - * Xero generated unique identifier for asset types - * - * @param assetTypeId UUID - */ + /** + * Xero generated unique identifier for asset types + * @param assetTypeId UUID + **/ + public void setAssetTypeId(UUID assetTypeId) { this.assetTypeId = assetTypeId; } /** - * The name of the asset type - * - * @param assetTypeName String - * @return AssetType - */ + * The name of the asset type + * @param assetTypeName String + * @return AssetType + **/ public AssetType assetTypeName(String assetTypeName) { this.assetTypeName = assetTypeName; return this; } - /** + /** * The name of the asset type - * * @return assetTypeName - */ - @ApiModelProperty( - example = "Computer Equipment", - required = true, - value = "The name of the asset type") - /** + **/ + @ApiModelProperty(example = "Computer Equipment", required = true, value = "The name of the asset type") + /** * The name of the asset type - * * @return assetTypeName String - */ + **/ public String getAssetTypeName() { return assetTypeName; } - /** - * The name of the asset type - * - * @param assetTypeName String - */ + /** + * The name of the asset type + * @param assetTypeName String + **/ + public void setAssetTypeName(String assetTypeName) { this.assetTypeName = assetTypeName; } /** - * The asset account for fixed assets of this type - * - * @param fixedAssetAccountId UUID - * @return AssetType - */ + * The asset account for fixed assets of this type + * @param fixedAssetAccountId UUID + * @return AssetType + **/ public AssetType fixedAssetAccountId(UUID fixedAssetAccountId) { this.fixedAssetAccountId = fixedAssetAccountId; return this; } - /** + /** * The asset account for fixed assets of this type - * * @return fixedAssetAccountId - */ - @ApiModelProperty( - example = "24e260f1-bfc4-4766-ad7f-8a8ce01de879", - value = "The asset account for fixed assets of this type") - /** + **/ + @ApiModelProperty(example = "24e260f1-bfc4-4766-ad7f-8a8ce01de879", value = "The asset account for fixed assets of this type") + /** * The asset account for fixed assets of this type - * * @return fixedAssetAccountId UUID - */ + **/ public UUID getFixedAssetAccountId() { return fixedAssetAccountId; } - /** - * The asset account for fixed assets of this type - * - * @param fixedAssetAccountId UUID - */ + /** + * The asset account for fixed assets of this type + * @param fixedAssetAccountId UUID + **/ + public void setFixedAssetAccountId(UUID fixedAssetAccountId) { this.fixedAssetAccountId = fixedAssetAccountId; } /** - * The expense account for the depreciation of fixed assets of this type - * - * @param depreciationExpenseAccountId UUID - * @return AssetType - */ + * The expense account for the depreciation of fixed assets of this type + * @param depreciationExpenseAccountId UUID + * @return AssetType + **/ public AssetType depreciationExpenseAccountId(UUID depreciationExpenseAccountId) { this.depreciationExpenseAccountId = depreciationExpenseAccountId; return this; } - /** + /** * The expense account for the depreciation of fixed assets of this type - * * @return depreciationExpenseAccountId - */ - @ApiModelProperty( - example = "b23fc79b-d66b-44b0-a240-e138e086fcbc", - value = "The expense account for the depreciation of fixed assets of this type") - /** + **/ + @ApiModelProperty(example = "b23fc79b-d66b-44b0-a240-e138e086fcbc", value = "The expense account for the depreciation of fixed assets of this type") + /** * The expense account for the depreciation of fixed assets of this type - * * @return depreciationExpenseAccountId UUID - */ + **/ public UUID getDepreciationExpenseAccountId() { return depreciationExpenseAccountId; } - /** - * The expense account for the depreciation of fixed assets of this type - * - * @param depreciationExpenseAccountId UUID - */ + /** + * The expense account for the depreciation of fixed assets of this type + * @param depreciationExpenseAccountId UUID + **/ + public void setDepreciationExpenseAccountId(UUID depreciationExpenseAccountId) { this.depreciationExpenseAccountId = depreciationExpenseAccountId; } /** - * The account for accumulated depreciation of fixed assets of this type - * - * @param accumulatedDepreciationAccountId UUID - * @return AssetType - */ + * The account for accumulated depreciation of fixed assets of this type + * @param accumulatedDepreciationAccountId UUID + * @return AssetType + **/ public AssetType accumulatedDepreciationAccountId(UUID accumulatedDepreciationAccountId) { this.accumulatedDepreciationAccountId = accumulatedDepreciationAccountId; return this; } - /** + /** * The account for accumulated depreciation of fixed assets of this type - * * @return accumulatedDepreciationAccountId - */ - @ApiModelProperty( - example = "ca4c6b39-4f4f-43e8-98da-5e1f350a6694", - value = "The account for accumulated depreciation of fixed assets of this type") - /** + **/ + @ApiModelProperty(example = "ca4c6b39-4f4f-43e8-98da-5e1f350a6694", value = "The account for accumulated depreciation of fixed assets of this type") + /** * The account for accumulated depreciation of fixed assets of this type - * * @return accumulatedDepreciationAccountId UUID - */ + **/ public UUID getAccumulatedDepreciationAccountId() { return accumulatedDepreciationAccountId; } - /** - * The account for accumulated depreciation of fixed assets of this type - * - * @param accumulatedDepreciationAccountId UUID - */ + /** + * The account for accumulated depreciation of fixed assets of this type + * @param accumulatedDepreciationAccountId UUID + **/ + public void setAccumulatedDepreciationAccountId(UUID accumulatedDepreciationAccountId) { this.accumulatedDepreciationAccountId = accumulatedDepreciationAccountId; } /** - * bookDepreciationSetting - * - * @param bookDepreciationSetting BookDepreciationSetting - * @return AssetType - */ + * bookDepreciationSetting + * @param bookDepreciationSetting BookDepreciationSetting + * @return AssetType + **/ public AssetType bookDepreciationSetting(BookDepreciationSetting bookDepreciationSetting) { this.bookDepreciationSetting = bookDepreciationSetting; return this; } - /** + /** * Get bookDepreciationSetting - * * @return bookDepreciationSetting - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * bookDepreciationSetting - * * @return bookDepreciationSetting BookDepreciationSetting - */ + **/ public BookDepreciationSetting getBookDepreciationSetting() { return bookDepreciationSetting; } - /** - * bookDepreciationSetting - * - * @param bookDepreciationSetting BookDepreciationSetting - */ + /** + * bookDepreciationSetting + * @param bookDepreciationSetting BookDepreciationSetting + **/ + public void setBookDepreciationSetting(BookDepreciationSetting bookDepreciationSetting) { this.bookDepreciationSetting = bookDepreciationSetting; } /** - * All asset types that have accumulated depreciation for any assets that use them are deemed - * ‘locked’ and cannot be removed. - * - * @param locks Integer - * @return AssetType - */ + * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. + * @param locks Integer + * @return AssetType + **/ public AssetType locks(Integer locks) { this.locks = locks; return this; } - /** - * All asset types that have accumulated depreciation for any assets that use them are deemed - * ‘locked’ and cannot be removed. - * + /** + * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. * @return locks - */ - @ApiModelProperty( - example = "33", - value = - "All asset types that have accumulated depreciation for any assets that use them are" - + " deemed ‘locked’ and cannot be removed.") - /** - * All asset types that have accumulated depreciation for any assets that use them are deemed - * ‘locked’ and cannot be removed. - * + **/ + @ApiModelProperty(example = "33", value = "All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed.") + /** + * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. * @return locks Integer - */ + **/ public Integer getLocks() { return locks; } - /** - * All asset types that have accumulated depreciation for any assets that use them are deemed - * ‘locked’ and cannot be removed. - * - * @param locks Integer - */ + /** + * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. + * @param locks Integer + **/ + public void setLocks(Integer locks) { this.locks = locks; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -314,53 +293,39 @@ public boolean equals(java.lang.Object o) { return false; } AssetType assetType = (AssetType) o; - return Objects.equals(this.assetTypeId, assetType.assetTypeId) - && Objects.equals(this.assetTypeName, assetType.assetTypeName) - && Objects.equals(this.fixedAssetAccountId, assetType.fixedAssetAccountId) - && Objects.equals(this.depreciationExpenseAccountId, assetType.depreciationExpenseAccountId) - && Objects.equals( - this.accumulatedDepreciationAccountId, assetType.accumulatedDepreciationAccountId) - && Objects.equals(this.bookDepreciationSetting, assetType.bookDepreciationSetting) - && Objects.equals(this.locks, assetType.locks); + return Objects.equals(this.assetTypeId, assetType.assetTypeId) && + Objects.equals(this.assetTypeName, assetType.assetTypeName) && + Objects.equals(this.fixedAssetAccountId, assetType.fixedAssetAccountId) && + Objects.equals(this.depreciationExpenseAccountId, assetType.depreciationExpenseAccountId) && + Objects.equals(this.accumulatedDepreciationAccountId, assetType.accumulatedDepreciationAccountId) && + Objects.equals(this.bookDepreciationSetting, assetType.bookDepreciationSetting) && + Objects.equals(this.locks, assetType.locks); } @Override public int hashCode() { - return Objects.hash( - assetTypeId, - assetTypeName, - fixedAssetAccountId, - depreciationExpenseAccountId, - accumulatedDepreciationAccountId, - bookDepreciationSetting, - locks); + return Objects.hash(assetTypeId, assetTypeName, fixedAssetAccountId, depreciationExpenseAccountId, accumulatedDepreciationAccountId, bookDepreciationSetting, locks); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AssetType {\n"); sb.append(" assetTypeId: ").append(toIndentedString(assetTypeId)).append("\n"); sb.append(" assetTypeName: ").append(toIndentedString(assetTypeName)).append("\n"); - sb.append(" fixedAssetAccountId: ") - .append(toIndentedString(fixedAssetAccountId)) - .append("\n"); - sb.append(" depreciationExpenseAccountId: ") - .append(toIndentedString(depreciationExpenseAccountId)) - .append("\n"); - sb.append(" accumulatedDepreciationAccountId: ") - .append(toIndentedString(accumulatedDepreciationAccountId)) - .append("\n"); - sb.append(" bookDepreciationSetting: ") - .append(toIndentedString(bookDepreciationSetting)) - .append("\n"); + sb.append(" fixedAssetAccountId: ").append(toIndentedString(fixedAssetAccountId)).append("\n"); + sb.append(" depreciationExpenseAccountId: ").append(toIndentedString(depreciationExpenseAccountId)).append("\n"); + sb.append(" accumulatedDepreciationAccountId: ").append(toIndentedString(accumulatedDepreciationAccountId)).append("\n"); + sb.append(" bookDepreciationSetting: ").append(toIndentedString(bookDepreciationSetting)).append("\n"); sb.append(" locks: ").append(toIndentedString(locks)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -368,4 +333,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/Assets.java b/src/main/java/com/xero/models/assets/Assets.java index 14b4fca88..86a4a3a4c 100644 --- a/src/main/java/com/xero/models/assets/Assets.java +++ b/src/main/java/com/xero/models/assets/Assets.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.assets.Asset; +import com.xero.models.assets.Pagination; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Assets + */ -/** Assets */ public class Assets { StringUtil util = new StringUtil(); @@ -28,46 +47,42 @@ public class Assets { @JsonProperty("items") private List items = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Assets - */ + * pagination + * @param pagination Pagination + * @return Assets + **/ public Assets pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * items - * - * @param items List<Asset> - * @return Assets - */ + * items + * @param items List<Asset> + * @return Assets + **/ public Assets items(List items) { this.items = items; return this; @@ -75,10 +90,9 @@ public Assets items(List items) { /** * items - * - * @param itemsItem Asset + * @param itemsItem Asset * @return Assets - */ + **/ public Assets addItemsItem(Asset itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -87,30 +101,29 @@ public Assets addItemsItem(Asset itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<Asset> - */ + /** + * items + * @param items List<Asset> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } Assets assets = (Assets) o; - return Objects.equals(this.pagination, assets.pagination) - && Objects.equals(this.items, assets.items); + return Objects.equals(this.pagination, assets.pagination) && + Objects.equals(this.items, assets.items); } @Override @@ -129,6 +142,7 @@ public int hashCode() { return Objects.hash(pagination, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/BookDepreciationDetail.java b/src/main/java/com/xero/models/assets/BookDepreciationDetail.java index ab329560a..be2cda479 100644 --- a/src/main/java/com/xero/models/assets/BookDepreciationDetail.java +++ b/src/main/java/com/xero/models/assets/BookDepreciationDetail.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BookDepreciationDetail + */ -/** BookDepreciationDetail */ public class BookDepreciationDetail { StringUtil util = new StringUtil(); @@ -42,277 +59,230 @@ public class BookDepreciationDetail { @JsonProperty("currentAccumDepreciationAmount") private Double currentAccumDepreciationAmount; /** - * When an asset is disposed, this will be the sell price minus the purchase price if a profit was - * made. - * - * @param currentCapitalGain Double - * @return BookDepreciationDetail - */ + * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. + * @param currentCapitalGain Double + * @return BookDepreciationDetail + **/ public BookDepreciationDetail currentCapitalGain(Double currentCapitalGain) { this.currentCapitalGain = currentCapitalGain; return this; } - /** - * When an asset is disposed, this will be the sell price minus the purchase price if a profit was - * made. - * + /** + * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. * @return currentCapitalGain - */ - @ApiModelProperty( - example = "5.25", - value = - "When an asset is disposed, this will be the sell price minus the purchase price if a" - + " profit was made.") - /** - * When an asset is disposed, this will be the sell price minus the purchase price if a profit was - * made. - * + **/ + @ApiModelProperty(example = "5.25", value = "When an asset is disposed, this will be the sell price minus the purchase price if a profit was made.") + /** + * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. * @return currentCapitalGain Double - */ + **/ public Double getCurrentCapitalGain() { return currentCapitalGain; } - /** - * When an asset is disposed, this will be the sell price minus the purchase price if a profit was - * made. - * - * @param currentCapitalGain Double - */ + /** + * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. + * @param currentCapitalGain Double + **/ + public void setCurrentCapitalGain(Double currentCapitalGain) { this.currentCapitalGain = currentCapitalGain; } /** - * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus - * the current book value. - * - * @param currentGainLoss Double - * @return BookDepreciationDetail - */ + * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. + * @param currentGainLoss Double + * @return BookDepreciationDetail + **/ public BookDepreciationDetail currentGainLoss(Double currentGainLoss) { this.currentGainLoss = currentGainLoss; return this; } - /** - * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus - * the current book value. - * + /** + * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. * @return currentGainLoss - */ - @ApiModelProperty( - example = "10.5", - value = - "When an asset is disposed, this will be the lowest one of sell price or purchase price," - + " minus the current book value.") - /** - * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus - * the current book value. - * + **/ + @ApiModelProperty(example = "10.5", value = "When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value.") + /** + * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. * @return currentGainLoss Double - */ + **/ public Double getCurrentGainLoss() { return currentGainLoss; } - /** - * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus - * the current book value. - * - * @param currentGainLoss Double - */ + /** + * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. + * @param currentGainLoss Double + **/ + public void setCurrentGainLoss(Double currentGainLoss) { this.currentGainLoss = currentGainLoss; } /** - * YYYY-MM-DD - * - * @param depreciationStartDate LocalDate - * @return BookDepreciationDetail - */ + * YYYY-MM-DD + * @param depreciationStartDate LocalDate + * @return BookDepreciationDetail + **/ public BookDepreciationDetail depreciationStartDate(LocalDate depreciationStartDate) { this.depreciationStartDate = depreciationStartDate; return this; } - /** + /** * YYYY-MM-DD - * * @return depreciationStartDate - */ + **/ @ApiModelProperty(value = "YYYY-MM-DD") - /** + /** * YYYY-MM-DD - * * @return depreciationStartDate LocalDate - */ + **/ public LocalDate getDepreciationStartDate() { return depreciationStartDate; } - /** - * YYYY-MM-DD - * - * @param depreciationStartDate LocalDate - */ + /** + * YYYY-MM-DD + * @param depreciationStartDate LocalDate + **/ + public void setDepreciationStartDate(LocalDate depreciationStartDate) { this.depreciationStartDate = depreciationStartDate; } /** - * The value of the asset you want to depreciate, if this is less than the cost of the asset. - * - * @param costLimit Double - * @return BookDepreciationDetail - */ + * The value of the asset you want to depreciate, if this is less than the cost of the asset. + * @param costLimit Double + * @return BookDepreciationDetail + **/ public BookDepreciationDetail costLimit(Double costLimit) { this.costLimit = costLimit; return this; } - /** + /** * The value of the asset you want to depreciate, if this is less than the cost of the asset. - * * @return costLimit - */ - @ApiModelProperty( - example = "9000.0", - value = - "The value of the asset you want to depreciate, if this is less than the cost of the" - + " asset.") - /** + **/ + @ApiModelProperty(example = "9000.0", value = "The value of the asset you want to depreciate, if this is less than the cost of the asset.") + /** * The value of the asset you want to depreciate, if this is less than the cost of the asset. - * * @return costLimit Double - */ + **/ public Double getCostLimit() { return costLimit; } - /** - * The value of the asset you want to depreciate, if this is less than the cost of the asset. - * - * @param costLimit Double - */ + /** + * The value of the asset you want to depreciate, if this is less than the cost of the asset. + * @param costLimit Double + **/ + public void setCostLimit(Double costLimit) { this.costLimit = costLimit; } /** - * The value of the asset remaining when you've fully depreciated it. - * - * @param residualValue Double - * @return BookDepreciationDetail - */ + * The value of the asset remaining when you've fully depreciated it. + * @param residualValue Double + * @return BookDepreciationDetail + **/ public BookDepreciationDetail residualValue(Double residualValue) { this.residualValue = residualValue; return this; } - /** + /** * The value of the asset remaining when you've fully depreciated it. - * * @return residualValue - */ - @ApiModelProperty( - example = "10000.0", - value = "The value of the asset remaining when you've fully depreciated it.") - /** + **/ + @ApiModelProperty(example = "10000.0", value = "The value of the asset remaining when you've fully depreciated it.") + /** * The value of the asset remaining when you've fully depreciated it. - * * @return residualValue Double - */ + **/ public Double getResidualValue() { return residualValue; } - /** - * The value of the asset remaining when you've fully depreciated it. - * - * @param residualValue Double - */ + /** + * The value of the asset remaining when you've fully depreciated it. + * @param residualValue Double + **/ + public void setResidualValue(Double residualValue) { this.residualValue = residualValue; } /** - * All depreciation prior to the current financial year. - * - * @param priorAccumDepreciationAmount Double - * @return BookDepreciationDetail - */ + * All depreciation prior to the current financial year. + * @param priorAccumDepreciationAmount Double + * @return BookDepreciationDetail + **/ public BookDepreciationDetail priorAccumDepreciationAmount(Double priorAccumDepreciationAmount) { this.priorAccumDepreciationAmount = priorAccumDepreciationAmount; return this; } - /** + /** * All depreciation prior to the current financial year. - * * @return priorAccumDepreciationAmount - */ - @ApiModelProperty( - example = "0.45", - value = "All depreciation prior to the current financial year.") - /** + **/ + @ApiModelProperty(example = "0.45", value = "All depreciation prior to the current financial year.") + /** * All depreciation prior to the current financial year. - * * @return priorAccumDepreciationAmount Double - */ + **/ public Double getPriorAccumDepreciationAmount() { return priorAccumDepreciationAmount; } - /** - * All depreciation prior to the current financial year. - * - * @param priorAccumDepreciationAmount Double - */ + /** + * All depreciation prior to the current financial year. + * @param priorAccumDepreciationAmount Double + **/ + public void setPriorAccumDepreciationAmount(Double priorAccumDepreciationAmount) { this.priorAccumDepreciationAmount = priorAccumDepreciationAmount; } /** - * All depreciation occurring in the current financial year. - * - * @param currentAccumDepreciationAmount Double - * @return BookDepreciationDetail - */ - public BookDepreciationDetail currentAccumDepreciationAmount( - Double currentAccumDepreciationAmount) { + * All depreciation occurring in the current financial year. + * @param currentAccumDepreciationAmount Double + * @return BookDepreciationDetail + **/ + public BookDepreciationDetail currentAccumDepreciationAmount(Double currentAccumDepreciationAmount) { this.currentAccumDepreciationAmount = currentAccumDepreciationAmount; return this; } - /** + /** * All depreciation occurring in the current financial year. - * * @return currentAccumDepreciationAmount - */ - @ApiModelProperty( - example = "5.0", - value = "All depreciation occurring in the current financial year.") - /** + **/ + @ApiModelProperty(example = "5.0", value = "All depreciation occurring in the current financial year.") + /** * All depreciation occurring in the current financial year. - * * @return currentAccumDepreciationAmount Double - */ + **/ public Double getCurrentAccumDepreciationAmount() { return currentAccumDepreciationAmount; } - /** - * All depreciation occurring in the current financial year. - * - * @param currentAccumDepreciationAmount Double - */ + /** + * All depreciation occurring in the current financial year. + * @param currentAccumDepreciationAmount Double + **/ + public void setCurrentAccumDepreciationAmount(Double currentAccumDepreciationAmount) { this.currentAccumDepreciationAmount = currentAccumDepreciationAmount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -322,53 +292,39 @@ public boolean equals(java.lang.Object o) { return false; } BookDepreciationDetail bookDepreciationDetail = (BookDepreciationDetail) o; - return Objects.equals(this.currentCapitalGain, bookDepreciationDetail.currentCapitalGain) - && Objects.equals(this.currentGainLoss, bookDepreciationDetail.currentGainLoss) - && Objects.equals(this.depreciationStartDate, bookDepreciationDetail.depreciationStartDate) - && Objects.equals(this.costLimit, bookDepreciationDetail.costLimit) - && Objects.equals(this.residualValue, bookDepreciationDetail.residualValue) - && Objects.equals( - this.priorAccumDepreciationAmount, bookDepreciationDetail.priorAccumDepreciationAmount) - && Objects.equals( - this.currentAccumDepreciationAmount, - bookDepreciationDetail.currentAccumDepreciationAmount); + return Objects.equals(this.currentCapitalGain, bookDepreciationDetail.currentCapitalGain) && + Objects.equals(this.currentGainLoss, bookDepreciationDetail.currentGainLoss) && + Objects.equals(this.depreciationStartDate, bookDepreciationDetail.depreciationStartDate) && + Objects.equals(this.costLimit, bookDepreciationDetail.costLimit) && + Objects.equals(this.residualValue, bookDepreciationDetail.residualValue) && + Objects.equals(this.priorAccumDepreciationAmount, bookDepreciationDetail.priorAccumDepreciationAmount) && + Objects.equals(this.currentAccumDepreciationAmount, bookDepreciationDetail.currentAccumDepreciationAmount); } @Override public int hashCode() { - return Objects.hash( - currentCapitalGain, - currentGainLoss, - depreciationStartDate, - costLimit, - residualValue, - priorAccumDepreciationAmount, - currentAccumDepreciationAmount); + return Objects.hash(currentCapitalGain, currentGainLoss, depreciationStartDate, costLimit, residualValue, priorAccumDepreciationAmount, currentAccumDepreciationAmount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BookDepreciationDetail {\n"); sb.append(" currentCapitalGain: ").append(toIndentedString(currentCapitalGain)).append("\n"); sb.append(" currentGainLoss: ").append(toIndentedString(currentGainLoss)).append("\n"); - sb.append(" depreciationStartDate: ") - .append(toIndentedString(depreciationStartDate)) - .append("\n"); + sb.append(" depreciationStartDate: ").append(toIndentedString(depreciationStartDate)).append("\n"); sb.append(" costLimit: ").append(toIndentedString(costLimit)).append("\n"); sb.append(" residualValue: ").append(toIndentedString(residualValue)).append("\n"); - sb.append(" priorAccumDepreciationAmount: ") - .append(toIndentedString(priorAccumDepreciationAmount)) - .append("\n"); - sb.append(" currentAccumDepreciationAmount: ") - .append(toIndentedString(currentAccumDepreciationAmount)) - .append("\n"); + sb.append(" priorAccumDepreciationAmount: ").append(toIndentedString(priorAccumDepreciationAmount)).append("\n"); + sb.append(" currentAccumDepreciationAmount: ").append(toIndentedString(currentAccumDepreciationAmount)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -376,4 +332,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/BookDepreciationSetting.java b/src/main/java/com/xero/models/assets/BookDepreciationSetting.java index 22314d9ca..b7989b895 100644 --- a/src/main/java/com/xero/models/assets/BookDepreciationSetting.java +++ b/src/main/java/com/xero/models/assets/BookDepreciationSetting.java @@ -9,37 +9,66 @@ * Do not edit the class manually. */ -package com.xero.models.assets; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BookDepreciationSetting + */ -/** BookDepreciationSetting */ public class BookDepreciationSetting { StringUtil util = new StringUtil(); - /** The method of depreciation applied to this asset. See Depreciation Methods */ + /** + * The method of depreciation applied to this asset. See Depreciation Methods + */ public enum DepreciationMethodEnum { - /** NODEPRECIATION */ + /** + * NODEPRECIATION + */ NODEPRECIATION("NoDepreciation"), - - /** STRAIGHTLINE */ + + /** + * STRAIGHTLINE + */ STRAIGHTLINE("StraightLine"), - - /** DIMINISHINGVALUE100 */ + + /** + * DIMINISHINGVALUE100 + */ DIMINISHINGVALUE100("DiminishingValue100"), - - /** DIMINISHINGVALUE150 */ + + /** + * DIMINISHINGVALUE150 + */ DIMINISHINGVALUE150("DiminishingValue150"), - - /** DIMINISHINGVALUE200 */ + + /** + * DIMINISHINGVALUE200 + */ DIMINISHINGVALUE200("DiminishingValue200"), - - /** FULLDEPRECIATION */ + + /** + * FULLDEPRECIATION + */ FULLDEPRECIATION("FullDepreciation"); private String value; @@ -48,31 +77,25 @@ public enum DepreciationMethodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static DepreciationMethodEnum fromValue(String value) { for (DepreciationMethodEnum b : DepreciationMethodEnum.values()) { @@ -84,14 +107,21 @@ public static DepreciationMethodEnum fromValue(String value) { } } + @JsonProperty("depreciationMethod") private DepreciationMethodEnum depreciationMethod; - /** The method of averaging applied to this asset. See Averaging Methods */ + /** + * The method of averaging applied to this asset. See Averaging Methods + */ public enum AveragingMethodEnum { - /** FULLMONTH */ + /** + * FULLMONTH + */ FULLMONTH("FullMonth"), - - /** ACTUALDAYS */ + + /** + * ACTUALDAYS + */ ACTUALDAYS("ActualDays"); private String value; @@ -100,31 +130,25 @@ public enum AveragingMethodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static AveragingMethodEnum fromValue(String value) { for (AveragingMethodEnum b : AveragingMethodEnum.values()) { @@ -136,6 +160,7 @@ public static AveragingMethodEnum fromValue(String value) { } } + @JsonProperty("averagingMethod") private AveragingMethodEnum averagingMethod; @@ -144,15 +169,23 @@ public static AveragingMethodEnum fromValue(String value) { @JsonProperty("effectiveLifeYears") private Integer effectiveLifeYears; - /** See Depreciation Calculation Methods */ + /** + * See Depreciation Calculation Methods + */ public enum DepreciationCalculationMethodEnum { - /** RATE */ + /** + * RATE + */ RATE("Rate"), - - /** LIFE */ + + /** + * LIFE + */ LIFE("Life"), - - /** NONE */ + + /** + * NONE + */ NONE("None"); private String value; @@ -161,31 +194,25 @@ public enum DepreciationCalculationMethodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static DepreciationCalculationMethodEnum fromValue(String value) { for (DepreciationCalculationMethodEnum b : DepreciationCalculationMethodEnum.values()) { @@ -197,6 +224,7 @@ public static DepreciationCalculationMethodEnum fromValue(String value) { } } + @JsonProperty("depreciationCalculationMethod") private DepreciationCalculationMethodEnum depreciationCalculationMethod; @@ -209,295 +237,262 @@ public static DepreciationCalculationMethodEnum fromValue(String value) { @JsonProperty("bookEffectiveDateOfChangeId") private UUID bookEffectiveDateOfChangeId; /** - * The method of depreciation applied to this asset. See Depreciation Methods - * - * @param depreciationMethod DepreciationMethodEnum - * @return BookDepreciationSetting - */ + * The method of depreciation applied to this asset. See Depreciation Methods + * @param depreciationMethod DepreciationMethodEnum + * @return BookDepreciationSetting + **/ public BookDepreciationSetting depreciationMethod(DepreciationMethodEnum depreciationMethod) { this.depreciationMethod = depreciationMethod; return this; } - /** + /** * The method of depreciation applied to this asset. See Depreciation Methods - * * @return depreciationMethod - */ - @ApiModelProperty( - example = "StraightLine", - value = "The method of depreciation applied to this asset. See Depreciation Methods") - /** + **/ + @ApiModelProperty(example = "StraightLine", value = "The method of depreciation applied to this asset. See Depreciation Methods") + /** * The method of depreciation applied to this asset. See Depreciation Methods - * * @return depreciationMethod DepreciationMethodEnum - */ + **/ public DepreciationMethodEnum getDepreciationMethod() { return depreciationMethod; } - /** - * The method of depreciation applied to this asset. See Depreciation Methods - * - * @param depreciationMethod DepreciationMethodEnum - */ + /** + * The method of depreciation applied to this asset. See Depreciation Methods + * @param depreciationMethod DepreciationMethodEnum + **/ + public void setDepreciationMethod(DepreciationMethodEnum depreciationMethod) { this.depreciationMethod = depreciationMethod; } /** - * The method of averaging applied to this asset. See Averaging Methods - * - * @param averagingMethod AveragingMethodEnum - * @return BookDepreciationSetting - */ + * The method of averaging applied to this asset. See Averaging Methods + * @param averagingMethod AveragingMethodEnum + * @return BookDepreciationSetting + **/ public BookDepreciationSetting averagingMethod(AveragingMethodEnum averagingMethod) { this.averagingMethod = averagingMethod; return this; } - /** + /** * The method of averaging applied to this asset. See Averaging Methods - * * @return averagingMethod - */ - @ApiModelProperty( - example = "ActualDays", - value = "The method of averaging applied to this asset. See Averaging Methods") - /** + **/ + @ApiModelProperty(example = "ActualDays", value = "The method of averaging applied to this asset. See Averaging Methods") + /** * The method of averaging applied to this asset. See Averaging Methods - * * @return averagingMethod AveragingMethodEnum - */ + **/ public AveragingMethodEnum getAveragingMethod() { return averagingMethod; } - /** - * The method of averaging applied to this asset. See Averaging Methods - * - * @param averagingMethod AveragingMethodEnum - */ + /** + * The method of averaging applied to this asset. See Averaging Methods + * @param averagingMethod AveragingMethodEnum + **/ + public void setAveragingMethod(AveragingMethodEnum averagingMethod) { this.averagingMethod = averagingMethod; } /** - * The rate of depreciation (e.g. 0.05) - * - * @param depreciationRate Double - * @return BookDepreciationSetting - */ + * The rate of depreciation (e.g. 0.05) + * @param depreciationRate Double + * @return BookDepreciationSetting + **/ public BookDepreciationSetting depreciationRate(Double depreciationRate) { this.depreciationRate = depreciationRate; return this; } - /** + /** * The rate of depreciation (e.g. 0.05) - * * @return depreciationRate - */ + **/ @ApiModelProperty(example = "0.05", value = "The rate of depreciation (e.g. 0.05)") - /** + /** * The rate of depreciation (e.g. 0.05) - * * @return depreciationRate Double - */ + **/ public Double getDepreciationRate() { return depreciationRate; } - /** - * The rate of depreciation (e.g. 0.05) - * - * @param depreciationRate Double - */ + /** + * The rate of depreciation (e.g. 0.05) + * @param depreciationRate Double + **/ + public void setDepreciationRate(Double depreciationRate) { this.depreciationRate = depreciationRate; } /** - * Effective life of the asset in years (e.g. 5) - * - * @param effectiveLifeYears Integer - * @return BookDepreciationSetting - */ + * Effective life of the asset in years (e.g. 5) + * @param effectiveLifeYears Integer + * @return BookDepreciationSetting + **/ public BookDepreciationSetting effectiveLifeYears(Integer effectiveLifeYears) { this.effectiveLifeYears = effectiveLifeYears; return this; } - /** + /** * Effective life of the asset in years (e.g. 5) - * * @return effectiveLifeYears - */ + **/ @ApiModelProperty(example = "5", value = "Effective life of the asset in years (e.g. 5)") - /** + /** * Effective life of the asset in years (e.g. 5) - * * @return effectiveLifeYears Integer - */ + **/ public Integer getEffectiveLifeYears() { return effectiveLifeYears; } - /** - * Effective life of the asset in years (e.g. 5) - * - * @param effectiveLifeYears Integer - */ + /** + * Effective life of the asset in years (e.g. 5) + * @param effectiveLifeYears Integer + **/ + public void setEffectiveLifeYears(Integer effectiveLifeYears) { this.effectiveLifeYears = effectiveLifeYears; } /** - * See Depreciation Calculation Methods - * - * @param depreciationCalculationMethod DepreciationCalculationMethodEnum - * @return BookDepreciationSetting - */ - public BookDepreciationSetting depreciationCalculationMethod( - DepreciationCalculationMethodEnum depreciationCalculationMethod) { + * See Depreciation Calculation Methods + * @param depreciationCalculationMethod DepreciationCalculationMethodEnum + * @return BookDepreciationSetting + **/ + public BookDepreciationSetting depreciationCalculationMethod(DepreciationCalculationMethodEnum depreciationCalculationMethod) { this.depreciationCalculationMethod = depreciationCalculationMethod; return this; } - /** + /** * See Depreciation Calculation Methods - * * @return depreciationCalculationMethod - */ + **/ @ApiModelProperty(example = "None", value = "See Depreciation Calculation Methods") - /** + /** * See Depreciation Calculation Methods - * * @return depreciationCalculationMethod DepreciationCalculationMethodEnum - */ + **/ public DepreciationCalculationMethodEnum getDepreciationCalculationMethod() { return depreciationCalculationMethod; } - /** - * See Depreciation Calculation Methods - * - * @param depreciationCalculationMethod DepreciationCalculationMethodEnum - */ - public void setDepreciationCalculationMethod( - DepreciationCalculationMethodEnum depreciationCalculationMethod) { + /** + * See Depreciation Calculation Methods + * @param depreciationCalculationMethod DepreciationCalculationMethodEnum + **/ + + public void setDepreciationCalculationMethod(DepreciationCalculationMethodEnum depreciationCalculationMethod) { this.depreciationCalculationMethod = depreciationCalculationMethod; } /** - * Unique Xero identifier for the depreciable object - * - * @param depreciableObjectId UUID - * @return BookDepreciationSetting - */ + * Unique Xero identifier for the depreciable object + * @param depreciableObjectId UUID + * @return BookDepreciationSetting + **/ public BookDepreciationSetting depreciableObjectId(UUID depreciableObjectId) { this.depreciableObjectId = depreciableObjectId; return this; } - /** + /** * Unique Xero identifier for the depreciable object - * * @return depreciableObjectId - */ - @ApiModelProperty( - example = "68f17094-af97-4f1b-b36b-013b45b6ad3c", - value = "Unique Xero identifier for the depreciable object") - /** + **/ + @ApiModelProperty(example = "68f17094-af97-4f1b-b36b-013b45b6ad3c", value = "Unique Xero identifier for the depreciable object") + /** * Unique Xero identifier for the depreciable object - * * @return depreciableObjectId UUID - */ + **/ public UUID getDepreciableObjectId() { return depreciableObjectId; } - /** - * Unique Xero identifier for the depreciable object - * - * @param depreciableObjectId UUID - */ + /** + * Unique Xero identifier for the depreciable object + * @param depreciableObjectId UUID + **/ + public void setDepreciableObjectId(UUID depreciableObjectId) { this.depreciableObjectId = depreciableObjectId; } /** - * The type of asset object - * - * @param depreciableObjectType String - * @return BookDepreciationSetting - */ + * The type of asset object + * @param depreciableObjectType String + * @return BookDepreciationSetting + **/ public BookDepreciationSetting depreciableObjectType(String depreciableObjectType) { this.depreciableObjectType = depreciableObjectType; return this; } - /** + /** * The type of asset object - * * @return depreciableObjectType - */ + **/ @ApiModelProperty(example = "Asset", value = "The type of asset object") - /** + /** * The type of asset object - * * @return depreciableObjectType String - */ + **/ public String getDepreciableObjectType() { return depreciableObjectType; } - /** - * The type of asset object - * - * @param depreciableObjectType String - */ + /** + * The type of asset object + * @param depreciableObjectType String + **/ + public void setDepreciableObjectType(String depreciableObjectType) { this.depreciableObjectType = depreciableObjectType; } /** - * Unique Xero identifier for the effective date change - * - * @param bookEffectiveDateOfChangeId UUID - * @return BookDepreciationSetting - */ + * Unique Xero identifier for the effective date change + * @param bookEffectiveDateOfChangeId UUID + * @return BookDepreciationSetting + **/ public BookDepreciationSetting bookEffectiveDateOfChangeId(UUID bookEffectiveDateOfChangeId) { this.bookEffectiveDateOfChangeId = bookEffectiveDateOfChangeId; return this; } - /** + /** * Unique Xero identifier for the effective date change - * * @return bookEffectiveDateOfChangeId - */ - @ApiModelProperty( - example = "68f17094-af97-4f1b-b36b-013b45b6ad3c", - value = "Unique Xero identifier for the effective date change") - /** + **/ + @ApiModelProperty(example = "68f17094-af97-4f1b-b36b-013b45b6ad3c", value = "Unique Xero identifier for the effective date change") + /** * Unique Xero identifier for the effective date change - * * @return bookEffectiveDateOfChangeId UUID - */ + **/ public UUID getBookEffectiveDateOfChangeId() { return bookEffectiveDateOfChangeId; } - /** - * Unique Xero identifier for the effective date change - * - * @param bookEffectiveDateOfChangeId UUID - */ + /** + * Unique Xero identifier for the effective date change + * @param bookEffectiveDateOfChangeId UUID + **/ + public void setBookEffectiveDateOfChangeId(UUID bookEffectiveDateOfChangeId) { this.bookEffectiveDateOfChangeId = bookEffectiveDateOfChangeId; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -507,32 +502,22 @@ public boolean equals(java.lang.Object o) { return false; } BookDepreciationSetting bookDepreciationSetting = (BookDepreciationSetting) o; - return Objects.equals(this.depreciationMethod, bookDepreciationSetting.depreciationMethod) - && Objects.equals(this.averagingMethod, bookDepreciationSetting.averagingMethod) - && Objects.equals(this.depreciationRate, bookDepreciationSetting.depreciationRate) - && Objects.equals(this.effectiveLifeYears, bookDepreciationSetting.effectiveLifeYears) - && Objects.equals( - this.depreciationCalculationMethod, - bookDepreciationSetting.depreciationCalculationMethod) - && Objects.equals(this.depreciableObjectId, bookDepreciationSetting.depreciableObjectId) - && Objects.equals(this.depreciableObjectType, bookDepreciationSetting.depreciableObjectType) - && Objects.equals( - this.bookEffectiveDateOfChangeId, bookDepreciationSetting.bookEffectiveDateOfChangeId); + return Objects.equals(this.depreciationMethod, bookDepreciationSetting.depreciationMethod) && + Objects.equals(this.averagingMethod, bookDepreciationSetting.averagingMethod) && + Objects.equals(this.depreciationRate, bookDepreciationSetting.depreciationRate) && + Objects.equals(this.effectiveLifeYears, bookDepreciationSetting.effectiveLifeYears) && + Objects.equals(this.depreciationCalculationMethod, bookDepreciationSetting.depreciationCalculationMethod) && + Objects.equals(this.depreciableObjectId, bookDepreciationSetting.depreciableObjectId) && + Objects.equals(this.depreciableObjectType, bookDepreciationSetting.depreciableObjectType) && + Objects.equals(this.bookEffectiveDateOfChangeId, bookDepreciationSetting.bookEffectiveDateOfChangeId); } @Override public int hashCode() { - return Objects.hash( - depreciationMethod, - averagingMethod, - depreciationRate, - effectiveLifeYears, - depreciationCalculationMethod, - depreciableObjectId, - depreciableObjectType, - bookEffectiveDateOfChangeId); + return Objects.hash(depreciationMethod, averagingMethod, depreciationRate, effectiveLifeYears, depreciationCalculationMethod, depreciableObjectId, depreciableObjectType, bookEffectiveDateOfChangeId); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -541,24 +526,17 @@ public String toString() { sb.append(" averagingMethod: ").append(toIndentedString(averagingMethod)).append("\n"); sb.append(" depreciationRate: ").append(toIndentedString(depreciationRate)).append("\n"); sb.append(" effectiveLifeYears: ").append(toIndentedString(effectiveLifeYears)).append("\n"); - sb.append(" depreciationCalculationMethod: ") - .append(toIndentedString(depreciationCalculationMethod)) - .append("\n"); - sb.append(" depreciableObjectId: ") - .append(toIndentedString(depreciableObjectId)) - .append("\n"); - sb.append(" depreciableObjectType: ") - .append(toIndentedString(depreciableObjectType)) - .append("\n"); - sb.append(" bookEffectiveDateOfChangeId: ") - .append(toIndentedString(bookEffectiveDateOfChangeId)) - .append("\n"); + sb.append(" depreciationCalculationMethod: ").append(toIndentedString(depreciationCalculationMethod)).append("\n"); + sb.append(" depreciableObjectId: ").append(toIndentedString(depreciableObjectId)).append("\n"); + sb.append(" depreciableObjectType: ").append(toIndentedString(depreciableObjectType)).append("\n"); + sb.append(" bookEffectiveDateOfChangeId: ").append(toIndentedString(bookEffectiveDateOfChangeId)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -566,4 +544,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/Error.java b/src/main/java/com/xero/models/assets/Error.java index 03d7a65b7..961a73bae 100644 --- a/src/main/java/com/xero/models/assets/Error.java +++ b/src/main/java/com/xero/models/assets/Error.java @@ -9,26 +9,43 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.assets.FieldValidationErrorsElement; +import com.xero.models.assets.ResourceValidationErrorsElement; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Error + */ -/** Error */ public class Error { StringUtil util = new StringUtil(); @JsonProperty("resourceValidationErrors") - private List resourceValidationErrors = - new ArrayList(); + private List resourceValidationErrors = new ArrayList(); @JsonProperty("fieldValidationErrors") - private List fieldValidationErrors = - new ArrayList(); + private List fieldValidationErrors = new ArrayList(); @JsonProperty("type") private String type; @@ -39,25 +56,21 @@ public class Error { @JsonProperty("detail") private String detail; /** - * Array of elements of resource validation errors - * - * @param resourceValidationErrors List<ResourceValidationErrorsElement> - * @return Error - */ - public Error resourceValidationErrors( - List resourceValidationErrors) { + * Array of elements of resource validation errors + * @param resourceValidationErrors List<ResourceValidationErrorsElement> + * @return Error + **/ + public Error resourceValidationErrors(List resourceValidationErrors) { this.resourceValidationErrors = resourceValidationErrors; return this; } /** * Array of elements of resource validation errors - * - * @param resourceValidationErrorsItem ResourceValidationErrorsElement + * @param resourceValidationErrorsItem ResourceValidationErrorsElement * @return Error - */ - public Error addResourceValidationErrorsItem( - ResourceValidationErrorsElement resourceValidationErrorsItem) { + **/ + public Error addResourceValidationErrorsItem(ResourceValidationErrorsElement resourceValidationErrorsItem) { if (this.resourceValidationErrors == null) { this.resourceValidationErrors = new ArrayList(); } @@ -65,37 +78,33 @@ public Error addResourceValidationErrorsItem( return this; } - /** + /** * Array of elements of resource validation errors - * * @return resourceValidationErrors - */ + **/ @ApiModelProperty(value = "Array of elements of resource validation errors") - /** + /** * Array of elements of resource validation errors - * * @return resourceValidationErrors List - */ + **/ public List getResourceValidationErrors() { return resourceValidationErrors; } - /** - * Array of elements of resource validation errors - * - * @param resourceValidationErrors List<ResourceValidationErrorsElement> - */ - public void setResourceValidationErrors( - List resourceValidationErrors) { + /** + * Array of elements of resource validation errors + * @param resourceValidationErrors List<ResourceValidationErrorsElement> + **/ + + public void setResourceValidationErrors(List resourceValidationErrors) { this.resourceValidationErrors = resourceValidationErrors; } /** - * Array of elements of field validation errors - * - * @param fieldValidationErrors List<FieldValidationErrorsElement> - * @return Error - */ + * Array of elements of field validation errors + * @param fieldValidationErrors List<FieldValidationErrorsElement> + * @return Error + **/ public Error fieldValidationErrors(List fieldValidationErrors) { this.fieldValidationErrors = fieldValidationErrors; return this; @@ -103,12 +112,10 @@ public Error fieldValidationErrors(List fieldValid /** * Array of elements of field validation errors - * - * @param fieldValidationErrorsItem FieldValidationErrorsElement + * @param fieldValidationErrorsItem FieldValidationErrorsElement * @return Error - */ - public Error addFieldValidationErrorsItem( - FieldValidationErrorsElement fieldValidationErrorsItem) { + **/ + public Error addFieldValidationErrorsItem(FieldValidationErrorsElement fieldValidationErrorsItem) { if (this.fieldValidationErrors == null) { this.fieldValidationErrors = new ArrayList(); } @@ -116,135 +123,125 @@ public Error addFieldValidationErrorsItem( return this; } - /** + /** * Array of elements of field validation errors - * * @return fieldValidationErrors - */ + **/ @ApiModelProperty(value = "Array of elements of field validation errors") - /** + /** * Array of elements of field validation errors - * * @return fieldValidationErrors List - */ + **/ public List getFieldValidationErrors() { return fieldValidationErrors; } - /** - * Array of elements of field validation errors - * - * @param fieldValidationErrors List<FieldValidationErrorsElement> - */ + /** + * Array of elements of field validation errors + * @param fieldValidationErrors List<FieldValidationErrorsElement> + **/ + public void setFieldValidationErrors(List fieldValidationErrors) { this.fieldValidationErrors = fieldValidationErrors; } /** - * The internal type of error, not accessible externally - * - * @param type String - * @return Error - */ + * The internal type of error, not accessible externally + * @param type String + * @return Error + **/ public Error type(String type) { this.type = type; return this; } - /** + /** * The internal type of error, not accessible externally - * * @return type - */ + **/ @ApiModelProperty(value = "The internal type of error, not accessible externally") - /** + /** * The internal type of error, not accessible externally - * * @return type String - */ + **/ public String getType() { return type; } - /** - * The internal type of error, not accessible externally - * - * @param type String - */ + /** + * The internal type of error, not accessible externally + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * Title of the error - * - * @param title String - * @return Error - */ + * Title of the error + * @param title String + * @return Error + **/ public Error title(String title) { this.title = title; return this; } - /** + /** * Title of the error - * * @return title - */ + **/ @ApiModelProperty(value = "Title of the error") - /** + /** * Title of the error - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Title of the error - * - * @param title String - */ + /** + * Title of the error + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * Detail of the error - * - * @param detail String - * @return Error - */ + * Detail of the error + * @param detail String + * @return Error + **/ public Error detail(String detail) { this.detail = detail; return this; } - /** + /** * Detail of the error - * * @return detail - */ + **/ @ApiModelProperty(value = "Detail of the error") - /** + /** * Detail of the error - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * Detail of the error - * - * @param detail String - */ + /** + * Detail of the error + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -254,11 +251,11 @@ public boolean equals(java.lang.Object o) { return false; } Error error = (Error) o; - return Objects.equals(this.resourceValidationErrors, error.resourceValidationErrors) - && Objects.equals(this.fieldValidationErrors, error.fieldValidationErrors) - && Objects.equals(this.type, error.type) - && Objects.equals(this.title, error.title) - && Objects.equals(this.detail, error.detail); + return Objects.equals(this.resourceValidationErrors, error.resourceValidationErrors) && + Objects.equals(this.fieldValidationErrors, error.fieldValidationErrors) && + Objects.equals(this.type, error.type) && + Objects.equals(this.title, error.title) && + Objects.equals(this.detail, error.detail); } @Override @@ -266,16 +263,13 @@ public int hashCode() { return Objects.hash(resourceValidationErrors, fieldValidationErrors, type, title, detail); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Error {\n"); - sb.append(" resourceValidationErrors: ") - .append(toIndentedString(resourceValidationErrors)) - .append("\n"); - sb.append(" fieldValidationErrors: ") - .append(toIndentedString(fieldValidationErrors)) - .append("\n"); + sb.append(" resourceValidationErrors: ").append(toIndentedString(resourceValidationErrors)).append("\n"); + sb.append(" fieldValidationErrors: ").append(toIndentedString(fieldValidationErrors)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); @@ -284,7 +278,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -292,4 +287,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/FieldValidationErrorsElement.java b/src/main/java/com/xero/models/assets/FieldValidationErrorsElement.java index 1b5d66983..573cc998a 100644 --- a/src/main/java/com/xero/models/assets/FieldValidationErrorsElement.java +++ b/src/main/java/com/xero/models/assets/FieldValidationErrorsElement.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * FieldValidationErrorsElement + */ -/** FieldValidationErrorsElement */ public class FieldValidationErrorsElement { StringUtil util = new StringUtil(); @@ -38,215 +55,198 @@ public class FieldValidationErrorsElement { @JsonProperty("detail") private String detail; /** - * The field name of the erroneous field - * - * @param fieldName String - * @return FieldValidationErrorsElement - */ + * The field name of the erroneous field + * @param fieldName String + * @return FieldValidationErrorsElement + **/ public FieldValidationErrorsElement fieldName(String fieldName) { this.fieldName = fieldName; return this; } - /** + /** * The field name of the erroneous field - * * @return fieldName - */ + **/ @ApiModelProperty(value = "The field name of the erroneous field") - /** + /** * The field name of the erroneous field - * * @return fieldName String - */ + **/ public String getFieldName() { return fieldName; } - /** - * The field name of the erroneous field - * - * @param fieldName String - */ + /** + * The field name of the erroneous field + * @param fieldName String + **/ + public void setFieldName(String fieldName) { this.fieldName = fieldName; } /** - * The provided value - * - * @param valueProvided String - * @return FieldValidationErrorsElement - */ + * The provided value + * @param valueProvided String + * @return FieldValidationErrorsElement + **/ public FieldValidationErrorsElement valueProvided(String valueProvided) { this.valueProvided = valueProvided; return this; } - /** + /** * The provided value - * * @return valueProvided - */ + **/ @ApiModelProperty(value = "The provided value") - /** + /** * The provided value - * * @return valueProvided String - */ + **/ public String getValueProvided() { return valueProvided; } - /** - * The provided value - * - * @param valueProvided String - */ + /** + * The provided value + * @param valueProvided String + **/ + public void setValueProvided(String valueProvided) { this.valueProvided = valueProvided; } /** - * Explanation of the field validation error - * - * @param localisedMessage String - * @return FieldValidationErrorsElement - */ + * Explanation of the field validation error + * @param localisedMessage String + * @return FieldValidationErrorsElement + **/ public FieldValidationErrorsElement localisedMessage(String localisedMessage) { this.localisedMessage = localisedMessage; return this; } - /** + /** * Explanation of the field validation error - * * @return localisedMessage - */ + **/ @ApiModelProperty(value = "Explanation of the field validation error") - /** + /** * Explanation of the field validation error - * * @return localisedMessage String - */ + **/ public String getLocalisedMessage() { return localisedMessage; } - /** - * Explanation of the field validation error - * - * @param localisedMessage String - */ + /** + * Explanation of the field validation error + * @param localisedMessage String + **/ + public void setLocalisedMessage(String localisedMessage) { this.localisedMessage = localisedMessage; } /** - * Internal type of the field validation error message - * - * @param type String - * @return FieldValidationErrorsElement - */ + * Internal type of the field validation error message + * @param type String + * @return FieldValidationErrorsElement + **/ public FieldValidationErrorsElement type(String type) { this.type = type; return this; } - /** + /** * Internal type of the field validation error message - * * @return type - */ + **/ @ApiModelProperty(value = "Internal type of the field validation error message") - /** + /** * Internal type of the field validation error message - * * @return type String - */ + **/ public String getType() { return type; } - /** - * Internal type of the field validation error message - * - * @param type String - */ + /** + * Internal type of the field validation error message + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * Title of the field validation error - * - * @param title String - * @return FieldValidationErrorsElement - */ + * Title of the field validation error + * @param title String + * @return FieldValidationErrorsElement + **/ public FieldValidationErrorsElement title(String title) { this.title = title; return this; } - /** + /** * Title of the field validation error - * * @return title - */ + **/ @ApiModelProperty(value = "Title of the field validation error") - /** + /** * Title of the field validation error - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Title of the field validation error - * - * @param title String - */ + /** + * Title of the field validation error + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * Detail of the field validation error - * - * @param detail String - * @return FieldValidationErrorsElement - */ + * Detail of the field validation error + * @param detail String + * @return FieldValidationErrorsElement + **/ public FieldValidationErrorsElement detail(String detail) { this.detail = detail; return this; } - /** + /** * Detail of the field validation error - * * @return detail - */ + **/ @ApiModelProperty(value = "Detail of the field validation error") - /** + /** * Detail of the field validation error - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * Detail of the field validation error - * - * @param detail String - */ + /** + * Detail of the field validation error + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -256,12 +256,12 @@ public boolean equals(java.lang.Object o) { return false; } FieldValidationErrorsElement fieldValidationErrorsElement = (FieldValidationErrorsElement) o; - return Objects.equals(this.fieldName, fieldValidationErrorsElement.fieldName) - && Objects.equals(this.valueProvided, fieldValidationErrorsElement.valueProvided) - && Objects.equals(this.localisedMessage, fieldValidationErrorsElement.localisedMessage) - && Objects.equals(this.type, fieldValidationErrorsElement.type) - && Objects.equals(this.title, fieldValidationErrorsElement.title) - && Objects.equals(this.detail, fieldValidationErrorsElement.detail); + return Objects.equals(this.fieldName, fieldValidationErrorsElement.fieldName) && + Objects.equals(this.valueProvided, fieldValidationErrorsElement.valueProvided) && + Objects.equals(this.localisedMessage, fieldValidationErrorsElement.localisedMessage) && + Objects.equals(this.type, fieldValidationErrorsElement.type) && + Objects.equals(this.title, fieldValidationErrorsElement.title) && + Objects.equals(this.detail, fieldValidationErrorsElement.detail); } @Override @@ -269,6 +269,7 @@ public int hashCode() { return Objects.hash(fieldName, valueProvided, localisedMessage, type, title, detail); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -284,7 +285,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -292,4 +294,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/Pagination.java b/src/main/java/com/xero/models/assets/Pagination.java index 72a5485c2..9ee4db516 100644 --- a/src/main/java/com/xero/models/assets/Pagination.java +++ b/src/main/java/com/xero/models/assets/Pagination.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Pagination + */ -/** Pagination */ public class Pagination { StringUtil util = new StringUtil(); @@ -32,145 +49,134 @@ public class Pagination { @JsonProperty("itemCount") private Integer itemCount; /** - * page - * - * @param page Integer - * @return Pagination - */ + * page + * @param page Integer + * @return Pagination + **/ public Pagination page(Integer page) { this.page = page; return this; } - /** + /** * Get page - * * @return page - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * page - * * @return page Integer - */ + **/ public Integer getPage() { return page; } - /** - * page - * - * @param page Integer - */ + /** + * page + * @param page Integer + **/ + public void setPage(Integer page) { this.page = page; } /** - * pageSize - * - * @param pageSize Integer - * @return Pagination - */ + * pageSize + * @param pageSize Integer + * @return Pagination + **/ public Pagination pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } - /** + /** * Get pageSize - * * @return pageSize - */ + **/ @ApiModelProperty(example = "10", value = "") - /** + /** * pageSize - * * @return pageSize Integer - */ + **/ public Integer getPageSize() { return pageSize; } - /** - * pageSize - * - * @param pageSize Integer - */ + /** + * pageSize + * @param pageSize Integer + **/ + public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** - * pageCount - * - * @param pageCount Integer - * @return Pagination - */ + * pageCount + * @param pageCount Integer + * @return Pagination + **/ public Pagination pageCount(Integer pageCount) { this.pageCount = pageCount; return this; } - /** + /** * Get pageCount - * * @return pageCount - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * pageCount - * * @return pageCount Integer - */ + **/ public Integer getPageCount() { return pageCount; } - /** - * pageCount - * - * @param pageCount Integer - */ + /** + * pageCount + * @param pageCount Integer + **/ + public void setPageCount(Integer pageCount) { this.pageCount = pageCount; } /** - * itemCount - * - * @param itemCount Integer - * @return Pagination - */ + * itemCount + * @param itemCount Integer + * @return Pagination + **/ public Pagination itemCount(Integer itemCount) { this.itemCount = itemCount; return this; } - /** + /** * Get itemCount - * * @return itemCount - */ + **/ @ApiModelProperty(example = "2", value = "") - /** + /** * itemCount - * * @return itemCount Integer - */ + **/ public Integer getItemCount() { return itemCount; } - /** - * itemCount - * - * @param itemCount Integer - */ + /** + * itemCount + * @param itemCount Integer + **/ + public void setItemCount(Integer itemCount) { this.itemCount = itemCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } Pagination pagination = (Pagination) o; - return Objects.equals(this.page, pagination.page) - && Objects.equals(this.pageSize, pagination.pageSize) - && Objects.equals(this.pageCount, pagination.pageCount) - && Objects.equals(this.itemCount, pagination.itemCount); + return Objects.equals(this.page, pagination.page) && + Objects.equals(this.pageSize, pagination.pageSize) && + Objects.equals(this.pageCount, pagination.pageCount) && + Objects.equals(this.itemCount, pagination.itemCount); } @Override @@ -191,6 +197,7 @@ public int hashCode() { return Objects.hash(page, pageSize, pageCount, itemCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -212,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/ResourceValidationErrorsElement.java b/src/main/java/com/xero/models/assets/ResourceValidationErrorsElement.java index 6134a1bf6..b2a4e9b9c 100644 --- a/src/main/java/com/xero/models/assets/ResourceValidationErrorsElement.java +++ b/src/main/java/com/xero/models/assets/ResourceValidationErrorsElement.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ResourceValidationErrorsElement + */ -/** ResourceValidationErrorsElement */ public class ResourceValidationErrorsElement { StringUtil util = new StringUtil(); @@ -35,180 +52,166 @@ public class ResourceValidationErrorsElement { @JsonProperty("detail") private String detail; /** - * The field name of the erroneous field - * - * @param resourceName String - * @return ResourceValidationErrorsElement - */ + * The field name of the erroneous field + * @param resourceName String + * @return ResourceValidationErrorsElement + **/ public ResourceValidationErrorsElement resourceName(String resourceName) { this.resourceName = resourceName; return this; } - /** + /** * The field name of the erroneous field - * * @return resourceName - */ + **/ @ApiModelProperty(value = "The field name of the erroneous field") - /** + /** * The field name of the erroneous field - * * @return resourceName String - */ + **/ public String getResourceName() { return resourceName; } - /** - * The field name of the erroneous field - * - * @param resourceName String - */ + /** + * The field name of the erroneous field + * @param resourceName String + **/ + public void setResourceName(String resourceName) { this.resourceName = resourceName; } /** - * Explanation of the resource validation error - * - * @param localisedMessage String - * @return ResourceValidationErrorsElement - */ + * Explanation of the resource validation error + * @param localisedMessage String + * @return ResourceValidationErrorsElement + **/ public ResourceValidationErrorsElement localisedMessage(String localisedMessage) { this.localisedMessage = localisedMessage; return this; } - /** + /** * Explanation of the resource validation error - * * @return localisedMessage - */ + **/ @ApiModelProperty(value = "Explanation of the resource validation error") - /** + /** * Explanation of the resource validation error - * * @return localisedMessage String - */ + **/ public String getLocalisedMessage() { return localisedMessage; } - /** - * Explanation of the resource validation error - * - * @param localisedMessage String - */ + /** + * Explanation of the resource validation error + * @param localisedMessage String + **/ + public void setLocalisedMessage(String localisedMessage) { this.localisedMessage = localisedMessage; } /** - * Internal type of the resource error message - * - * @param type String - * @return ResourceValidationErrorsElement - */ + * Internal type of the resource error message + * @param type String + * @return ResourceValidationErrorsElement + **/ public ResourceValidationErrorsElement type(String type) { this.type = type; return this; } - /** + /** * Internal type of the resource error message - * * @return type - */ + **/ @ApiModelProperty(value = "Internal type of the resource error message") - /** + /** * Internal type of the resource error message - * * @return type String - */ + **/ public String getType() { return type; } - /** - * Internal type of the resource error message - * - * @param type String - */ + /** + * Internal type of the resource error message + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * Title of the resource validation error - * - * @param title String - * @return ResourceValidationErrorsElement - */ + * Title of the resource validation error + * @param title String + * @return ResourceValidationErrorsElement + **/ public ResourceValidationErrorsElement title(String title) { this.title = title; return this; } - /** + /** * Title of the resource validation error - * * @return title - */ + **/ @ApiModelProperty(value = "Title of the resource validation error") - /** + /** * Title of the resource validation error - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Title of the resource validation error - * - * @param title String - */ + /** + * Title of the resource validation error + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * Detail of the resource validation error - * - * @param detail String - * @return ResourceValidationErrorsElement - */ + * Detail of the resource validation error + * @param detail String + * @return ResourceValidationErrorsElement + **/ public ResourceValidationErrorsElement detail(String detail) { this.detail = detail; return this; } - /** + /** * Detail of the resource validation error - * * @return detail - */ + **/ @ApiModelProperty(value = "Detail of the resource validation error") - /** + /** * Detail of the resource validation error - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * Detail of the resource validation error - * - * @param detail String - */ + /** + * Detail of the resource validation error + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,13 +220,12 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ResourceValidationErrorsElement resourceValidationErrorsElement = - (ResourceValidationErrorsElement) o; - return Objects.equals(this.resourceName, resourceValidationErrorsElement.resourceName) - && Objects.equals(this.localisedMessage, resourceValidationErrorsElement.localisedMessage) - && Objects.equals(this.type, resourceValidationErrorsElement.type) - && Objects.equals(this.title, resourceValidationErrorsElement.title) - && Objects.equals(this.detail, resourceValidationErrorsElement.detail); + ResourceValidationErrorsElement resourceValidationErrorsElement = (ResourceValidationErrorsElement) o; + return Objects.equals(this.resourceName, resourceValidationErrorsElement.resourceName) && + Objects.equals(this.localisedMessage, resourceValidationErrorsElement.localisedMessage) && + Objects.equals(this.type, resourceValidationErrorsElement.type) && + Objects.equals(this.title, resourceValidationErrorsElement.title) && + Objects.equals(this.detail, resourceValidationErrorsElement.detail); } @Override @@ -231,6 +233,7 @@ public int hashCode() { return Objects.hash(resourceName, localisedMessage, type, title, detail); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +248,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +257,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/assets/Setting.java b/src/main/java/com/xero/models/assets/Setting.java index 6fbb6b818..871e17d9b 100644 --- a/src/main/java/com/xero/models/assets/Setting.java +++ b/src/main/java/com/xero/models/assets/Setting.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.assets; +package com.xero.models.assets; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Setting + */ -/** Setting */ public class Setting { StringUtil util = new StringUtil(); @@ -46,294 +63,262 @@ public class Setting { @JsonProperty("optInForTax") private Boolean optInForTax; /** - * The prefix used for fixed asset numbers (“FA-” by default) - * - * @param assetNumberPrefix String - * @return Setting - */ + * The prefix used for fixed asset numbers (“FA-” by default) + * @param assetNumberPrefix String + * @return Setting + **/ public Setting assetNumberPrefix(String assetNumberPrefix) { this.assetNumberPrefix = assetNumberPrefix; return this; } - /** + /** * The prefix used for fixed asset numbers (“FA-” by default) - * * @return assetNumberPrefix - */ - @ApiModelProperty( - example = "FA-", - value = "The prefix used for fixed asset numbers (“FA-” by default)") - /** + **/ + @ApiModelProperty(example = "FA-", value = "The prefix used for fixed asset numbers (“FA-” by default)") + /** * The prefix used for fixed asset numbers (“FA-” by default) - * * @return assetNumberPrefix String - */ + **/ public String getAssetNumberPrefix() { return assetNumberPrefix; } - /** - * The prefix used for fixed asset numbers (“FA-” by default) - * - * @param assetNumberPrefix String - */ + /** + * The prefix used for fixed asset numbers (“FA-” by default) + * @param assetNumberPrefix String + **/ + public void setAssetNumberPrefix(String assetNumberPrefix) { this.assetNumberPrefix = assetNumberPrefix; } /** - * The next available sequence number - * - * @param assetNumberSequence String - * @return Setting - */ + * The next available sequence number + * @param assetNumberSequence String + * @return Setting + **/ public Setting assetNumberSequence(String assetNumberSequence) { this.assetNumberSequence = assetNumberSequence; return this; } - /** + /** * The next available sequence number - * * @return assetNumberSequence - */ + **/ @ApiModelProperty(example = "0022", value = "The next available sequence number") - /** + /** * The next available sequence number - * * @return assetNumberSequence String - */ + **/ public String getAssetNumberSequence() { return assetNumberSequence; } - /** - * The next available sequence number - * - * @param assetNumberSequence String - */ + /** + * The next available sequence number + * @param assetNumberSequence String + **/ + public void setAssetNumberSequence(String assetNumberSequence) { this.assetNumberSequence = assetNumberSequence; } /** - * The date depreciation calculations started on registered fixed assets in Xero - * - * @param assetStartDate LocalDate - * @return Setting - */ + * The date depreciation calculations started on registered fixed assets in Xero + * @param assetStartDate LocalDate + * @return Setting + **/ public Setting assetStartDate(LocalDate assetStartDate) { this.assetStartDate = assetStartDate; return this; } - /** + /** * The date depreciation calculations started on registered fixed assets in Xero - * * @return assetStartDate - */ - @ApiModelProperty( - value = "The date depreciation calculations started on registered fixed assets in Xero") - /** + **/ + @ApiModelProperty(value = "The date depreciation calculations started on registered fixed assets in Xero") + /** * The date depreciation calculations started on registered fixed assets in Xero - * * @return assetStartDate LocalDate - */ + **/ public LocalDate getAssetStartDate() { return assetStartDate; } - /** - * The date depreciation calculations started on registered fixed assets in Xero - * - * @param assetStartDate LocalDate - */ + /** + * The date depreciation calculations started on registered fixed assets in Xero + * @param assetStartDate LocalDate + **/ + public void setAssetStartDate(LocalDate assetStartDate) { this.assetStartDate = assetStartDate; } /** - * The last depreciation date - * - * @param lastDepreciationDate LocalDate - * @return Setting - */ + * The last depreciation date + * @param lastDepreciationDate LocalDate + * @return Setting + **/ public Setting lastDepreciationDate(LocalDate lastDepreciationDate) { this.lastDepreciationDate = lastDepreciationDate; return this; } - /** + /** * The last depreciation date - * * @return lastDepreciationDate - */ + **/ @ApiModelProperty(value = "The last depreciation date") - /** + /** * The last depreciation date - * * @return lastDepreciationDate LocalDate - */ + **/ public LocalDate getLastDepreciationDate() { return lastDepreciationDate; } - /** - * The last depreciation date - * - * @param lastDepreciationDate LocalDate - */ + /** + * The last depreciation date + * @param lastDepreciationDate LocalDate + **/ + public void setLastDepreciationDate(LocalDate lastDepreciationDate) { this.lastDepreciationDate = lastDepreciationDate; } /** - * Default account that gains are posted to - * - * @param defaultGainOnDisposalAccountId UUID - * @return Setting - */ + * Default account that gains are posted to + * @param defaultGainOnDisposalAccountId UUID + * @return Setting + **/ public Setting defaultGainOnDisposalAccountId(UUID defaultGainOnDisposalAccountId) { this.defaultGainOnDisposalAccountId = defaultGainOnDisposalAccountId; return this; } - /** + /** * Default account that gains are posted to - * * @return defaultGainOnDisposalAccountId - */ - @ApiModelProperty( - example = "346ddb97-739a-4274-b43b-66aa3218d17c", - value = "Default account that gains are posted to") - /** + **/ + @ApiModelProperty(example = "346ddb97-739a-4274-b43b-66aa3218d17c", value = "Default account that gains are posted to") + /** * Default account that gains are posted to - * * @return defaultGainOnDisposalAccountId UUID - */ + **/ public UUID getDefaultGainOnDisposalAccountId() { return defaultGainOnDisposalAccountId; } - /** - * Default account that gains are posted to - * - * @param defaultGainOnDisposalAccountId UUID - */ + /** + * Default account that gains are posted to + * @param defaultGainOnDisposalAccountId UUID + **/ + public void setDefaultGainOnDisposalAccountId(UUID defaultGainOnDisposalAccountId) { this.defaultGainOnDisposalAccountId = defaultGainOnDisposalAccountId; } /** - * Default account that losses are posted to - * - * @param defaultLossOnDisposalAccountId UUID - * @return Setting - */ + * Default account that losses are posted to + * @param defaultLossOnDisposalAccountId UUID + * @return Setting + **/ public Setting defaultLossOnDisposalAccountId(UUID defaultLossOnDisposalAccountId) { this.defaultLossOnDisposalAccountId = defaultLossOnDisposalAccountId; return this; } - /** + /** * Default account that losses are posted to - * * @return defaultLossOnDisposalAccountId - */ - @ApiModelProperty( - example = "1b798541-24e2-4855-9309-c023a0b576f3", - value = "Default account that losses are posted to") - /** + **/ + @ApiModelProperty(example = "1b798541-24e2-4855-9309-c023a0b576f3", value = "Default account that losses are posted to") + /** * Default account that losses are posted to - * * @return defaultLossOnDisposalAccountId UUID - */ + **/ public UUID getDefaultLossOnDisposalAccountId() { return defaultLossOnDisposalAccountId; } - /** - * Default account that losses are posted to - * - * @param defaultLossOnDisposalAccountId UUID - */ + /** + * Default account that losses are posted to + * @param defaultLossOnDisposalAccountId UUID + **/ + public void setDefaultLossOnDisposalAccountId(UUID defaultLossOnDisposalAccountId) { this.defaultLossOnDisposalAccountId = defaultLossOnDisposalAccountId; } /** - * Default account that capital gains are posted to - * - * @param defaultCapitalGainOnDisposalAccountId UUID - * @return Setting - */ + * Default account that capital gains are posted to + * @param defaultCapitalGainOnDisposalAccountId UUID + * @return Setting + **/ public Setting defaultCapitalGainOnDisposalAccountId(UUID defaultCapitalGainOnDisposalAccountId) { this.defaultCapitalGainOnDisposalAccountId = defaultCapitalGainOnDisposalAccountId; return this; } - /** + /** * Default account that capital gains are posted to - * * @return defaultCapitalGainOnDisposalAccountId - */ - @ApiModelProperty( - example = "6d6a0bdb-e118-45d8-a023-2ad617ec1cb7", - value = "Default account that capital gains are posted to") - /** + **/ + @ApiModelProperty(example = "6d6a0bdb-e118-45d8-a023-2ad617ec1cb7", value = "Default account that capital gains are posted to") + /** * Default account that capital gains are posted to - * * @return defaultCapitalGainOnDisposalAccountId UUID - */ + **/ public UUID getDefaultCapitalGainOnDisposalAccountId() { return defaultCapitalGainOnDisposalAccountId; } - /** - * Default account that capital gains are posted to - * - * @param defaultCapitalGainOnDisposalAccountId UUID - */ + /** + * Default account that capital gains are posted to + * @param defaultCapitalGainOnDisposalAccountId UUID + **/ + public void setDefaultCapitalGainOnDisposalAccountId(UUID defaultCapitalGainOnDisposalAccountId) { this.defaultCapitalGainOnDisposalAccountId = defaultCapitalGainOnDisposalAccountId; } /** - * opt in for tax calculation - * - * @param optInForTax Boolean - * @return Setting - */ + * opt in for tax calculation + * @param optInForTax Boolean + * @return Setting + **/ public Setting optInForTax(Boolean optInForTax) { this.optInForTax = optInForTax; return this; } - /** + /** * opt in for tax calculation - * * @return optInForTax - */ + **/ @ApiModelProperty(example = "false", value = "opt in for tax calculation") - /** + /** * opt in for tax calculation - * * @return optInForTax Boolean - */ + **/ public Boolean getOptInForTax() { return optInForTax; } - /** - * opt in for tax calculation - * - * @param optInForTax Boolean - */ + /** + * opt in for tax calculation + * @param optInForTax Boolean + **/ + public void setOptInForTax(Boolean optInForTax) { this.optInForTax = optInForTax; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -343,61 +328,41 @@ public boolean equals(java.lang.Object o) { return false; } Setting setting = (Setting) o; - return Objects.equals(this.assetNumberPrefix, setting.assetNumberPrefix) - && Objects.equals(this.assetNumberSequence, setting.assetNumberSequence) - && Objects.equals(this.assetStartDate, setting.assetStartDate) - && Objects.equals(this.lastDepreciationDate, setting.lastDepreciationDate) - && Objects.equals( - this.defaultGainOnDisposalAccountId, setting.defaultGainOnDisposalAccountId) - && Objects.equals( - this.defaultLossOnDisposalAccountId, setting.defaultLossOnDisposalAccountId) - && Objects.equals( - this.defaultCapitalGainOnDisposalAccountId, - setting.defaultCapitalGainOnDisposalAccountId) - && Objects.equals(this.optInForTax, setting.optInForTax); + return Objects.equals(this.assetNumberPrefix, setting.assetNumberPrefix) && + Objects.equals(this.assetNumberSequence, setting.assetNumberSequence) && + Objects.equals(this.assetStartDate, setting.assetStartDate) && + Objects.equals(this.lastDepreciationDate, setting.lastDepreciationDate) && + Objects.equals(this.defaultGainOnDisposalAccountId, setting.defaultGainOnDisposalAccountId) && + Objects.equals(this.defaultLossOnDisposalAccountId, setting.defaultLossOnDisposalAccountId) && + Objects.equals(this.defaultCapitalGainOnDisposalAccountId, setting.defaultCapitalGainOnDisposalAccountId) && + Objects.equals(this.optInForTax, setting.optInForTax); } @Override public int hashCode() { - return Objects.hash( - assetNumberPrefix, - assetNumberSequence, - assetStartDate, - lastDepreciationDate, - defaultGainOnDisposalAccountId, - defaultLossOnDisposalAccountId, - defaultCapitalGainOnDisposalAccountId, - optInForTax); + return Objects.hash(assetNumberPrefix, assetNumberSequence, assetStartDate, lastDepreciationDate, defaultGainOnDisposalAccountId, defaultLossOnDisposalAccountId, defaultCapitalGainOnDisposalAccountId, optInForTax); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Setting {\n"); sb.append(" assetNumberPrefix: ").append(toIndentedString(assetNumberPrefix)).append("\n"); - sb.append(" assetNumberSequence: ") - .append(toIndentedString(assetNumberSequence)) - .append("\n"); + sb.append(" assetNumberSequence: ").append(toIndentedString(assetNumberSequence)).append("\n"); sb.append(" assetStartDate: ").append(toIndentedString(assetStartDate)).append("\n"); - sb.append(" lastDepreciationDate: ") - .append(toIndentedString(lastDepreciationDate)) - .append("\n"); - sb.append(" defaultGainOnDisposalAccountId: ") - .append(toIndentedString(defaultGainOnDisposalAccountId)) - .append("\n"); - sb.append(" defaultLossOnDisposalAccountId: ") - .append(toIndentedString(defaultLossOnDisposalAccountId)) - .append("\n"); - sb.append(" defaultCapitalGainOnDisposalAccountId: ") - .append(toIndentedString(defaultCapitalGainOnDisposalAccountId)) - .append("\n"); + sb.append(" lastDepreciationDate: ").append(toIndentedString(lastDepreciationDate)).append("\n"); + sb.append(" defaultGainOnDisposalAccountId: ").append(toIndentedString(defaultGainOnDisposalAccountId)).append("\n"); + sb.append(" defaultLossOnDisposalAccountId: ").append(toIndentedString(defaultLossOnDisposalAccountId)).append("\n"); + sb.append(" defaultCapitalGainOnDisposalAccountId: ").append(toIndentedString(defaultCapitalGainOnDisposalAccountId)).append("\n"); sb.append(" optInForTax: ").append(toIndentedString(optInForTax)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -405,4 +370,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/CountryCode.java b/src/main/java/com/xero/models/bankfeeds/CountryCode.java index dc1ed877d..dbe6f322b 100644 --- a/src/main/java/com/xero/models/bankfeeds/CountryCode.java +++ b/src/main/java/com/xero/models/bankfeeds/CountryCode.java @@ -9,736 +9,1225 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; - +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application - * supports multi-region. Talk to your Partner Manager to confirm if this is the case. + * ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ public enum CountryCode { - - /** AD */ + + /** + * AD + */ AD("AD"), - - /** AE */ + + /** + * AE + */ AE("AE"), - - /** AF */ + + /** + * AF + */ AF("AF"), - - /** AG */ + + /** + * AG + */ AG("AG"), - - /** AI */ + + /** + * AI + */ AI("AI"), - - /** AL */ + + /** + * AL + */ AL("AL"), - - /** AM */ + + /** + * AM + */ AM("AM"), - - /** AN */ + + /** + * AN + */ AN("AN"), - - /** AO */ + + /** + * AO + */ AO("AO"), - - /** AQ */ + + /** + * AQ + */ AQ("AQ"), - - /** AR */ + + /** + * AR + */ AR("AR"), - - /** AS */ + + /** + * AS + */ AS("AS"), - - /** AT */ + + /** + * AT + */ AT("AT"), - - /** AU */ + + /** + * AU + */ AU("AU"), - - /** AW */ + + /** + * AW + */ AW("AW"), - - /** AZ */ + + /** + * AZ + */ AZ("AZ"), - - /** BA */ + + /** + * BA + */ BA("BA"), - - /** BB */ + + /** + * BB + */ BB("BB"), - - /** BD */ + + /** + * BD + */ BD("BD"), - - /** BE */ + + /** + * BE + */ BE("BE"), - - /** BF */ + + /** + * BF + */ BF("BF"), - - /** BG */ + + /** + * BG + */ BG("BG"), - - /** BH */ + + /** + * BH + */ BH("BH"), - - /** BI */ + + /** + * BI + */ BI("BI"), - - /** BJ */ + + /** + * BJ + */ BJ("BJ"), - - /** BL */ + + /** + * BL + */ BL("BL"), - - /** BM */ + + /** + * BM + */ BM("BM"), - - /** BN */ + + /** + * BN + */ BN("BN"), - - /** BO */ + + /** + * BO + */ BO("BO"), - - /** BR */ + + /** + * BR + */ BR("BR"), - - /** BS */ + + /** + * BS + */ BS("BS"), - - /** BT */ + + /** + * BT + */ BT("BT"), - - /** BW */ + + /** + * BW + */ BW("BW"), - - /** BY */ + + /** + * BY + */ BY("BY"), - - /** BZ */ + + /** + * BZ + */ BZ("BZ"), - - /** CA */ + + /** + * CA + */ CA("CA"), - - /** CC */ + + /** + * CC + */ CC("CC"), - - /** CD */ + + /** + * CD + */ CD("CD"), - - /** CF */ + + /** + * CF + */ CF("CF"), - - /** CG */ + + /** + * CG + */ CG("CG"), - - /** CH */ + + /** + * CH + */ CH("CH"), - - /** CI */ + + /** + * CI + */ CI("CI"), - - /** CK */ + + /** + * CK + */ CK("CK"), - - /** CL */ + + /** + * CL + */ CL("CL"), - - /** CM */ + + /** + * CM + */ CM("CM"), - - /** CN */ + + /** + * CN + */ CN("CN"), - - /** CO */ + + /** + * CO + */ CO("CO"), - - /** CR */ + + /** + * CR + */ CR("CR"), - - /** CU */ + + /** + * CU + */ CU("CU"), - - /** CV */ + + /** + * CV + */ CV("CV"), - - /** CW */ + + /** + * CW + */ CW("CW"), - - /** CX */ + + /** + * CX + */ CX("CX"), - - /** CY */ + + /** + * CY + */ CY("CY"), - - /** CZ */ + + /** + * CZ + */ CZ("CZ"), - - /** DE */ + + /** + * DE + */ DE("DE"), - - /** DJ */ + + /** + * DJ + */ DJ("DJ"), - - /** DK */ + + /** + * DK + */ DK("DK"), - - /** DM */ + + /** + * DM + */ DM("DM"), - - /** DO */ + + /** + * DO + */ DO("DO"), - - /** DZ */ + + /** + * DZ + */ DZ("DZ"), - - /** EC */ + + /** + * EC + */ EC("EC"), - - /** EE */ + + /** + * EE + */ EE("EE"), - - /** EG */ + + /** + * EG + */ EG("EG"), - - /** EH */ + + /** + * EH + */ EH("EH"), - - /** ER */ + + /** + * ER + */ ER("ER"), - - /** ES */ + + /** + * ES + */ ES("ES"), - - /** ET */ + + /** + * ET + */ ET("ET"), - - /** FI */ + + /** + * FI + */ FI("FI"), - - /** FJ */ + + /** + * FJ + */ FJ("FJ"), - - /** FK */ + + /** + * FK + */ FK("FK"), - - /** FM */ + + /** + * FM + */ FM("FM"), - - /** FO */ + + /** + * FO + */ FO("FO"), - - /** FR */ + + /** + * FR + */ FR("FR"), - - /** GA */ + + /** + * GA + */ GA("GA"), - - /** GB */ + + /** + * GB + */ GB("GB"), - - /** GD */ + + /** + * GD + */ GD("GD"), - - /** GE */ + + /** + * GE + */ GE("GE"), - - /** GG */ + + /** + * GG + */ GG("GG"), - - /** GH */ + + /** + * GH + */ GH("GH"), - - /** GI */ + + /** + * GI + */ GI("GI"), - - /** GL */ + + /** + * GL + */ GL("GL"), - - /** GM */ + + /** + * GM + */ GM("GM"), - - /** GN */ + + /** + * GN + */ GN("GN"), - - /** GQ */ + + /** + * GQ + */ GQ("GQ"), - - /** GR */ + + /** + * GR + */ GR("GR"), - - /** GT */ + + /** + * GT + */ GT("GT"), - - /** GU */ + + /** + * GU + */ GU("GU"), - - /** GW */ + + /** + * GW + */ GW("GW"), - - /** GY */ + + /** + * GY + */ GY("GY"), - - /** HK */ + + /** + * HK + */ HK("HK"), - - /** HN */ + + /** + * HN + */ HN("HN"), - - /** HR */ + + /** + * HR + */ HR("HR"), - - /** HT */ + + /** + * HT + */ HT("HT"), - - /** HU */ + + /** + * HU + */ HU("HU"), - - /** ID */ + + /** + * ID + */ ID("ID"), - - /** IE */ + + /** + * IE + */ IE("IE"), - - /** IL */ + + /** + * IL + */ IL("IL"), - - /** IM */ + + /** + * IM + */ IM("IM"), - - /** IN */ + + /** + * IN + */ IN("IN"), - - /** IO */ + + /** + * IO + */ IO("IO"), - - /** IQ */ + + /** + * IQ + */ IQ("IQ"), - - /** IR */ + + /** + * IR + */ IR("IR"), - - /** IS */ + + /** + * IS + */ IS("IS"), - - /** IT */ + + /** + * IT + */ IT("IT"), - - /** JE */ + + /** + * JE + */ JE("JE"), - - /** JM */ + + /** + * JM + */ JM("JM"), - - /** JO */ + + /** + * JO + */ JO("JO"), - - /** JP */ + + /** + * JP + */ JP("JP"), - - /** KE */ + + /** + * KE + */ KE("KE"), - - /** KG */ + + /** + * KG + */ KG("KG"), - - /** KH */ + + /** + * KH + */ KH("KH"), - - /** KI */ + + /** + * KI + */ KI("KI"), - - /** KM */ + + /** + * KM + */ KM("KM"), - - /** KN */ + + /** + * KN + */ KN("KN"), - - /** KP */ + + /** + * KP + */ KP("KP"), - - /** KR */ + + /** + * KR + */ KR("KR"), - - /** KW */ + + /** + * KW + */ KW("KW"), - - /** KY */ + + /** + * KY + */ KY("KY"), - - /** KZ */ + + /** + * KZ + */ KZ("KZ"), - - /** LA */ + + /** + * LA + */ LA("LA"), - - /** LB */ + + /** + * LB + */ LB("LB"), - - /** LC */ + + /** + * LC + */ LC("LC"), - - /** LI */ + + /** + * LI + */ LI("LI"), - - /** LK */ + + /** + * LK + */ LK("LK"), - - /** LR */ + + /** + * LR + */ LR("LR"), - - /** LS */ + + /** + * LS + */ LS("LS"), - - /** LT */ + + /** + * LT + */ LT("LT"), - - /** LU */ + + /** + * LU + */ LU("LU"), - - /** LV */ + + /** + * LV + */ LV("LV"), - - /** LY */ + + /** + * LY + */ LY("LY"), - - /** MA */ + + /** + * MA + */ MA("MA"), - - /** MC */ + + /** + * MC + */ MC("MC"), - - /** MD */ + + /** + * MD + */ MD("MD"), - - /** ME */ + + /** + * ME + */ ME("ME"), - - /** MF */ + + /** + * MF + */ MF("MF"), - - /** MG */ + + /** + * MG + */ MG("MG"), - - /** MH */ + + /** + * MH + */ MH("MH"), - - /** MK */ + + /** + * MK + */ MK("MK"), - - /** ML */ + + /** + * ML + */ ML("ML"), - - /** MM */ + + /** + * MM + */ MM("MM"), - - /** MN */ + + /** + * MN + */ MN("MN"), - - /** MO */ + + /** + * MO + */ MO("MO"), - - /** MP */ + + /** + * MP + */ MP("MP"), - - /** MR */ + + /** + * MR + */ MR("MR"), - - /** MS */ + + /** + * MS + */ MS("MS"), - - /** MT */ + + /** + * MT + */ MT("MT"), - - /** MU */ + + /** + * MU + */ MU("MU"), - - /** MV */ + + /** + * MV + */ MV("MV"), - - /** MW */ + + /** + * MW + */ MW("MW"), - - /** MX */ + + /** + * MX + */ MX("MX"), - - /** MY */ + + /** + * MY + */ MY("MY"), - - /** MZ */ + + /** + * MZ + */ MZ("MZ"), - - /** NA */ + + /** + * NA + */ NA("NA"), - - /** NC */ + + /** + * NC + */ NC("NC"), - - /** NE */ + + /** + * NE + */ NE("NE"), - - /** NG */ + + /** + * NG + */ NG("NG"), - - /** NI */ + + /** + * NI + */ NI("NI"), - - /** NL */ + + /** + * NL + */ NL("NL"), - - /** FALSE */ + + /** + * FALSE + */ FALSE("false"), - - /** NP */ + + /** + * NP + */ NP("NP"), - - /** NR */ + + /** + * NR + */ NR("NR"), - - /** NU */ + + /** + * NU + */ NU("NU"), - - /** NZ */ + + /** + * NZ + */ NZ("NZ"), - - /** OM */ + + /** + * OM + */ OM("OM"), - - /** PA */ + + /** + * PA + */ PA("PA"), - - /** PE */ + + /** + * PE + */ PE("PE"), - - /** PF */ + + /** + * PF + */ PF("PF"), - - /** PG */ + + /** + * PG + */ PG("PG"), - - /** PH */ + + /** + * PH + */ PH("PH"), - - /** PK */ + + /** + * PK + */ PK("PK"), - - /** PL */ + + /** + * PL + */ PL("PL"), - - /** PM */ + + /** + * PM + */ PM("PM"), - - /** PN */ + + /** + * PN + */ PN("PN"), - - /** PR */ + + /** + * PR + */ PR("PR"), - - /** PS */ + + /** + * PS + */ PS("PS"), - - /** PT */ + + /** + * PT + */ PT("PT"), - - /** PW */ + + /** + * PW + */ PW("PW"), - - /** PY */ + + /** + * PY + */ PY("PY"), - - /** QA */ + + /** + * QA + */ QA("QA"), - - /** RE */ + + /** + * RE + */ RE("RE"), - - /** RO */ + + /** + * RO + */ RO("RO"), - - /** RS */ + + /** + * RS + */ RS("RS"), - - /** RU */ + + /** + * RU + */ RU("RU"), - - /** RW */ + + /** + * RW + */ RW("RW"), - - /** SA */ + + /** + * SA + */ SA("SA"), - - /** SB */ + + /** + * SB + */ SB("SB"), - - /** SC */ + + /** + * SC + */ SC("SC"), - - /** SD */ + + /** + * SD + */ SD("SD"), - - /** SE */ + + /** + * SE + */ SE("SE"), - - /** SG */ + + /** + * SG + */ SG("SG"), - - /** SH */ + + /** + * SH + */ SH("SH"), - - /** SI */ + + /** + * SI + */ SI("SI"), - - /** SJ */ + + /** + * SJ + */ SJ("SJ"), - - /** SK */ + + /** + * SK + */ SK("SK"), - - /** SL */ + + /** + * SL + */ SL("SL"), - - /** SM */ + + /** + * SM + */ SM("SM"), - - /** SN */ + + /** + * SN + */ SN("SN"), - - /** SO */ + + /** + * SO + */ SO("SO"), - - /** SR */ + + /** + * SR + */ SR("SR"), - - /** SS */ + + /** + * SS + */ SS("SS"), - - /** ST */ + + /** + * ST + */ ST("ST"), - - /** SV */ + + /** + * SV + */ SV("SV"), - - /** SX */ + + /** + * SX + */ SX("SX"), - - /** SY */ + + /** + * SY + */ SY("SY"), - - /** SZ */ + + /** + * SZ + */ SZ("SZ"), - - /** TC */ + + /** + * TC + */ TC("TC"), - - /** TD */ + + /** + * TD + */ TD("TD"), - - /** TG */ + + /** + * TG + */ TG("TG"), - - /** TH */ + + /** + * TH + */ TH("TH"), - - /** TJ */ + + /** + * TJ + */ TJ("TJ"), - - /** TK */ + + /** + * TK + */ TK("TK"), - - /** TL */ + + /** + * TL + */ TL("TL"), - - /** TM */ + + /** + * TM + */ TM("TM"), - - /** TN */ + + /** + * TN + */ TN("TN"), - - /** TO */ + + /** + * TO + */ TO("TO"), - - /** TR */ + + /** + * TR + */ TR("TR"), - - /** TT */ + + /** + * TT + */ TT("TT"), - - /** TV */ + + /** + * TV + */ TV("TV"), - - /** TW */ + + /** + * TW + */ TW("TW"), - - /** TZ */ + + /** + * TZ + */ TZ("TZ"), - - /** UA */ + + /** + * UA + */ UA("UA"), - - /** UG */ + + /** + * UG + */ UG("UG"), - - /** US */ + + /** + * US + */ US("US"), - - /** UY */ + + /** + * UY + */ UY("UY"), - - /** UZ */ + + /** + * UZ + */ UZ("UZ"), - - /** VA */ + + /** + * VA + */ VA("VA"), - - /** VC */ + + /** + * VC + */ VC("VC"), - - /** VE */ + + /** + * VE + */ VE("VE"), - - /** VG */ + + /** + * VG + */ VG("VG"), - - /** VI */ + + /** + * VI + */ VI("VI"), - - /** VN */ + + /** + * VN + */ VN("VN"), - - /** VU */ + + /** + * VU + */ VU("VU"), - - /** WF */ + + /** + * WF + */ WF("WF"), - - /** WS */ + + /** + * WS + */ WS("WS"), - - /** XK */ + + /** + * XK + */ XK("XK"), - - /** YE */ + + /** + * YE + */ YE("YE"), - - /** YT */ + + /** + * YT + */ YT("YT"), - - /** ZA */ + + /** + * ZA + */ ZA("ZA"), - - /** ZM */ + + /** + * ZM + */ ZM("ZM"), - - /** ZW */ + + /** + * ZW + */ ZW("ZW"); private String value; @@ -747,26 +1236,24 @@ public enum CountryCode { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CountryCode fromValue(String value) { @@ -778,3 +1265,4 @@ public static CountryCode fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/bankfeeds/CreditDebitIndicator.java b/src/main/java/com/xero/models/bankfeeds/CreditDebitIndicator.java index ffe001f3f..1aa756aa0 100644 --- a/src/main/java/com/xero/models/bankfeeds/CreditDebitIndicator.java +++ b/src/main/java/com/xero/models/bankfeeds/CreditDebitIndicator.java @@ -9,22 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * If the statement balances are credit or debit, the CreditDebitIndicator should be specified from - * the perspective of the Customer. + * If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ public enum CreditDebitIndicator { - - /** CREDIT */ + + /** + * CREDIT + */ CREDIT("CREDIT"), - - /** DEBIT */ + + /** + * DEBIT + */ DEBIT("DEBIT"); private String value; @@ -33,26 +46,24 @@ public enum CreditDebitIndicator { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CreditDebitIndicator fromValue(String value) { @@ -64,3 +75,4 @@ public static CreditDebitIndicator fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/bankfeeds/CurrencyCode.java b/src/main/java/com/xero/models/bankfeeds/CurrencyCode.java index f93634b97..c859969f1 100644 --- a/src/main/java/com/xero/models/bankfeeds/CurrencyCode.java +++ b/src/main/java/com/xero/models/bankfeeds/CurrencyCode.java @@ -9,502 +9,840 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; - +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ +/** + * 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. + */ public enum CurrencyCode { - - /** AED */ + + /** + * AED + */ AED("AED"), - - /** AFN */ + + /** + * AFN + */ AFN("AFN"), - - /** ALL */ + + /** + * ALL + */ ALL("ALL"), - - /** AMD */ + + /** + * AMD + */ AMD("AMD"), - - /** ANG */ + + /** + * ANG + */ ANG("ANG"), - - /** AOA */ + + /** + * AOA + */ AOA("AOA"), - - /** ARS */ + + /** + * ARS + */ ARS("ARS"), - - /** AUD */ + + /** + * AUD + */ AUD("AUD"), - - /** AWG */ + + /** + * AWG + */ AWG("AWG"), - - /** AZN */ + + /** + * AZN + */ AZN("AZN"), - - /** BAM */ + + /** + * BAM + */ BAM("BAM"), - - /** BBD */ + + /** + * BBD + */ BBD("BBD"), - - /** BDT */ + + /** + * BDT + */ BDT("BDT"), - - /** BGN */ + + /** + * BGN + */ BGN("BGN"), - - /** BHD */ + + /** + * BHD + */ BHD("BHD"), - - /** BIF */ + + /** + * BIF + */ BIF("BIF"), - - /** BMD */ + + /** + * BMD + */ BMD("BMD"), - - /** BND */ + + /** + * BND + */ BND("BND"), - - /** BOB */ + + /** + * BOB + */ BOB("BOB"), - - /** BRL */ + + /** + * BRL + */ BRL("BRL"), - - /** BSD */ + + /** + * BSD + */ BSD("BSD"), - - /** BTN */ + + /** + * BTN + */ BTN("BTN"), - - /** BWP */ + + /** + * BWP + */ BWP("BWP"), - - /** BYN */ + + /** + * BYN + */ BYN("BYN"), - - /** BZD */ + + /** + * BZD + */ BZD("BZD"), - - /** CAD */ + + /** + * CAD + */ CAD("CAD"), - - /** CDF */ + + /** + * CDF + */ CDF("CDF"), - - /** CHF */ + + /** + * CHF + */ CHF("CHF"), - - /** CLP */ + + /** + * CLP + */ CLP("CLP"), - - /** CNY */ + + /** + * CNY + */ CNY("CNY"), - - /** COP */ + + /** + * COP + */ COP("COP"), - - /** CRC */ + + /** + * CRC + */ CRC("CRC"), - - /** CUC */ + + /** + * CUC + */ CUC("CUC"), - - /** CUP */ + + /** + * CUP + */ CUP("CUP"), - - /** CVE */ + + /** + * CVE + */ CVE("CVE"), - - /** CZK */ + + /** + * CZK + */ CZK("CZK"), - - /** DJF */ + + /** + * DJF + */ DJF("DJF"), - - /** DKK */ + + /** + * DKK + */ DKK("DKK"), - - /** DOP */ + + /** + * DOP + */ DOP("DOP"), - - /** DZD */ + + /** + * DZD + */ DZD("DZD"), - - /** EGP */ + + /** + * EGP + */ EGP("EGP"), - - /** ERN */ + + /** + * ERN + */ ERN("ERN"), - - /** ETB */ + + /** + * ETB + */ ETB("ETB"), - - /** EUR */ + + /** + * EUR + */ EUR("EUR"), - - /** FJD */ + + /** + * FJD + */ FJD("FJD"), - - /** FKP */ + + /** + * FKP + */ FKP("FKP"), - - /** GBP */ + + /** + * GBP + */ GBP("GBP"), - - /** GEL */ + + /** + * GEL + */ GEL("GEL"), - - /** GGP */ + + /** + * GGP + */ GGP("GGP"), - - /** GHS */ + + /** + * GHS + */ GHS("GHS"), - - /** GIP */ + + /** + * GIP + */ GIP("GIP"), - - /** GMD */ + + /** + * GMD + */ GMD("GMD"), - - /** GNF */ + + /** + * GNF + */ GNF("GNF"), - - /** GTQ */ + + /** + * GTQ + */ GTQ("GTQ"), - - /** GYD */ + + /** + * GYD + */ GYD("GYD"), - - /** HKD */ + + /** + * HKD + */ HKD("HKD"), - - /** HNL */ + + /** + * HNL + */ HNL("HNL"), - - /** HRK */ + + /** + * HRK + */ HRK("HRK"), - - /** HTG */ + + /** + * HTG + */ HTG("HTG"), - - /** HUF */ + + /** + * HUF + */ HUF("HUF"), - - /** IDR */ + + /** + * IDR + */ IDR("IDR"), - - /** ILS */ + + /** + * ILS + */ ILS("ILS"), - - /** IMP */ + + /** + * IMP + */ IMP("IMP"), - - /** INR */ + + /** + * INR + */ INR("INR"), - - /** IQD */ + + /** + * IQD + */ IQD("IQD"), - - /** IRR */ + + /** + * IRR + */ IRR("IRR"), - - /** ISK */ + + /** + * ISK + */ ISK("ISK"), - - /** JEP */ + + /** + * JEP + */ JEP("JEP"), - - /** JMD */ + + /** + * JMD + */ JMD("JMD"), - - /** JOD */ + + /** + * JOD + */ JOD("JOD"), - - /** JPY */ + + /** + * JPY + */ JPY("JPY"), - - /** KES */ + + /** + * KES + */ KES("KES"), - - /** KGS */ + + /** + * KGS + */ KGS("KGS"), - - /** KHR */ + + /** + * KHR + */ KHR("KHR"), - - /** KMF */ + + /** + * KMF + */ KMF("KMF"), - - /** KPW */ + + /** + * KPW + */ KPW("KPW"), - - /** KRW */ + + /** + * KRW + */ KRW("KRW"), - - /** KWD */ + + /** + * KWD + */ KWD("KWD"), - - /** KYD */ + + /** + * KYD + */ KYD("KYD"), - - /** KZT */ + + /** + * KZT + */ KZT("KZT"), - - /** LAK */ + + /** + * LAK + */ LAK("LAK"), - - /** LBP */ + + /** + * LBP + */ LBP("LBP"), - - /** LKR */ + + /** + * LKR + */ LKR("LKR"), - - /** LRD */ + + /** + * LRD + */ LRD("LRD"), - - /** LSL */ + + /** + * LSL + */ LSL("LSL"), - - /** LYD */ + + /** + * LYD + */ LYD("LYD"), - - /** MAD */ + + /** + * MAD + */ MAD("MAD"), - - /** MDL */ + + /** + * MDL + */ MDL("MDL"), - - /** MGA */ + + /** + * MGA + */ MGA("MGA"), - - /** MKD */ + + /** + * MKD + */ MKD("MKD"), - - /** MMK */ + + /** + * MMK + */ MMK("MMK"), - - /** MNT */ + + /** + * MNT + */ MNT("MNT"), - - /** MOP */ + + /** + * MOP + */ MOP("MOP"), - - /** MRU */ + + /** + * MRU + */ MRU("MRU"), - - /** MUR */ + + /** + * MUR + */ MUR("MUR"), - - /** MVR */ + + /** + * MVR + */ MVR("MVR"), - - /** MWK */ + + /** + * MWK + */ MWK("MWK"), - - /** MXN */ + + /** + * MXN + */ MXN("MXN"), - - /** MYR */ + + /** + * MYR + */ MYR("MYR"), - - /** MZN */ + + /** + * MZN + */ MZN("MZN"), - - /** NAD */ + + /** + * NAD + */ NAD("NAD"), - - /** NGN */ + + /** + * NGN + */ NGN("NGN"), - - /** NIO */ + + /** + * NIO + */ NIO("NIO"), - - /** NOK */ + + /** + * NOK + */ NOK("NOK"), - - /** NPR */ + + /** + * NPR + */ NPR("NPR"), - - /** NZD */ + + /** + * NZD + */ NZD("NZD"), - - /** OMR */ + + /** + * OMR + */ OMR("OMR"), - - /** PAB */ + + /** + * PAB + */ PAB("PAB"), - - /** PEN */ + + /** + * PEN + */ PEN("PEN"), - - /** PGK */ + + /** + * PGK + */ PGK("PGK"), - - /** PHP */ + + /** + * PHP + */ PHP("PHP"), - - /** PKR */ + + /** + * PKR + */ PKR("PKR"), - - /** PLN */ + + /** + * PLN + */ PLN("PLN"), - - /** PYG */ + + /** + * PYG + */ PYG("PYG"), - - /** QAR */ + + /** + * QAR + */ QAR("QAR"), - - /** RON */ + + /** + * RON + */ RON("RON"), - - /** RSD */ + + /** + * RSD + */ RSD("RSD"), - - /** RUB */ + + /** + * RUB + */ RUB("RUB"), - - /** RWF */ + + /** + * RWF + */ RWF("RWF"), - - /** SAR */ + + /** + * SAR + */ SAR("SAR"), - - /** SBD */ + + /** + * SBD + */ SBD("SBD"), - - /** SCR */ + + /** + * SCR + */ SCR("SCR"), - - /** SDG */ + + /** + * SDG + */ SDG("SDG"), - - /** SEK */ + + /** + * SEK + */ SEK("SEK"), - - /** SGD */ + + /** + * SGD + */ SGD("SGD"), - - /** SHP */ + + /** + * SHP + */ SHP("SHP"), - - /** SLL */ + + /** + * SLL + */ SLL("SLL"), - - /** SOS */ + + /** + * SOS + */ SOS("SOS"), - - /** SPL */ + + /** + * SPL + */ SPL("SPL"), - - /** SRD */ + + /** + * SRD + */ SRD("SRD"), - - /** STN */ + + /** + * STN + */ STN("STN"), - - /** SVC */ + + /** + * SVC + */ SVC("SVC"), - - /** SYP */ + + /** + * SYP + */ SYP("SYP"), - - /** SZL */ + + /** + * SZL + */ SZL("SZL"), - - /** THB */ + + /** + * THB + */ THB("THB"), - - /** TJS */ + + /** + * TJS + */ TJS("TJS"), - - /** TMT */ + + /** + * TMT + */ TMT("TMT"), - - /** TND */ + + /** + * TND + */ TND("TND"), - - /** TOP */ + + /** + * TOP + */ TOP("TOP"), - - /** TRY */ + + /** + * TRY + */ TRY("TRY"), - - /** TTD */ + + /** + * TTD + */ TTD("TTD"), - - /** TVD */ + + /** + * TVD + */ TVD("TVD"), - - /** TWD */ + + /** + * TWD + */ TWD("TWD"), - - /** TZS */ + + /** + * TZS + */ TZS("TZS"), - - /** UAH */ + + /** + * UAH + */ UAH("UAH"), - - /** UGX */ + + /** + * UGX + */ UGX("UGX"), - - /** USD */ + + /** + * USD + */ USD("USD"), - - /** UYU */ + + /** + * UYU + */ UYU("UYU"), - - /** UZS */ + + /** + * UZS + */ UZS("UZS"), - - /** VEF */ + + /** + * VEF + */ VEF("VEF"), - - /** VND */ + + /** + * VND + */ VND("VND"), - - /** VUV */ + + /** + * VUV + */ VUV("VUV"), - - /** WST */ + + /** + * WST + */ WST("WST"), - - /** XAF */ + + /** + * XAF + */ XAF("XAF"), - - /** XCD */ + + /** + * XCD + */ XCD("XCD"), - - /** XDR */ + + /** + * XDR + */ XDR("XDR"), - - /** XOF */ + + /** + * XOF + */ XOF("XOF"), - - /** XPF */ + + /** + * XPF + */ XPF("XPF"), - - /** YER */ + + /** + * YER + */ YER("YER"), - - /** ZAR */ + + /** + * ZAR + */ ZAR("ZAR"), - - /** ZMW */ + + /** + * ZMW + */ ZMW("ZMW"), - - /** ZMK */ + + /** + * ZMK + */ ZMK("ZMK"), - - /** ZWD */ + + /** + * ZWD + */ ZWD("ZWD"); private String value; @@ -513,26 +851,24 @@ public enum CurrencyCode { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CurrencyCode fromValue(String value) { @@ -544,3 +880,4 @@ public static CurrencyCode fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/bankfeeds/EndBalance.java b/src/main/java/com/xero/models/bankfeeds/EndBalance.java index dd175fb82..d25c5a6e1 100644 --- a/src/main/java/com/xero/models/bankfeeds/EndBalance.java +++ b/src/main/java/com/xero/models/bankfeeds/EndBalance.java @@ -9,21 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.bankfeeds.CreditDebitIndicator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; /** * The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ -@ApiModel( - description = - "The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance" - + " Amount.") +@ApiModel(description = "The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount.") + public class EndBalance { StringUtil util = new StringUtil(); @@ -33,75 +45,70 @@ public class EndBalance { @JsonProperty("creditDebitIndicator") private CreditDebitIndicator creditDebitIndicator; /** - * amount - * - * @param amount Double - * @return EndBalance - */ + * amount + * @param amount Double + * @return EndBalance + **/ public EndBalance amount(Double amount) { this.amount = amount; return this; } - /** + /** * Get amount - * * @return amount - */ + **/ @ApiModelProperty(example = "10.1340", value = "") - /** + /** * amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * amount - * - * @param amount Double - */ + /** + * amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * creditDebitIndicator - * - * @param creditDebitIndicator CreditDebitIndicator - * @return EndBalance - */ + * creditDebitIndicator + * @param creditDebitIndicator CreditDebitIndicator + * @return EndBalance + **/ public EndBalance creditDebitIndicator(CreditDebitIndicator creditDebitIndicator) { this.creditDebitIndicator = creditDebitIndicator; return this; } - /** + /** * Get creditDebitIndicator - * * @return creditDebitIndicator - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditDebitIndicator - * * @return creditDebitIndicator CreditDebitIndicator - */ + **/ public CreditDebitIndicator getCreditDebitIndicator() { return creditDebitIndicator; } - /** - * creditDebitIndicator - * - * @param creditDebitIndicator CreditDebitIndicator - */ + /** + * creditDebitIndicator + * @param creditDebitIndicator CreditDebitIndicator + **/ + public void setCreditDebitIndicator(CreditDebitIndicator creditDebitIndicator) { this.creditDebitIndicator = creditDebitIndicator; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,8 +118,8 @@ public boolean equals(java.lang.Object o) { return false; } EndBalance endBalance = (EndBalance) o; - return Objects.equals(this.amount, endBalance.amount) - && Objects.equals(this.creditDebitIndicator, endBalance.creditDebitIndicator); + return Objects.equals(this.amount, endBalance.amount) && + Objects.equals(this.creditDebitIndicator, endBalance.creditDebitIndicator); } @Override @@ -120,20 +127,20 @@ public int hashCode() { return Objects.hash(amount, creditDebitIndicator); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EndBalance {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" creditDebitIndicator: ") - .append(toIndentedString(creditDebitIndicator)) - .append("\n"); + sb.append(" creditDebitIndicator: ").append(toIndentedString(creditDebitIndicator)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -141,4 +148,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/Error.java b/src/main/java/com/xero/models/bankfeeds/Error.java index aaa7e1e8e..3d31db81a 100644 --- a/src/main/java/com/xero/models/bankfeeds/Error.java +++ b/src/main/java/com/xero/models/bankfeeds/Error.java @@ -9,24 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; /** - * On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx - * and a Content-Type of application/problem+json. + * On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ -@ApiModel( - description = - "On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx" - + " or 5xx and a Content-Type of application/problem+json.") +@ApiModel(description = "On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json.") + public class Error { StringUtil util = new StringUtil(); @@ -38,71 +46,113 @@ public class Error { @JsonProperty("detail") private String detail; - /** Identifies the type of error. */ + /** + * Identifies the type of error. + */ public enum TypeEnum { - /** INVALID_REQUEST */ + /** + * INVALID_REQUEST + */ INVALID_REQUEST("invalid-request"), - - /** INVALID_APPLICATION */ + + /** + * INVALID_APPLICATION + */ INVALID_APPLICATION("invalid-application"), - - /** INVALID_FEED_CONNECTION */ + + /** + * INVALID_FEED_CONNECTION + */ INVALID_FEED_CONNECTION("invalid-feed-connection"), - - /** DUPLICATE_STATEMENT */ + + /** + * DUPLICATE_STATEMENT + */ DUPLICATE_STATEMENT("duplicate-statement"), - - /** INVALID_END_BALANCE */ + + /** + * INVALID_END_BALANCE + */ INVALID_END_BALANCE("invalid-end-balance"), - - /** INVALID_START_AND_END_DATE */ + + /** + * INVALID_START_AND_END_DATE + */ INVALID_START_AND_END_DATE("invalid-start-and-end-date"), - - /** INVALID_START_DATE */ + + /** + * INVALID_START_DATE + */ INVALID_START_DATE("invalid-start-date"), - - /** INTERNAL_ERROR */ + + /** + * INTERNAL_ERROR + */ INTERNAL_ERROR("internal-error"), - - /** FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION */ - FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION( - "feed-already-connected-in-current-organisation"), - - /** INVALID_END_DATE */ + + /** + * FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION + */ + FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION("feed-already-connected-in-current-organisation"), + + /** + * INVALID_END_DATE + */ INVALID_END_DATE("invalid-end-date"), - - /** STATEMENT_NOT_FOUND */ + + /** + * STATEMENT_NOT_FOUND + */ STATEMENT_NOT_FOUND("statement-not-found"), - - /** FEED_CONNECTED_IN_DIFFERENT_ORGANISATION */ + + /** + * FEED_CONNECTED_IN_DIFFERENT_ORGANISATION + */ FEED_CONNECTED_IN_DIFFERENT_ORGANISATION("feed-connected-in-different-organisation"), - - /** FEED_ALREADY_CONNECTED_IN_DIFFERENT_ORGANISATION */ - FEED_ALREADY_CONNECTED_IN_DIFFERENT_ORGANISATION( - "feed-already-connected-in-different-organisation"), - - /** BANK_FEED_NOT_FOUND */ + + /** + * FEED_ALREADY_CONNECTED_IN_DIFFERENT_ORGANISATION + */ + FEED_ALREADY_CONNECTED_IN_DIFFERENT_ORGANISATION("feed-already-connected-in-different-organisation"), + + /** + * BANK_FEED_NOT_FOUND + */ BANK_FEED_NOT_FOUND("bank-feed-not-found"), - - /** INVALID_COUNTRY_SPECIFIED */ + + /** + * INVALID_COUNTRY_SPECIFIED + */ INVALID_COUNTRY_SPECIFIED("invalid-country-specified"), - - /** INVALID_ORGANISATION_BANK_FEEDS */ + + /** + * INVALID_ORGANISATION_BANK_FEEDS + */ INVALID_ORGANISATION_BANK_FEEDS("invalid-organisation-bank-feeds"), - - /** INVALID_ORGANISATION_MULTI_CURRENCY */ + + /** + * INVALID_ORGANISATION_MULTI_CURRENCY + */ INVALID_ORGANISATION_MULTI_CURRENCY("invalid-organisation-multi-currency"), - - /** INVALID_FEED_CONNECTION_FOR_ORGANISATION */ + + /** + * INVALID_FEED_CONNECTION_FOR_ORGANISATION + */ INVALID_FEED_CONNECTION_FOR_ORGANISATION("invalid-feed-connection-for-organisation"), - - /** INVALID_USER_ROLE */ + + /** + * INVALID_USER_ROLE + */ INVALID_USER_ROLE("invalid-user-role"), - - /** ACCOUNT_NOT_VALID */ + + /** + * ACCOUNT_NOT_VALID + */ ACCOUNT_NOT_VALID("account-not-valid"), - - /** FEED_NOT_FOUND_OR_ALREADY_DELETED */ + + /** + * FEED_NOT_FOUND_OR_ALREADY_DELETED + */ FEED_NOT_FOUND_OR_ALREADY_DELETED("feed-not-found-or-already-deleted"); private String value; @@ -111,31 +161,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -147,152 +191,138 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("type") private TypeEnum type; /** - * Human readable high level error description. - * - * @param title String - * @return Error - */ + * Human readable high level error description. + * @param title String + * @return Error + **/ public Error title(String title) { this.title = title; return this; } - /** + /** * Human readable high level error description. - * * @return title - */ - @ApiModelProperty( - example = "Invalid Application", - value = "Human readable high level error description.") - /** + **/ + @ApiModelProperty(example = "Invalid Application", value = "Human readable high level error description.") + /** * Human readable high level error description. - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Human readable high level error description. - * - * @param title String - */ + /** + * Human readable high level error description. + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * The numeric HTTP Status Code, e.g. 404 - * - * @param status Integer - * @return Error - */ + * The numeric HTTP Status Code, e.g. 404 + * @param status Integer + * @return Error + **/ public Error status(Integer status) { this.status = status; return this; } - /** + /** * The numeric HTTP Status Code, e.g. 404 - * * @return status - */ + **/ @ApiModelProperty(example = "403", value = "The numeric HTTP Status Code, e.g. 404") - /** + /** * The numeric HTTP Status Code, e.g. 404 - * * @return status Integer - */ + **/ public Integer getStatus() { return status; } - /** - * The numeric HTTP Status Code, e.g. 404 - * - * @param status Integer - */ + /** + * The numeric HTTP Status Code, e.g. 404 + * @param status Integer + **/ + public void setStatus(Integer status) { this.status = status; } /** - * Human readable detailed error description. - * - * @param detail String - * @return Error - */ + * Human readable detailed error description. + * @param detail String + * @return Error + **/ public Error detail(String detail) { this.detail = detail; return this; } - /** + /** * Human readable detailed error description. - * * @return detail - */ - @ApiModelProperty( - example = "The application has not been configured to use these API endpoints.", - value = "Human readable detailed error description.") - /** + **/ + @ApiModelProperty(example = "The application has not been configured to use these API endpoints.", value = "Human readable detailed error description.") + /** * Human readable detailed error description. - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * Human readable detailed error description. - * - * @param detail String - */ + /** + * Human readable detailed error description. + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } /** - * Identifies the type of error. - * - * @param type TypeEnum - * @return Error - */ + * Identifies the type of error. + * @param type TypeEnum + * @return Error + **/ public Error type(TypeEnum type) { this.type = type; return this; } - /** + /** * Identifies the type of error. - * * @return type - */ + **/ @ApiModelProperty(example = "invalid-application", value = "Identifies the type of error.") - /** + /** * Identifies the type of error. - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * Identifies the type of error. - * - * @param type TypeEnum - */ + /** + * Identifies the type of error. + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -302,10 +332,10 @@ public boolean equals(java.lang.Object o) { return false; } Error error = (Error) o; - return Objects.equals(this.title, error.title) - && Objects.equals(this.status, error.status) - && Objects.equals(this.detail, error.detail) - && Objects.equals(this.type, error.type); + return Objects.equals(this.title, error.title) && + Objects.equals(this.status, error.status) && + Objects.equals(this.detail, error.detail) && + Objects.equals(this.type, error.type); } @Override @@ -313,6 +343,7 @@ public int hashCode() { return Objects.hash(title, status, detail, type); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -326,7 +357,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -334,4 +366,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/FeedConnection.java b/src/main/java/com/xero/models/bankfeeds/FeedConnection.java index d1d47b2d2..d54994cde 100644 --- a/src/main/java/com/xero/models/bankfeeds/FeedConnection.java +++ b/src/main/java/com/xero/models/bankfeeds/FeedConnection.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.bankfeeds.CountryCode; +import com.xero.models.bankfeeds.CurrencyCode; +import com.xero.models.bankfeeds.Error; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * FeedConnection + */ -/** FeedConnection */ public class FeedConnection { StringUtil util = new StringUtil(); @@ -38,14 +56,17 @@ public class FeedConnection { @JsonProperty("accountId") private UUID accountId; /** - * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other - * than credit cards. + * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. */ public enum AccountTypeEnum { - /** BANK */ + /** + * BANK + */ BANK("BANK"), - - /** CREDITCARD */ + + /** + * CREDITCARD + */ CREDITCARD("CREDITCARD"); private String value; @@ -54,31 +75,25 @@ public enum AccountTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static AccountTypeEnum fromValue(String value) { for (AccountTypeEnum b : AccountTypeEnum.values()) { @@ -90,6 +105,7 @@ public static AccountTypeEnum fromValue(String value) { } } + @JsonProperty("accountType") private AccountTypeEnum accountType; @@ -98,12 +114,18 @@ public static AccountTypeEnum fromValue(String value) { @JsonProperty("country") private CountryCode country; - /** the current status of the feed connection */ + /** + * the current status of the feed connection + */ public enum StatusEnum { - /** PENDING */ + /** + * PENDING + */ PENDING("PENDING"), - - /** REJECTED */ + + /** + * REJECTED + */ REJECTED("REJECTED"); private String value; @@ -112,31 +134,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -148,410 +164,333 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; @JsonProperty("error") private Error error; /** - * GUID used to identify the Account. - * - * @param id UUID - * @return FeedConnection - */ + * GUID used to identify the Account. + * @param id UUID + * @return FeedConnection + **/ public FeedConnection id(UUID id) { this.id = id; return this; } - /** + /** * GUID used to identify the Account. - * * @return id - */ - @ApiModelProperty( - example = "00d3cf8d-95dc-4466-8dc0-47e6d1197e28", - value = "GUID used to identify the Account.") - /** + **/ + @ApiModelProperty(example = "00d3cf8d-95dc-4466-8dc0-47e6d1197e28", value = "GUID used to identify the Account.") + /** * GUID used to identify the Account. - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * GUID used to identify the Account. - * - * @param id UUID - */ + /** + * GUID used to identify the Account. + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * This account identifier is generated by the financial institute (FI). This must be unique for - * your financial institute. - * - * @param accountToken String - * @return FeedConnection - */ + * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. + * @param accountToken String + * @return FeedConnection + **/ public FeedConnection accountToken(String accountToken) { this.accountToken = accountToken; return this; } - /** - * This account identifier is generated by the financial institute (FI). This must be unique for - * your financial institute. - * + /** + * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. * @return accountToken - */ - @ApiModelProperty( - example = "10000123", - value = - "This account identifier is generated by the financial institute (FI). This must be" - + " unique for your financial institute.") - /** - * This account identifier is generated by the financial institute (FI). This must be unique for - * your financial institute. - * + **/ + @ApiModelProperty(example = "10000123", value = "This account identifier is generated by the financial institute (FI). This must be unique for your financial institute.") + /** + * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. * @return accountToken String - */ + **/ public String getAccountToken() { return accountToken; } - /** - * This account identifier is generated by the financial institute (FI). This must be unique for - * your financial institute. - * - * @param accountToken String - */ + /** + * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. + * @param accountToken String + **/ + public void setAccountToken(String accountToken) { this.accountToken = accountToken; } /** - * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number - * is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account - * if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be - * supplied for Credit Card numbers. Must be included if AccountId is not specified. - * - * @param accountNumber String - * @return FeedConnection - */ + * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. + * @param accountNumber String + * @return FeedConnection + **/ public FeedConnection accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** - * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number - * is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account - * if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be - * supplied for Credit Card numbers. Must be included if AccountId is not specified. - * + /** + * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. * @return accountNumber - */ - @ApiModelProperty( - example = "3809087654321500", - value = - "String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The" - + " Account Number is used to match the feed to a Xero Bank Account. The API will" - + " create a new Xero Bank Account if a match to an existing Xero Bank Account is" - + " not found. Only the last 4 digits must be supplied for Credit Card numbers. Must" - + " be included if AccountId is not specified.") - /** - * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number - * is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account - * if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be - * supplied for Credit Card numbers. Must be included if AccountId is not specified. - * + **/ + @ApiModelProperty(example = "3809087654321500", value = "String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified.") + /** + * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number - * is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account - * if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be - * supplied for Credit Card numbers. Must be included if AccountId is not specified. - * - * @param accountNumber String - */ + /** + * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero - * Bank Account is not found. - * - * @param accountName String - * @return FeedConnection - */ + * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. + * @param accountName String + * @return FeedConnection + **/ public FeedConnection accountName(String accountName) { this.accountName = accountName; return this; } - /** - * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero - * Bank Account is not found. - * + /** + * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. * @return accountName - */ - @ApiModelProperty( - example = "Joe's Savings Account", - value = - "The Account Name will be used for the creation of a new Xero Bank Account if a matching" - + " Xero Bank Account is not found.") - /** - * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero - * Bank Account is not found. - * + **/ + @ApiModelProperty(example = "Joe's Savings Account", value = "The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found.") + /** + * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero - * Bank Account is not found. - * - * @param accountName String - */ + /** + * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. - * - * @param accountId UUID - * @return FeedConnection - */ + * Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. + * @param accountId UUID + * @return FeedConnection + **/ public FeedConnection accountId(UUID accountId) { this.accountId = accountId; return this; } - /** + /** * Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. - * * @return accountId - */ - @ApiModelProperty( - example = "079a88ea-276d-41fb-a1f1-366ef3e22921", - value = - "Xero identifier for a bank account in Xero. Must be included if AccountNumber is not" - + " specified.") - /** + **/ + @ApiModelProperty(example = "079a88ea-276d-41fb-a1f1-366ef3e22921", value = "Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified.") + /** * Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. - * * @return accountId UUID - */ + **/ public UUID getAccountId() { return accountId; } - /** - * Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. - * - * @param accountId UUID - */ + /** + * Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. + * @param accountId UUID + **/ + public void setAccountId(UUID accountId) { this.accountId = accountId; } /** - * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other - * than credit cards. - * - * @param accountType AccountTypeEnum - * @return FeedConnection - */ + * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. + * @param accountType AccountTypeEnum + * @return FeedConnection + **/ public FeedConnection accountType(AccountTypeEnum accountType) { this.accountType = accountType; return this; } - /** - * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other - * than credit cards. - * + /** + * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. * @return accountType - */ - @ApiModelProperty( - example = "BANK", - value = - "High level bank account type - BANK CREDITCARD BANK encompasses all bank account types" - + " other than credit cards.") - /** - * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other - * than credit cards. - * + **/ + @ApiModelProperty(example = "BANK", value = "High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards.") + /** + * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. * @return accountType AccountTypeEnum - */ + **/ public AccountTypeEnum getAccountType() { return accountType; } - /** - * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other - * than credit cards. - * - * @param accountType AccountTypeEnum - */ + /** + * High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. + * @param accountType AccountTypeEnum + **/ + public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; } /** - * currency - * - * @param currency CurrencyCode - * @return FeedConnection - */ + * currency + * @param currency CurrencyCode + * @return FeedConnection + **/ public FeedConnection currency(CurrencyCode currency) { this.currency = currency; return this; } - /** + /** * Get currency - * * @return currency - */ + **/ @ApiModelProperty(value = "") - /** + /** * currency - * * @return currency CurrencyCode - */ + **/ public CurrencyCode getCurrency() { return currency; } - /** - * currency - * - * @param currency CurrencyCode - */ + /** + * currency + * @param currency CurrencyCode + **/ + public void setCurrency(CurrencyCode currency) { this.currency = currency; } /** - * country - * - * @param country CountryCode - * @return FeedConnection - */ + * country + * @param country CountryCode + * @return FeedConnection + **/ public FeedConnection country(CountryCode country) { this.country = country; return this; } - /** + /** * Get country - * * @return country - */ + **/ @ApiModelProperty(value = "") - /** + /** * country - * * @return country CountryCode - */ + **/ public CountryCode getCountry() { return country; } - /** - * country - * - * @param country CountryCode - */ + /** + * country + * @param country CountryCode + **/ + public void setCountry(CountryCode country) { this.country = country; } /** - * the current status of the feed connection - * - * @param status StatusEnum - * @return FeedConnection - */ + * the current status of the feed connection + * @param status StatusEnum + * @return FeedConnection + **/ public FeedConnection status(StatusEnum status) { this.status = status; return this; } - /** + /** * the current status of the feed connection - * * @return status - */ + **/ @ApiModelProperty(example = "REJECTED", value = "the current status of the feed connection") - /** + /** * the current status of the feed connection - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * the current status of the feed connection - * - * @param status StatusEnum - */ + /** + * the current status of the feed connection + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * error - * - * @param error Error - * @return FeedConnection - */ + * error + * @param error Error + * @return FeedConnection + **/ public FeedConnection error(Error error) { this.error = error; return this; } - /** + /** * Get error - * * @return error - */ + **/ @ApiModelProperty(value = "") - /** + /** * error - * * @return error Error - */ + **/ public Error getError() { return error; } - /** - * error - * - * @param error Error - */ + /** + * error + * @param error Error + **/ + public void setError(Error error) { this.error = error; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -561,33 +500,24 @@ public boolean equals(java.lang.Object o) { return false; } FeedConnection feedConnection = (FeedConnection) o; - return Objects.equals(this.id, feedConnection.id) - && Objects.equals(this.accountToken, feedConnection.accountToken) - && Objects.equals(this.accountNumber, feedConnection.accountNumber) - && Objects.equals(this.accountName, feedConnection.accountName) - && Objects.equals(this.accountId, feedConnection.accountId) - && Objects.equals(this.accountType, feedConnection.accountType) - && Objects.equals(this.currency, feedConnection.currency) - && Objects.equals(this.country, feedConnection.country) - && Objects.equals(this.status, feedConnection.status) - && Objects.equals(this.error, feedConnection.error); + return Objects.equals(this.id, feedConnection.id) && + Objects.equals(this.accountToken, feedConnection.accountToken) && + Objects.equals(this.accountNumber, feedConnection.accountNumber) && + Objects.equals(this.accountName, feedConnection.accountName) && + Objects.equals(this.accountId, feedConnection.accountId) && + Objects.equals(this.accountType, feedConnection.accountType) && + Objects.equals(this.currency, feedConnection.currency) && + Objects.equals(this.country, feedConnection.country) && + Objects.equals(this.status, feedConnection.status) && + Objects.equals(this.error, feedConnection.error); } @Override public int hashCode() { - return Objects.hash( - id, - accountToken, - accountNumber, - accountName, - accountId, - accountType, - currency, - country, - status, - error); + return Objects.hash(id, accountToken, accountNumber, accountName, accountId, accountType, currency, country, status, error); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -607,7 +537,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -615,4 +546,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/FeedConnections.java b/src/main/java/com/xero/models/bankfeeds/FeedConnections.java index b6aefc339..5f7c3b1e4 100644 --- a/src/main/java/com/xero/models/bankfeeds/FeedConnections.java +++ b/src/main/java/com/xero/models/bankfeeds/FeedConnections.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.bankfeeds.FeedConnection; +import com.xero.models.bankfeeds.Pagination; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * FeedConnections + */ -/** FeedConnections */ public class FeedConnections { StringUtil util = new StringUtil(); @@ -28,46 +47,42 @@ public class FeedConnections { @JsonProperty("items") private List items = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return FeedConnections - */ + * pagination + * @param pagination Pagination + * @return FeedConnections + **/ public FeedConnections pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * items - * - * @param items List<FeedConnection> - * @return FeedConnections - */ + * items + * @param items List<FeedConnection> + * @return FeedConnections + **/ public FeedConnections items(List items) { this.items = items; return this; @@ -75,10 +90,9 @@ public FeedConnections items(List items) { /** * items - * - * @param itemsItem FeedConnection + * @param itemsItem FeedConnection * @return FeedConnections - */ + **/ public FeedConnections addItemsItem(FeedConnection itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -87,30 +101,29 @@ public FeedConnections addItemsItem(FeedConnection itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<FeedConnection> - */ + /** + * items + * @param items List<FeedConnection> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } FeedConnections feedConnections = (FeedConnections) o; - return Objects.equals(this.pagination, feedConnections.pagination) - && Objects.equals(this.items, feedConnections.items); + return Objects.equals(this.pagination, feedConnections.pagination) && + Objects.equals(this.items, feedConnections.items); } @Override @@ -129,6 +142,7 @@ public int hashCode() { return Objects.hash(pagination, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/Pagination.java b/src/main/java/com/xero/models/bankfeeds/Pagination.java index f9c49c535..9d3868791 100644 --- a/src/main/java/com/xero/models/bankfeeds/Pagination.java +++ b/src/main/java/com/xero/models/bankfeeds/Pagination.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Pagination + */ -/** Pagination */ public class Pagination { StringUtil util = new StringUtil(); @@ -32,176 +49,134 @@ public class Pagination { @JsonProperty("itemCount") private Integer itemCount; /** - * Page number which specifies the set of records to retrieve. Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the - * records. When page value is not a number or a negative number, by default, the first set of - * records is returned. - * - * @param page Integer - * @return Pagination - */ + * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * @param page Integer + * @return Pagination + **/ public Pagination page(Integer page) { this.page = page; return this; } - /** - * Page number which specifies the set of records to retrieve. Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the - * records. When page value is not a number or a negative number, by default, the first set of - * records is returned. - * + /** + * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. * @return page - */ - @ApiModelProperty( - example = "1", - value = - "Page number which specifies the set of records to retrieve. Example -" - + " https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set" - + " of the records. When page value is not a number or a negative number, by" - + " default, the first set of records is returned.") - /** - * Page number which specifies the set of records to retrieve. Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the - * records. When page value is not a number or a negative number, by default, the first set of - * records is returned. - * + **/ + @ApiModelProperty(example = "1", value = "Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned.") + /** + * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. * @return page Integer - */ + **/ public Integer getPage() { return page; } - /** - * Page number which specifies the set of records to retrieve. Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the - * records. When page value is not a number or a negative number, by default, the first set of - * records is returned. - * - * @param page Integer - */ + /** + * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * @param page Integer + **/ + public void setPage(Integer page) { this.page = page; } /** - * Page size which specifies how many records per page will be returned (default 50). Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of - * 100. - * - * @param pageSize Integer - * @return Pagination - */ + * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * @param pageSize Integer + * @return Pagination + **/ public Pagination pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } - /** - * Page size which specifies how many records per page will be returned (default 50). Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of - * 100. - * + /** + * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. * @return pageSize - */ - @ApiModelProperty( - example = "10", - value = - "Page size which specifies how many records per page will be returned (default 50)." - + " Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to" - + " specify page size of 100.") - /** - * Page size which specifies how many records per page will be returned (default 50). Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of - * 100. - * + **/ + @ApiModelProperty(example = "10", value = "Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100.") + /** + * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. * @return pageSize Integer - */ + **/ public Integer getPageSize() { return pageSize; } - /** - * Page size which specifies how many records per page will be returned (default 50). Example - - * https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of - * 100. - * - * @param pageSize Integer - */ + /** + * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * @param pageSize Integer + **/ + public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** - * Number of pages available - * - * @param pageCount Integer - * @return Pagination - */ + * Number of pages available + * @param pageCount Integer + * @return Pagination + **/ public Pagination pageCount(Integer pageCount) { this.pageCount = pageCount; return this; } - /** + /** * Number of pages available - * * @return pageCount - */ + **/ @ApiModelProperty(example = "1", value = "Number of pages available") - /** + /** * Number of pages available - * * @return pageCount Integer - */ + **/ public Integer getPageCount() { return pageCount; } - /** - * Number of pages available - * - * @param pageCount Integer - */ + /** + * Number of pages available + * @param pageCount Integer + **/ + public void setPageCount(Integer pageCount) { this.pageCount = pageCount; } /** - * Number of items returned - * - * @param itemCount Integer - * @return Pagination - */ + * Number of items returned + * @param itemCount Integer + * @return Pagination + **/ public Pagination itemCount(Integer itemCount) { this.itemCount = itemCount; return this; } - /** + /** * Number of items returned - * * @return itemCount - */ + **/ @ApiModelProperty(example = "2", value = "Number of items returned") - /** + /** * Number of items returned - * * @return itemCount Integer - */ + **/ public Integer getItemCount() { return itemCount; } - /** - * Number of items returned - * - * @param itemCount Integer - */ + /** + * Number of items returned + * @param itemCount Integer + **/ + public void setItemCount(Integer itemCount) { this.itemCount = itemCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } Pagination pagination = (Pagination) o; - return Objects.equals(this.page, pagination.page) - && Objects.equals(this.pageSize, pagination.pageSize) - && Objects.equals(this.pageCount, pagination.pageCount) - && Objects.equals(this.itemCount, pagination.itemCount); + return Objects.equals(this.page, pagination.page) && + Objects.equals(this.pageSize, pagination.pageSize) && + Objects.equals(this.pageCount, pagination.pageCount) && + Objects.equals(this.itemCount, pagination.itemCount); } @Override @@ -222,6 +197,7 @@ public int hashCode() { return Objects.hash(page, pageSize, pageCount, itemCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -235,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -243,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/StartBalance.java b/src/main/java/com/xero/models/bankfeeds/StartBalance.java index 70068c038..88c4570bf 100644 --- a/src/main/java/com/xero/models/bankfeeds/StartBalance.java +++ b/src/main/java/com/xero/models/bankfeeds/StartBalance.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.bankfeeds.CreditDebitIndicator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; -/** The starting balance of the statement */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The starting balance of the statement + */ @ApiModel(description = "The starting balance of the statement") + public class StartBalance { StringUtil util = new StringUtil(); @@ -28,77 +45,70 @@ public class StartBalance { @JsonProperty("creditDebitIndicator") private CreditDebitIndicator creditDebitIndicator; /** - * decimal(19,4) unsigned Opening/closing balance amount. - * - * @param amount Double - * @return StartBalance - */ + * decimal(19,4) unsigned Opening/closing balance amount. + * @param amount Double + * @return StartBalance + **/ public StartBalance amount(Double amount) { this.amount = amount; return this; } - /** + /** * decimal(19,4) unsigned Opening/closing balance amount. - * * @return amount - */ - @ApiModelProperty( - example = "9.0000", - value = "decimal(19,4) unsigned Opening/closing balance amount.") - /** + **/ + @ApiModelProperty(example = "9.0000", value = "decimal(19,4) unsigned Opening/closing balance amount.") + /** * decimal(19,4) unsigned Opening/closing balance amount. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * decimal(19,4) unsigned Opening/closing balance amount. - * - * @param amount Double - */ + /** + * decimal(19,4) unsigned Opening/closing balance amount. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * creditDebitIndicator - * - * @param creditDebitIndicator CreditDebitIndicator - * @return StartBalance - */ + * creditDebitIndicator + * @param creditDebitIndicator CreditDebitIndicator + * @return StartBalance + **/ public StartBalance creditDebitIndicator(CreditDebitIndicator creditDebitIndicator) { this.creditDebitIndicator = creditDebitIndicator; return this; } - /** + /** * Get creditDebitIndicator - * * @return creditDebitIndicator - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditDebitIndicator - * * @return creditDebitIndicator CreditDebitIndicator - */ + **/ public CreditDebitIndicator getCreditDebitIndicator() { return creditDebitIndicator; } - /** - * creditDebitIndicator - * - * @param creditDebitIndicator CreditDebitIndicator - */ + /** + * creditDebitIndicator + * @param creditDebitIndicator CreditDebitIndicator + **/ + public void setCreditDebitIndicator(CreditDebitIndicator creditDebitIndicator) { this.creditDebitIndicator = creditDebitIndicator; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +118,8 @@ public boolean equals(java.lang.Object o) { return false; } StartBalance startBalance = (StartBalance) o; - return Objects.equals(this.amount, startBalance.amount) - && Objects.equals(this.creditDebitIndicator, startBalance.creditDebitIndicator); + return Objects.equals(this.amount, startBalance.amount) && + Objects.equals(this.creditDebitIndicator, startBalance.creditDebitIndicator); } @Override @@ -117,20 +127,20 @@ public int hashCode() { return Objects.hash(amount, creditDebitIndicator); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StartBalance {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" creditDebitIndicator: ") - .append(toIndentedString(creditDebitIndicator)) - .append("\n"); + sb.append(" creditDebitIndicator: ").append(toIndentedString(creditDebitIndicator)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -138,4 +148,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/Statement.java b/src/main/java/com/xero/models/bankfeeds/Statement.java index e4e41a597..55433aa43 100644 --- a/src/main/java/com/xero/models/bankfeeds/Statement.java +++ b/src/main/java/com/xero/models/bankfeeds/Statement.java @@ -9,20 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.bankfeeds.EndBalance; +import com.xero.models.bankfeeds.Error; +import com.xero.models.bankfeeds.StartBalance; +import com.xero.models.bankfeeds.StatementLine; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Statement + */ -/** Statement */ public class Statement { StringUtil util = new StringUtil(); @@ -31,15 +50,23 @@ public class Statement { @JsonProperty("feedConnectionId") private UUID feedConnectionId; - /** Current status of statements */ + /** + * Current status of statements + */ public enum StatusEnum { - /** PENDING */ + /** + * PENDING + */ PENDING("PENDING"), - - /** REJECTED */ + + /** + * REJECTED + */ REJECTED("REJECTED"), - - /** DELIVERED */ + + /** + * DELIVERED + */ DELIVERED("DELIVERED"); private String value; @@ -48,31 +75,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -84,6 +105,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; @@ -108,273 +130,234 @@ public static StatusEnum fromValue(String value) { @JsonProperty("statementLineCount") private Integer statementLineCount; /** - * GUID used to identify the Statement. - * - * @param id UUID - * @return Statement - */ + * GUID used to identify the Statement. + * @param id UUID + * @return Statement + **/ public Statement id(UUID id) { this.id = id; return this; } - /** + /** * GUID used to identify the Statement. - * * @return id - */ - @ApiModelProperty( - example = "ba4f3127-5e46-427d-80ea-dea2fcd26afe", - value = "GUID used to identify the Statement.") - /** + **/ + @ApiModelProperty(example = "ba4f3127-5e46-427d-80ea-dea2fcd26afe", value = "GUID used to identify the Statement.") + /** * GUID used to identify the Statement. - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * GUID used to identify the Statement. - * - * @param id UUID - */ + /** + * GUID used to identify the Statement. + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * The Xero generated feed connection Id that identifies the Xero Bank Account Container into - * which the statement should be delivered. This is obtained by calling GET FeedConnections. - * - * @param feedConnectionId UUID - * @return Statement - */ + * The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. + * @param feedConnectionId UUID + * @return Statement + **/ public Statement feedConnectionId(UUID feedConnectionId) { this.feedConnectionId = feedConnectionId; return this; } - /** - * The Xero generated feed connection Id that identifies the Xero Bank Account Container into - * which the statement should be delivered. This is obtained by calling GET FeedConnections. - * + /** + * The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. * @return feedConnectionId - */ - @ApiModelProperty( - example = "87cb0dc8-fa32-409c-b622-19f8de8dcc83", - value = - "The Xero generated feed connection Id that identifies the Xero Bank Account Container" - + " into which the statement should be delivered. This is obtained by calling GET" - + " FeedConnections.") - /** - * The Xero generated feed connection Id that identifies the Xero Bank Account Container into - * which the statement should be delivered. This is obtained by calling GET FeedConnections. - * + **/ + @ApiModelProperty(example = "87cb0dc8-fa32-409c-b622-19f8de8dcc83", value = "The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections.") + /** + * The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. * @return feedConnectionId UUID - */ + **/ public UUID getFeedConnectionId() { return feedConnectionId; } - /** - * The Xero generated feed connection Id that identifies the Xero Bank Account Container into - * which the statement should be delivered. This is obtained by calling GET FeedConnections. - * - * @param feedConnectionId UUID - */ + /** + * The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. + * @param feedConnectionId UUID + **/ + public void setFeedConnectionId(UUID feedConnectionId) { this.feedConnectionId = feedConnectionId; } /** - * Current status of statements - * - * @param status StatusEnum - * @return Statement - */ + * Current status of statements + * @param status StatusEnum + * @return Statement + **/ public Statement status(StatusEnum status) { this.status = status; return this; } - /** + /** * Current status of statements - * * @return status - */ + **/ @ApiModelProperty(example = "PENDING", value = "Current status of statements") - /** + /** * Current status of statements - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Current status of statements - * - * @param status StatusEnum - */ + /** + * Current status of statements + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD - * - * @param startDate LocalDate - * @return Statement - */ + * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD + * @param startDate LocalDate + * @return Statement + **/ public Statement startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD - * * @return startDate - */ - @ApiModelProperty( - example = "Fri Jul 27 00:00:00 UTC 2018", - value = - "Opening balance date (can be no older than one year from the current date) ISO-8601" - + " YYYY-MM-DD") - /** + **/ + @ApiModelProperty(example = "Fri Jul 27 00:00:00 UTC 2018", value = "Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD") + /** * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD - * - * @param startDate LocalDate - */ + /** + * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * Closing balance date ISO-8601 YYYY-MM-DD - * - * @param endDate LocalDate - * @return Statement - */ + * Closing balance date ISO-8601 YYYY-MM-DD + * @param endDate LocalDate + * @return Statement + **/ public Statement endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * Closing balance date ISO-8601 YYYY-MM-DD - * * @return endDate - */ - @ApiModelProperty( - example = "Fri Jul 27 00:00:00 UTC 2018", - value = "Closing balance date ISO-8601 YYYY-MM-DD") - /** + **/ + @ApiModelProperty(example = "Fri Jul 27 00:00:00 UTC 2018", value = "Closing balance date ISO-8601 YYYY-MM-DD") + /** * Closing balance date ISO-8601 YYYY-MM-DD - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * Closing balance date ISO-8601 YYYY-MM-DD - * - * @param endDate LocalDate - */ + /** + * Closing balance date ISO-8601 YYYY-MM-DD + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * startBalance - * - * @param startBalance StartBalance - * @return Statement - */ + * startBalance + * @param startBalance StartBalance + * @return Statement + **/ public Statement startBalance(StartBalance startBalance) { this.startBalance = startBalance; return this; } - /** + /** * Get startBalance - * * @return startBalance - */ + **/ @ApiModelProperty(value = "") - /** + /** * startBalance - * * @return startBalance StartBalance - */ + **/ public StartBalance getStartBalance() { return startBalance; } - /** - * startBalance - * - * @param startBalance StartBalance - */ + /** + * startBalance + * @param startBalance StartBalance + **/ + public void setStartBalance(StartBalance startBalance) { this.startBalance = startBalance; } /** - * endBalance - * - * @param endBalance EndBalance - * @return Statement - */ + * endBalance + * @param endBalance EndBalance + * @return Statement + **/ public Statement endBalance(EndBalance endBalance) { this.endBalance = endBalance; return this; } - /** + /** * Get endBalance - * * @return endBalance - */ + **/ @ApiModelProperty(value = "") - /** + /** * endBalance - * * @return endBalance EndBalance - */ + **/ public EndBalance getEndBalance() { return endBalance; } - /** - * endBalance - * - * @param endBalance EndBalance - */ + /** + * endBalance + * @param endBalance EndBalance + **/ + public void setEndBalance(EndBalance endBalance) { this.endBalance = endBalance; } /** - * statementLines - * - * @param statementLines List<StatementLine> - * @return Statement - */ + * statementLines + * @param statementLines List<StatementLine> + * @return Statement + **/ public Statement statementLines(List statementLines) { this.statementLines = statementLines; return this; @@ -382,10 +365,9 @@ public Statement statementLines(List statementLines) { /** * statementLines - * - * @param statementLinesItem StatementLine + * @param statementLinesItem StatementLine * @return Statement - */ + **/ public Statement addStatementLinesItem(StatementLine statementLinesItem) { if (this.statementLines == null) { this.statementLines = new ArrayList(); @@ -394,36 +376,33 @@ public Statement addStatementLinesItem(StatementLine statementLinesItem) { return this; } - /** + /** * Get statementLines - * * @return statementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * statementLines - * * @return statementLines List - */ + **/ public List getStatementLines() { return statementLines; } - /** - * statementLines - * - * @param statementLines List<StatementLine> - */ + /** + * statementLines + * @param statementLines List<StatementLine> + **/ + public void setStatementLines(List statementLines) { this.statementLines = statementLines; } /** - * errors - * - * @param errors List<Error> - * @return Statement - */ + * errors + * @param errors List<Error> + * @return Statement + **/ public Statement errors(List errors) { this.errors = errors; return this; @@ -431,10 +410,9 @@ public Statement errors(List errors) { /** * errors - * - * @param errorsItem Error + * @param errorsItem Error * @return Statement - */ + **/ public Statement addErrorsItem(Error errorsItem) { if (this.errors == null) { this.errors = new ArrayList(); @@ -443,65 +421,61 @@ public Statement addErrorsItem(Error errorsItem) { return this; } - /** + /** * Get errors - * * @return errors - */ + **/ @ApiModelProperty(value = "") - /** + /** * errors - * * @return errors List - */ + **/ public List getErrors() { return errors; } - /** - * errors - * - * @param errors List<Error> - */ + /** + * errors + * @param errors List<Error> + **/ + public void setErrors(List errors) { this.errors = errors; } /** - * statementLineCount - * - * @param statementLineCount Integer - * @return Statement - */ + * statementLineCount + * @param statementLineCount Integer + * @return Statement + **/ public Statement statementLineCount(Integer statementLineCount) { this.statementLineCount = statementLineCount; return this; } - /** + /** * Get statementLineCount - * * @return statementLineCount - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * statementLineCount - * * @return statementLineCount Integer - */ + **/ public Integer getStatementLineCount() { return statementLineCount; } - /** - * statementLineCount - * - * @param statementLineCount Integer - */ + /** + * statementLineCount + * @param statementLineCount Integer + **/ + public void setStatementLineCount(Integer statementLineCount) { this.statementLineCount = statementLineCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -511,33 +485,24 @@ public boolean equals(java.lang.Object o) { return false; } Statement statement = (Statement) o; - return Objects.equals(this.id, statement.id) - && Objects.equals(this.feedConnectionId, statement.feedConnectionId) - && Objects.equals(this.status, statement.status) - && Objects.equals(this.startDate, statement.startDate) - && Objects.equals(this.endDate, statement.endDate) - && Objects.equals(this.startBalance, statement.startBalance) - && Objects.equals(this.endBalance, statement.endBalance) - && Objects.equals(this.statementLines, statement.statementLines) - && Objects.equals(this.errors, statement.errors) - && Objects.equals(this.statementLineCount, statement.statementLineCount); + return Objects.equals(this.id, statement.id) && + Objects.equals(this.feedConnectionId, statement.feedConnectionId) && + Objects.equals(this.status, statement.status) && + Objects.equals(this.startDate, statement.startDate) && + Objects.equals(this.endDate, statement.endDate) && + Objects.equals(this.startBalance, statement.startBalance) && + Objects.equals(this.endBalance, statement.endBalance) && + Objects.equals(this.statementLines, statement.statementLines) && + Objects.equals(this.errors, statement.errors) && + Objects.equals(this.statementLineCount, statement.statementLineCount); } @Override public int hashCode() { - return Objects.hash( - id, - feedConnectionId, - status, - startDate, - endDate, - startBalance, - endBalance, - statementLines, - errors, - statementLineCount); + return Objects.hash(id, feedConnectionId, status, startDate, endDate, startBalance, endBalance, statementLines, errors, statementLineCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -557,7 +522,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -565,4 +531,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/StatementLine.java b/src/main/java/com/xero/models/bankfeeds/StatementLine.java index b78d03ded..1aa9bced4 100644 --- a/src/main/java/com/xero/models/bankfeeds/StatementLine.java +++ b/src/main/java/com/xero/models/bankfeeds/StatementLine.java @@ -9,17 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.bankfeeds.CreditDebitIndicator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; -/** the lines details for a statement */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * the lines details for a statement + */ @ApiModel(description = "the lines details for a statement") + public class StatementLine { StringUtil util = new StringUtil(); @@ -50,340 +67,294 @@ public class StatementLine { @JsonProperty("transactionType") private String transactionType; /** - * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 - * YYYY-MM-DD - * - * @param postedDate LocalDate - * @return StatementLine - */ + * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD + * @param postedDate LocalDate + * @return StatementLine + **/ public StatementLine postedDate(LocalDate postedDate) { this.postedDate = postedDate; return this; } - /** - * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 - * YYYY-MM-DD - * + /** + * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD * @return postedDate - */ - @ApiModelProperty( - example = "Sun Jun 10 00:00:00 UTC 2018", - value = - "The date that the transaction was processed or cleared as seen in internet banking" - + " ISO-8601 YYYY-MM-DD") - /** - * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 - * YYYY-MM-DD - * + **/ + @ApiModelProperty(example = "Sun Jun 10 00:00:00 UTC 2018", value = "The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD") + /** + * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD * @return postedDate LocalDate - */ + **/ public LocalDate getPostedDate() { return postedDate; } - /** - * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 - * YYYY-MM-DD - * - * @param postedDate LocalDate - */ + /** + * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD + * @param postedDate LocalDate + **/ + public void setPostedDate(LocalDate postedDate) { this.postedDate = postedDate; } /** - * Transaction description - * - * @param description String - * @return StatementLine - */ + * Transaction description + * @param description String + * @return StatementLine + **/ public StatementLine description(String description) { this.description = description; return this; } - /** + /** * Transaction description - * * @return description - */ + **/ @ApiModelProperty(example = "Description for statement line 2", value = "Transaction description") - /** + /** * Transaction description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Transaction description - * - * @param description String - */ + /** + * Transaction description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Transaction amount - * - * @param amount Double - * @return StatementLine - */ + * Transaction amount + * @param amount Double + * @return StatementLine + **/ public StatementLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Transaction amount - * * @return amount - */ + **/ @ApiModelProperty(example = "5.00", value = "Transaction amount") - /** + /** * Transaction amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Transaction amount - * - * @param amount Double - */ + /** + * Transaction amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * creditDebitIndicator - * - * @param creditDebitIndicator CreditDebitIndicator - * @return StatementLine - */ + * creditDebitIndicator + * @param creditDebitIndicator CreditDebitIndicator + * @return StatementLine + **/ public StatementLine creditDebitIndicator(CreditDebitIndicator creditDebitIndicator) { this.creditDebitIndicator = creditDebitIndicator; return this; } - /** + /** * Get creditDebitIndicator - * * @return creditDebitIndicator - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditDebitIndicator - * * @return creditDebitIndicator CreditDebitIndicator - */ + **/ public CreditDebitIndicator getCreditDebitIndicator() { return creditDebitIndicator; } - /** - * creditDebitIndicator - * - * @param creditDebitIndicator CreditDebitIndicator - */ + /** + * creditDebitIndicator + * @param creditDebitIndicator CreditDebitIndicator + **/ + public void setCreditDebitIndicator(CreditDebitIndicator creditDebitIndicator) { this.creditDebitIndicator = creditDebitIndicator; } /** - * Financial institute's internal transaction identifier. If provided this field is factored - * into duplicate detection. - * - * @param transactionId String - * @return StatementLine - */ + * Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. + * @param transactionId String + * @return StatementLine + **/ public StatementLine transactionId(String transactionId) { this.transactionId = transactionId; return this; } - /** - * Financial institute's internal transaction identifier. If provided this field is factored - * into duplicate detection. - * + /** + * Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. * @return transactionId - */ - @ApiModelProperty( - example = "transaction-id-2", - value = - "Financial institute's internal transaction identifier. If provided this field is" - + " factored into duplicate detection.") - /** - * Financial institute's internal transaction identifier. If provided this field is factored - * into duplicate detection. - * + **/ + @ApiModelProperty(example = "transaction-id-2", value = "Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection.") + /** + * Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. * @return transactionId String - */ + **/ public String getTransactionId() { return transactionId; } - /** - * Financial institute's internal transaction identifier. If provided this field is factored - * into duplicate detection. - * - * @param transactionId String - */ + /** + * Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. + * @param transactionId String + **/ + public void setTransactionId(String transactionId) { this.transactionId = transactionId; } /** - * Typically the merchant or payee name - * - * @param payeeName String - * @return StatementLine - */ + * Typically the merchant or payee name + * @param payeeName String + * @return StatementLine + **/ public StatementLine payeeName(String payeeName) { this.payeeName = payeeName; return this; } - /** + /** * Typically the merchant or payee name - * * @return payeeName - */ - @ApiModelProperty( - example = "Payee name for statement line 2", - value = "Typically the merchant or payee name") - /** + **/ + @ApiModelProperty(example = "Payee name for statement line 2", value = "Typically the merchant or payee name") + /** * Typically the merchant or payee name - * * @return payeeName String - */ + **/ public String getPayeeName() { return payeeName; } - /** - * Typically the merchant or payee name - * - * @param payeeName String - */ + /** + * Typically the merchant or payee name + * @param payeeName String + **/ + public void setPayeeName(String payeeName) { this.payeeName = payeeName; } /** - * Optional field to enhance the Description - * - * @param reference String - * @return StatementLine - */ + * Optional field to enhance the Description + * @param reference String + * @return StatementLine + **/ public StatementLine reference(String reference) { this.reference = reference; return this; } - /** + /** * Optional field to enhance the Description - * * @return reference - */ - @ApiModelProperty( - example = "Reference for statement line 2", - value = "Optional field to enhance the Description") - /** + **/ + @ApiModelProperty(example = "Reference for statement line 2", value = "Optional field to enhance the Description") + /** * Optional field to enhance the Description - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Optional field to enhance the Description - * - * @param reference String - */ + /** + * Optional field to enhance the Description + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * The cheque/check number - * - * @param chequeNumber String - * @return StatementLine - */ + * The cheque/check number + * @param chequeNumber String + * @return StatementLine + **/ public StatementLine chequeNumber(String chequeNumber) { this.chequeNumber = chequeNumber; return this; } - /** + /** * The cheque/check number - * * @return chequeNumber - */ + **/ @ApiModelProperty(example = "021", value = "The cheque/check number") - /** + /** * The cheque/check number - * * @return chequeNumber String - */ + **/ public String getChequeNumber() { return chequeNumber; } - /** - * The cheque/check number - * - * @param chequeNumber String - */ + /** + * The cheque/check number + * @param chequeNumber String + **/ + public void setChequeNumber(String chequeNumber) { this.chequeNumber = chequeNumber; } /** - * Descriptive transaction type - * - * @param transactionType String - * @return StatementLine - */ + * Descriptive transaction type + * @param transactionType String + * @return StatementLine + **/ public StatementLine transactionType(String transactionType) { this.transactionType = transactionType; return this; } - /** + /** * Descriptive transaction type - * * @return transactionType - */ + **/ @ApiModelProperty(example = "Refund", value = "Descriptive transaction type") - /** + /** * Descriptive transaction type - * * @return transactionType String - */ + **/ public String getTransactionType() { return transactionType; } - /** - * Descriptive transaction type - * - * @param transactionType String - */ + /** + * Descriptive transaction type + * @param transactionType String + **/ + public void setTransactionType(String transactionType) { this.transactionType = transactionType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -393,31 +364,23 @@ public boolean equals(java.lang.Object o) { return false; } StatementLine statementLine = (StatementLine) o; - return Objects.equals(this.postedDate, statementLine.postedDate) - && Objects.equals(this.description, statementLine.description) - && Objects.equals(this.amount, statementLine.amount) - && Objects.equals(this.creditDebitIndicator, statementLine.creditDebitIndicator) - && Objects.equals(this.transactionId, statementLine.transactionId) - && Objects.equals(this.payeeName, statementLine.payeeName) - && Objects.equals(this.reference, statementLine.reference) - && Objects.equals(this.chequeNumber, statementLine.chequeNumber) - && Objects.equals(this.transactionType, statementLine.transactionType); + return Objects.equals(this.postedDate, statementLine.postedDate) && + Objects.equals(this.description, statementLine.description) && + Objects.equals(this.amount, statementLine.amount) && + Objects.equals(this.creditDebitIndicator, statementLine.creditDebitIndicator) && + Objects.equals(this.transactionId, statementLine.transactionId) && + Objects.equals(this.payeeName, statementLine.payeeName) && + Objects.equals(this.reference, statementLine.reference) && + Objects.equals(this.chequeNumber, statementLine.chequeNumber) && + Objects.equals(this.transactionType, statementLine.transactionType); } @Override public int hashCode() { - return Objects.hash( - postedDate, - description, - amount, - creditDebitIndicator, - transactionId, - payeeName, - reference, - chequeNumber, - transactionType); + return Objects.hash(postedDate, description, amount, creditDebitIndicator, transactionId, payeeName, reference, chequeNumber, transactionType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -425,9 +388,7 @@ public String toString() { sb.append(" postedDate: ").append(toIndentedString(postedDate)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" creditDebitIndicator: ") - .append(toIndentedString(creditDebitIndicator)) - .append("\n"); + sb.append(" creditDebitIndicator: ").append(toIndentedString(creditDebitIndicator)).append("\n"); sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); sb.append(" payeeName: ").append(toIndentedString(payeeName)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); @@ -438,7 +399,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -446,4 +408,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/bankfeeds/Statements.java b/src/main/java/com/xero/models/bankfeeds/Statements.java index a48694cb0..4192cb0bd 100644 --- a/src/main/java/com/xero/models/bankfeeds/Statements.java +++ b/src/main/java/com/xero/models/bankfeeds/Statements.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.bankfeeds; +package com.xero.models.bankfeeds; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.bankfeeds.Pagination; +import com.xero.models.bankfeeds.Statement; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Statements + */ -/** Statements */ public class Statements { StringUtil util = new StringUtil(); @@ -28,46 +47,42 @@ public class Statements { @JsonProperty("items") private List items = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Statements - */ + * pagination + * @param pagination Pagination + * @return Statements + **/ public Statements pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * items - * - * @param items List<Statement> - * @return Statements - */ + * items + * @param items List<Statement> + * @return Statements + **/ public Statements items(List items) { this.items = items; return this; @@ -75,10 +90,9 @@ public Statements items(List items) { /** * items - * - * @param itemsItem Statement + * @param itemsItem Statement * @return Statements - */ + **/ public Statements addItemsItem(Statement itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -87,30 +101,29 @@ public Statements addItemsItem(Statement itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<Statement> - */ + /** + * items + * @param items List<Statement> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } Statements statements = (Statements) o; - return Objects.equals(this.pagination, statements.pagination) - && Objects.equals(this.items, statements.items); + return Objects.equals(this.pagination, statements.pagination) && + Objects.equals(this.items, statements.items); } @Override @@ -129,6 +142,7 @@ public int hashCode() { return Objects.hash(pagination, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/file/Association.java b/src/main/java/com/xero/models/file/Association.java index 6058c6ae6..02ce903b7 100644 --- a/src/main/java/com/xero/models/file/Association.java +++ b/src/main/java/com/xero/models/file/Association.java @@ -9,15 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.file; +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.file.ObjectGroup; +import com.xero.models.file.ObjectType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Association + */ -/** Association */ public class Association { StringUtil util = new StringUtil(); @@ -42,286 +61,230 @@ public class Association { @JsonProperty("ObjectType") private ObjectType objectType; /** - * Boolean flag to determines whether the file is sent with the document it is attached to on - * client facing communications. Note- The SendWithObject element is only returned when using - * /Associations/{ObjectId} endpoint. - * - * @param sendWithObject Boolean - * @return Association - */ + * Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint. + * @param sendWithObject Boolean + * @return Association + **/ public Association sendWithObject(Boolean sendWithObject) { this.sendWithObject = sendWithObject; return this; } - /** - * Boolean flag to determines whether the file is sent with the document it is attached to on - * client facing communications. Note- The SendWithObject element is only returned when using - * /Associations/{ObjectId} endpoint. - * + /** + * Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint. * @return sendWithObject - */ - @ApiModelProperty( - example = "true", - value = - "Boolean flag to determines whether the file is sent with the document it is attached to" - + " on client facing communications. Note- The SendWithObject element is only" - + " returned when using /Associations/{ObjectId} endpoint.") - /** - * Boolean flag to determines whether the file is sent with the document it is attached to on - * client facing communications. Note- The SendWithObject element is only returned when using - * /Associations/{ObjectId} endpoint. - * + **/ + @ApiModelProperty(example = "true", value = "Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint.") + /** + * Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint. * @return sendWithObject Boolean - */ + **/ public Boolean getSendWithObject() { return sendWithObject; } - /** - * Boolean flag to determines whether the file is sent with the document it is attached to on - * client facing communications. Note- The SendWithObject element is only returned when using - * /Associations/{ObjectId} endpoint. - * - * @param sendWithObject Boolean - */ + /** + * Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint. + * @param sendWithObject Boolean + **/ + public void setSendWithObject(Boolean sendWithObject) { this.sendWithObject = sendWithObject; } /** - * The name of the associated file. Note- The Name element is only returned when using - * /Associations/{ObjectId} endpoint. - * - * @param name String - * @return Association - */ + * The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint. + * @param name String + * @return Association + **/ public Association name(String name) { this.name = name; return this; } - /** - * The name of the associated file. Note- The Name element is only returned when using - * /Associations/{ObjectId} endpoint. - * + /** + * The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint. * @return name - */ - @ApiModelProperty( - example = "Test.pdf", - value = - "The name of the associated file. Note- The Name element is only returned when using" - + " /Associations/{ObjectId} endpoint.") - /** - * The name of the associated file. Note- The Name element is only returned when using - * /Associations/{ObjectId} endpoint. - * + **/ + @ApiModelProperty(example = "Test.pdf", value = "The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint.") + /** + * The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint. * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the associated file. Note- The Name element is only returned when using - * /Associations/{ObjectId} endpoint. - * - * @param name String - */ + /** + * The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The size of the associated file in bytes. Note- The Size element is only returned when using - * /Associations/{ObjectId} endpoint. - * - * @param size Integer - * @return Association - */ + * The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint. + * @param size Integer + * @return Association + **/ public Association size(Integer size) { this.size = size; return this; } - /** - * The size of the associated file in bytes. Note- The Size element is only returned when using - * /Associations/{ObjectId} endpoint. - * + /** + * The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint. * @return size - */ - @ApiModelProperty( - example = "12357", - value = - "The size of the associated file in bytes. Note- The Size element is only returned when" - + " using /Associations/{ObjectId} endpoint.") - /** - * The size of the associated file in bytes. Note- The Size element is only returned when using - * /Associations/{ObjectId} endpoint. - * + **/ + @ApiModelProperty(example = "12357", value = "The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint.") + /** + * The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint. * @return size Integer - */ + **/ public Integer getSize() { return size; } - /** - * The size of the associated file in bytes. Note- The Size element is only returned when using - * /Associations/{ObjectId} endpoint. - * - * @param size Integer - */ + /** + * The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint. + * @param size Integer + **/ + public void setSize(Integer size) { this.size = size; } /** - * The unique identifier of the file - * - * @param fileId UUID - * @return Association - */ + * The unique identifier of the file + * @param fileId UUID + * @return Association + **/ public Association fileId(UUID fileId) { this.fileId = fileId; return this; } - /** + /** * The unique identifier of the file - * * @return fileId - */ + **/ @ApiModelProperty(value = "The unique identifier of the file") - /** + /** * The unique identifier of the file - * * @return fileId UUID - */ + **/ public UUID getFileId() { return fileId; } - /** - * The unique identifier of the file - * - * @param fileId UUID - */ + /** + * The unique identifier of the file + * @param fileId UUID + **/ + public void setFileId(UUID fileId) { this.fileId = fileId; } /** - * The identifier of the object that the file is being associated with (e.g. InvoiceID, - * BankTransactionID, ContactID) - * - * @param objectId UUID - * @return Association - */ + * The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID) + * @param objectId UUID + * @return Association + **/ public Association objectId(UUID objectId) { this.objectId = objectId; return this; } - /** - * The identifier of the object that the file is being associated with (e.g. InvoiceID, - * BankTransactionID, ContactID) - * + /** + * The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID) * @return objectId - */ - @ApiModelProperty( - value = - "The identifier of the object that the file is being associated with (e.g. InvoiceID," - + " BankTransactionID, ContactID)") - /** - * The identifier of the object that the file is being associated with (e.g. InvoiceID, - * BankTransactionID, ContactID) - * + **/ + @ApiModelProperty(value = "The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID)") + /** + * The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID) * @return objectId UUID - */ + **/ public UUID getObjectId() { return objectId; } - /** - * The identifier of the object that the file is being associated with (e.g. InvoiceID, - * BankTransactionID, ContactID) - * - * @param objectId UUID - */ + /** + * The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID) + * @param objectId UUID + **/ + public void setObjectId(UUID objectId) { this.objectId = objectId; } /** - * objectGroup - * - * @param objectGroup ObjectGroup - * @return Association - */ + * objectGroup + * @param objectGroup ObjectGroup + * @return Association + **/ public Association objectGroup(ObjectGroup objectGroup) { this.objectGroup = objectGroup; return this; } - /** + /** * Get objectGroup - * * @return objectGroup - */ + **/ @ApiModelProperty(value = "") - /** + /** * objectGroup - * * @return objectGroup ObjectGroup - */ + **/ public ObjectGroup getObjectGroup() { return objectGroup; } - /** - * objectGroup - * - * @param objectGroup ObjectGroup - */ + /** + * objectGroup + * @param objectGroup ObjectGroup + **/ + public void setObjectGroup(ObjectGroup objectGroup) { this.objectGroup = objectGroup; } /** - * objectType - * - * @param objectType ObjectType - * @return Association - */ + * objectType + * @param objectType ObjectType + * @return Association + **/ public Association objectType(ObjectType objectType) { this.objectType = objectType; return this; } - /** + /** * Get objectType - * * @return objectType - */ + **/ @ApiModelProperty(value = "") - /** + /** * objectType - * * @return objectType ObjectType - */ + **/ public ObjectType getObjectType() { return objectType; } - /** - * objectType - * - * @param objectType ObjectType - */ + /** + * objectType + * @param objectType ObjectType + **/ + public void setObjectType(ObjectType objectType) { this.objectType = objectType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -331,13 +294,13 @@ public boolean equals(java.lang.Object o) { return false; } Association association = (Association) o; - return Objects.equals(this.sendWithObject, association.sendWithObject) - && Objects.equals(this.name, association.name) - && Objects.equals(this.size, association.size) - && Objects.equals(this.fileId, association.fileId) - && Objects.equals(this.objectId, association.objectId) - && Objects.equals(this.objectGroup, association.objectGroup) - && Objects.equals(this.objectType, association.objectType); + return Objects.equals(this.sendWithObject, association.sendWithObject) && + Objects.equals(this.name, association.name) && + Objects.equals(this.size, association.size) && + Objects.equals(this.fileId, association.fileId) && + Objects.equals(this.objectId, association.objectId) && + Objects.equals(this.objectGroup, association.objectGroup) && + Objects.equals(this.objectType, association.objectType); } @Override @@ -345,6 +308,7 @@ public int hashCode() { return Objects.hash(sendWithObject, name, size, fileId, objectId, objectGroup, objectType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -361,7 +325,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -369,4 +334,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/file/FileObject.java b/src/main/java/com/xero/models/file/FileObject.java index 8988d9adf..2720a54e8 100644 --- a/src/main/java/com/xero/models/file/FileObject.java +++ b/src/main/java/com/xero/models/file/FileObject.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.file; +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.file.User; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * FileObject + */ -/** FileObject */ public class FileObject { StringUtil util = new StringUtil(); @@ -45,289 +63,262 @@ public class FileObject { @JsonProperty("FolderId") private UUID folderId; /** - * File Name - * - * @param name String - * @return FileObject - */ + * File Name + * @param name String + * @return FileObject + **/ public FileObject name(String name) { this.name = name; return this; } - /** + /** * File Name - * * @return name - */ + **/ @ApiModelProperty(example = "File2.jpg", value = "File Name") - /** + /** * File Name - * * @return name String - */ + **/ public String getName() { return name; } - /** - * File Name - * - * @param name String - */ + /** + * File Name + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * MimeType of the file (image/png, image/jpeg, application/pdf, etc..) - * - * @param mimeType String - * @return FileObject - */ + * MimeType of the file (image/png, image/jpeg, application/pdf, etc..) + * @param mimeType String + * @return FileObject + **/ public FileObject mimeType(String mimeType) { this.mimeType = mimeType; return this; } - /** + /** * MimeType of the file (image/png, image/jpeg, application/pdf, etc..) - * * @return mimeType - */ - @ApiModelProperty( - example = "image/jpeg", - value = "MimeType of the file (image/png, image/jpeg, application/pdf, etc..)") - /** + **/ + @ApiModelProperty(example = "image/jpeg", value = "MimeType of the file (image/png, image/jpeg, application/pdf, etc..)") + /** * MimeType of the file (image/png, image/jpeg, application/pdf, etc..) - * * @return mimeType String - */ + **/ public String getMimeType() { return mimeType; } - /** - * MimeType of the file (image/png, image/jpeg, application/pdf, etc..) - * - * @param mimeType String - */ + /** + * MimeType of the file (image/png, image/jpeg, application/pdf, etc..) + * @param mimeType String + **/ + public void setMimeType(String mimeType) { this.mimeType = mimeType; } /** - * Numeric value in bytes - * - * @param size Integer - * @return FileObject - */ + * Numeric value in bytes + * @param size Integer + * @return FileObject + **/ public FileObject size(Integer size) { this.size = size; return this; } - /** + /** * Numeric value in bytes - * * @return size - */ + **/ @ApiModelProperty(example = "3615", value = "Numeric value in bytes") - /** + /** * Numeric value in bytes - * * @return size Integer - */ + **/ public Integer getSize() { return size; } - /** - * Numeric value in bytes - * - * @param size Integer - */ + /** + * Numeric value in bytes + * @param size Integer + **/ + public void setSize(Integer size) { this.size = size; } /** - * Created date in UTC - * - * @param createdDateUtc String - * @return FileObject - */ + * Created date in UTC + * @param createdDateUtc String + * @return FileObject + **/ public FileObject createdDateUtc(String createdDateUtc) { this.createdDateUtc = createdDateUtc; return this; } - /** + /** * Created date in UTC - * * @return createdDateUtc - */ + **/ @ApiModelProperty(example = "2020-12-03T19:04:58.6970000", value = "Created date in UTC") - /** + /** * Created date in UTC - * * @return createdDateUtc String - */ + **/ public String getCreatedDateUtc() { return createdDateUtc; } - /** - * Created date in UTC - * - * @param createdDateUtc String - */ + /** + * Created date in UTC + * @param createdDateUtc String + **/ + public void setCreatedDateUtc(String createdDateUtc) { this.createdDateUtc = createdDateUtc; } /** - * Updated date in UTC - * - * @param updatedDateUtc String - * @return FileObject - */ + * Updated date in UTC + * @param updatedDateUtc String + * @return FileObject + **/ public FileObject updatedDateUtc(String updatedDateUtc) { this.updatedDateUtc = updatedDateUtc; return this; } - /** + /** * Updated date in UTC - * * @return updatedDateUtc - */ + **/ @ApiModelProperty(example = "2020-12-03T19:04:58.6970000", value = "Updated date in UTC") - /** + /** * Updated date in UTC - * * @return updatedDateUtc String - */ + **/ public String getUpdatedDateUtc() { return updatedDateUtc; } - /** - * Updated date in UTC - * - * @param updatedDateUtc String - */ + /** + * Updated date in UTC + * @param updatedDateUtc String + **/ + public void setUpdatedDateUtc(String updatedDateUtc) { this.updatedDateUtc = updatedDateUtc; } /** - * user - * - * @param user User - * @return FileObject - */ + * user + * @param user User + * @return FileObject + **/ public FileObject user(User user) { this.user = user; return this; } - /** + /** * Get user - * * @return user - */ + **/ @ApiModelProperty(value = "") - /** + /** * user - * * @return user User - */ + **/ public User getUser() { return user; } - /** - * user - * - * @param user User - */ + /** + * user + * @param user User + **/ + public void setUser(User user) { this.user = user; } /** - * File object's UUID - * - * @param id UUID - * @return FileObject - */ + * File object's UUID + * @param id UUID + * @return FileObject + **/ public FileObject id(UUID id) { this.id = id; return this; } - /** + /** * File object's UUID - * * @return id - */ + **/ @ApiModelProperty(example = "d290f1ee-6c54-4b01-90e6-d701748f0851", value = "File object's UUID") - /** + /** * File object's UUID - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * File object's UUID - * - * @param id UUID - */ + /** + * File object's UUID + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Folder relation object's UUID - * - * @param folderId UUID - * @return FileObject - */ + * Folder relation object's UUID + * @param folderId UUID + * @return FileObject + **/ public FileObject folderId(UUID folderId) { this.folderId = folderId; return this; } - /** + /** * Folder relation object's UUID - * * @return folderId - */ - @ApiModelProperty( - example = "0f8ccf21-7267-4268-9167-a1e2c40c84c8", - value = "Folder relation object's UUID") - /** + **/ + @ApiModelProperty(example = "0f8ccf21-7267-4268-9167-a1e2c40c84c8", value = "Folder relation object's UUID") + /** * Folder relation object's UUID - * * @return folderId UUID - */ + **/ public UUID getFolderId() { return folderId; } - /** - * Folder relation object's UUID - * - * @param folderId UUID - */ + /** + * Folder relation object's UUID + * @param folderId UUID + **/ + public void setFolderId(UUID folderId) { this.folderId = folderId; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -337,14 +328,14 @@ public boolean equals(java.lang.Object o) { return false; } FileObject fileObject = (FileObject) o; - return Objects.equals(this.name, fileObject.name) - && Objects.equals(this.mimeType, fileObject.mimeType) - && Objects.equals(this.size, fileObject.size) - && Objects.equals(this.createdDateUtc, fileObject.createdDateUtc) - && Objects.equals(this.updatedDateUtc, fileObject.updatedDateUtc) - && Objects.equals(this.user, fileObject.user) - && Objects.equals(this.id, fileObject.id) - && Objects.equals(this.folderId, fileObject.folderId); + return Objects.equals(this.name, fileObject.name) && + Objects.equals(this.mimeType, fileObject.mimeType) && + Objects.equals(this.size, fileObject.size) && + Objects.equals(this.createdDateUtc, fileObject.createdDateUtc) && + Objects.equals(this.updatedDateUtc, fileObject.updatedDateUtc) && + Objects.equals(this.user, fileObject.user) && + Objects.equals(this.id, fileObject.id) && + Objects.equals(this.folderId, fileObject.folderId); } @Override @@ -352,6 +343,7 @@ public int hashCode() { return Objects.hash(name, mimeType, size, createdDateUtc, updatedDateUtc, user, id, folderId); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -369,7 +361,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -377,4 +370,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/file/Files.java b/src/main/java/com/xero/models/file/Files.java index aa1f4874f..b9c624432 100644 --- a/src/main/java/com/xero/models/file/Files.java +++ b/src/main/java/com/xero/models/file/Files.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.file; +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.file.FileObject; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Files + */ -/** Files */ public class Files { StringUtil util = new StringUtil(); @@ -34,116 +52,106 @@ public class Files { @JsonProperty("Items") private List items = new ArrayList(); /** - * totalCount - * - * @param totalCount Integer - * @return Files - */ + * totalCount + * @param totalCount Integer + * @return Files + **/ public Files totalCount(Integer totalCount) { this.totalCount = totalCount; return this; } - /** + /** * Get totalCount - * * @return totalCount - */ + **/ @ApiModelProperty(example = "2", value = "") - /** + /** * totalCount - * * @return totalCount Integer - */ + **/ public Integer getTotalCount() { return totalCount; } - /** - * totalCount - * - * @param totalCount Integer - */ + /** + * totalCount + * @param totalCount Integer + **/ + public void setTotalCount(Integer totalCount) { this.totalCount = totalCount; } /** - * page - * - * @param page Integer - * @return Files - */ + * page + * @param page Integer + * @return Files + **/ public Files page(Integer page) { this.page = page; return this; } - /** + /** * Get page - * * @return page - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * page - * * @return page Integer - */ + **/ public Integer getPage() { return page; } - /** - * page - * - * @param page Integer - */ + /** + * page + * @param page Integer + **/ + public void setPage(Integer page) { this.page = page; } /** - * perPage - * - * @param perPage Integer - * @return Files - */ + * perPage + * @param perPage Integer + * @return Files + **/ public Files perPage(Integer perPage) { this.perPage = perPage; return this; } - /** + /** * Get perPage - * * @return perPage - */ + **/ @ApiModelProperty(example = "50", value = "") - /** + /** * perPage - * * @return perPage Integer - */ + **/ public Integer getPerPage() { return perPage; } - /** - * perPage - * - * @param perPage Integer - */ + /** + * perPage + * @param perPage Integer + **/ + public void setPerPage(Integer perPage) { this.perPage = perPage; } /** - * items - * - * @param items List<FileObject> - * @return Files - */ + * items + * @param items List<FileObject> + * @return Files + **/ public Files items(List items) { this.items = items; return this; @@ -151,10 +159,9 @@ public Files items(List items) { /** * items - * - * @param itemsItem FileObject + * @param itemsItem FileObject * @return Files - */ + **/ public Files addItemsItem(FileObject itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -163,30 +170,29 @@ public Files addItemsItem(FileObject itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<FileObject> - */ + /** + * items + * @param items List<FileObject> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -196,10 +202,10 @@ public boolean equals(java.lang.Object o) { return false; } Files files = (Files) o; - return Objects.equals(this.totalCount, files.totalCount) - && Objects.equals(this.page, files.page) - && Objects.equals(this.perPage, files.perPage) - && Objects.equals(this.items, files.items); + return Objects.equals(this.totalCount, files.totalCount) && + Objects.equals(this.page, files.page) && + Objects.equals(this.perPage, files.perPage) && + Objects.equals(this.items, files.items); } @Override @@ -207,6 +213,7 @@ public int hashCode() { return Objects.hash(totalCount, page, perPage, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -220,7 +227,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -228,4 +236,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/file/Folder.java b/src/main/java/com/xero/models/file/Folder.java index 37a827aef..64ab4d1b5 100644 --- a/src/main/java/com/xero/models/file/Folder.java +++ b/src/main/java/com/xero/models/file/Folder.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.file; +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Folder + */ -/** Folder */ public class Folder { StringUtil util = new StringUtil(); @@ -36,188 +53,166 @@ public class Folder { @JsonProperty("Id") private UUID id; /** - * The name of the folder - * - * @param name String - * @return Folder - */ + * The name of the folder + * @param name String + * @return Folder + **/ public Folder name(String name) { this.name = name; return this; } - /** + /** * The name of the folder - * * @return name - */ + **/ @ApiModelProperty(example = "assets", value = "The name of the folder") - /** + /** * The name of the folder - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the folder - * - * @param name String - */ + /** + * The name of the folder + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The number of files in the folder - * - * @param fileCount Integer - * @return Folder - */ + * The number of files in the folder + * @param fileCount Integer + * @return Folder + **/ public Folder fileCount(Integer fileCount) { this.fileCount = fileCount; return this; } - /** + /** * The number of files in the folder - * * @return fileCount - */ + **/ @ApiModelProperty(example = "5", value = "The number of files in the folder") - /** + /** * The number of files in the folder - * * @return fileCount Integer - */ + **/ public Integer getFileCount() { return fileCount; } - /** - * The number of files in the folder - * - * @param fileCount Integer - */ + /** + * The number of files in the folder + * @param fileCount Integer + **/ + public void setFileCount(Integer fileCount) { this.fileCount = fileCount; } /** - * The email address used to email files to the inbox. Only the inbox will have this element. - * - * @param email String - * @return Folder - */ + * The email address used to email files to the inbox. Only the inbox will have this element. + * @param email String + * @return Folder + **/ public Folder email(String email) { this.email = email; return this; } - /** + /** * The email address used to email files to the inbox. Only the inbox will have this element. - * * @return email - */ - @ApiModelProperty( - example = "foo@bar.com", - value = - "The email address used to email files to the inbox. Only the inbox will have this" - + " element.") - /** + **/ + @ApiModelProperty(example = "foo@bar.com", value = "The email address used to email files to the inbox. Only the inbox will have this element.") + /** * The email address used to email files to the inbox. Only the inbox will have this element. - * * @return email String - */ + **/ public String getEmail() { return email; } - /** - * The email address used to email files to the inbox. Only the inbox will have this element. - * - * @param email String - */ + /** + * The email address used to email files to the inbox. Only the inbox will have this element. + * @param email String + **/ + public void setEmail(String email) { this.email = email; } /** - * to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. - * - * @param isInbox Boolean - * @return Folder - */ + * to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. + * @param isInbox Boolean + * @return Folder + **/ public Folder isInbox(Boolean isInbox) { this.isInbox = isInbox; return this; } - /** + /** * to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. - * * @return isInbox - */ - @ApiModelProperty( - example = "true", - value = "to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted.") - /** + **/ + @ApiModelProperty(example = "true", value = "to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted.") + /** * to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. - * * @return isInbox Boolean - */ + **/ public Boolean getIsInbox() { return isInbox; } - /** - * to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. - * - * @param isInbox Boolean - */ + /** + * to indicate if the folder is the Inbox. The Inbox cannot be renamed or deleted. + * @param isInbox Boolean + **/ + public void setIsInbox(Boolean isInbox) { this.isInbox = isInbox; } /** - * Xero unique identifier for a folder Files - * - * @param id UUID - * @return Folder - */ + * Xero unique identifier for a folder Files + * @param id UUID + * @return Folder + **/ public Folder id(UUID id) { this.id = id; return this; } - /** - * Xero unique identifier for a folder Files - * + /** + * Xero unique identifier for a folder Files * @return id - */ - @ApiModelProperty( - example = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c", - value = "Xero unique identifier for a folder Files") - /** - * Xero unique identifier for a folder Files - * + **/ + @ApiModelProperty(example = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c", value = "Xero unique identifier for a folder Files") + /** + * Xero unique identifier for a folder Files * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * Xero unique identifier for a folder Files - * - * @param id UUID - */ + /** + * Xero unique identifier for a folder Files + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } Folder folder = (Folder) o; - return Objects.equals(this.name, folder.name) - && Objects.equals(this.fileCount, folder.fileCount) - && Objects.equals(this.email, folder.email) - && Objects.equals(this.isInbox, folder.isInbox) - && Objects.equals(this.id, folder.id); + return Objects.equals(this.name, folder.name) && + Objects.equals(this.fileCount, folder.fileCount) && + Objects.equals(this.email, folder.email) && + Objects.equals(this.isInbox, folder.isInbox) && + Objects.equals(this.id, folder.id); } @Override @@ -239,6 +234,7 @@ public int hashCode() { return Objects.hash(name, fileCount, email, isInbox, id); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -253,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -261,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/file/Folders.java b/src/main/java/com/xero/models/file/Folders.java index 2ce537732..b83e7c7f9 100644 --- a/src/main/java/com/xero/models/file/Folders.java +++ b/src/main/java/com/xero/models/file/Folders.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.file; +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.file.Folder; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Folders + */ -/** Folders */ public class Folders { StringUtil util = new StringUtil(); @JsonProperty("Folders") private List folders = new ArrayList(); /** - * folders - * - * @param folders List<Folder> - * @return Folders - */ + * folders + * @param folders List<Folder> + * @return Folders + **/ public Folders folders(List folders) { this.folders = folders; return this; @@ -37,10 +54,9 @@ public Folders folders(List folders) { /** * folders - * - * @param foldersItem Folder + * @param foldersItem Folder * @return Folders - */ + **/ public Folders addFoldersItem(Folder foldersItem) { if (this.folders == null) { this.folders = new ArrayList(); @@ -49,30 +65,29 @@ public Folders addFoldersItem(Folder foldersItem) { return this; } - /** + /** * Get folders - * * @return folders - */ + **/ @ApiModelProperty(value = "") - /** + /** * folders - * * @return folders List - */ + **/ public List getFolders() { return folders; } - /** - * folders - * - * @param folders List<Folder> - */ + /** + * folders + * @param folders List<Folder> + **/ + public void setFolders(List folders) { this.folders = folders; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(folders); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/file/ObjectGroup.java b/src/main/java/com/xero/models/file/ObjectGroup.java index 92f6b383e..7749d0de4 100644 --- a/src/main/java/com/xero/models/file/ObjectGroup.java +++ b/src/main/java/com/xero/models/file/ObjectGroup.java @@ -9,52 +9,85 @@ * Do not edit the class manually. */ -package com.xero.models.file; - +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * The Object Group that the object is in. These roughly correlate to the endpoints that can be used - * to retrieve the object via the core accounting API. + * The Object Group that the object is in. These roughly correlate to the endpoints that can be used to retrieve the object via the core accounting API. */ public enum ObjectGroup { - - /** ACCOUNT */ + + /** + * ACCOUNT + */ ACCOUNT("Account"), - - /** BANKTRANSACTION */ + + /** + * BANKTRANSACTION + */ BANKTRANSACTION("BankTransaction"), - - /** CONTACT */ + + /** + * CONTACT + */ CONTACT("Contact"), - - /** CREDITNOTE */ + + /** + * CREDITNOTE + */ CREDITNOTE("CreditNote"), - - /** INVOICE */ + + /** + * INVOICE + */ INVOICE("Invoice"), - - /** ITEM */ + + /** + * ITEM + */ ITEM("Item"), - - /** MANUALJOURNAL */ + + /** + * MANUALJOURNAL + */ MANUALJOURNAL("ManualJournal"), - - /** OVERPAYMENT */ + + /** + * OVERPAYMENT + */ OVERPAYMENT("Overpayment"), - - /** PAYMENT */ + + /** + * PAYMENT + */ PAYMENT("Payment"), - - /** PREPAYMENT */ + + /** + * PREPAYMENT + */ PREPAYMENT("Prepayment"), - - /** QUOTE */ + + /** + * QUOTE + */ QUOTE("Quote"), - - /** RECEIPT */ + + /** + * RECEIPT + */ RECEIPT("Receipt"); private String value; @@ -63,26 +96,24 @@ public enum ObjectGroup { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static ObjectGroup fromValue(String value) { @@ -94,3 +125,4 @@ public static ObjectGroup fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/file/ObjectType.java b/src/main/java/com/xero/models/file/ObjectType.java index f4b08c9aa..559b8b498 100644 --- a/src/main/java/com/xero/models/file/ObjectType.java +++ b/src/main/java/com/xero/models/file/ObjectType.java @@ -9,181 +9,305 @@ * Do not edit the class manually. */ -package com.xero.models.file; - +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The Object Type */ +/** + * The Object Type + */ public enum ObjectType { - - /** UNKNOWN */ + + /** + * UNKNOWN + */ UNKNOWN("Unknown"), - - /** ACCPAY */ + + /** + * ACCPAY + */ ACCPAY("Accpay"), - - /** ACCPAYCREDIT */ + + /** + * ACCPAYCREDIT + */ ACCPAYCREDIT("AccPayCredit"), - - /** ACCPAYPAYMENT */ + + /** + * ACCPAYPAYMENT + */ ACCPAYPAYMENT("AccPayPayment"), - - /** ACCREC */ + + /** + * ACCREC + */ ACCREC("AccRec"), - - /** ACCRECCREDIT */ + + /** + * ACCRECCREDIT + */ ACCRECCREDIT("AccRecCredit"), - - /** ACCRECPAYMENT */ + + /** + * ACCRECPAYMENT + */ ACCRECPAYMENT("AccRecPayment"), - - /** ADJUSTMENT */ + + /** + * ADJUSTMENT + */ ADJUSTMENT("Adjustment"), - - /** APCREDITPAYMENT */ + + /** + * APCREDITPAYMENT + */ APCREDITPAYMENT("ApCreditPayment"), - - /** APOVERPAYMENT */ + + /** + * APOVERPAYMENT + */ APOVERPAYMENT("ApOverPayment"), - - /** APOVERPAYMENTPAYMENT */ + + /** + * APOVERPAYMENTPAYMENT + */ APOVERPAYMENTPAYMENT("ApOverPaymentPayment"), - - /** APOVERPAYMENTSOURCEPAYMENT */ + + /** + * APOVERPAYMENTSOURCEPAYMENT + */ APOVERPAYMENTSOURCEPAYMENT("ApOverPaymentSourcePayment"), - - /** APPREPAYMENT */ + + /** + * APPREPAYMENT + */ APPREPAYMENT("ApPrepayment"), - - /** APPREPAYMENTPAYMENT */ + + /** + * APPREPAYMENTPAYMENT + */ APPREPAYMENTPAYMENT("ApPrepaymentPayment"), - - /** APPREPAYMENTSOURCEPAYMENT */ + + /** + * APPREPAYMENTSOURCEPAYMENT + */ APPREPAYMENTSOURCEPAYMENT("ApPrepaymentSourcePayment"), - - /** ARCREDITPAYMENT */ + + /** + * ARCREDITPAYMENT + */ ARCREDITPAYMENT("ArCreditPayment"), - - /** AROVERPAYMENT */ + + /** + * AROVERPAYMENT + */ AROVERPAYMENT("ArOverPayment"), - - /** AROVERPAYMENTPAYMENT */ + + /** + * AROVERPAYMENTPAYMENT + */ AROVERPAYMENTPAYMENT("ArOverpaymentPayment"), - - /** AROVERPAYMENTSOURCEPAYMENT */ + + /** + * AROVERPAYMENTSOURCEPAYMENT + */ AROVERPAYMENTSOURCEPAYMENT("ArOverpaymentSourcePayment"), - - /** ARPREPAYMENT */ + + /** + * ARPREPAYMENT + */ ARPREPAYMENT("ArPrepayment"), - - /** ARPREPAYMENTPAYMENT */ + + /** + * ARPREPAYMENTPAYMENT + */ ARPREPAYMENTPAYMENT("ArPrepaymentPayment"), - - /** ARPREPAYMENTSOURCEPAYMENT */ + + /** + * ARPREPAYMENTSOURCEPAYMENT + */ ARPREPAYMENTSOURCEPAYMENT("ArPrepaymentSourcePayment"), - - /** CASHPAID */ + + /** + * CASHPAID + */ CASHPAID("CashPaid"), - - /** CASHREC */ + + /** + * CASHREC + */ CASHREC("CashRec"), - - /** EXPPAYMENT */ + + /** + * EXPPAYMENT + */ EXPPAYMENT("ExpPayment"), - - /** MANJOURNAL */ + + /** + * MANJOURNAL + */ MANJOURNAL("ManJournal"), - - /** PURCHASEORDER */ + + /** + * PURCHASEORDER + */ PURCHASEORDER("PurchaseOrder"), - - /** RECEIPT */ + + /** + * RECEIPT + */ RECEIPT("Receipt"), - - /** TRANSFER */ + + /** + * TRANSFER + */ TRANSFER("Transfer"), - - /** ACCOUNT */ + + /** + * ACCOUNT + */ ACCOUNT("Account"), - - /** CONTACT */ + + /** + * CONTACT + */ CONTACT("Contact"), - - /** BUSINESS */ + + /** + * BUSINESS + */ BUSINESS("Business"), - - /** EMPLOYEE */ + + /** + * EMPLOYEE + */ EMPLOYEE("Employee"), - - /** PERSON */ + + /** + * PERSON + */ PERSON("Person"), - - /** USER */ + + /** + * USER + */ USER("User"), - - /** ORG */ + + /** + * ORG + */ ORG("Org"), - - /** FIXEDASSET */ + + /** + * FIXEDASSET + */ FIXEDASSET("FixedAsset"), - - /** PAYRUN */ + + /** + * PAYRUN + */ PAYRUN("PayRun"), - - /** PRICELISTITEM */ + + /** + * PRICELISTITEM + */ PRICELISTITEM("PriceListItem"), - - /** BANK */ + + /** + * BANK + */ BANK("Bank"), - - /** CURRENT */ + + /** + * CURRENT + */ CURRENT("Current"), - - /** EQUITY */ + + /** + * EQUITY + */ EQUITY("Equity"), - - /** EXPENSE */ + + /** + * EXPENSE + */ EXPENSE("Expense"), - - /** FIXED */ + + /** + * FIXED + */ FIXED("Fixed"), - - /** LIABILITY */ + + /** + * LIABILITY + */ LIABILITY("Liability"), - - /** PREPAYMENT */ + + /** + * PREPAYMENT + */ PREPAYMENT("Prepayment"), - - /** REVENUE */ + + /** + * REVENUE + */ REVENUE("Revenue"), - - /** SALES */ + + /** + * SALES + */ SALES("Sales"), - - /** OVERHEADS */ + + /** + * OVERHEADS + */ OVERHEADS("Overheads"), - - /** DEPRECIATN */ + + /** + * DEPRECIATN + */ DEPRECIATN("Depreciatn"), - - /** OTHERINCOME */ + + /** + * OTHERINCOME + */ OTHERINCOME("OtherIncome"), - - /** DIRECTCOSTS */ + + /** + * DIRECTCOSTS + */ DIRECTCOSTS("DirectCosts"), - - /** CURRLIAB */ + + /** + * CURRLIAB + */ CURRLIAB("Currliab"), - - /** TERMLIAB */ + + /** + * TERMLIAB + */ TERMLIAB("Termliab"), - - /** NONCURRENT */ + + /** + * NONCURRENT + */ NONCURRENT("NonCurrent"), - - /** SALESQUOTE */ + + /** + * SALESQUOTE + */ SALESQUOTE("SalesQuote"); private String value; @@ -192,26 +316,24 @@ public enum ObjectType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static ObjectType fromValue(String value) { @@ -223,3 +345,4 @@ public static ObjectType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/file/User.java b/src/main/java/com/xero/models/file/User.java index e59f67702..bfd4c1bff 100644 --- a/src/main/java/com/xero/models/file/User.java +++ b/src/main/java/com/xero/models/file/User.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.file; +package com.xero.models.file; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * User + */ -/** User */ public class User { StringUtil util = new StringUtil(); @@ -36,185 +53,166 @@ public class User { @JsonProperty("FullName") private String fullName; /** - * Xero identifier - * - * @param id UUID - * @return User - */ + * Xero identifier + * @param id UUID + * @return User + **/ public User id(UUID id) { this.id = id; return this; } - /** + /** * Xero identifier - * * @return id - */ - @ApiModelProperty( - example = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c", - required = true, - value = "Xero identifier") - /** + **/ + @ApiModelProperty(example = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c", required = true, value = "Xero identifier") + /** * Xero identifier - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * Xero identifier - * - * @param id UUID - */ + /** + * Xero identifier + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Key is Name, but returns Email address of user who created the file - * - * @param name String - * @return User - */ + * Key is Name, but returns Email address of user who created the file + * @param name String + * @return User + **/ public User name(String name) { this.name = name; return this; } - /** + /** * Key is Name, but returns Email address of user who created the file - * * @return name - */ - @ApiModelProperty( - example = "john.smith@mail.com", - value = "Key is Name, but returns Email address of user who created the file") - /** + **/ + @ApiModelProperty(example = "john.smith@mail.com", value = "Key is Name, but returns Email address of user who created the file") + /** * Key is Name, but returns Email address of user who created the file - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Key is Name, but returns Email address of user who created the file - * - * @param name String - */ + /** + * Key is Name, but returns Email address of user who created the file + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * First name of user - * - * @param firstName String - * @return User - */ + * First name of user + * @param firstName String + * @return User + **/ public User firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of user - * * @return firstName - */ + **/ @ApiModelProperty(example = "John", value = "First name of user") - /** + /** * First name of user - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of user - * - * @param firstName String - */ + /** + * First name of user + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of user - * - * @param lastName String - * @return User - */ + * Last name of user + * @param lastName String + * @return User + **/ public User lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of user - * * @return lastName - */ + **/ @ApiModelProperty(example = "Smith", value = "Last name of user") - /** + /** * Last name of user - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of user - * - * @param lastName String - */ + /** + * Last name of user + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Last name of user - * - * @param fullName String - * @return User - */ + * Last name of user + * @param fullName String + * @return User + **/ public User fullName(String fullName) { this.fullName = fullName; return this; } - /** + /** * Last name of user - * * @return fullName - */ + **/ @ApiModelProperty(example = "Smith", value = "Last name of user") - /** + /** * Last name of user - * * @return fullName String - */ + **/ public String getFullName() { return fullName; } - /** - * Last name of user - * - * @param fullName String - */ + /** + * Last name of user + * @param fullName String + **/ + public void setFullName(String fullName) { this.fullName = fullName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -224,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } User user = (User) o; - return Objects.equals(this.id, user.id) - && Objects.equals(this.name, user.name) - && Objects.equals(this.firstName, user.firstName) - && Objects.equals(this.lastName, user.lastName) - && Objects.equals(this.fullName, user.fullName); + return Objects.equals(this.id, user.id) && + Objects.equals(this.name, user.name) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.fullName, user.fullName); } @Override @@ -236,6 +234,7 @@ public int hashCode() { return Objects.hash(id, name, firstName, lastName, fullName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -258,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/AccountUsage.java b/src/main/java/com/xero/models/finance/AccountUsage.java index a77302c38..d49753c3c 100644 --- a/src/main/java/com/xero/models/finance/AccountUsage.java +++ b/src/main/java/com/xero/models/finance/AccountUsage.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * AccountUsage + */ -/** AccountUsage */ public class AccountUsage { StringUtil util = new StringUtil(); @@ -61,460 +78,422 @@ public class AccountUsage { @JsonProperty("reportCodeUpdatedDateUtc") private OffsetDateTime reportCodeUpdatedDateUtc; /** - * The month this usage item contains data for - * - * @param month String - * @return AccountUsage - */ + * The month this usage item contains data for + * @param month String + * @return AccountUsage + **/ public AccountUsage month(String month) { this.month = month; return this; } - /** + /** * The month this usage item contains data for - * * @return month - */ + **/ @ApiModelProperty(value = "The month this usage item contains data for") - /** + /** * The month this usage item contains data for - * * @return month String - */ + **/ public String getMonth() { return month; } - /** - * The month this usage item contains data for - * - * @param month String - */ + /** + * The month this usage item contains data for + * @param month String + **/ + public void setMonth(String month) { this.month = month; } /** - * The account this usage item contains data for - * - * @param accountId UUID - * @return AccountUsage - */ + * The account this usage item contains data for + * @param accountId UUID + * @return AccountUsage + **/ public AccountUsage accountId(UUID accountId) { this.accountId = accountId; return this; } - /** + /** * The account this usage item contains data for - * * @return accountId - */ + **/ @ApiModelProperty(value = "The account this usage item contains data for") - /** + /** * The account this usage item contains data for - * * @return accountId UUID - */ + **/ public UUID getAccountId() { return accountId; } - /** - * The account this usage item contains data for - * - * @param accountId UUID - */ + /** + * The account this usage item contains data for + * @param accountId UUID + **/ + public void setAccountId(UUID accountId) { this.accountId = accountId; } /** - * The currency code this usage item contains data for - * - * @param currencyCode String - * @return AccountUsage - */ + * The currency code this usage item contains data for + * @param currencyCode String + * @return AccountUsage + **/ public AccountUsage currencyCode(String currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * The currency code this usage item contains data for - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "The currency code this usage item contains data for") - /** + /** * The currency code this usage item contains data for - * * @return currencyCode String - */ + **/ public String getCurrencyCode() { return currencyCode; } - /** - * The currency code this usage item contains data for - * - * @param currencyCode String - */ + /** + * The currency code this usage item contains data for + * @param currencyCode String + **/ + public void setCurrencyCode(String currencyCode) { this.currencyCode = currencyCode; } /** - * Total received - * - * @param totalReceived Double - * @return AccountUsage - */ + * Total received + * @param totalReceived Double + * @return AccountUsage + **/ public AccountUsage totalReceived(Double totalReceived) { this.totalReceived = totalReceived; return this; } - /** + /** * Total received - * * @return totalReceived - */ + **/ @ApiModelProperty(value = "Total received") - /** + /** * Total received - * * @return totalReceived Double - */ + **/ public Double getTotalReceived() { return totalReceived; } - /** - * Total received - * - * @param totalReceived Double - */ + /** + * Total received + * @param totalReceived Double + **/ + public void setTotalReceived(Double totalReceived) { this.totalReceived = totalReceived; } /** - * Count of received - * - * @param countReceived Integer - * @return AccountUsage - */ + * Count of received + * @param countReceived Integer + * @return AccountUsage + **/ public AccountUsage countReceived(Integer countReceived) { this.countReceived = countReceived; return this; } - /** + /** * Count of received - * * @return countReceived - */ + **/ @ApiModelProperty(value = "Count of received") - /** + /** * Count of received - * * @return countReceived Integer - */ + **/ public Integer getCountReceived() { return countReceived; } - /** - * Count of received - * - * @param countReceived Integer - */ + /** + * Count of received + * @param countReceived Integer + **/ + public void setCountReceived(Integer countReceived) { this.countReceived = countReceived; } /** - * Total paid - * - * @param totalPaid Double - * @return AccountUsage - */ + * Total paid + * @param totalPaid Double + * @return AccountUsage + **/ public AccountUsage totalPaid(Double totalPaid) { this.totalPaid = totalPaid; return this; } - /** + /** * Total paid - * * @return totalPaid - */ + **/ @ApiModelProperty(value = "Total paid") - /** + /** * Total paid - * * @return totalPaid Double - */ + **/ public Double getTotalPaid() { return totalPaid; } - /** - * Total paid - * - * @param totalPaid Double - */ + /** + * Total paid + * @param totalPaid Double + **/ + public void setTotalPaid(Double totalPaid) { this.totalPaid = totalPaid; } /** - * Count of paid - * - * @param countPaid Integer - * @return AccountUsage - */ + * Count of paid + * @param countPaid Integer + * @return AccountUsage + **/ public AccountUsage countPaid(Integer countPaid) { this.countPaid = countPaid; return this; } - /** + /** * Count of paid - * * @return countPaid - */ + **/ @ApiModelProperty(value = "Count of paid") - /** + /** * Count of paid - * * @return countPaid Integer - */ + **/ public Integer getCountPaid() { return countPaid; } - /** - * Count of paid - * - * @param countPaid Integer - */ + /** + * Count of paid + * @param countPaid Integer + **/ + public void setCountPaid(Integer countPaid) { this.countPaid = countPaid; } /** - * Total value of manual journals - * - * @param totalManualJournal Double - * @return AccountUsage - */ + * Total value of manual journals + * @param totalManualJournal Double + * @return AccountUsage + **/ public AccountUsage totalManualJournal(Double totalManualJournal) { this.totalManualJournal = totalManualJournal; return this; } - /** + /** * Total value of manual journals - * * @return totalManualJournal - */ + **/ @ApiModelProperty(value = "Total value of manual journals") - /** + /** * Total value of manual journals - * * @return totalManualJournal Double - */ + **/ public Double getTotalManualJournal() { return totalManualJournal; } - /** - * Total value of manual journals - * - * @param totalManualJournal Double - */ + /** + * Total value of manual journals + * @param totalManualJournal Double + **/ + public void setTotalManualJournal(Double totalManualJournal) { this.totalManualJournal = totalManualJournal; } /** - * Count of manual journals - * - * @param countManualJournal Integer - * @return AccountUsage - */ + * Count of manual journals + * @param countManualJournal Integer + * @return AccountUsage + **/ public AccountUsage countManualJournal(Integer countManualJournal) { this.countManualJournal = countManualJournal; return this; } - /** + /** * Count of manual journals - * * @return countManualJournal - */ + **/ @ApiModelProperty(value = "Count of manual journals") - /** + /** * Count of manual journals - * * @return countManualJournal Integer - */ + **/ public Integer getCountManualJournal() { return countManualJournal; } - /** - * Count of manual journals - * - * @param countManualJournal Integer - */ + /** + * Count of manual journals + * @param countManualJournal Integer + **/ + public void setCountManualJournal(Integer countManualJournal) { this.countManualJournal = countManualJournal; } /** - * The name of the account - * - * @param accountName String - * @return AccountUsage - */ + * The name of the account + * @param accountName String + * @return AccountUsage + **/ public AccountUsage accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * The name of the account - * * @return accountName - */ + **/ @ApiModelProperty(value = "The name of the account") - /** + /** * The name of the account - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * The name of the account - * - * @param accountName String - */ + /** + * The name of the account + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * Shown if set - * - * @param reportingCode String - * @return AccountUsage - */ + * Shown if set + * @param reportingCode String + * @return AccountUsage + **/ public AccountUsage reportingCode(String reportingCode) { this.reportingCode = reportingCode; return this; } - /** + /** * Shown if set - * * @return reportingCode - */ + **/ @ApiModelProperty(value = "Shown if set") - /** + /** * Shown if set - * * @return reportingCode String - */ + **/ public String getReportingCode() { return reportingCode; } - /** - * Shown if set - * - * @param reportingCode String - */ + /** + * Shown if set + * @param reportingCode String + **/ + public void setReportingCode(String reportingCode) { this.reportingCode = reportingCode; } /** - * Shown if set - * - * @param reportingCodeName String - * @return AccountUsage - */ + * Shown if set + * @param reportingCodeName String + * @return AccountUsage + **/ public AccountUsage reportingCodeName(String reportingCodeName) { this.reportingCodeName = reportingCodeName; return this; } - /** + /** * Shown if set - * * @return reportingCodeName - */ + **/ @ApiModelProperty(value = "Shown if set") - /** + /** * Shown if set - * * @return reportingCodeName String - */ + **/ public String getReportingCodeName() { return reportingCodeName; } - /** - * Shown if set - * - * @param reportingCodeName String - */ + /** + * Shown if set + * @param reportingCodeName String + **/ + public void setReportingCodeName(String reportingCodeName) { this.reportingCodeName = reportingCodeName; } /** - * Last modified date UTC format - * - * @param reportCodeUpdatedDateUtc OffsetDateTime - * @return AccountUsage - */ + * Last modified date UTC format + * @param reportCodeUpdatedDateUtc OffsetDateTime + * @return AccountUsage + **/ public AccountUsage reportCodeUpdatedDateUtc(OffsetDateTime reportCodeUpdatedDateUtc) { this.reportCodeUpdatedDateUtc = reportCodeUpdatedDateUtc; return this; } - /** + /** * Last modified date UTC format - * * @return reportCodeUpdatedDateUtc - */ + **/ @ApiModelProperty(value = "Last modified date UTC format") - /** + /** * Last modified date UTC format - * * @return reportCodeUpdatedDateUtc OffsetDateTime - */ + **/ public OffsetDateTime getReportCodeUpdatedDateUtc() { return reportCodeUpdatedDateUtc; } - /** - * Last modified date UTC format - * - * @param reportCodeUpdatedDateUtc OffsetDateTime - */ + /** + * Last modified date UTC format + * @param reportCodeUpdatedDateUtc OffsetDateTime + **/ + public void setReportCodeUpdatedDateUtc(OffsetDateTime reportCodeUpdatedDateUtc) { this.reportCodeUpdatedDateUtc = reportCodeUpdatedDateUtc; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -524,39 +503,27 @@ public boolean equals(java.lang.Object o) { return false; } AccountUsage accountUsage = (AccountUsage) o; - return Objects.equals(this.month, accountUsage.month) - && Objects.equals(this.accountId, accountUsage.accountId) - && Objects.equals(this.currencyCode, accountUsage.currencyCode) - && Objects.equals(this.totalReceived, accountUsage.totalReceived) - && Objects.equals(this.countReceived, accountUsage.countReceived) - && Objects.equals(this.totalPaid, accountUsage.totalPaid) - && Objects.equals(this.countPaid, accountUsage.countPaid) - && Objects.equals(this.totalManualJournal, accountUsage.totalManualJournal) - && Objects.equals(this.countManualJournal, accountUsage.countManualJournal) - && Objects.equals(this.accountName, accountUsage.accountName) - && Objects.equals(this.reportingCode, accountUsage.reportingCode) - && Objects.equals(this.reportingCodeName, accountUsage.reportingCodeName) - && Objects.equals(this.reportCodeUpdatedDateUtc, accountUsage.reportCodeUpdatedDateUtc); + return Objects.equals(this.month, accountUsage.month) && + Objects.equals(this.accountId, accountUsage.accountId) && + Objects.equals(this.currencyCode, accountUsage.currencyCode) && + Objects.equals(this.totalReceived, accountUsage.totalReceived) && + Objects.equals(this.countReceived, accountUsage.countReceived) && + Objects.equals(this.totalPaid, accountUsage.totalPaid) && + Objects.equals(this.countPaid, accountUsage.countPaid) && + Objects.equals(this.totalManualJournal, accountUsage.totalManualJournal) && + Objects.equals(this.countManualJournal, accountUsage.countManualJournal) && + Objects.equals(this.accountName, accountUsage.accountName) && + Objects.equals(this.reportingCode, accountUsage.reportingCode) && + Objects.equals(this.reportingCodeName, accountUsage.reportingCodeName) && + Objects.equals(this.reportCodeUpdatedDateUtc, accountUsage.reportCodeUpdatedDateUtc); } @Override public int hashCode() { - return Objects.hash( - month, - accountId, - currencyCode, - totalReceived, - countReceived, - totalPaid, - countPaid, - totalManualJournal, - countManualJournal, - accountName, - reportingCode, - reportingCodeName, - reportCodeUpdatedDateUtc); + return Objects.hash(month, accountId, currencyCode, totalReceived, countReceived, totalPaid, countPaid, totalManualJournal, countManualJournal, accountName, reportingCode, reportingCodeName, reportCodeUpdatedDateUtc); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -573,15 +540,14 @@ public String toString() { sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); sb.append(" reportingCode: ").append(toIndentedString(reportingCode)).append("\n"); sb.append(" reportingCodeName: ").append(toIndentedString(reportingCodeName)).append("\n"); - sb.append(" reportCodeUpdatedDateUtc: ") - .append(toIndentedString(reportCodeUpdatedDateUtc)) - .append("\n"); + sb.append(" reportCodeUpdatedDateUtc: ").append(toIndentedString(reportCodeUpdatedDateUtc)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -589,4 +555,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/AccountUsageResponse.java b/src/main/java/com/xero/models/finance/AccountUsageResponse.java index cd644a02d..08f36cd15 100644 --- a/src/main/java/com/xero/models/finance/AccountUsageResponse.java +++ b/src/main/java/com/xero/models/finance/AccountUsageResponse.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.AccountUsage; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * AccountUsageResponse + */ -/** AccountUsageResponse */ public class AccountUsageResponse { StringUtil util = new StringUtil(); @@ -35,116 +53,106 @@ public class AccountUsageResponse { @JsonProperty("accountUsage") private List accountUsage = new ArrayList(); /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - * @return AccountUsageResponse - */ + * The requested Organisation to which the data pertains + * @param organisationId UUID + * @return AccountUsageResponse + **/ public AccountUsageResponse organisationId(UUID organisationId) { this.organisationId = organisationId; return this; } - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId - */ + **/ @ApiModelProperty(value = "The requested Organisation to which the data pertains") - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId UUID - */ + **/ public UUID getOrganisationId() { return organisationId; } - /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - */ + /** + * The requested Organisation to which the data pertains + * @param organisationId UUID + **/ + public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; } /** - * The start month of the report - * - * @param startMonth String - * @return AccountUsageResponse - */ + * The start month of the report + * @param startMonth String + * @return AccountUsageResponse + **/ public AccountUsageResponse startMonth(String startMonth) { this.startMonth = startMonth; return this; } - /** + /** * The start month of the report - * * @return startMonth - */ + **/ @ApiModelProperty(value = "The start month of the report") - /** + /** * The start month of the report - * * @return startMonth String - */ + **/ public String getStartMonth() { return startMonth; } - /** - * The start month of the report - * - * @param startMonth String - */ + /** + * The start month of the report + * @param startMonth String + **/ + public void setStartMonth(String startMonth) { this.startMonth = startMonth; } /** - * The end month of the report - * - * @param endMonth String - * @return AccountUsageResponse - */ + * The end month of the report + * @param endMonth String + * @return AccountUsageResponse + **/ public AccountUsageResponse endMonth(String endMonth) { this.endMonth = endMonth; return this; } - /** + /** * The end month of the report - * * @return endMonth - */ + **/ @ApiModelProperty(value = "The end month of the report") - /** + /** * The end month of the report - * * @return endMonth String - */ + **/ public String getEndMonth() { return endMonth; } - /** - * The end month of the report - * - * @param endMonth String - */ + /** + * The end month of the report + * @param endMonth String + **/ + public void setEndMonth(String endMonth) { this.endMonth = endMonth; } /** - * accountUsage - * - * @param accountUsage List<AccountUsage> - * @return AccountUsageResponse - */ + * accountUsage + * @param accountUsage List<AccountUsage> + * @return AccountUsageResponse + **/ public AccountUsageResponse accountUsage(List accountUsage) { this.accountUsage = accountUsage; return this; @@ -152,10 +160,9 @@ public AccountUsageResponse accountUsage(List accountUsage) { /** * accountUsage - * - * @param accountUsageItem AccountUsage + * @param accountUsageItem AccountUsage * @return AccountUsageResponse - */ + **/ public AccountUsageResponse addAccountUsageItem(AccountUsage accountUsageItem) { if (this.accountUsage == null) { this.accountUsage = new ArrayList(); @@ -164,30 +171,29 @@ public AccountUsageResponse addAccountUsageItem(AccountUsage accountUsageItem) { return this; } - /** + /** * Get accountUsage - * * @return accountUsage - */ + **/ @ApiModelProperty(value = "") - /** + /** * accountUsage - * * @return accountUsage List - */ + **/ public List getAccountUsage() { return accountUsage; } - /** - * accountUsage - * - * @param accountUsage List<AccountUsage> - */ + /** + * accountUsage + * @param accountUsage List<AccountUsage> + **/ + public void setAccountUsage(List accountUsage) { this.accountUsage = accountUsage; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -197,10 +203,10 @@ public boolean equals(java.lang.Object o) { return false; } AccountUsageResponse accountUsageResponse = (AccountUsageResponse) o; - return Objects.equals(this.organisationId, accountUsageResponse.organisationId) - && Objects.equals(this.startMonth, accountUsageResponse.startMonth) - && Objects.equals(this.endMonth, accountUsageResponse.endMonth) - && Objects.equals(this.accountUsage, accountUsageResponse.accountUsage); + return Objects.equals(this.organisationId, accountUsageResponse.organisationId) && + Objects.equals(this.startMonth, accountUsageResponse.startMonth) && + Objects.equals(this.endMonth, accountUsageResponse.endMonth) && + Objects.equals(this.accountUsage, accountUsageResponse.accountUsage); } @Override @@ -208,6 +214,7 @@ public int hashCode() { return Objects.hash(organisationId, startMonth, endMonth, accountUsage); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -221,7 +228,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -229,4 +237,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/BalanceSheetAccountDetail.java b/src/main/java/com/xero/models/finance/BalanceSheetAccountDetail.java index c5e06ef32..ec6d36af1 100644 --- a/src/main/java/com/xero/models/finance/BalanceSheetAccountDetail.java +++ b/src/main/java/com/xero/models/finance/BalanceSheetAccountDetail.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BalanceSheetAccountDetail + */ -/** BalanceSheetAccountDetail */ public class BalanceSheetAccountDetail { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class BalanceSheetAccountDetail { @JsonProperty("total") private Double total; /** - * Accounting code - * - * @param code String - * @return BalanceSheetAccountDetail - */ + * Accounting code + * @param code String + * @return BalanceSheetAccountDetail + **/ public BalanceSheetAccountDetail code(String code) { this.code = code; return this; } - /** + /** * Accounting code - * * @return code - */ + **/ @ApiModelProperty(value = "Accounting code") - /** + /** * Accounting code - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * Accounting code - * - * @param code String - */ + /** + * Accounting code + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * ID of the account - * - * @param accountID UUID - * @return BalanceSheetAccountDetail - */ + * ID of the account + * @param accountID UUID + * @return BalanceSheetAccountDetail + **/ public BalanceSheetAccountDetail accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * ID of the account - * * @return accountID - */ + **/ @ApiModelProperty(value = "ID of the account") - /** + /** * ID of the account - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * ID of the account - * - * @param accountID UUID - */ + /** + * ID of the account + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * Account name - * - * @param name String - * @return BalanceSheetAccountDetail - */ + * Account name + * @param name String + * @return BalanceSheetAccountDetail + **/ public BalanceSheetAccountDetail name(String name) { this.name = name; return this; } - /** + /** * Account name - * * @return name - */ + **/ @ApiModelProperty(value = "Account name") - /** + /** * Account name - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Account name - * - * @param name String - */ + /** + * Account name + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Reporting code - * - * @param reportingCode String - * @return BalanceSheetAccountDetail - */ + * Reporting code + * @param reportingCode String + * @return BalanceSheetAccountDetail + **/ public BalanceSheetAccountDetail reportingCode(String reportingCode) { this.reportingCode = reportingCode; return this; } - /** + /** * Reporting code - * * @return reportingCode - */ + **/ @ApiModelProperty(value = "Reporting code") - /** + /** * Reporting code - * * @return reportingCode String - */ + **/ public String getReportingCode() { return reportingCode; } - /** - * Reporting code - * - * @param reportingCode String - */ + /** + * Reporting code + * @param reportingCode String + **/ + public void setReportingCode(String reportingCode) { this.reportingCode = reportingCode; } /** - * Total movement on this account - * - * @param total Double - * @return BalanceSheetAccountDetail - */ + * Total movement on this account + * @param total Double + * @return BalanceSheetAccountDetail + **/ public BalanceSheetAccountDetail total(Double total) { this.total = total; return this; } - /** + /** * Total movement on this account - * * @return total - */ + **/ @ApiModelProperty(value = "Total movement on this account") - /** + /** * Total movement on this account - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total movement on this account - * - * @param total Double - */ + /** + * Total movement on this account + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } BalanceSheetAccountDetail balanceSheetAccountDetail = (BalanceSheetAccountDetail) o; - return Objects.equals(this.code, balanceSheetAccountDetail.code) - && Objects.equals(this.accountID, balanceSheetAccountDetail.accountID) - && Objects.equals(this.name, balanceSheetAccountDetail.name) - && Objects.equals(this.reportingCode, balanceSheetAccountDetail.reportingCode) - && Objects.equals(this.total, balanceSheetAccountDetail.total); + return Objects.equals(this.code, balanceSheetAccountDetail.code) && + Objects.equals(this.accountID, balanceSheetAccountDetail.accountID) && + Objects.equals(this.name, balanceSheetAccountDetail.name) && + Objects.equals(this.reportingCode, balanceSheetAccountDetail.reportingCode) && + Objects.equals(this.total, balanceSheetAccountDetail.total); } @Override @@ -231,6 +234,7 @@ public int hashCode() { return Objects.hash(code, accountID, name, reportingCode, total); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/BalanceSheetAccountGroup.java b/src/main/java/com/xero/models/finance/BalanceSheetAccountGroup.java index 11d21509c..873f6b70f 100644 --- a/src/main/java/com/xero/models/finance/BalanceSheetAccountGroup.java +++ b/src/main/java/com/xero/models/finance/BalanceSheetAccountGroup.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.BalanceSheetAccountType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BalanceSheetAccountGroup + */ -/** BalanceSheetAccountGroup */ public class BalanceSheetAccountGroup { StringUtil util = new StringUtil(); @@ -28,11 +46,10 @@ public class BalanceSheetAccountGroup { @JsonProperty("total") private Double total; /** - * accountTypes - * - * @param accountTypes List<BalanceSheetAccountType> - * @return BalanceSheetAccountGroup - */ + * accountTypes + * @param accountTypes List<BalanceSheetAccountType> + * @return BalanceSheetAccountGroup + **/ public BalanceSheetAccountGroup accountTypes(List accountTypes) { this.accountTypes = accountTypes; return this; @@ -40,10 +57,9 @@ public BalanceSheetAccountGroup accountTypes(List accou /** * accountTypes - * - * @param accountTypesItem BalanceSheetAccountType + * @param accountTypesItem BalanceSheetAccountType * @return BalanceSheetAccountGroup - */ + **/ public BalanceSheetAccountGroup addAccountTypesItem(BalanceSheetAccountType accountTypesItem) { if (this.accountTypes == null) { this.accountTypes = new ArrayList(); @@ -52,65 +68,61 @@ public BalanceSheetAccountGroup addAccountTypesItem(BalanceSheetAccountType acco return this; } - /** + /** * Get accountTypes - * * @return accountTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * accountTypes - * * @return accountTypes List - */ + **/ public List getAccountTypes() { return accountTypes; } - /** - * accountTypes - * - * @param accountTypes List<BalanceSheetAccountType> - */ + /** + * accountTypes + * @param accountTypes List<BalanceSheetAccountType> + **/ + public void setAccountTypes(List accountTypes) { this.accountTypes = accountTypes; } /** - * Total value of all the accounts in this type - * - * @param total Double - * @return BalanceSheetAccountGroup - */ + * Total value of all the accounts in this type + * @param total Double + * @return BalanceSheetAccountGroup + **/ public BalanceSheetAccountGroup total(Double total) { this.total = total; return this; } - /** + /** * Total value of all the accounts in this type - * * @return total - */ + **/ @ApiModelProperty(value = "Total value of all the accounts in this type") - /** + /** * Total value of all the accounts in this type - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total value of all the accounts in this type - * - * @param total Double - */ + /** + * Total value of all the accounts in this type + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +132,8 @@ public boolean equals(java.lang.Object o) { return false; } BalanceSheetAccountGroup balanceSheetAccountGroup = (BalanceSheetAccountGroup) o; - return Objects.equals(this.accountTypes, balanceSheetAccountGroup.accountTypes) - && Objects.equals(this.total, balanceSheetAccountGroup.total); + return Objects.equals(this.accountTypes, balanceSheetAccountGroup.accountTypes) && + Objects.equals(this.total, balanceSheetAccountGroup.total); } @Override @@ -129,6 +141,7 @@ public int hashCode() { return Objects.hash(accountTypes, total); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +153,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +162,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/BalanceSheetAccountType.java b/src/main/java/com/xero/models/finance/BalanceSheetAccountType.java index c0be4d948..bdca51d3a 100644 --- a/src/main/java/com/xero/models/finance/BalanceSheetAccountType.java +++ b/src/main/java/com/xero/models/finance/BalanceSheetAccountType.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.BalanceSheetAccountDetail; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BalanceSheetAccountType + */ -/** BalanceSheetAccountType */ public class BalanceSheetAccountType { StringUtil util = new StringUtil(); @@ -31,71 +49,52 @@ public class BalanceSheetAccountType { @JsonProperty("total") private Double total; /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - * @return BalanceSheetAccountType - */ + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + * @return BalanceSheetAccountType + **/ public BalanceSheetAccountType accountType(String accountType) { this.accountType = accountType; return this; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType - */ - @ApiModelProperty( - value = - "The type of the account. See Account" - + " Types") - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + **/ + @ApiModelProperty(value = "The type of the account. See Account Types") + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType String - */ + **/ public String getAccountType() { return accountType; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - */ + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + **/ + public void setAccountType(String accountType) { this.accountType = accountType; } /** - * A list of all accounts of this type. Refer to the Account section below for each account - * element detail. - * - * @param accounts List<BalanceSheetAccountDetail> - * @return BalanceSheetAccountType - */ + * A list of all accounts of this type. Refer to the Account section below for each account element detail. + * @param accounts List<BalanceSheetAccountDetail> + * @return BalanceSheetAccountType + **/ public BalanceSheetAccountType accounts(List accounts) { this.accounts = accounts; return this; } /** - * A list of all accounts of this type. Refer to the Account section below for each account - * element detail. - * - * @param accountsItem BalanceSheetAccountDetail + * A list of all accounts of this type. Refer to the Account section below for each account element detail. + * @param accountsItem BalanceSheetAccountDetail * @return BalanceSheetAccountType - */ + **/ public BalanceSheetAccountType addAccountsItem(BalanceSheetAccountDetail accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -104,71 +103,61 @@ public BalanceSheetAccountType addAccountsItem(BalanceSheetAccountDetail account return this; } - /** - * A list of all accounts of this type. Refer to the Account section below for each account - * element detail. - * + /** + * A list of all accounts of this type. Refer to the Account section below for each account element detail. * @return accounts - */ - @ApiModelProperty( - value = - "A list of all accounts of this type. Refer to the Account section below for each" - + " account element detail.") - /** - * A list of all accounts of this type. Refer to the Account section below for each account - * element detail. - * + **/ + @ApiModelProperty(value = "A list of all accounts of this type. Refer to the Account section below for each account element detail.") + /** + * A list of all accounts of this type. Refer to the Account section below for each account element detail. * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * A list of all accounts of this type. Refer to the Account section below for each account - * element detail. - * - * @param accounts List<BalanceSheetAccountDetail> - */ + /** + * A list of all accounts of this type. Refer to the Account section below for each account element detail. + * @param accounts List<BalanceSheetAccountDetail> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } /** - * Total value of all the accounts in this type - * - * @param total Double - * @return BalanceSheetAccountType - */ + * Total value of all the accounts in this type + * @param total Double + * @return BalanceSheetAccountType + **/ public BalanceSheetAccountType total(Double total) { this.total = total; return this; } - /** + /** * Total value of all the accounts in this type - * * @return total - */ + **/ @ApiModelProperty(value = "Total value of all the accounts in this type") - /** + /** * Total value of all the accounts in this type - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total value of all the accounts in this type - * - * @param total Double - */ + /** + * Total value of all the accounts in this type + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -178,9 +167,9 @@ public boolean equals(java.lang.Object o) { return false; } BalanceSheetAccountType balanceSheetAccountType = (BalanceSheetAccountType) o; - return Objects.equals(this.accountType, balanceSheetAccountType.accountType) - && Objects.equals(this.accounts, balanceSheetAccountType.accounts) - && Objects.equals(this.total, balanceSheetAccountType.total); + return Objects.equals(this.accountType, balanceSheetAccountType.accountType) && + Objects.equals(this.accounts, balanceSheetAccountType.accounts) && + Objects.equals(this.total, balanceSheetAccountType.total); } @Override @@ -188,6 +177,7 @@ public int hashCode() { return Objects.hash(accountType, accounts, total); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -200,7 +190,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -208,4 +199,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/BalanceSheetResponse.java b/src/main/java/com/xero/models/finance/BalanceSheetResponse.java index 8d4accbb5..c9b78487c 100644 --- a/src/main/java/com/xero/models/finance/BalanceSheetResponse.java +++ b/src/main/java/com/xero/models/finance/BalanceSheetResponse.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.BalanceSheetAccountGroup; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BalanceSheetResponse + */ -/** BalanceSheetResponse */ public class BalanceSheetResponse { StringUtil util = new StringUtil(); @@ -33,145 +51,134 @@ public class BalanceSheetResponse { @JsonProperty("equity") private BalanceSheetAccountGroup equity; /** - * Balance date of the report - * - * @param balanceDate LocalDate - * @return BalanceSheetResponse - */ + * Balance date of the report + * @param balanceDate LocalDate + * @return BalanceSheetResponse + **/ public BalanceSheetResponse balanceDate(LocalDate balanceDate) { this.balanceDate = balanceDate; return this; } - /** + /** * Balance date of the report - * * @return balanceDate - */ + **/ @ApiModelProperty(value = "Balance date of the report") - /** + /** * Balance date of the report - * * @return balanceDate LocalDate - */ + **/ public LocalDate getBalanceDate() { return balanceDate; } - /** - * Balance date of the report - * - * @param balanceDate LocalDate - */ + /** + * Balance date of the report + * @param balanceDate LocalDate + **/ + public void setBalanceDate(LocalDate balanceDate) { this.balanceDate = balanceDate; } /** - * asset - * - * @param asset BalanceSheetAccountGroup - * @return BalanceSheetResponse - */ + * asset + * @param asset BalanceSheetAccountGroup + * @return BalanceSheetResponse + **/ public BalanceSheetResponse asset(BalanceSheetAccountGroup asset) { this.asset = asset; return this; } - /** + /** * Get asset - * * @return asset - */ + **/ @ApiModelProperty(value = "") - /** + /** * asset - * * @return asset BalanceSheetAccountGroup - */ + **/ public BalanceSheetAccountGroup getAsset() { return asset; } - /** - * asset - * - * @param asset BalanceSheetAccountGroup - */ + /** + * asset + * @param asset BalanceSheetAccountGroup + **/ + public void setAsset(BalanceSheetAccountGroup asset) { this.asset = asset; } /** - * liability - * - * @param liability BalanceSheetAccountGroup - * @return BalanceSheetResponse - */ + * liability + * @param liability BalanceSheetAccountGroup + * @return BalanceSheetResponse + **/ public BalanceSheetResponse liability(BalanceSheetAccountGroup liability) { this.liability = liability; return this; } - /** + /** * Get liability - * * @return liability - */ + **/ @ApiModelProperty(value = "") - /** + /** * liability - * * @return liability BalanceSheetAccountGroup - */ + **/ public BalanceSheetAccountGroup getLiability() { return liability; } - /** - * liability - * - * @param liability BalanceSheetAccountGroup - */ + /** + * liability + * @param liability BalanceSheetAccountGroup + **/ + public void setLiability(BalanceSheetAccountGroup liability) { this.liability = liability; } /** - * equity - * - * @param equity BalanceSheetAccountGroup - * @return BalanceSheetResponse - */ + * equity + * @param equity BalanceSheetAccountGroup + * @return BalanceSheetResponse + **/ public BalanceSheetResponse equity(BalanceSheetAccountGroup equity) { this.equity = equity; return this; } - /** + /** * Get equity - * * @return equity - */ + **/ @ApiModelProperty(value = "") - /** + /** * equity - * * @return equity BalanceSheetAccountGroup - */ + **/ public BalanceSheetAccountGroup getEquity() { return equity; } - /** - * equity - * - * @param equity BalanceSheetAccountGroup - */ + /** + * equity + * @param equity BalanceSheetAccountGroup + **/ + public void setEquity(BalanceSheetAccountGroup equity) { this.equity = equity; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +188,10 @@ public boolean equals(java.lang.Object o) { return false; } BalanceSheetResponse balanceSheetResponse = (BalanceSheetResponse) o; - return Objects.equals(this.balanceDate, balanceSheetResponse.balanceDate) - && Objects.equals(this.asset, balanceSheetResponse.asset) - && Objects.equals(this.liability, balanceSheetResponse.liability) - && Objects.equals(this.equity, balanceSheetResponse.equity); + return Objects.equals(this.balanceDate, balanceSheetResponse.balanceDate) && + Objects.equals(this.asset, balanceSheetResponse.asset) && + Objects.equals(this.liability, balanceSheetResponse.liability) && + Objects.equals(this.equity, balanceSheetResponse.equity); } @Override @@ -192,6 +199,7 @@ public int hashCode() { return Objects.hash(balanceDate, asset, liability, equity); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +213,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +222,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/BankStatementAccountingResponse.java b/src/main/java/com/xero/models/finance/BankStatementAccountingResponse.java index 68ce5a13f..d68b053b4 100644 --- a/src/main/java/com/xero/models/finance/BankStatementAccountingResponse.java +++ b/src/main/java/com/xero/models/finance/BankStatementAccountingResponse.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.StatementResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankStatementAccountingResponse + */ -/** BankStatementAccountingResponse */ public class BankStatementAccountingResponse { StringUtil util = new StringUtil(); @@ -35,116 +53,106 @@ public class BankStatementAccountingResponse { @JsonProperty("statements") private List statements = new ArrayList(); /** - * Xero Identifier of bank account - * - * @param bankAccountId UUID - * @return BankStatementAccountingResponse - */ + * Xero Identifier of bank account + * @param bankAccountId UUID + * @return BankStatementAccountingResponse + **/ public BankStatementAccountingResponse bankAccountId(UUID bankAccountId) { this.bankAccountId = bankAccountId; return this; } - /** + /** * Xero Identifier of bank account - * * @return bankAccountId - */ + **/ @ApiModelProperty(value = "Xero Identifier of bank account") - /** + /** * Xero Identifier of bank account - * * @return bankAccountId UUID - */ + **/ public UUID getBankAccountId() { return bankAccountId; } - /** - * Xero Identifier of bank account - * - * @param bankAccountId UUID - */ + /** + * Xero Identifier of bank account + * @param bankAccountId UUID + **/ + public void setBankAccountId(UUID bankAccountId) { this.bankAccountId = bankAccountId; } /** - * Name of bank account - * - * @param bankAccountName String - * @return BankStatementAccountingResponse - */ + * Name of bank account + * @param bankAccountName String + * @return BankStatementAccountingResponse + **/ public BankStatementAccountingResponse bankAccountName(String bankAccountName) { this.bankAccountName = bankAccountName; return this; } - /** + /** * Name of bank account - * * @return bankAccountName - */ + **/ @ApiModelProperty(value = "Name of bank account") - /** + /** * Name of bank account - * * @return bankAccountName String - */ + **/ public String getBankAccountName() { return bankAccountName; } - /** - * Name of bank account - * - * @param bankAccountName String - */ + /** + * Name of bank account + * @param bankAccountName String + **/ + public void setBankAccountName(String bankAccountName) { this.bankAccountName = bankAccountName; } /** - * Currency code of the bank account - * - * @param bankAccountCurrencyCode String - * @return BankStatementAccountingResponse - */ + * Currency code of the bank account + * @param bankAccountCurrencyCode String + * @return BankStatementAccountingResponse + **/ public BankStatementAccountingResponse bankAccountCurrencyCode(String bankAccountCurrencyCode) { this.bankAccountCurrencyCode = bankAccountCurrencyCode; return this; } - /** + /** * Currency code of the bank account - * * @return bankAccountCurrencyCode - */ + **/ @ApiModelProperty(value = "Currency code of the bank account") - /** + /** * Currency code of the bank account - * * @return bankAccountCurrencyCode String - */ + **/ public String getBankAccountCurrencyCode() { return bankAccountCurrencyCode; } - /** - * Currency code of the bank account - * - * @param bankAccountCurrencyCode String - */ + /** + * Currency code of the bank account + * @param bankAccountCurrencyCode String + **/ + public void setBankAccountCurrencyCode(String bankAccountCurrencyCode) { this.bankAccountCurrencyCode = bankAccountCurrencyCode; } /** - * List of bank statements and linked accounting data for the requested period - * - * @param statements List<StatementResponse> - * @return BankStatementAccountingResponse - */ + * List of bank statements and linked accounting data for the requested period + * @param statements List<StatementResponse> + * @return BankStatementAccountingResponse + **/ public BankStatementAccountingResponse statements(List statements) { this.statements = statements; return this; @@ -152,10 +160,9 @@ public BankStatementAccountingResponse statements(List statem /** * List of bank statements and linked accounting data for the requested period - * - * @param statementsItem StatementResponse + * @param statementsItem StatementResponse * @return BankStatementAccountingResponse - */ + **/ public BankStatementAccountingResponse addStatementsItem(StatementResponse statementsItem) { if (this.statements == null) { this.statements = new ArrayList(); @@ -164,31 +171,29 @@ public BankStatementAccountingResponse addStatementsItem(StatementResponse state return this; } - /** + /** * List of bank statements and linked accounting data for the requested period - * * @return statements - */ - @ApiModelProperty( - value = "List of bank statements and linked accounting data for the requested period") - /** + **/ + @ApiModelProperty(value = "List of bank statements and linked accounting data for the requested period") + /** * List of bank statements and linked accounting data for the requested period - * * @return statements List - */ + **/ public List getStatements() { return statements; } - /** - * List of bank statements and linked accounting data for the requested period - * - * @param statements List<StatementResponse> - */ + /** + * List of bank statements and linked accounting data for the requested period + * @param statements List<StatementResponse> + **/ + public void setStatements(List statements) { this.statements = statements; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -197,13 +202,11 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - BankStatementAccountingResponse bankStatementAccountingResponse = - (BankStatementAccountingResponse) o; - return Objects.equals(this.bankAccountId, bankStatementAccountingResponse.bankAccountId) - && Objects.equals(this.bankAccountName, bankStatementAccountingResponse.bankAccountName) - && Objects.equals( - this.bankAccountCurrencyCode, bankStatementAccountingResponse.bankAccountCurrencyCode) - && Objects.equals(this.statements, bankStatementAccountingResponse.statements); + BankStatementAccountingResponse bankStatementAccountingResponse = (BankStatementAccountingResponse) o; + return Objects.equals(this.bankAccountId, bankStatementAccountingResponse.bankAccountId) && + Objects.equals(this.bankAccountName, bankStatementAccountingResponse.bankAccountName) && + Objects.equals(this.bankAccountCurrencyCode, bankStatementAccountingResponse.bankAccountCurrencyCode) && + Objects.equals(this.statements, bankStatementAccountingResponse.statements); } @Override @@ -211,22 +214,22 @@ public int hashCode() { return Objects.hash(bankAccountId, bankAccountName, bankAccountCurrencyCode, statements); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BankStatementAccountingResponse {\n"); sb.append(" bankAccountId: ").append(toIndentedString(bankAccountId)).append("\n"); sb.append(" bankAccountName: ").append(toIndentedString(bankAccountName)).append("\n"); - sb.append(" bankAccountCurrencyCode: ") - .append(toIndentedString(bankAccountCurrencyCode)) - .append("\n"); + sb.append(" bankAccountCurrencyCode: ").append(toIndentedString(bankAccountCurrencyCode)).append("\n"); sb.append(" statements: ").append(toIndentedString(statements)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -234,4 +237,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/BankStatementResponse.java b/src/main/java/com/xero/models/finance/BankStatementResponse.java index a17d42a61..3db70d66c 100644 --- a/src/main/java/com/xero/models/finance/BankStatementResponse.java +++ b/src/main/java/com/xero/models/finance/BankStatementResponse.java @@ -9,14 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.CurrentStatementResponse; +import com.xero.models.finance.StatementLinesResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankStatementResponse + */ -/** BankStatementResponse */ public class BankStatementResponse { StringUtil util = new StringUtil(); @@ -26,75 +45,70 @@ public class BankStatementResponse { @JsonProperty("currentStatement") private CurrentStatementResponse currentStatement; /** - * statementLines - * - * @param statementLines StatementLinesResponse - * @return BankStatementResponse - */ + * statementLines + * @param statementLines StatementLinesResponse + * @return BankStatementResponse + **/ public BankStatementResponse statementLines(StatementLinesResponse statementLines) { this.statementLines = statementLines; return this; } - /** + /** * Get statementLines - * * @return statementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * statementLines - * * @return statementLines StatementLinesResponse - */ + **/ public StatementLinesResponse getStatementLines() { return statementLines; } - /** - * statementLines - * - * @param statementLines StatementLinesResponse - */ + /** + * statementLines + * @param statementLines StatementLinesResponse + **/ + public void setStatementLines(StatementLinesResponse statementLines) { this.statementLines = statementLines; } /** - * currentStatement - * - * @param currentStatement CurrentStatementResponse - * @return BankStatementResponse - */ + * currentStatement + * @param currentStatement CurrentStatementResponse + * @return BankStatementResponse + **/ public BankStatementResponse currentStatement(CurrentStatementResponse currentStatement) { this.currentStatement = currentStatement; return this; } - /** + /** * Get currentStatement - * * @return currentStatement - */ + **/ @ApiModelProperty(value = "") - /** + /** * currentStatement - * * @return currentStatement CurrentStatementResponse - */ + **/ public CurrentStatementResponse getCurrentStatement() { return currentStatement; } - /** - * currentStatement - * - * @param currentStatement CurrentStatementResponse - */ + /** + * currentStatement + * @param currentStatement CurrentStatementResponse + **/ + public void setCurrentStatement(CurrentStatementResponse currentStatement) { this.currentStatement = currentStatement; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +118,8 @@ public boolean equals(java.lang.Object o) { return false; } BankStatementResponse bankStatementResponse = (BankStatementResponse) o; - return Objects.equals(this.statementLines, bankStatementResponse.statementLines) - && Objects.equals(this.currentStatement, bankStatementResponse.currentStatement); + return Objects.equals(this.statementLines, bankStatementResponse.statementLines) && + Objects.equals(this.currentStatement, bankStatementResponse.currentStatement); } @Override @@ -113,6 +127,7 @@ public int hashCode() { return Objects.hash(statementLines, currentStatement); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +139,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +148,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/BankTransactionResponse.java b/src/main/java/com/xero/models/finance/BankTransactionResponse.java index 137d17189..baa9a37fe 100644 --- a/src/main/java/com/xero/models/finance/BankTransactionResponse.java +++ b/src/main/java/com/xero/models/finance/BankTransactionResponse.java @@ -9,18 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ContactResponse; +import com.xero.models.finance.LineItemResponse; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankTransactionResponse + */ -/** BankTransactionResponse */ public class BankTransactionResponse { StringUtil util = new StringUtil(); @@ -42,200 +61,180 @@ public class BankTransactionResponse { @JsonProperty("lineItems") private List lineItems = new ArrayList(); /** - * Xero Identifier of transaction - * - * @param bankTransactionId UUID - * @return BankTransactionResponse - */ + * Xero Identifier of transaction + * @param bankTransactionId UUID + * @return BankTransactionResponse + **/ public BankTransactionResponse bankTransactionId(UUID bankTransactionId) { this.bankTransactionId = bankTransactionId; return this; } - /** + /** * Xero Identifier of transaction - * * @return bankTransactionId - */ + **/ @ApiModelProperty(value = "Xero Identifier of transaction") - /** + /** * Xero Identifier of transaction - * * @return bankTransactionId UUID - */ + **/ public UUID getBankTransactionId() { return bankTransactionId; } - /** - * Xero Identifier of transaction - * - * @param bankTransactionId UUID - */ + /** + * Xero Identifier of transaction + * @param bankTransactionId UUID + **/ + public void setBankTransactionId(UUID bankTransactionId) { this.bankTransactionId = bankTransactionId; } /** - * Xero Identifier of batch payment. Present if the transaction is part of a batch. - * - * @param batchPaymentId UUID - * @return BankTransactionResponse - */ + * Xero Identifier of batch payment. Present if the transaction is part of a batch. + * @param batchPaymentId UUID + * @return BankTransactionResponse + **/ public BankTransactionResponse batchPaymentId(UUID batchPaymentId) { this.batchPaymentId = batchPaymentId; return this; } - /** + /** * Xero Identifier of batch payment. Present if the transaction is part of a batch. - * * @return batchPaymentId - */ - @ApiModelProperty( - value = "Xero Identifier of batch payment. Present if the transaction is part of a batch.") - /** + **/ + @ApiModelProperty(value = "Xero Identifier of batch payment. Present if the transaction is part of a batch.") + /** * Xero Identifier of batch payment. Present if the transaction is part of a batch. - * * @return batchPaymentId UUID - */ + **/ public UUID getBatchPaymentId() { return batchPaymentId; } - /** - * Xero Identifier of batch payment. Present if the transaction is part of a batch. - * - * @param batchPaymentId UUID - */ + /** + * Xero Identifier of batch payment. Present if the transaction is part of a batch. + * @param batchPaymentId UUID + **/ + public void setBatchPaymentId(UUID batchPaymentId) { this.batchPaymentId = batchPaymentId; } /** - * contact - * - * @param contact ContactResponse - * @return BankTransactionResponse - */ + * contact + * @param contact ContactResponse + * @return BankTransactionResponse + **/ public BankTransactionResponse contact(ContactResponse contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact ContactResponse - */ + **/ public ContactResponse getContact() { return contact; } - /** - * contact - * - * @param contact ContactResponse - */ + /** + * contact + * @param contact ContactResponse + **/ + public void setContact(ContactResponse contact) { this.contact = contact; } /** - * Date of transaction - YYYY-MM-DD - * - * @param date LocalDate - * @return BankTransactionResponse - */ + * Date of transaction - YYYY-MM-DD + * @param date LocalDate + * @return BankTransactionResponse + **/ public BankTransactionResponse date(LocalDate date) { this.date = date; return this; } - /** + /** * Date of transaction - YYYY-MM-DD - * * @return date - */ + **/ @ApiModelProperty(value = "Date of transaction - YYYY-MM-DD") - /** + /** * Date of transaction - YYYY-MM-DD - * * @return date LocalDate - */ + **/ public LocalDate getDate() { return date; } - /** - * Date of transaction - YYYY-MM-DD - * - * @param date LocalDate - */ + /** + * Date of transaction - YYYY-MM-DD + * @param date LocalDate + **/ + public void setDate(LocalDate date) { this.date = date; } /** - * Amount of transaction - * - * @param amount Double - * @return BankTransactionResponse - */ + * Amount of transaction + * @param amount Double + * @return BankTransactionResponse + **/ public BankTransactionResponse amount(Double amount) { this.amount = amount; return this; } - /** + /** * Amount of transaction - * * @return amount - */ + **/ @ApiModelProperty(value = "Amount of transaction") - /** + /** * Amount of transaction - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Amount of transaction - * - * @param amount Double - */ + /** + * Amount of transaction + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The LineItems element can contain any number of individual LineItem sub-elements. Not included - * in summary mode - * - * @param lineItems List<LineItemResponse> - * @return BankTransactionResponse - */ + * The LineItems element can contain any number of individual LineItem sub-elements. Not included in summary mode + * @param lineItems List<LineItemResponse> + * @return BankTransactionResponse + **/ public BankTransactionResponse lineItems(List lineItems) { this.lineItems = lineItems; return this; } /** - * The LineItems element can contain any number of individual LineItem sub-elements. Not included - * in summary mode - * - * @param lineItemsItem LineItemResponse + * The LineItems element can contain any number of individual LineItem sub-elements. Not included in summary mode + * @param lineItemsItem LineItemResponse * @return BankTransactionResponse - */ + **/ public BankTransactionResponse addLineItemsItem(LineItemResponse lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -244,36 +243,29 @@ public BankTransactionResponse addLineItemsItem(LineItemResponse lineItemsItem) return this; } - /** - * The LineItems element can contain any number of individual LineItem sub-elements. Not included - * in summary mode - * + /** + * The LineItems element can contain any number of individual LineItem sub-elements. Not included in summary mode * @return lineItems - */ - @ApiModelProperty( - value = - "The LineItems element can contain any number of individual LineItem sub-elements. Not" - + " included in summary mode") - /** - * The LineItems element can contain any number of individual LineItem sub-elements. Not included - * in summary mode - * + **/ + @ApiModelProperty(value = "The LineItems element can contain any number of individual LineItem sub-elements. Not included in summary mode") + /** + * The LineItems element can contain any number of individual LineItem sub-elements. Not included in summary mode * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * The LineItems element can contain any number of individual LineItem sub-elements. Not included - * in summary mode - * - * @param lineItems List<LineItemResponse> - */ + /** + * The LineItems element can contain any number of individual LineItem sub-elements. Not included in summary mode + * @param lineItems List<LineItemResponse> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -283,12 +275,12 @@ public boolean equals(java.lang.Object o) { return false; } BankTransactionResponse bankTransactionResponse = (BankTransactionResponse) o; - return Objects.equals(this.bankTransactionId, bankTransactionResponse.bankTransactionId) - && Objects.equals(this.batchPaymentId, bankTransactionResponse.batchPaymentId) - && Objects.equals(this.contact, bankTransactionResponse.contact) - && Objects.equals(this.date, bankTransactionResponse.date) - && Objects.equals(this.amount, bankTransactionResponse.amount) - && Objects.equals(this.lineItems, bankTransactionResponse.lineItems); + return Objects.equals(this.bankTransactionId, bankTransactionResponse.bankTransactionId) && + Objects.equals(this.batchPaymentId, bankTransactionResponse.batchPaymentId) && + Objects.equals(this.contact, bankTransactionResponse.contact) && + Objects.equals(this.date, bankTransactionResponse.date) && + Objects.equals(this.amount, bankTransactionResponse.amount) && + Objects.equals(this.lineItems, bankTransactionResponse.lineItems); } @Override @@ -296,6 +288,7 @@ public int hashCode() { return Objects.hash(bankTransactionId, batchPaymentId, contact, date, amount, lineItems); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -311,7 +304,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -319,4 +313,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CashAccountResponse.java b/src/main/java/com/xero/models/finance/CashAccountResponse.java index fd9d45892..05f1a27ab 100644 --- a/src/main/java/com/xero/models/finance/CashAccountResponse.java +++ b/src/main/java/com/xero/models/finance/CashAccountResponse.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CashAccountResponse + */ -/** CashAccountResponse */ public class CashAccountResponse { StringUtil util = new StringUtil(); @@ -35,201 +52,166 @@ public class CashAccountResponse { @JsonProperty("balanceCurrency") private String balanceCurrency; /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a positive (debit) value. - * - * @param unreconciledAmountPos Double - * @return CashAccountResponse - */ + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a positive (debit) value. + * @param unreconciledAmountPos Double + * @return CashAccountResponse + **/ public CashAccountResponse unreconciledAmountPos(Double unreconciledAmountPos) { this.unreconciledAmountPos = unreconciledAmountPos; return this; } - /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a positive (debit) value. - * + /** + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a positive (debit) value. * @return unreconciledAmountPos - */ - @ApiModelProperty( - value = - "Total value of transactions in the journals which are not reconciled to bank statement" - + " lines, and have a positive (debit) value.") - /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a positive (debit) value. - * + **/ + @ApiModelProperty(value = "Total value of transactions in the journals which are not reconciled to bank statement lines, and have a positive (debit) value.") + /** + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a positive (debit) value. * @return unreconciledAmountPos Double - */ + **/ public Double getUnreconciledAmountPos() { return unreconciledAmountPos; } - /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a positive (debit) value. - * - * @param unreconciledAmountPos Double - */ + /** + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a positive (debit) value. + * @param unreconciledAmountPos Double + **/ + public void setUnreconciledAmountPos(Double unreconciledAmountPos) { this.unreconciledAmountPos = unreconciledAmountPos; } /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a negative (credit) value. - * - * @param unreconciledAmountNeg Double - * @return CashAccountResponse - */ + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a negative (credit) value. + * @param unreconciledAmountNeg Double + * @return CashAccountResponse + **/ public CashAccountResponse unreconciledAmountNeg(Double unreconciledAmountNeg) { this.unreconciledAmountNeg = unreconciledAmountNeg; return this; } - /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a negative (credit) value. - * + /** + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a negative (credit) value. * @return unreconciledAmountNeg - */ - @ApiModelProperty( - value = - "Total value of transactions in the journals which are not reconciled to bank statement" - + " lines, and have a negative (credit) value.") - /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a negative (credit) value. - * + **/ + @ApiModelProperty(value = "Total value of transactions in the journals which are not reconciled to bank statement lines, and have a negative (credit) value.") + /** + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a negative (credit) value. * @return unreconciledAmountNeg Double - */ + **/ public Double getUnreconciledAmountNeg() { return unreconciledAmountNeg; } - /** - * Total value of transactions in the journals which are not reconciled to bank statement lines, - * and have a negative (credit) value. - * - * @param unreconciledAmountNeg Double - */ + /** + * Total value of transactions in the journals which are not reconciled to bank statement lines, and have a negative (credit) value. + * @param unreconciledAmountNeg Double + **/ + public void setUnreconciledAmountNeg(Double unreconciledAmountNeg) { this.unreconciledAmountNeg = unreconciledAmountNeg; } /** - * Starting (or historic) balance from the journals (manually keyed in by users on account - * creation - unverified). - * - * @param startingBalance Double - * @return CashAccountResponse - */ + * Starting (or historic) balance from the journals (manually keyed in by users on account creation - unverified). + * @param startingBalance Double + * @return CashAccountResponse + **/ public CashAccountResponse startingBalance(Double startingBalance) { this.startingBalance = startingBalance; return this; } - /** - * Starting (or historic) balance from the journals (manually keyed in by users on account - * creation - unverified). - * + /** + * Starting (or historic) balance from the journals (manually keyed in by users on account creation - unverified). * @return startingBalance - */ - @ApiModelProperty( - value = - "Starting (or historic) balance from the journals (manually keyed in by users on account" - + " creation - unverified).") - /** - * Starting (or historic) balance from the journals (manually keyed in by users on account - * creation - unverified). - * + **/ + @ApiModelProperty(value = "Starting (or historic) balance from the journals (manually keyed in by users on account creation - unverified).") + /** + * Starting (or historic) balance from the journals (manually keyed in by users on account creation - unverified). * @return startingBalance Double - */ + **/ public Double getStartingBalance() { return startingBalance; } - /** - * Starting (or historic) balance from the journals (manually keyed in by users on account - * creation - unverified). - * - * @param startingBalance Double - */ + /** + * Starting (or historic) balance from the journals (manually keyed in by users on account creation - unverified). + * @param startingBalance Double + **/ + public void setStartingBalance(Double startingBalance) { this.startingBalance = startingBalance; } /** - * Current cash at bank accounting value from the journals. - * - * @param accountBalance Double - * @return CashAccountResponse - */ + * Current cash at bank accounting value from the journals. + * @param accountBalance Double + * @return CashAccountResponse + **/ public CashAccountResponse accountBalance(Double accountBalance) { this.accountBalance = accountBalance; return this; } - /** + /** * Current cash at bank accounting value from the journals. - * * @return accountBalance - */ + **/ @ApiModelProperty(value = "Current cash at bank accounting value from the journals.") - /** + /** * Current cash at bank accounting value from the journals. - * * @return accountBalance Double - */ + **/ public Double getAccountBalance() { return accountBalance; } - /** - * Current cash at bank accounting value from the journals. - * - * @param accountBalance Double - */ + /** + * Current cash at bank accounting value from the journals. + * @param accountBalance Double + **/ + public void setAccountBalance(Double accountBalance) { this.accountBalance = accountBalance; } /** - * Currency which the cashAccount transactions relate to. - * - * @param balanceCurrency String - * @return CashAccountResponse - */ + * Currency which the cashAccount transactions relate to. + * @param balanceCurrency String + * @return CashAccountResponse + **/ public CashAccountResponse balanceCurrency(String balanceCurrency) { this.balanceCurrency = balanceCurrency; return this; } - /** + /** * Currency which the cashAccount transactions relate to. - * * @return balanceCurrency - */ + **/ @ApiModelProperty(value = "Currency which the cashAccount transactions relate to.") - /** + /** * Currency which the cashAccount transactions relate to. - * * @return balanceCurrency String - */ + **/ public String getBalanceCurrency() { return balanceCurrency; } - /** - * Currency which the cashAccount transactions relate to. - * - * @param balanceCurrency String - */ + /** + * Currency which the cashAccount transactions relate to. + * @param balanceCurrency String + **/ + public void setBalanceCurrency(String balanceCurrency) { this.balanceCurrency = balanceCurrency; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -239,33 +221,25 @@ public boolean equals(java.lang.Object o) { return false; } CashAccountResponse cashAccountResponse = (CashAccountResponse) o; - return Objects.equals(this.unreconciledAmountPos, cashAccountResponse.unreconciledAmountPos) - && Objects.equals(this.unreconciledAmountNeg, cashAccountResponse.unreconciledAmountNeg) - && Objects.equals(this.startingBalance, cashAccountResponse.startingBalance) - && Objects.equals(this.accountBalance, cashAccountResponse.accountBalance) - && Objects.equals(this.balanceCurrency, cashAccountResponse.balanceCurrency); + return Objects.equals(this.unreconciledAmountPos, cashAccountResponse.unreconciledAmountPos) && + Objects.equals(this.unreconciledAmountNeg, cashAccountResponse.unreconciledAmountNeg) && + Objects.equals(this.startingBalance, cashAccountResponse.startingBalance) && + Objects.equals(this.accountBalance, cashAccountResponse.accountBalance) && + Objects.equals(this.balanceCurrency, cashAccountResponse.balanceCurrency); } @Override public int hashCode() { - return Objects.hash( - unreconciledAmountPos, - unreconciledAmountNeg, - startingBalance, - accountBalance, - balanceCurrency); + return Objects.hash(unreconciledAmountPos, unreconciledAmountNeg, startingBalance, accountBalance, balanceCurrency); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CashAccountResponse {\n"); - sb.append(" unreconciledAmountPos: ") - .append(toIndentedString(unreconciledAmountPos)) - .append("\n"); - sb.append(" unreconciledAmountNeg: ") - .append(toIndentedString(unreconciledAmountNeg)) - .append("\n"); + sb.append(" unreconciledAmountPos: ").append(toIndentedString(unreconciledAmountPos)).append("\n"); + sb.append(" unreconciledAmountNeg: ").append(toIndentedString(unreconciledAmountNeg)).append("\n"); sb.append(" startingBalance: ").append(toIndentedString(startingBalance)).append("\n"); sb.append(" accountBalance: ").append(toIndentedString(accountBalance)).append("\n"); sb.append(" balanceCurrency: ").append(toIndentedString(balanceCurrency)).append("\n"); @@ -274,7 +248,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -282,4 +257,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CashBalance.java b/src/main/java/com/xero/models/finance/CashBalance.java index 203083830..9e1361582 100644 --- a/src/main/java/com/xero/models/finance/CashBalance.java +++ b/src/main/java/com/xero/models/finance/CashBalance.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CashBalance + */ -/** CashBalance */ public class CashBalance { StringUtil util = new StringUtil(); @@ -29,90 +46,83 @@ public class CashBalance { @JsonProperty("netCashMovement") private Double netCashMovement; /** - * Opening balance of cash and cash equivalents - * - * @param openingCashBalance Double - * @return CashBalance - */ + * Opening balance of cash and cash equivalents + * @param openingCashBalance Double + * @return CashBalance + **/ public CashBalance openingCashBalance(Double openingCashBalance) { this.openingCashBalance = openingCashBalance; return this; } - /** + /** * Opening balance of cash and cash equivalents - * * @return openingCashBalance - */ + **/ @ApiModelProperty(value = "Opening balance of cash and cash equivalents") - /** + /** * Opening balance of cash and cash equivalents - * * @return openingCashBalance Double - */ + **/ public Double getOpeningCashBalance() { return openingCashBalance; } - /** - * Opening balance of cash and cash equivalents - * - * @param openingCashBalance Double - */ + /** + * Opening balance of cash and cash equivalents + * @param openingCashBalance Double + **/ + public void setOpeningCashBalance(Double openingCashBalance) { this.openingCashBalance = openingCashBalance; } /** - * Closing balance of cash and cash equivalents - * - * @param closingCashBalance Double - * @return CashBalance - */ + * Closing balance of cash and cash equivalents + * @param closingCashBalance Double + * @return CashBalance + **/ public CashBalance closingCashBalance(Double closingCashBalance) { this.closingCashBalance = closingCashBalance; return this; } - /** + /** * Closing balance of cash and cash equivalents - * * @return closingCashBalance - */ + **/ @ApiModelProperty(value = "Closing balance of cash and cash equivalents") - /** + /** * Closing balance of cash and cash equivalents - * * @return closingCashBalance Double - */ + **/ public Double getClosingCashBalance() { return closingCashBalance; } - /** - * Closing balance of cash and cash equivalents - * - * @param closingCashBalance Double - */ + /** + * Closing balance of cash and cash equivalents + * @param closingCashBalance Double + **/ + public void setClosingCashBalance(Double closingCashBalance) { this.closingCashBalance = closingCashBalance; } - /** + /** * Net movement of cash and cash equivalents for the period - * * @return netCashMovement - */ + **/ @ApiModelProperty(value = "Net movement of cash and cash equivalents for the period") - /** + /** * Net movement of cash and cash equivalents for the period - * * @return netCashMovement Double - */ + **/ public Double getNetCashMovement() { return netCashMovement; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -122,9 +132,9 @@ public boolean equals(java.lang.Object o) { return false; } CashBalance cashBalance = (CashBalance) o; - return Objects.equals(this.openingCashBalance, cashBalance.openingCashBalance) - && Objects.equals(this.closingCashBalance, cashBalance.closingCashBalance) - && Objects.equals(this.netCashMovement, cashBalance.netCashMovement); + return Objects.equals(this.openingCashBalance, cashBalance.openingCashBalance) && + Objects.equals(this.closingCashBalance, cashBalance.closingCashBalance) && + Objects.equals(this.netCashMovement, cashBalance.netCashMovement); } @Override @@ -132,6 +142,7 @@ public int hashCode() { return Objects.hash(openingCashBalance, closingCashBalance, netCashMovement); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,7 +155,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -152,4 +164,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CashValidationResponse.java b/src/main/java/com/xero/models/finance/CashValidationResponse.java index 33db0b2c6..91b799d24 100644 --- a/src/main/java/com/xero/models/finance/CashValidationResponse.java +++ b/src/main/java/com/xero/models/finance/CashValidationResponse.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.BankStatementResponse; +import com.xero.models.finance.CashAccountResponse; +import com.xero.models.finance.StatementBalanceResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CashValidationResponse + */ -/** CashValidationResponse */ public class CashValidationResponse { StringUtil util = new StringUtil(); @@ -37,187 +57,166 @@ public class CashValidationResponse { @JsonProperty("cashAccount") private CashAccountResponse cashAccount; /** - * The Xero identifier for an account - * - * @param accountId UUID - * @return CashValidationResponse - */ + * The Xero identifier for an account + * @param accountId UUID + * @return CashValidationResponse + **/ public CashValidationResponse accountId(UUID accountId) { this.accountId = accountId; return this; } - /** + /** * The Xero identifier for an account - * * @return accountId - */ + **/ @ApiModelProperty(value = "The Xero identifier for an account") - /** + /** * The Xero identifier for an account - * * @return accountId UUID - */ + **/ public UUID getAccountId() { return accountId; } - /** - * The Xero identifier for an account - * - * @param accountId UUID - */ + /** + * The Xero identifier for an account + * @param accountId UUID + **/ + public void setAccountId(UUID accountId) { this.accountId = accountId; } /** - * statementBalance - * - * @param statementBalance StatementBalanceResponse - * @return CashValidationResponse - */ + * statementBalance + * @param statementBalance StatementBalanceResponse + * @return CashValidationResponse + **/ public CashValidationResponse statementBalance(StatementBalanceResponse statementBalance) { this.statementBalance = statementBalance; return this; } - /** + /** * Get statementBalance - * * @return statementBalance - */ + **/ @ApiModelProperty(value = "") - /** + /** * statementBalance - * * @return statementBalance StatementBalanceResponse - */ + **/ public StatementBalanceResponse getStatementBalance() { return statementBalance; } - /** - * statementBalance - * - * @param statementBalance StatementBalanceResponse - */ + /** + * statementBalance + * @param statementBalance StatementBalanceResponse + **/ + public void setStatementBalance(StatementBalanceResponse statementBalance) { this.statementBalance = statementBalance; } /** - * UTC Date when the last bank statement item was entered into Xero. This date is represented in - * ISO 8601 format. - * - * @param statementBalanceDate LocalDate - * @return CashValidationResponse - */ + * UTC Date when the last bank statement item was entered into Xero. This date is represented in ISO 8601 format. + * @param statementBalanceDate LocalDate + * @return CashValidationResponse + **/ public CashValidationResponse statementBalanceDate(LocalDate statementBalanceDate) { this.statementBalanceDate = statementBalanceDate; return this; } - /** - * UTC Date when the last bank statement item was entered into Xero. This date is represented in - * ISO 8601 format. - * + /** + * UTC Date when the last bank statement item was entered into Xero. This date is represented in ISO 8601 format. * @return statementBalanceDate - */ - @ApiModelProperty( - value = - "UTC Date when the last bank statement item was entered into Xero. This date is" - + " represented in ISO 8601 format.") - /** - * UTC Date when the last bank statement item was entered into Xero. This date is represented in - * ISO 8601 format. - * + **/ + @ApiModelProperty(value = "UTC Date when the last bank statement item was entered into Xero. This date is represented in ISO 8601 format.") + /** + * UTC Date when the last bank statement item was entered into Xero. This date is represented in ISO 8601 format. * @return statementBalanceDate LocalDate - */ + **/ public LocalDate getStatementBalanceDate() { return statementBalanceDate; } - /** - * UTC Date when the last bank statement item was entered into Xero. This date is represented in - * ISO 8601 format. - * - * @param statementBalanceDate LocalDate - */ + /** + * UTC Date when the last bank statement item was entered into Xero. This date is represented in ISO 8601 format. + * @param statementBalanceDate LocalDate + **/ + public void setStatementBalanceDate(LocalDate statementBalanceDate) { this.statementBalanceDate = statementBalanceDate; } /** - * bankStatement - * - * @param bankStatement BankStatementResponse - * @return CashValidationResponse - */ + * bankStatement + * @param bankStatement BankStatementResponse + * @return CashValidationResponse + **/ public CashValidationResponse bankStatement(BankStatementResponse bankStatement) { this.bankStatement = bankStatement; return this; } - /** + /** * Get bankStatement - * * @return bankStatement - */ + **/ @ApiModelProperty(value = "") - /** + /** * bankStatement - * * @return bankStatement BankStatementResponse - */ + **/ public BankStatementResponse getBankStatement() { return bankStatement; } - /** - * bankStatement - * - * @param bankStatement BankStatementResponse - */ + /** + * bankStatement + * @param bankStatement BankStatementResponse + **/ + public void setBankStatement(BankStatementResponse bankStatement) { this.bankStatement = bankStatement; } /** - * cashAccount - * - * @param cashAccount CashAccountResponse - * @return CashValidationResponse - */ + * cashAccount + * @param cashAccount CashAccountResponse + * @return CashValidationResponse + **/ public CashValidationResponse cashAccount(CashAccountResponse cashAccount) { this.cashAccount = cashAccount; return this; } - /** + /** * Get cashAccount - * * @return cashAccount - */ + **/ @ApiModelProperty(value = "") - /** + /** * cashAccount - * * @return cashAccount CashAccountResponse - */ + **/ public CashAccountResponse getCashAccount() { return cashAccount; } - /** - * cashAccount - * - * @param cashAccount CashAccountResponse - */ + /** + * cashAccount + * @param cashAccount CashAccountResponse + **/ + public void setCashAccount(CashAccountResponse cashAccount) { this.cashAccount = cashAccount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,28 +226,26 @@ public boolean equals(java.lang.Object o) { return false; } CashValidationResponse cashValidationResponse = (CashValidationResponse) o; - return Objects.equals(this.accountId, cashValidationResponse.accountId) - && Objects.equals(this.statementBalance, cashValidationResponse.statementBalance) - && Objects.equals(this.statementBalanceDate, cashValidationResponse.statementBalanceDate) - && Objects.equals(this.bankStatement, cashValidationResponse.bankStatement) - && Objects.equals(this.cashAccount, cashValidationResponse.cashAccount); + return Objects.equals(this.accountId, cashValidationResponse.accountId) && + Objects.equals(this.statementBalance, cashValidationResponse.statementBalance) && + Objects.equals(this.statementBalanceDate, cashValidationResponse.statementBalanceDate) && + Objects.equals(this.bankStatement, cashValidationResponse.bankStatement) && + Objects.equals(this.cashAccount, cashValidationResponse.cashAccount); } @Override public int hashCode() { - return Objects.hash( - accountId, statementBalance, statementBalanceDate, bankStatement, cashAccount); + return Objects.hash(accountId, statementBalance, statementBalanceDate, bankStatement, cashAccount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CashValidationResponse {\n"); sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); sb.append(" statementBalance: ").append(toIndentedString(statementBalance)).append("\n"); - sb.append(" statementBalanceDate: ") - .append(toIndentedString(statementBalanceDate)) - .append("\n"); + sb.append(" statementBalanceDate: ").append(toIndentedString(statementBalanceDate)).append("\n"); sb.append(" bankStatement: ").append(toIndentedString(bankStatement)).append("\n"); sb.append(" cashAccount: ").append(toIndentedString(cashAccount)).append("\n"); sb.append("}"); @@ -256,7 +253,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -264,4 +262,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CashflowAccount.java b/src/main/java/com/xero/models/finance/CashflowAccount.java index a2890dda8..8b7ad9d48 100644 --- a/src/main/java/com/xero/models/finance/CashflowAccount.java +++ b/src/main/java/com/xero/models/finance/CashflowAccount.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CashflowAccount + */ -/** CashflowAccount */ public class CashflowAccount { StringUtil util = new StringUtil(); @@ -42,274 +59,230 @@ public class CashflowAccount { @JsonProperty("total") private Double total; /** - * ID of the account - * - * @param accountId UUID - * @return CashflowAccount - */ + * ID of the account + * @param accountId UUID + * @return CashflowAccount + **/ public CashflowAccount accountId(UUID accountId) { this.accountId = accountId; return this; } - /** + /** * ID of the account - * * @return accountId - */ + **/ @ApiModelProperty(value = "ID of the account") - /** + /** * ID of the account - * * @return accountId UUID - */ + **/ public UUID getAccountId() { return accountId; } - /** - * ID of the account - * - * @param accountId UUID - */ + /** + * ID of the account + * @param accountId UUID + **/ + public void setAccountId(UUID accountId) { this.accountId = accountId; } /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - * @return CashflowAccount - */ + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + * @return CashflowAccount + **/ public CashflowAccount accountType(String accountType) { this.accountType = accountType; return this; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType - */ - @ApiModelProperty( - value = - "The type of the account. See Account" - + " Types") - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + **/ + @ApiModelProperty(value = "The type of the account. See Account Types") + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType String - */ + **/ public String getAccountType() { return accountType; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - */ + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + **/ + public void setAccountType(String accountType) { this.accountType = accountType; } /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * - * @param accountClass String - * @return CashflowAccount - */ + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> + * @param accountClass String + * @return CashflowAccount + **/ public CashflowAccount accountClass(String accountClass) { this.accountClass = accountClass; return this; } - /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * + /** + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> * @return accountClass - */ - @ApiModelProperty( - value = - "The class of the account. See Account" - + " Class Types") - /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * + **/ + @ApiModelProperty(value = "The class of the account. See Account Class Types") + /** + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> * @return accountClass String - */ + **/ public String getAccountClass() { return accountClass; } - /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * - * @param accountClass String - */ + /** + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> + * @param accountClass String + **/ + public void setAccountClass(String accountClass) { this.accountClass = accountClass; } /** - * Account code - * - * @param code String - * @return CashflowAccount - */ + * Account code + * @param code String + * @return CashflowAccount + **/ public CashflowAccount code(String code) { this.code = code; return this; } - /** + /** * Account code - * * @return code - */ + **/ @ApiModelProperty(value = "Account code") - /** + /** * Account code - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * Account code - * - * @param code String - */ + /** + * Account code + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Account name - * - * @param name String - * @return CashflowAccount - */ + * Account name + * @param name String + * @return CashflowAccount + **/ public CashflowAccount name(String name) { this.name = name; return this; } - /** + /** * Account name - * * @return name - */ + **/ @ApiModelProperty(value = "Account name") - /** + /** * Account name - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Account name - * - * @param name String - */ + /** + * Account name + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Reporting code used for cash flow classification - * - * @param reportingCode String - * @return CashflowAccount - */ + * Reporting code used for cash flow classification + * @param reportingCode String + * @return CashflowAccount + **/ public CashflowAccount reportingCode(String reportingCode) { this.reportingCode = reportingCode; return this; } - /** + /** * Reporting code used for cash flow classification - * * @return reportingCode - */ + **/ @ApiModelProperty(value = "Reporting code used for cash flow classification") - /** + /** * Reporting code used for cash flow classification - * * @return reportingCode String - */ + **/ public String getReportingCode() { return reportingCode; } - /** - * Reporting code used for cash flow classification - * - * @param reportingCode String - */ + /** + * Reporting code used for cash flow classification + * @param reportingCode String + **/ + public void setReportingCode(String reportingCode) { this.reportingCode = reportingCode; } /** - * Total amount for the account - * - * @param total Double - * @return CashflowAccount - */ + * Total amount for the account + * @param total Double + * @return CashflowAccount + **/ public CashflowAccount total(Double total) { this.total = total; return this; } - /** + /** * Total amount for the account - * * @return total - */ + **/ @ApiModelProperty(value = "Total amount for the account") - /** + /** * Total amount for the account - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total amount for the account - * - * @param total Double - */ + /** + * Total amount for the account + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -319,13 +292,13 @@ public boolean equals(java.lang.Object o) { return false; } CashflowAccount cashflowAccount = (CashflowAccount) o; - return Objects.equals(this.accountId, cashflowAccount.accountId) - && Objects.equals(this.accountType, cashflowAccount.accountType) - && Objects.equals(this.accountClass, cashflowAccount.accountClass) - && Objects.equals(this.code, cashflowAccount.code) - && Objects.equals(this.name, cashflowAccount.name) - && Objects.equals(this.reportingCode, cashflowAccount.reportingCode) - && Objects.equals(this.total, cashflowAccount.total); + return Objects.equals(this.accountId, cashflowAccount.accountId) && + Objects.equals(this.accountType, cashflowAccount.accountType) && + Objects.equals(this.accountClass, cashflowAccount.accountClass) && + Objects.equals(this.code, cashflowAccount.code) && + Objects.equals(this.name, cashflowAccount.name) && + Objects.equals(this.reportingCode, cashflowAccount.reportingCode) && + Objects.equals(this.total, cashflowAccount.total); } @Override @@ -333,6 +306,7 @@ public int hashCode() { return Objects.hash(accountId, accountType, accountClass, code, name, reportingCode, total); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -349,7 +323,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -357,4 +332,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CashflowActivity.java b/src/main/java/com/xero/models/finance/CashflowActivity.java index da6a7148b..3c9519193 100644 --- a/src/main/java/com/xero/models/finance/CashflowActivity.java +++ b/src/main/java/com/xero/models/finance/CashflowActivity.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.CashflowType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CashflowActivity + */ -/** CashflowActivity */ public class CashflowActivity { StringUtil util = new StringUtil(); @@ -31,88 +49,74 @@ public class CashflowActivity { @JsonProperty("cashflowTypes") private List cashflowTypes = new ArrayList(); /** - * Name of the cashflow activity type. It will be either Operating Activities, Investing - * Activities or Financing Activities - * - * @param name String - * @return CashflowActivity - */ + * Name of the cashflow activity type. It will be either Operating Activities, Investing Activities or Financing Activities + * @param name String + * @return CashflowActivity + **/ public CashflowActivity name(String name) { this.name = name; return this; } - /** - * Name of the cashflow activity type. It will be either Operating Activities, Investing - * Activities or Financing Activities - * + /** + * Name of the cashflow activity type. It will be either Operating Activities, Investing Activities or Financing Activities * @return name - */ - @ApiModelProperty( - value = - "Name of the cashflow activity type. It will be either Operating Activities, Investing" - + " Activities or Financing Activities") - /** - * Name of the cashflow activity type. It will be either Operating Activities, Investing - * Activities or Financing Activities - * + **/ + @ApiModelProperty(value = "Name of the cashflow activity type. It will be either Operating Activities, Investing Activities or Financing Activities") + /** + * Name of the cashflow activity type. It will be either Operating Activities, Investing Activities or Financing Activities * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the cashflow activity type. It will be either Operating Activities, Investing - * Activities or Financing Activities - * - * @param name String - */ + /** + * Name of the cashflow activity type. It will be either Operating Activities, Investing Activities or Financing Activities + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Total value of the activity type - * - * @param total Double - * @return CashflowActivity - */ + * Total value of the activity type + * @param total Double + * @return CashflowActivity + **/ public CashflowActivity total(Double total) { this.total = total; return this; } - /** + /** * Total value of the activity type - * * @return total - */ + **/ @ApiModelProperty(value = "Total value of the activity type") - /** + /** * Total value of the activity type - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total value of the activity type - * - * @param total Double - */ + /** + * Total value of the activity type + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * cashflowTypes - * - * @param cashflowTypes List<CashflowType> - * @return CashflowActivity - */ + * cashflowTypes + * @param cashflowTypes List<CashflowType> + * @return CashflowActivity + **/ public CashflowActivity cashflowTypes(List cashflowTypes) { this.cashflowTypes = cashflowTypes; return this; @@ -120,10 +124,9 @@ public CashflowActivity cashflowTypes(List cashflowTypes) { /** * cashflowTypes - * - * @param cashflowTypesItem CashflowType + * @param cashflowTypesItem CashflowType * @return CashflowActivity - */ + **/ public CashflowActivity addCashflowTypesItem(CashflowType cashflowTypesItem) { if (this.cashflowTypes == null) { this.cashflowTypes = new ArrayList(); @@ -132,30 +135,29 @@ public CashflowActivity addCashflowTypesItem(CashflowType cashflowTypesItem) { return this; } - /** + /** * Get cashflowTypes - * * @return cashflowTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * cashflowTypes - * * @return cashflowTypes List - */ + **/ public List getCashflowTypes() { return cashflowTypes; } - /** - * cashflowTypes - * - * @param cashflowTypes List<CashflowType> - */ + /** + * cashflowTypes + * @param cashflowTypes List<CashflowType> + **/ + public void setCashflowTypes(List cashflowTypes) { this.cashflowTypes = cashflowTypes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,9 +167,9 @@ public boolean equals(java.lang.Object o) { return false; } CashflowActivity cashflowActivity = (CashflowActivity) o; - return Objects.equals(this.name, cashflowActivity.name) - && Objects.equals(this.total, cashflowActivity.total) - && Objects.equals(this.cashflowTypes, cashflowActivity.cashflowTypes); + return Objects.equals(this.name, cashflowActivity.name) && + Objects.equals(this.total, cashflowActivity.total) && + Objects.equals(this.cashflowTypes, cashflowActivity.cashflowTypes); } @Override @@ -175,6 +177,7 @@ public int hashCode() { return Objects.hash(name, total, cashflowTypes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -187,7 +190,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -195,4 +199,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CashflowResponse.java b/src/main/java/com/xero/models/finance/CashflowResponse.java index 0996abd58..5408f1852 100644 --- a/src/main/java/com/xero/models/finance/CashflowResponse.java +++ b/src/main/java/com/xero/models/finance/CashflowResponse.java @@ -9,17 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.CashBalance; +import com.xero.models.finance.CashflowActivity; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CashflowResponse + */ -/** CashflowResponse */ public class CashflowResponse { StringUtil util = new StringUtil(); @@ -35,116 +54,106 @@ public class CashflowResponse { @JsonProperty("cashflowActivities") private List cashflowActivities = new ArrayList(); /** - * Start date of the report - * - * @param startDate LocalDate - * @return CashflowResponse - */ + * Start date of the report + * @param startDate LocalDate + * @return CashflowResponse + **/ public CashflowResponse startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the report - * * @return startDate - */ + **/ @ApiModelProperty(value = "Start date of the report") - /** + /** * Start date of the report - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the report - * - * @param startDate LocalDate - */ + /** + * Start date of the report + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * End date of the report - * - * @param endDate LocalDate - * @return CashflowResponse - */ + * End date of the report + * @param endDate LocalDate + * @return CashflowResponse + **/ public CashflowResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * End date of the report - * * @return endDate - */ + **/ @ApiModelProperty(value = "End date of the report") - /** + /** * End date of the report - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * End date of the report - * - * @param endDate LocalDate - */ + /** + * End date of the report + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * cashBalance - * - * @param cashBalance CashBalance - * @return CashflowResponse - */ + * cashBalance + * @param cashBalance CashBalance + * @return CashflowResponse + **/ public CashflowResponse cashBalance(CashBalance cashBalance) { this.cashBalance = cashBalance; return this; } - /** + /** * Get cashBalance - * * @return cashBalance - */ + **/ @ApiModelProperty(value = "") - /** + /** * cashBalance - * * @return cashBalance CashBalance - */ + **/ public CashBalance getCashBalance() { return cashBalance; } - /** - * cashBalance - * - * @param cashBalance CashBalance - */ + /** + * cashBalance + * @param cashBalance CashBalance + **/ + public void setCashBalance(CashBalance cashBalance) { this.cashBalance = cashBalance; } /** - * Break down of cash and cash equivalents for the period - * - * @param cashflowActivities List<CashflowActivity> - * @return CashflowResponse - */ + * Break down of cash and cash equivalents for the period + * @param cashflowActivities List<CashflowActivity> + * @return CashflowResponse + **/ public CashflowResponse cashflowActivities(List cashflowActivities) { this.cashflowActivities = cashflowActivities; return this; @@ -152,10 +161,9 @@ public CashflowResponse cashflowActivities(List cashflowActivi /** * Break down of cash and cash equivalents for the period - * - * @param cashflowActivitiesItem CashflowActivity + * @param cashflowActivitiesItem CashflowActivity * @return CashflowResponse - */ + **/ public CashflowResponse addCashflowActivitiesItem(CashflowActivity cashflowActivitiesItem) { if (this.cashflowActivities == null) { this.cashflowActivities = new ArrayList(); @@ -164,30 +172,29 @@ public CashflowResponse addCashflowActivitiesItem(CashflowActivity cashflowActiv return this; } - /** + /** * Break down of cash and cash equivalents for the period - * * @return cashflowActivities - */ + **/ @ApiModelProperty(value = "Break down of cash and cash equivalents for the period") - /** + /** * Break down of cash and cash equivalents for the period - * * @return cashflowActivities List - */ + **/ public List getCashflowActivities() { return cashflowActivities; } - /** - * Break down of cash and cash equivalents for the period - * - * @param cashflowActivities List<CashflowActivity> - */ + /** + * Break down of cash and cash equivalents for the period + * @param cashflowActivities List<CashflowActivity> + **/ + public void setCashflowActivities(List cashflowActivities) { this.cashflowActivities = cashflowActivities; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -197,10 +204,10 @@ public boolean equals(java.lang.Object o) { return false; } CashflowResponse cashflowResponse = (CashflowResponse) o; - return Objects.equals(this.startDate, cashflowResponse.startDate) - && Objects.equals(this.endDate, cashflowResponse.endDate) - && Objects.equals(this.cashBalance, cashflowResponse.cashBalance) - && Objects.equals(this.cashflowActivities, cashflowResponse.cashflowActivities); + return Objects.equals(this.startDate, cashflowResponse.startDate) && + Objects.equals(this.endDate, cashflowResponse.endDate) && + Objects.equals(this.cashBalance, cashflowResponse.cashBalance) && + Objects.equals(this.cashflowActivities, cashflowResponse.cashflowActivities); } @Override @@ -208,6 +215,7 @@ public int hashCode() { return Objects.hash(startDate, endDate, cashBalance, cashflowActivities); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -221,7 +229,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -229,4 +238,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CashflowType.java b/src/main/java/com/xero/models/finance/CashflowType.java index 099b60474..345e1f11e 100644 --- a/src/main/java/com/xero/models/finance/CashflowType.java +++ b/src/main/java/com/xero/models/finance/CashflowType.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.CashflowAccount; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CashflowType + */ -/** CashflowType */ public class CashflowType { StringUtil util = new StringUtil(); @@ -31,81 +49,74 @@ public class CashflowType { @JsonProperty("accounts") private List accounts = new ArrayList(); /** - * Name of the activity - * - * @param name String - * @return CashflowType - */ + * Name of the activity + * @param name String + * @return CashflowType + **/ public CashflowType name(String name) { this.name = name; return this; } - /** + /** * Name of the activity - * * @return name - */ + **/ @ApiModelProperty(value = "Name of the activity") - /** + /** * Name of the activity - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the activity - * - * @param name String - */ + /** + * Name of the activity + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Total value of the activity - * - * @param total Double - * @return CashflowType - */ + * Total value of the activity + * @param total Double + * @return CashflowType + **/ public CashflowType total(Double total) { this.total = total; return this; } - /** + /** * Total value of the activity - * * @return total - */ + **/ @ApiModelProperty(value = "Total value of the activity") - /** + /** * Total value of the activity - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total value of the activity - * - * @param total Double - */ + /** + * Total value of the activity + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * List of the accounts in this activity - * - * @param accounts List<CashflowAccount> - * @return CashflowType - */ + * List of the accounts in this activity + * @param accounts List<CashflowAccount> + * @return CashflowType + **/ public CashflowType accounts(List accounts) { this.accounts = accounts; return this; @@ -113,10 +124,9 @@ public CashflowType accounts(List accounts) { /** * List of the accounts in this activity - * - * @param accountsItem CashflowAccount + * @param accountsItem CashflowAccount * @return CashflowType - */ + **/ public CashflowType addAccountsItem(CashflowAccount accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -125,30 +135,29 @@ public CashflowType addAccountsItem(CashflowAccount accountsItem) { return this; } - /** + /** * List of the accounts in this activity - * * @return accounts - */ + **/ @ApiModelProperty(value = "List of the accounts in this activity") - /** + /** * List of the accounts in this activity - * * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * List of the accounts in this activity - * - * @param accounts List<CashflowAccount> - */ + /** + * List of the accounts in this activity + * @param accounts List<CashflowAccount> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +167,9 @@ public boolean equals(java.lang.Object o) { return false; } CashflowType cashflowType = (CashflowType) o; - return Objects.equals(this.name, cashflowType.name) - && Objects.equals(this.total, cashflowType.total) - && Objects.equals(this.accounts, cashflowType.accounts); + return Objects.equals(this.name, cashflowType.name) && + Objects.equals(this.total, cashflowType.total) && + Objects.equals(this.accounts, cashflowType.accounts); } @Override @@ -168,6 +177,7 @@ public int hashCode() { return Objects.hash(name, total, accounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +190,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +199,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ContactDetail.java b/src/main/java/com/xero/models/finance/ContactDetail.java index 1d058785d..389a0bc5c 100644 --- a/src/main/java/com/xero/models/finance/ContactDetail.java +++ b/src/main/java/com/xero/models/finance/ContactDetail.java @@ -9,17 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ContactTotalDetail; +import com.xero.models.finance.ContactTotalOther; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ContactDetail + */ -/** ContactDetail */ public class ContactDetail { StringUtil util = new StringUtil(); @@ -41,215 +60,170 @@ public class ContactDetail { @JsonProperty("accountCodes") private List accountCodes = new ArrayList(); /** - * ID of the contact associated with the transactions. Transactions with no contact will be - * grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are - * receive or spend bank transfers will be grouped under the special ID: - * 207322B3-6A58-4BE7-80F1-430123914AD6 - * - * @param contactId UUID - * @return ContactDetail - */ + * ID of the contact associated with the transactions. Transactions with no contact will be grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are receive or spend bank transfers will be grouped under the special ID: 207322B3-6A58-4BE7-80F1-430123914AD6 + * @param contactId UUID + * @return ContactDetail + **/ public ContactDetail contactId(UUID contactId) { this.contactId = contactId; return this; } - /** - * ID of the contact associated with the transactions. Transactions with no contact will be - * grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are - * receive or spend bank transfers will be grouped under the special ID: - * 207322B3-6A58-4BE7-80F1-430123914AD6 - * + /** + * ID of the contact associated with the transactions. Transactions with no contact will be grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are receive or spend bank transfers will be grouped under the special ID: 207322B3-6A58-4BE7-80F1-430123914AD6 * @return contactId - */ - @ApiModelProperty( - value = - "ID of the contact associated with the transactions. Transactions with no contact" - + " will be grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. " - + " Transactions that are receive or spend bank transfers will be grouped under the" - + " special ID: 207322B3-6A58-4BE7-80F1-430123914AD6") - /** - * ID of the contact associated with the transactions. Transactions with no contact will be - * grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are - * receive or spend bank transfers will be grouped under the special ID: - * 207322B3-6A58-4BE7-80F1-430123914AD6 - * + **/ + @ApiModelProperty(value = "ID of the contact associated with the transactions. Transactions with no contact will be grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are receive or spend bank transfers will be grouped under the special ID: 207322B3-6A58-4BE7-80F1-430123914AD6") + /** + * ID of the contact associated with the transactions. Transactions with no contact will be grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are receive or spend bank transfers will be grouped under the special ID: 207322B3-6A58-4BE7-80F1-430123914AD6 * @return contactId UUID - */ + **/ public UUID getContactId() { return contactId; } - /** - * ID of the contact associated with the transactions. Transactions with no contact will be - * grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are - * receive or spend bank transfers will be grouped under the special ID: - * 207322B3-6A58-4BE7-80F1-430123914AD6 - * - * @param contactId UUID - */ + /** + * ID of the contact associated with the transactions. Transactions with no contact will be grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are receive or spend bank transfers will be grouped under the special ID: 207322B3-6A58-4BE7-80F1-430123914AD6 + * @param contactId UUID + **/ + public void setContactId(UUID contactId) { this.contactId = contactId; } /** - * Name of the contact associated with the transactions. If no contact is associated with the - * transactions this will appear as “None Provided”, For receive or spend bank transfer - * transactions, this will appear as “Bank Transfer”. - * - * @param name String - * @return ContactDetail - */ + * Name of the contact associated with the transactions. If no contact is associated with the transactions this will appear as “None Provided”, For receive or spend bank transfer transactions, this will appear as “Bank Transfer”. + * @param name String + * @return ContactDetail + **/ public ContactDetail name(String name) { this.name = name; return this; } - /** - * Name of the contact associated with the transactions. If no contact is associated with the - * transactions this will appear as “None Provided”, For receive or spend bank transfer - * transactions, this will appear as “Bank Transfer”. - * + /** + * Name of the contact associated with the transactions. If no contact is associated with the transactions this will appear as “None Provided”, For receive or spend bank transfer transactions, this will appear as “Bank Transfer”. * @return name - */ - @ApiModelProperty( - value = - "Name of the contact associated with the transactions. If no contact is associated" - + " with the transactions this will appear as “None Provided”, For receive or" - + " spend bank transfer transactions, this will appear as “Bank Transfer”.") - /** - * Name of the contact associated with the transactions. If no contact is associated with the - * transactions this will appear as “None Provided”, For receive or spend bank transfer - * transactions, this will appear as “Bank Transfer”. - * + **/ + @ApiModelProperty(value = "Name of the contact associated with the transactions. If no contact is associated with the transactions this will appear as “None Provided”, For receive or spend bank transfer transactions, this will appear as “Bank Transfer”.") + /** + * Name of the contact associated with the transactions. If no contact is associated with the transactions this will appear as “None Provided”, For receive or spend bank transfer transactions, this will appear as “Bank Transfer”. * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the contact associated with the transactions. If no contact is associated with the - * transactions this will appear as “None Provided”, For receive or spend bank transfer - * transactions, this will appear as “Bank Transfer”. - * - * @param name String - */ + /** + * Name of the contact associated with the transactions. If no contact is associated with the transactions this will appear as “None Provided”, For receive or spend bank transfer transactions, this will appear as “Bank Transfer”. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Total value for the contact - * - * @param total Double - * @return ContactDetail - */ + * Total value for the contact + * @param total Double + * @return ContactDetail + **/ public ContactDetail total(Double total) { this.total = total; return this; } - /** + /** * Total value for the contact - * * @return total - */ + **/ @ApiModelProperty(value = "Total value for the contact") - /** + /** * Total value for the contact - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total value for the contact - * - * @param total Double - */ + /** + * Total value for the contact + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * totalDetail - * - * @param totalDetail ContactTotalDetail - * @return ContactDetail - */ + * totalDetail + * @param totalDetail ContactTotalDetail + * @return ContactDetail + **/ public ContactDetail totalDetail(ContactTotalDetail totalDetail) { this.totalDetail = totalDetail; return this; } - /** + /** * Get totalDetail - * * @return totalDetail - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalDetail - * * @return totalDetail ContactTotalDetail - */ + **/ public ContactTotalDetail getTotalDetail() { return totalDetail; } - /** - * totalDetail - * - * @param totalDetail ContactTotalDetail - */ + /** + * totalDetail + * @param totalDetail ContactTotalDetail + **/ + public void setTotalDetail(ContactTotalDetail totalDetail) { this.totalDetail = totalDetail; } /** - * totalOther - * - * @param totalOther ContactTotalOther - * @return ContactDetail - */ + * totalOther + * @param totalOther ContactTotalOther + * @return ContactDetail + **/ public ContactDetail totalOther(ContactTotalOther totalOther) { this.totalOther = totalOther; return this; } - /** + /** * Get totalOther - * * @return totalOther - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalOther - * * @return totalOther ContactTotalOther - */ + **/ public ContactTotalOther getTotalOther() { return totalOther; } - /** - * totalOther - * - * @param totalOther ContactTotalOther - */ + /** + * totalOther + * @param totalOther ContactTotalOther + **/ + public void setTotalOther(ContactTotalOther totalOther) { this.totalOther = totalOther; } /** - * A list of account codes involved in transactions. - * - * @param accountCodes List<> - * @return ContactDetail - */ + * A list of account codes involved in transactions. + * @param accountCodes List<> + * @return ContactDetail + **/ public ContactDetail accountCodes(List accountCodes) { this.accountCodes = accountCodes; return this; @@ -257,10 +231,9 @@ public ContactDetail accountCodes(List accountCodes) { /** * A list of account codes involved in transactions. - * - * @param accountCodesItem String + * @param accountCodesItem String * @return ContactDetail - */ + **/ public ContactDetail addAccountCodesItem(String accountCodesItem) { if (this.accountCodes == null) { this.accountCodes = new ArrayList(); @@ -269,30 +242,29 @@ public ContactDetail addAccountCodesItem(String accountCodesItem) { return this; } - /** + /** * A list of account codes involved in transactions. - * * @return accountCodes - */ + **/ @ApiModelProperty(value = "A list of account codes involved in transactions.") - /** + /** * A list of account codes involved in transactions. - * * @return accountCodes List - */ + **/ public List getAccountCodes() { return accountCodes; } - /** - * A list of account codes involved in transactions. - * - * @param accountCodes List<> - */ + /** + * A list of account codes involved in transactions. + * @param accountCodes List<> + **/ + public void setAccountCodes(List accountCodes) { this.accountCodes = accountCodes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -302,12 +274,12 @@ public boolean equals(java.lang.Object o) { return false; } ContactDetail contactDetail = (ContactDetail) o; - return Objects.equals(this.contactId, contactDetail.contactId) - && Objects.equals(this.name, contactDetail.name) - && Objects.equals(this.total, contactDetail.total) - && Objects.equals(this.totalDetail, contactDetail.totalDetail) - && Objects.equals(this.totalOther, contactDetail.totalOther) - && Objects.equals(this.accountCodes, contactDetail.accountCodes); + return Objects.equals(this.contactId, contactDetail.contactId) && + Objects.equals(this.name, contactDetail.name) && + Objects.equals(this.total, contactDetail.total) && + Objects.equals(this.totalDetail, contactDetail.totalDetail) && + Objects.equals(this.totalOther, contactDetail.totalOther) && + Objects.equals(this.accountCodes, contactDetail.accountCodes); } @Override @@ -315,6 +287,7 @@ public int hashCode() { return Objects.hash(contactId, name, total, totalDetail, totalOther, accountCodes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -330,7 +303,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -338,4 +312,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ContactResponse.java b/src/main/java/com/xero/models/finance/ContactResponse.java index eb92b9961..e380fa3a5 100644 --- a/src/main/java/com/xero/models/finance/ContactResponse.java +++ b/src/main/java/com/xero/models/finance/ContactResponse.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ContactResponse + */ -/** ContactResponse */ public class ContactResponse { StringUtil util = new StringUtil(); @@ -27,75 +44,70 @@ public class ContactResponse { @JsonProperty("contactName") private String contactName; /** - * Xero Identifier of contact - * - * @param contactId UUID - * @return ContactResponse - */ + * Xero Identifier of contact + * @param contactId UUID + * @return ContactResponse + **/ public ContactResponse contactId(UUID contactId) { this.contactId = contactId; return this; } - /** + /** * Xero Identifier of contact - * * @return contactId - */ + **/ @ApiModelProperty(value = "Xero Identifier of contact") - /** + /** * Xero Identifier of contact - * * @return contactId UUID - */ + **/ public UUID getContactId() { return contactId; } - /** - * Xero Identifier of contact - * - * @param contactId UUID - */ + /** + * Xero Identifier of contact + * @param contactId UUID + **/ + public void setContactId(UUID contactId) { this.contactId = contactId; } /** - * Full name of contact/organisation - * - * @param contactName String - * @return ContactResponse - */ + * Full name of contact/organisation + * @param contactName String + * @return ContactResponse + **/ public ContactResponse contactName(String contactName) { this.contactName = contactName; return this; } - /** + /** * Full name of contact/organisation - * * @return contactName - */ + **/ @ApiModelProperty(value = "Full name of contact/organisation") - /** + /** * Full name of contact/organisation - * * @return contactName String - */ + **/ public String getContactName() { return contactName; } - /** - * Full name of contact/organisation - * - * @param contactName String - */ + /** + * Full name of contact/organisation + * @param contactName String + **/ + public void setContactName(String contactName) { this.contactName = contactName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } ContactResponse contactResponse = (ContactResponse) o; - return Objects.equals(this.contactId, contactResponse.contactId) - && Objects.equals(this.contactName, contactResponse.contactName); + return Objects.equals(this.contactId, contactResponse.contactId) && + Objects.equals(this.contactName, contactResponse.contactName); } @Override @@ -114,6 +126,7 @@ public int hashCode() { return Objects.hash(contactId, contactName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -125,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -133,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ContactTotalDetail.java b/src/main/java/com/xero/models/finance/ContactTotalDetail.java index 08c8f754c..9ab5a6c01 100644 --- a/src/main/java/com/xero/models/finance/ContactTotalDetail.java +++ b/src/main/java/com/xero/models/finance/ContactTotalDetail.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ContactTotalDetail + */ -/** ContactTotalDetail */ public class ContactTotalDetail { StringUtil util = new StringUtil(); @@ -29,110 +46,102 @@ public class ContactTotalDetail { @JsonProperty("totalCreditedUnApplied") private Double totalCreditedUnApplied; /** - * Total paid invoice and cash value for the contact within the period. - * - * @param totalPaid Double - * @return ContactTotalDetail - */ + * Total paid invoice and cash value for the contact within the period. + * @param totalPaid Double + * @return ContactTotalDetail + **/ public ContactTotalDetail totalPaid(Double totalPaid) { this.totalPaid = totalPaid; return this; } - /** + /** * Total paid invoice and cash value for the contact within the period. - * * @return totalPaid - */ + **/ @ApiModelProperty(value = "Total paid invoice and cash value for the contact within the period.") - /** + /** * Total paid invoice and cash value for the contact within the period. - * * @return totalPaid Double - */ + **/ public Double getTotalPaid() { return totalPaid; } - /** - * Total paid invoice and cash value for the contact within the period. - * - * @param totalPaid Double - */ + /** + * Total paid invoice and cash value for the contact within the period. + * @param totalPaid Double + **/ + public void setTotalPaid(Double totalPaid) { this.totalPaid = totalPaid; } /** - * Total outstanding invoice value for the contact within the period. - * - * @param totalOutstanding Double - * @return ContactTotalDetail - */ + * Total outstanding invoice value for the contact within the period. + * @param totalOutstanding Double + * @return ContactTotalDetail + **/ public ContactTotalDetail totalOutstanding(Double totalOutstanding) { this.totalOutstanding = totalOutstanding; return this; } - /** + /** * Total outstanding invoice value for the contact within the period. - * * @return totalOutstanding - */ + **/ @ApiModelProperty(value = "Total outstanding invoice value for the contact within the period.") - /** + /** * Total outstanding invoice value for the contact within the period. - * * @return totalOutstanding Double - */ + **/ public Double getTotalOutstanding() { return totalOutstanding; } - /** - * Total outstanding invoice value for the contact within the period. - * - * @param totalOutstanding Double - */ + /** + * Total outstanding invoice value for the contact within the period. + * @param totalOutstanding Double + **/ + public void setTotalOutstanding(Double totalOutstanding) { this.totalOutstanding = totalOutstanding; } /** - * Total unapplied credited value for the contact within the period. - * - * @param totalCreditedUnApplied Double - * @return ContactTotalDetail - */ + * Total unapplied credited value for the contact within the period. + * @param totalCreditedUnApplied Double + * @return ContactTotalDetail + **/ public ContactTotalDetail totalCreditedUnApplied(Double totalCreditedUnApplied) { this.totalCreditedUnApplied = totalCreditedUnApplied; return this; } - /** + /** * Total unapplied credited value for the contact within the period. - * * @return totalCreditedUnApplied - */ + **/ @ApiModelProperty(value = "Total unapplied credited value for the contact within the period.") - /** + /** * Total unapplied credited value for the contact within the period. - * * @return totalCreditedUnApplied Double - */ + **/ public Double getTotalCreditedUnApplied() { return totalCreditedUnApplied; } - /** - * Total unapplied credited value for the contact within the period. - * - * @param totalCreditedUnApplied Double - */ + /** + * Total unapplied credited value for the contact within the period. + * @param totalCreditedUnApplied Double + **/ + public void setTotalCreditedUnApplied(Double totalCreditedUnApplied) { this.totalCreditedUnApplied = totalCreditedUnApplied; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +151,9 @@ public boolean equals(java.lang.Object o) { return false; } ContactTotalDetail contactTotalDetail = (ContactTotalDetail) o; - return Objects.equals(this.totalPaid, contactTotalDetail.totalPaid) - && Objects.equals(this.totalOutstanding, contactTotalDetail.totalOutstanding) - && Objects.equals(this.totalCreditedUnApplied, contactTotalDetail.totalCreditedUnApplied); + return Objects.equals(this.totalPaid, contactTotalDetail.totalPaid) && + Objects.equals(this.totalOutstanding, contactTotalDetail.totalOutstanding) && + Objects.equals(this.totalCreditedUnApplied, contactTotalDetail.totalCreditedUnApplied); } @Override @@ -152,21 +161,21 @@ public int hashCode() { return Objects.hash(totalPaid, totalOutstanding, totalCreditedUnApplied); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ContactTotalDetail {\n"); sb.append(" totalPaid: ").append(toIndentedString(totalPaid)).append("\n"); sb.append(" totalOutstanding: ").append(toIndentedString(totalOutstanding)).append("\n"); - sb.append(" totalCreditedUnApplied: ") - .append(toIndentedString(totalCreditedUnApplied)) - .append("\n"); + sb.append(" totalCreditedUnApplied: ").append(toIndentedString(totalCreditedUnApplied)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -174,4 +183,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ContactTotalOther.java b/src/main/java/com/xero/models/finance/ContactTotalOther.java index 08b14831a..ea4d1b32a 100644 --- a/src/main/java/com/xero/models/finance/ContactTotalOther.java +++ b/src/main/java/com/xero/models/finance/ContactTotalOther.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ContactTotalOther + */ -/** ContactTotalOther */ public class ContactTotalOther { StringUtil util = new StringUtil(); @@ -32,152 +49,134 @@ public class ContactTotalOther { @JsonProperty("transactionCount") private Integer transactionCount; /** - * Total outstanding invoice value for the contact within the period where the invoices are more - * than 90 days old - * - * @param totalOutstandingAged Double - * @return ContactTotalOther - */ + * Total outstanding invoice value for the contact within the period where the invoices are more than 90 days old + * @param totalOutstandingAged Double + * @return ContactTotalOther + **/ public ContactTotalOther totalOutstandingAged(Double totalOutstandingAged) { this.totalOutstandingAged = totalOutstandingAged; return this; } - /** - * Total outstanding invoice value for the contact within the period where the invoices are more - * than 90 days old - * + /** + * Total outstanding invoice value for the contact within the period where the invoices are more than 90 days old * @return totalOutstandingAged - */ - @ApiModelProperty( - value = - "Total outstanding invoice value for the contact within the period where the invoices" - + " are more than 90 days old") - /** - * Total outstanding invoice value for the contact within the period where the invoices are more - * than 90 days old - * + **/ + @ApiModelProperty(value = "Total outstanding invoice value for the contact within the period where the invoices are more than 90 days old") + /** + * Total outstanding invoice value for the contact within the period where the invoices are more than 90 days old * @return totalOutstandingAged Double - */ + **/ public Double getTotalOutstandingAged() { return totalOutstandingAged; } - /** - * Total outstanding invoice value for the contact within the period where the invoices are more - * than 90 days old - * - * @param totalOutstandingAged Double - */ + /** + * Total outstanding invoice value for the contact within the period where the invoices are more than 90 days old + * @param totalOutstandingAged Double + **/ + public void setTotalOutstandingAged(Double totalOutstandingAged) { this.totalOutstandingAged = totalOutstandingAged; } /** - * Total voided value for the contact. - * - * @param totalVoided Double - * @return ContactTotalOther - */ + * Total voided value for the contact. + * @param totalVoided Double + * @return ContactTotalOther + **/ public ContactTotalOther totalVoided(Double totalVoided) { this.totalVoided = totalVoided; return this; } - /** + /** * Total voided value for the contact. - * * @return totalVoided - */ + **/ @ApiModelProperty(value = "Total voided value for the contact.") - /** + /** * Total voided value for the contact. - * * @return totalVoided Double - */ + **/ public Double getTotalVoided() { return totalVoided; } - /** - * Total voided value for the contact. - * - * @param totalVoided Double - */ + /** + * Total voided value for the contact. + * @param totalVoided Double + **/ + public void setTotalVoided(Double totalVoided) { this.totalVoided = totalVoided; } /** - * Total credited value for the contact. - * - * @param totalCredited Double - * @return ContactTotalOther - */ + * Total credited value for the contact. + * @param totalCredited Double + * @return ContactTotalOther + **/ public ContactTotalOther totalCredited(Double totalCredited) { this.totalCredited = totalCredited; return this; } - /** + /** * Total credited value for the contact. - * * @return totalCredited - */ + **/ @ApiModelProperty(value = "Total credited value for the contact.") - /** + /** * Total credited value for the contact. - * * @return totalCredited Double - */ + **/ public Double getTotalCredited() { return totalCredited; } - /** - * Total credited value for the contact. - * - * @param totalCredited Double - */ + /** + * Total credited value for the contact. + * @param totalCredited Double + **/ + public void setTotalCredited(Double totalCredited) { this.totalCredited = totalCredited; } /** - * Number of transactions for the contact. - * - * @param transactionCount Integer - * @return ContactTotalOther - */ + * Number of transactions for the contact. + * @param transactionCount Integer + * @return ContactTotalOther + **/ public ContactTotalOther transactionCount(Integer transactionCount) { this.transactionCount = transactionCount; return this; } - /** + /** * Number of transactions for the contact. - * * @return transactionCount - */ + **/ @ApiModelProperty(value = "Number of transactions for the contact.") - /** + /** * Number of transactions for the contact. - * * @return transactionCount Integer - */ + **/ public Integer getTransactionCount() { return transactionCount; } - /** - * Number of transactions for the contact. - * - * @param transactionCount Integer - */ + /** + * Number of transactions for the contact. + * @param transactionCount Integer + **/ + public void setTransactionCount(Integer transactionCount) { this.transactionCount = transactionCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -187,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } ContactTotalOther contactTotalOther = (ContactTotalOther) o; - return Objects.equals(this.totalOutstandingAged, contactTotalOther.totalOutstandingAged) - && Objects.equals(this.totalVoided, contactTotalOther.totalVoided) - && Objects.equals(this.totalCredited, contactTotalOther.totalCredited) - && Objects.equals(this.transactionCount, contactTotalOther.transactionCount); + return Objects.equals(this.totalOutstandingAged, contactTotalOther.totalOutstandingAged) && + Objects.equals(this.totalVoided, contactTotalOther.totalVoided) && + Objects.equals(this.totalCredited, contactTotalOther.totalCredited) && + Objects.equals(this.transactionCount, contactTotalOther.transactionCount); } @Override @@ -198,13 +197,12 @@ public int hashCode() { return Objects.hash(totalOutstandingAged, totalVoided, totalCredited, transactionCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ContactTotalOther {\n"); - sb.append(" totalOutstandingAged: ") - .append(toIndentedString(totalOutstandingAged)) - .append("\n"); + sb.append(" totalOutstandingAged: ").append(toIndentedString(totalOutstandingAged)).append("\n"); sb.append(" totalVoided: ").append(toIndentedString(totalVoided)).append("\n"); sb.append(" totalCredited: ").append(toIndentedString(totalCredited)).append("\n"); sb.append(" transactionCount: ").append(toIndentedString(transactionCount)).append("\n"); @@ -213,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -221,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CreditNoteResponse.java b/src/main/java/com/xero/models/finance/CreditNoteResponse.java index 85cc247fd..c8b3f2b43 100644 --- a/src/main/java/com/xero/models/finance/CreditNoteResponse.java +++ b/src/main/java/com/xero/models/finance/CreditNoteResponse.java @@ -9,17 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ContactResponse; +import com.xero.models.finance.LineItemResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CreditNoteResponse + */ -/** CreditNoteResponse */ public class CreditNoteResponse { StringUtil util = new StringUtil(); @@ -35,118 +54,106 @@ public class CreditNoteResponse { @JsonProperty("lineItems") private List lineItems = new ArrayList(); /** - * Xero Identifier of credit note - * - * @param creditNoteId UUID - * @return CreditNoteResponse - */ + * Xero Identifier of credit note + * @param creditNoteId UUID + * @return CreditNoteResponse + **/ public CreditNoteResponse creditNoteId(UUID creditNoteId) { this.creditNoteId = creditNoteId; return this; } - /** + /** * Xero Identifier of credit note - * * @return creditNoteId - */ + **/ @ApiModelProperty(value = "Xero Identifier of credit note") - /** + /** * Xero Identifier of credit note - * * @return creditNoteId UUID - */ + **/ public UUID getCreditNoteId() { return creditNoteId; } - /** - * Xero Identifier of credit note - * - * @param creditNoteId UUID - */ + /** + * Xero Identifier of credit note + * @param creditNoteId UUID + **/ + public void setCreditNoteId(UUID creditNoteId) { this.creditNoteId = creditNoteId; } /** - * contact - * - * @param contact ContactResponse - * @return CreditNoteResponse - */ + * contact + * @param contact ContactResponse + * @return CreditNoteResponse + **/ public CreditNoteResponse contact(ContactResponse contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact ContactResponse - */ + **/ public ContactResponse getContact() { return contact; } - /** - * contact - * - * @param contact ContactResponse - */ + /** + * contact + * @param contact ContactResponse + **/ + public void setContact(ContactResponse contact) { this.contact = contact; } /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - * @return CreditNoteResponse - */ + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + * @return CreditNoteResponse + **/ public CreditNoteResponse total(Double total) { this.total = total; return this; } - /** + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total - */ - @ApiModelProperty( - value = - "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") - /** + **/ + @ApiModelProperty(value = "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - */ + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - * @return CreditNoteResponse - */ + * Not included in summary mode + * @param lineItems List<LineItemResponse> + * @return CreditNoteResponse + **/ public CreditNoteResponse lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -154,10 +161,9 @@ public CreditNoteResponse lineItems(List lineItems) { /** * Not included in summary mode - * - * @param lineItemsItem LineItemResponse + * @param lineItemsItem LineItemResponse * @return CreditNoteResponse - */ + **/ public CreditNoteResponse addLineItemsItem(LineItemResponse lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -166,30 +172,29 @@ public CreditNoteResponse addLineItemsItem(LineItemResponse lineItemsItem) { return this; } - /** + /** * Not included in summary mode - * * @return lineItems - */ + **/ @ApiModelProperty(value = "Not included in summary mode") - /** + /** * Not included in summary mode - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - */ + /** + * Not included in summary mode + * @param lineItems List<LineItemResponse> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -199,10 +204,10 @@ public boolean equals(java.lang.Object o) { return false; } CreditNoteResponse creditNoteResponse = (CreditNoteResponse) o; - return Objects.equals(this.creditNoteId, creditNoteResponse.creditNoteId) - && Objects.equals(this.contact, creditNoteResponse.contact) - && Objects.equals(this.total, creditNoteResponse.total) - && Objects.equals(this.lineItems, creditNoteResponse.lineItems); + return Objects.equals(this.creditNoteId, creditNoteResponse.creditNoteId) && + Objects.equals(this.contact, creditNoteResponse.contact) && + Objects.equals(this.total, creditNoteResponse.total) && + Objects.equals(this.lineItems, creditNoteResponse.lineItems); } @Override @@ -210,6 +215,7 @@ public int hashCode() { return Objects.hash(creditNoteId, contact, total, lineItems); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -223,7 +229,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -231,4 +238,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/CurrentStatementResponse.java b/src/main/java/com/xero/models/finance/CurrentStatementResponse.java index 83c9cfdf8..5e62794c2 100644 --- a/src/main/java/com/xero/models/finance/CurrentStatementResponse.java +++ b/src/main/java/com/xero/models/finance/CurrentStatementResponse.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CurrentStatementResponse + */ -/** CurrentStatementResponse */ public class CurrentStatementResponse { StringUtil util = new StringUtil(); @@ -40,269 +57,198 @@ public class CurrentStatementResponse { @JsonProperty("importSourceType") private String importSourceType; /** - * Looking at the most recent bank statement, this field indicates the first date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * - * @param startDate LocalDate - * @return CurrentStatementResponse - */ + * Looking at the most recent bank statement, this field indicates the first date which transactions on this statement pertain to. This date is represented in ISO 8601 format. + * @param startDate LocalDate + * @return CurrentStatementResponse + **/ public CurrentStatementResponse startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** - * Looking at the most recent bank statement, this field indicates the first date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * + /** + * Looking at the most recent bank statement, this field indicates the first date which transactions on this statement pertain to. This date is represented in ISO 8601 format. * @return startDate - */ - @ApiModelProperty( - value = - "Looking at the most recent bank statement, this field indicates the first date which" - + " transactions on this statement pertain to. This date is represented in ISO 8601" - + " format.") - /** - * Looking at the most recent bank statement, this field indicates the first date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * + **/ + @ApiModelProperty(value = "Looking at the most recent bank statement, this field indicates the first date which transactions on this statement pertain to. This date is represented in ISO 8601 format.") + /** + * Looking at the most recent bank statement, this field indicates the first date which transactions on this statement pertain to. This date is represented in ISO 8601 format. * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Looking at the most recent bank statement, this field indicates the first date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * - * @param startDate LocalDate - */ + /** + * Looking at the most recent bank statement, this field indicates the first date which transactions on this statement pertain to. This date is represented in ISO 8601 format. + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * Looking at the most recent bank statement, this field indicates the last date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * - * @param endDate LocalDate - * @return CurrentStatementResponse - */ + * Looking at the most recent bank statement, this field indicates the last date which transactions on this statement pertain to. This date is represented in ISO 8601 format. + * @param endDate LocalDate + * @return CurrentStatementResponse + **/ public CurrentStatementResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** - * Looking at the most recent bank statement, this field indicates the last date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * + /** + * Looking at the most recent bank statement, this field indicates the last date which transactions on this statement pertain to. This date is represented in ISO 8601 format. * @return endDate - */ - @ApiModelProperty( - value = - "Looking at the most recent bank statement, this field indicates the last date which" - + " transactions on this statement pertain to. This date is represented in ISO 8601" - + " format.") - /** - * Looking at the most recent bank statement, this field indicates the last date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * + **/ + @ApiModelProperty(value = "Looking at the most recent bank statement, this field indicates the last date which transactions on this statement pertain to. This date is represented in ISO 8601 format.") + /** + * Looking at the most recent bank statement, this field indicates the last date which transactions on this statement pertain to. This date is represented in ISO 8601 format. * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * Looking at the most recent bank statement, this field indicates the last date which - * transactions on this statement pertain to. This date is represented in ISO 8601 format. - * - * @param endDate LocalDate - */ + /** + * Looking at the most recent bank statement, this field indicates the last date which transactions on this statement pertain to. This date is represented in ISO 8601 format. + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Looking at the most recent bank statement, this field indicates the balance before the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * - * @param startBalance Double - * @return CurrentStatementResponse - */ + * Looking at the most recent bank statement, this field indicates the balance before the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). + * @param startBalance Double + * @return CurrentStatementResponse + **/ public CurrentStatementResponse startBalance(Double startBalance) { this.startBalance = startBalance; return this; } - /** - * Looking at the most recent bank statement, this field indicates the balance before the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * + /** + * Looking at the most recent bank statement, this field indicates the balance before the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). * @return startBalance - */ - @ApiModelProperty( - value = - "Looking at the most recent bank statement, this field indicates the balance before the" - + " transactions on the statement are applied (note, this is not always populated by" - + " the bank in every single instance (~10%)).") - /** - * Looking at the most recent bank statement, this field indicates the balance before the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * + **/ + @ApiModelProperty(value = "Looking at the most recent bank statement, this field indicates the balance before the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)).") + /** + * Looking at the most recent bank statement, this field indicates the balance before the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). * @return startBalance Double - */ + **/ public Double getStartBalance() { return startBalance; } - /** - * Looking at the most recent bank statement, this field indicates the balance before the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * - * @param startBalance Double - */ + /** + * Looking at the most recent bank statement, this field indicates the balance before the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). + * @param startBalance Double + **/ + public void setStartBalance(Double startBalance) { this.startBalance = startBalance; } /** - * Looking at the most recent bank statement, this field indicates the balance after the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * - * @param endBalance Double - * @return CurrentStatementResponse - */ + * Looking at the most recent bank statement, this field indicates the balance after the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). + * @param endBalance Double + * @return CurrentStatementResponse + **/ public CurrentStatementResponse endBalance(Double endBalance) { this.endBalance = endBalance; return this; } - /** - * Looking at the most recent bank statement, this field indicates the balance after the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * + /** + * Looking at the most recent bank statement, this field indicates the balance after the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). * @return endBalance - */ - @ApiModelProperty( - value = - "Looking at the most recent bank statement, this field indicates the balance after the" - + " transactions on the statement are applied (note, this is not always populated by" - + " the bank in every single instance (~10%)).") - /** - * Looking at the most recent bank statement, this field indicates the balance after the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * + **/ + @ApiModelProperty(value = "Looking at the most recent bank statement, this field indicates the balance after the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)).") + /** + * Looking at the most recent bank statement, this field indicates the balance after the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). * @return endBalance Double - */ + **/ public Double getEndBalance() { return endBalance; } - /** - * Looking at the most recent bank statement, this field indicates the balance after the - * transactions on the statement are applied (note, this is not always populated by the bank in - * every single instance (~10%)). - * - * @param endBalance Double - */ + /** + * Looking at the most recent bank statement, this field indicates the balance after the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%)). + * @param endBalance Double + **/ + public void setEndBalance(Double endBalance) { this.endBalance = endBalance; } /** - * Looking at the most recent bank statement, this field indicates when the document was imported - * into Xero. This date is represented in ISO 8601 format. - * - * @param importedDateTimeUtc OffsetDateTime - * @return CurrentStatementResponse - */ + * Looking at the most recent bank statement, this field indicates when the document was imported into Xero. This date is represented in ISO 8601 format. + * @param importedDateTimeUtc OffsetDateTime + * @return CurrentStatementResponse + **/ public CurrentStatementResponse importedDateTimeUtc(OffsetDateTime importedDateTimeUtc) { this.importedDateTimeUtc = importedDateTimeUtc; return this; } - /** - * Looking at the most recent bank statement, this field indicates when the document was imported - * into Xero. This date is represented in ISO 8601 format. - * + /** + * Looking at the most recent bank statement, this field indicates when the document was imported into Xero. This date is represented in ISO 8601 format. * @return importedDateTimeUtc - */ - @ApiModelProperty( - value = - "Looking at the most recent bank statement, this field indicates when the document was" - + " imported into Xero. This date is represented in ISO 8601 format.") - /** - * Looking at the most recent bank statement, this field indicates when the document was imported - * into Xero. This date is represented in ISO 8601 format. - * + **/ + @ApiModelProperty(value = "Looking at the most recent bank statement, this field indicates when the document was imported into Xero. This date is represented in ISO 8601 format.") + /** + * Looking at the most recent bank statement, this field indicates when the document was imported into Xero. This date is represented in ISO 8601 format. * @return importedDateTimeUtc OffsetDateTime - */ + **/ public OffsetDateTime getImportedDateTimeUtc() { return importedDateTimeUtc; } - /** - * Looking at the most recent bank statement, this field indicates when the document was imported - * into Xero. This date is represented in ISO 8601 format. - * - * @param importedDateTimeUtc OffsetDateTime - */ + /** + * Looking at the most recent bank statement, this field indicates when the document was imported into Xero. This date is represented in ISO 8601 format. + * @param importedDateTimeUtc OffsetDateTime + **/ + public void setImportedDateTimeUtc(OffsetDateTime importedDateTimeUtc) { this.importedDateTimeUtc = importedDateTimeUtc; } /** - * Looking at the most recent bank statement, this field indicates the source of the data (direct - * bank feed, file upload, or manual keying). - * - * @param importSourceType String - * @return CurrentStatementResponse - */ + * Looking at the most recent bank statement, this field indicates the source of the data (direct bank feed, file upload, or manual keying). + * @param importSourceType String + * @return CurrentStatementResponse + **/ public CurrentStatementResponse importSourceType(String importSourceType) { this.importSourceType = importSourceType; return this; } - /** - * Looking at the most recent bank statement, this field indicates the source of the data (direct - * bank feed, file upload, or manual keying). - * + /** + * Looking at the most recent bank statement, this field indicates the source of the data (direct bank feed, file upload, or manual keying). * @return importSourceType - */ - @ApiModelProperty( - value = - "Looking at the most recent bank statement, this field indicates the source of the data" - + " (direct bank feed, file upload, or manual keying).") - /** - * Looking at the most recent bank statement, this field indicates the source of the data (direct - * bank feed, file upload, or manual keying). - * + **/ + @ApiModelProperty(value = "Looking at the most recent bank statement, this field indicates the source of the data (direct bank feed, file upload, or manual keying).") + /** + * Looking at the most recent bank statement, this field indicates the source of the data (direct bank feed, file upload, or manual keying). * @return importSourceType String - */ + **/ public String getImportSourceType() { return importSourceType; } - /** - * Looking at the most recent bank statement, this field indicates the source of the data (direct - * bank feed, file upload, or manual keying). - * - * @param importSourceType String - */ + /** + * Looking at the most recent bank statement, this field indicates the source of the data (direct bank feed, file upload, or manual keying). + * @param importSourceType String + **/ + public void setImportSourceType(String importSourceType) { this.importSourceType = importSourceType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -312,20 +258,20 @@ public boolean equals(java.lang.Object o) { return false; } CurrentStatementResponse currentStatementResponse = (CurrentStatementResponse) o; - return Objects.equals(this.startDate, currentStatementResponse.startDate) - && Objects.equals(this.endDate, currentStatementResponse.endDate) - && Objects.equals(this.startBalance, currentStatementResponse.startBalance) - && Objects.equals(this.endBalance, currentStatementResponse.endBalance) - && Objects.equals(this.importedDateTimeUtc, currentStatementResponse.importedDateTimeUtc) - && Objects.equals(this.importSourceType, currentStatementResponse.importSourceType); + return Objects.equals(this.startDate, currentStatementResponse.startDate) && + Objects.equals(this.endDate, currentStatementResponse.endDate) && + Objects.equals(this.startBalance, currentStatementResponse.startBalance) && + Objects.equals(this.endBalance, currentStatementResponse.endBalance) && + Objects.equals(this.importedDateTimeUtc, currentStatementResponse.importedDateTimeUtc) && + Objects.equals(this.importSourceType, currentStatementResponse.importSourceType); } @Override public int hashCode() { - return Objects.hash( - startDate, endDate, startBalance, endBalance, importedDateTimeUtc, importSourceType); + return Objects.hash(startDate, endDate, startBalance, endBalance, importedDateTimeUtc, importSourceType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -334,16 +280,15 @@ public String toString() { sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); sb.append(" startBalance: ").append(toIndentedString(startBalance)).append("\n"); sb.append(" endBalance: ").append(toIndentedString(endBalance)).append("\n"); - sb.append(" importedDateTimeUtc: ") - .append(toIndentedString(importedDateTimeUtc)) - .append("\n"); + sb.append(" importedDateTimeUtc: ").append(toIndentedString(importedDateTimeUtc)).append("\n"); sb.append(" importSourceType: ").append(toIndentedString(importSourceType)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -351,4 +296,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/DataSourceResponse.java b/src/main/java/com/xero/models/finance/DataSourceResponse.java index ee713e9af..8168710fd 100644 --- a/src/main/java/com/xero/models/finance/DataSourceResponse.java +++ b/src/main/java/com/xero/models/finance/DataSourceResponse.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * DataSourceResponse + */ -/** DataSourceResponse */ public class DataSourceResponse { StringUtil util = new StringUtil(); @@ -56,567 +73,390 @@ public class DataSourceResponse { @JsonProperty("other") private Double other; /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. - * - * @param directBankFeed Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. + * @param directBankFeed Double + * @return DataSourceResponse + **/ public DataSourceResponse directBankFeed(Double directBankFeed) { this.directBankFeed = directBankFeed; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. - * + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. * @return directBankFeed - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was a direct" - + " bank feed in to Xero via an API integration. This could be from a bank or" - + " aggregator. This gives an indication on the certainty of correctness of the" - + " data.") - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data.") + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. * @return directBankFeed Double - */ + **/ public Double getDirectBankFeed() { return directBankFeed; } - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. - * - * @param directBankFeed Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. + * @param directBankFeed Double + **/ + public void setDirectBankFeed(Double directBankFeed) { this.directBankFeed = directBankFeed; } /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. - * - * @param fileUpload Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. + * @param fileUpload Double + * @return DataSourceResponse + **/ public DataSourceResponse fileUpload(Double fileUpload) { this.fileUpload = fileUpload; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. - * + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. * @return fileUpload - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was a file" - + " manually uploaded in to Xero. This gives an indication on the certainty of" - + " correctness of the data.") - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data.") + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. * @return fileUpload Double - */ + **/ public Double getFileUpload() { return fileUpload; } - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. - * - * @param fileUpload Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. + * @param fileUpload Double + **/ + public void setFileUpload(Double fileUpload) { this.fileUpload = fileUpload; } /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. - * - * @param manual Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. + * @param manual Double + * @return DataSourceResponse + **/ public DataSourceResponse manual(Double manual) { this.manual = manual; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. - * + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. * @return manual - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was manually" - + " input in to Xero. This gives an indication on the certainty of correctness of" - + " the data.") - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data.") + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. * @return manual Double - */ + **/ public Double getManual() { return manual; } - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. - * - * @param manual Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. + * @param manual Double + **/ + public void setManual(Double manual) { this.manual = manual; } /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only positive transactions are - * included. - * - * @param directBankFeedPos Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param directBankFeedPos Double + * @return DataSourceResponse + **/ public DataSourceResponse directBankFeedPos(Double directBankFeedPos) { this.directBankFeedPos = directBankFeedPos; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only positive transactions are - * included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return directBankFeedPos - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was a direct" - + " bank feed in to Xero via an API integration. This could be from a bank or" - + " aggregator. This gives an indication on the certainty of correctness of the" - + " data. Only positive transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only positive transactions are - * included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return directBankFeedPos Double - */ + **/ public Double getDirectBankFeedPos() { return directBankFeedPos; } - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only positive transactions are - * included. - * - * @param directBankFeedPos Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param directBankFeedPos Double + **/ + public void setDirectBankFeedPos(Double directBankFeedPos) { this.directBankFeedPos = directBankFeedPos; } /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * positive transactions are included. - * - * @param fileUploadPos Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param fileUploadPos Double + * @return DataSourceResponse + **/ public DataSourceResponse fileUploadPos(Double fileUploadPos) { this.fileUploadPos = fileUploadPos; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * positive transactions are included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return fileUploadPos - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was a file" - + " manually uploaded in to Xero. This gives an indication on the certainty of" - + " correctness of the data. Only positive transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * positive transactions are included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return fileUploadPos Double - */ + **/ public Double getFileUploadPos() { return fileUploadPos; } - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * positive transactions are included. - * - * @param fileUploadPos Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param fileUploadPos Double + **/ + public void setFileUploadPos(Double fileUploadPos) { this.fileUploadPos = fileUploadPos; } /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only positive - * transactions are included. - * - * @param manualPos Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param manualPos Double + * @return DataSourceResponse + **/ public DataSourceResponse manualPos(Double manualPos) { this.manualPos = manualPos; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only positive - * transactions are included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return manualPos - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was manually" - + " input in to Xero. This gives an indication on the certainty of correctness of" - + " the data. Only positive transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only positive - * transactions are included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return manualPos Double - */ + **/ public Double getManualPos() { return manualPos; } - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only positive - * transactions are included. - * - * @param manualPos Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param manualPos Double + **/ + public void setManualPos(Double manualPos) { this.manualPos = manualPos; } /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only negative transactions are - * included. - * - * @param directBankFeedNeg Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param directBankFeedNeg Double + * @return DataSourceResponse + **/ public DataSourceResponse directBankFeedNeg(Double directBankFeedNeg) { this.directBankFeedNeg = directBankFeedNeg; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only negative transactions are - * included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return directBankFeedNeg - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was a direct" - + " bank feed in to Xero via an API integration. This could be from a bank or" - + " aggregator. This gives an indication on the certainty of correctness of the" - + " data. Only negative transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only negative transactions are - * included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return directBankFeedNeg Double - */ + **/ public Double getDirectBankFeedNeg() { return directBankFeedNeg; } - /** - * Sum of the amounts of all statement lines where the source of the data was a direct bank feed - * in to Xero via an API integration. This could be from a bank or aggregator. This gives an - * indication on the certainty of correctness of the data. Only negative transactions are - * included. - * - * @param directBankFeedNeg Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param directBankFeedNeg Double + **/ + public void setDirectBankFeedNeg(Double directBankFeedNeg) { this.directBankFeedNeg = directBankFeedNeg; } /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * negative transactions are included. - * - * @param fileUploadNeg Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param fileUploadNeg Double + * @return DataSourceResponse + **/ public DataSourceResponse fileUploadNeg(Double fileUploadNeg) { this.fileUploadNeg = fileUploadNeg; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * negative transactions are included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return fileUploadNeg - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was a file" - + " manually uploaded in to Xero. This gives an indication on the certainty of" - + " correctness of the data. Only negative transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * negative transactions are included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return fileUploadNeg Double - */ + **/ public Double getFileUploadNeg() { return fileUploadNeg; } - /** - * Sum of the amounts of all statement lines where the source of the data was a file manually - * uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only - * negative transactions are included. - * - * @param fileUploadNeg Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param fileUploadNeg Double + **/ + public void setFileUploadNeg(Double fileUploadNeg) { this.fileUploadNeg = fileUploadNeg; } /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only negative - * transactions are included. - * - * @param manualNeg Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param manualNeg Double + * @return DataSourceResponse + **/ public DataSourceResponse manualNeg(Double manualNeg) { this.manualNeg = manualNeg; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only negative - * transactions are included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return manualNeg - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was manually" - + " input in to Xero. This gives an indication on the certainty of correctness of" - + " the data. Only negative transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only negative - * transactions are included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return manualNeg Double - */ + **/ public Double getManualNeg() { return manualNeg; } - /** - * Sum of the amounts of all statement lines where the source of the data was manually input in to - * Xero. This gives an indication on the certainty of correctness of the data. Only negative - * transactions are included. - * - * @param manualNeg Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param manualNeg Double + **/ + public void setManualNeg(Double manualNeg) { this.manualNeg = manualNeg; } /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only positive transactions are - * included. - * - * @param otherPos Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param otherPos Double + * @return DataSourceResponse + **/ public DataSourceResponse otherPos(Double otherPos) { this.otherPos = otherPos; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only positive transactions are - * included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return otherPos - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was unknown. " - + " This gives an indication on the certainty of correctness of the data. Only" - + " positive transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only positive transactions are - * included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * @return otherPos Double - */ + **/ public Double getOtherPos() { return otherPos; } - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only positive transactions are - * included. - * - * @param otherPos Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param otherPos Double + **/ + public void setOtherPos(Double otherPos) { this.otherPos = otherPos; } /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only negative transactions are - * included. - * - * @param otherNeg Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param otherNeg Double + * @return DataSourceResponse + **/ public DataSourceResponse otherNeg(Double otherNeg) { this.otherNeg = otherNeg; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only negative transactions are - * included. - * + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return otherNeg - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was unknown. " - + " This gives an indication on the certainty of correctness of the data. Only" - + " negative transactions are included.") - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only negative transactions are - * included. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.") + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * @return otherNeg Double - */ + **/ public Double getOtherNeg() { return otherNeg; } - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. Only negative transactions are - * included. - * - * @param otherNeg Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param otherNeg Double + **/ + public void setOtherNeg(Double otherNeg) { this.otherNeg = otherNeg; } /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. - * - * @param other Double - * @return DataSourceResponse - */ + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. + * @param other Double + * @return DataSourceResponse + **/ public DataSourceResponse other(Double other) { this.other = other; return this; } - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. - * + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. * @return other - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where the source of the data was unknown. " - + " This gives an indication on the certainty of correctness of the data.") - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data.") + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. * @return other Double - */ + **/ public Double getOther() { return other; } - /** - * Sum of the amounts of all statement lines where the source of the data was unknown. This gives - * an indication on the certainty of correctness of the data. - * - * @param other Double - */ + /** + * Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. + * @param other Double + **/ + public void setOther(Double other) { this.other = other; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -626,37 +466,26 @@ public boolean equals(java.lang.Object o) { return false; } DataSourceResponse dataSourceResponse = (DataSourceResponse) o; - return Objects.equals(this.directBankFeed, dataSourceResponse.directBankFeed) - && Objects.equals(this.fileUpload, dataSourceResponse.fileUpload) - && Objects.equals(this.manual, dataSourceResponse.manual) - && Objects.equals(this.directBankFeedPos, dataSourceResponse.directBankFeedPos) - && Objects.equals(this.fileUploadPos, dataSourceResponse.fileUploadPos) - && Objects.equals(this.manualPos, dataSourceResponse.manualPos) - && Objects.equals(this.directBankFeedNeg, dataSourceResponse.directBankFeedNeg) - && Objects.equals(this.fileUploadNeg, dataSourceResponse.fileUploadNeg) - && Objects.equals(this.manualNeg, dataSourceResponse.manualNeg) - && Objects.equals(this.otherPos, dataSourceResponse.otherPos) - && Objects.equals(this.otherNeg, dataSourceResponse.otherNeg) - && Objects.equals(this.other, dataSourceResponse.other); + return Objects.equals(this.directBankFeed, dataSourceResponse.directBankFeed) && + Objects.equals(this.fileUpload, dataSourceResponse.fileUpload) && + Objects.equals(this.manual, dataSourceResponse.manual) && + Objects.equals(this.directBankFeedPos, dataSourceResponse.directBankFeedPos) && + Objects.equals(this.fileUploadPos, dataSourceResponse.fileUploadPos) && + Objects.equals(this.manualPos, dataSourceResponse.manualPos) && + Objects.equals(this.directBankFeedNeg, dataSourceResponse.directBankFeedNeg) && + Objects.equals(this.fileUploadNeg, dataSourceResponse.fileUploadNeg) && + Objects.equals(this.manualNeg, dataSourceResponse.manualNeg) && + Objects.equals(this.otherPos, dataSourceResponse.otherPos) && + Objects.equals(this.otherNeg, dataSourceResponse.otherNeg) && + Objects.equals(this.other, dataSourceResponse.other); } @Override public int hashCode() { - return Objects.hash( - directBankFeed, - fileUpload, - manual, - directBankFeedPos, - fileUploadPos, - manualPos, - directBankFeedNeg, - fileUploadNeg, - manualNeg, - otherPos, - otherNeg, - other); + return Objects.hash(directBankFeed, fileUpload, manual, directBankFeedPos, fileUploadPos, manualPos, directBankFeedNeg, fileUploadNeg, manualNeg, otherPos, otherNeg, other); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -678,7 +507,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -686,4 +516,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/HistoryRecordResponse.java b/src/main/java/com/xero/models/finance/HistoryRecordResponse.java index d9b986a90..86fba6bb2 100644 --- a/src/main/java/com/xero/models/finance/HistoryRecordResponse.java +++ b/src/main/java/com/xero/models/finance/HistoryRecordResponse.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * HistoryRecordResponse + */ -/** HistoryRecordResponse */ public class HistoryRecordResponse { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class HistoryRecordResponse { @JsonProperty("details") private String details; /** - * The type of change recorded against the document - * - * @param changes String - * @return HistoryRecordResponse - */ + * The type of change recorded against the document + * @param changes String + * @return HistoryRecordResponse + **/ public HistoryRecordResponse changes(String changes) { this.changes = changes; return this; } - /** + /** * The type of change recorded against the document - * * @return changes - */ + **/ @ApiModelProperty(value = "The type of change recorded against the document") - /** + /** * The type of change recorded against the document - * * @return changes String - */ + **/ public String getChanges() { return changes; } - /** - * The type of change recorded against the document - * - * @param changes String - */ + /** + * The type of change recorded against the document + * @param changes String + **/ + public void setChanges(String changes) { this.changes = changes; } /** - * UTC date that the history record was created - * - * @param dateUTCString String - * @return HistoryRecordResponse - */ + * UTC date that the history record was created + * @param dateUTCString String + * @return HistoryRecordResponse + **/ public HistoryRecordResponse dateUTCString(String dateUTCString) { this.dateUTCString = dateUTCString; return this; } - /** + /** * UTC date that the history record was created - * * @return dateUTCString - */ + **/ @ApiModelProperty(value = "UTC date that the history record was created") - /** + /** * UTC date that the history record was created - * * @return dateUTCString String - */ + **/ public String getDateUTCString() { return dateUTCString; } - /** - * UTC date that the history record was created - * - * @param dateUTCString String - */ + /** + * UTC date that the history record was created + * @param dateUTCString String + **/ + public void setDateUTCString(String dateUTCString) { this.dateUTCString = dateUTCString; } /** - * UTC date that the history record was created - * - * @param dateUTC OffsetDateTime - * @return HistoryRecordResponse - */ + * UTC date that the history record was created + * @param dateUTC OffsetDateTime + * @return HistoryRecordResponse + **/ public HistoryRecordResponse dateUTC(OffsetDateTime dateUTC) { this.dateUTC = dateUTC; return this; } - /** + /** * UTC date that the history record was created - * * @return dateUTC - */ + **/ @ApiModelProperty(value = "UTC date that the history record was created") - /** + /** * UTC date that the history record was created - * * @return dateUTC OffsetDateTime - */ + **/ public OffsetDateTime getDateUTC() { return dateUTC; } - /** - * UTC date that the history record was created - * - * @param dateUTC OffsetDateTime - */ + /** + * UTC date that the history record was created + * @param dateUTC OffsetDateTime + **/ + public void setDateUTC(OffsetDateTime dateUTC) { this.dateUTC = dateUTC; } /** - * The users first and last name - * - * @param user String - * @return HistoryRecordResponse - */ + * The users first and last name + * @param user String + * @return HistoryRecordResponse + **/ public HistoryRecordResponse user(String user) { this.user = user; return this; } - /** + /** * The users first and last name - * * @return user - */ + **/ @ApiModelProperty(value = "The users first and last name") - /** + /** * The users first and last name - * * @return user String - */ + **/ public String getUser() { return user; } - /** - * The users first and last name - * - * @param user String - */ + /** + * The users first and last name + * @param user String + **/ + public void setUser(String user) { this.user = user; } /** - * Description of the change event or transaction - * - * @param details String - * @return HistoryRecordResponse - */ + * Description of the change event or transaction + * @param details String + * @return HistoryRecordResponse + **/ public HistoryRecordResponse details(String details) { this.details = details; return this; } - /** + /** * Description of the change event or transaction - * * @return details - */ + **/ @ApiModelProperty(value = "Description of the change event or transaction") - /** + /** * Description of the change event or transaction - * * @return details String - */ + **/ public String getDetails() { return details; } - /** - * Description of the change event or transaction - * - * @param details String - */ + /** + * Description of the change event or transaction + * @param details String + **/ + public void setDetails(String details) { this.details = details; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } HistoryRecordResponse historyRecordResponse = (HistoryRecordResponse) o; - return Objects.equals(this.changes, historyRecordResponse.changes) - && Objects.equals(this.dateUTCString, historyRecordResponse.dateUTCString) - && Objects.equals(this.dateUTC, historyRecordResponse.dateUTC) - && Objects.equals(this.user, historyRecordResponse.user) - && Objects.equals(this.details, historyRecordResponse.details); + return Objects.equals(this.changes, historyRecordResponse.changes) && + Objects.equals(this.dateUTCString, historyRecordResponse.dateUTCString) && + Objects.equals(this.dateUTC, historyRecordResponse.dateUTC) && + Objects.equals(this.user, historyRecordResponse.user) && + Objects.equals(this.details, historyRecordResponse.details); } @Override @@ -231,6 +234,7 @@ public int hashCode() { return Objects.hash(changes, dateUTCString, dateUTC, user, details); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/IncomeByContactResponse.java b/src/main/java/com/xero/models/finance/IncomeByContactResponse.java index 13d5c60c9..f542dee3f 100644 --- a/src/main/java/com/xero/models/finance/IncomeByContactResponse.java +++ b/src/main/java/com/xero/models/finance/IncomeByContactResponse.java @@ -9,17 +9,38 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ContactDetail; +import com.xero.models.finance.ManualJournalTotal; +import com.xero.models.finance.TotalDetail; +import com.xero.models.finance.TotalOther; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * IncomeByContactResponse + */ -/** IncomeByContactResponse */ public class IncomeByContactResponse { StringUtil util = new StringUtil(); @@ -44,186 +65,170 @@ public class IncomeByContactResponse { @JsonProperty("manualJournals") private ManualJournalTotal manualJournals; /** - * Start date of the report - * - * @param startDate LocalDate - * @return IncomeByContactResponse - */ + * Start date of the report + * @param startDate LocalDate + * @return IncomeByContactResponse + **/ public IncomeByContactResponse startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the report - * * @return startDate - */ + **/ @ApiModelProperty(value = "Start date of the report") - /** + /** * Start date of the report - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the report - * - * @param startDate LocalDate - */ + /** + * Start date of the report + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * End date of the report - * - * @param endDate LocalDate - * @return IncomeByContactResponse - */ + * End date of the report + * @param endDate LocalDate + * @return IncomeByContactResponse + **/ public IncomeByContactResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * End date of the report - * * @return endDate - */ + **/ @ApiModelProperty(value = "End date of the report") - /** + /** * End date of the report - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * End date of the report - * - * @param endDate LocalDate - */ + /** + * End date of the report + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Total value - * - * @param total Double - * @return IncomeByContactResponse - */ + * Total value + * @param total Double + * @return IncomeByContactResponse + **/ public IncomeByContactResponse total(Double total) { this.total = total; return this; } - /** + /** * Total value - * * @return total - */ + **/ @ApiModelProperty(value = "Total value") - /** + /** * Total value - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total value - * - * @param total Double - */ + /** + * Total value + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * totalDetail - * - * @param totalDetail TotalDetail - * @return IncomeByContactResponse - */ + * totalDetail + * @param totalDetail TotalDetail + * @return IncomeByContactResponse + **/ public IncomeByContactResponse totalDetail(TotalDetail totalDetail) { this.totalDetail = totalDetail; return this; } - /** + /** * Get totalDetail - * * @return totalDetail - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalDetail - * * @return totalDetail TotalDetail - */ + **/ public TotalDetail getTotalDetail() { return totalDetail; } - /** - * totalDetail - * - * @param totalDetail TotalDetail - */ + /** + * totalDetail + * @param totalDetail TotalDetail + **/ + public void setTotalDetail(TotalDetail totalDetail) { this.totalDetail = totalDetail; } /** - * totalOther - * - * @param totalOther TotalOther - * @return IncomeByContactResponse - */ + * totalOther + * @param totalOther TotalOther + * @return IncomeByContactResponse + **/ public IncomeByContactResponse totalOther(TotalOther totalOther) { this.totalOther = totalOther; return this; } - /** + /** * Get totalOther - * * @return totalOther - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalOther - * * @return totalOther TotalOther - */ + **/ public TotalOther getTotalOther() { return totalOther; } - /** - * totalOther - * - * @param totalOther TotalOther - */ + /** + * totalOther + * @param totalOther TotalOther + **/ + public void setTotalOther(TotalOther totalOther) { this.totalOther = totalOther; } /** - * contacts - * - * @param contacts List<ContactDetail> - * @return IncomeByContactResponse - */ + * contacts + * @param contacts List<ContactDetail> + * @return IncomeByContactResponse + **/ public IncomeByContactResponse contacts(List contacts) { this.contacts = contacts; return this; @@ -231,10 +236,9 @@ public IncomeByContactResponse contacts(List contacts) { /** * contacts - * - * @param contactsItem ContactDetail + * @param contactsItem ContactDetail * @return IncomeByContactResponse - */ + **/ public IncomeByContactResponse addContactsItem(ContactDetail contactsItem) { if (this.contacts == null) { this.contacts = new ArrayList(); @@ -243,65 +247,61 @@ public IncomeByContactResponse addContactsItem(ContactDetail contactsItem) { return this; } - /** + /** * Get contacts - * * @return contacts - */ + **/ @ApiModelProperty(value = "") - /** + /** * contacts - * * @return contacts List - */ + **/ public List getContacts() { return contacts; } - /** - * contacts - * - * @param contacts List<ContactDetail> - */ + /** + * contacts + * @param contacts List<ContactDetail> + **/ + public void setContacts(List contacts) { this.contacts = contacts; } /** - * manualJournals - * - * @param manualJournals ManualJournalTotal - * @return IncomeByContactResponse - */ + * manualJournals + * @param manualJournals ManualJournalTotal + * @return IncomeByContactResponse + **/ public IncomeByContactResponse manualJournals(ManualJournalTotal manualJournals) { this.manualJournals = manualJournals; return this; } - /** + /** * Get manualJournals - * * @return manualJournals - */ + **/ @ApiModelProperty(value = "") - /** + /** * manualJournals - * * @return manualJournals ManualJournalTotal - */ + **/ public ManualJournalTotal getManualJournals() { return manualJournals; } - /** - * manualJournals - * - * @param manualJournals ManualJournalTotal - */ + /** + * manualJournals + * @param manualJournals ManualJournalTotal + **/ + public void setManualJournals(ManualJournalTotal manualJournals) { this.manualJournals = manualJournals; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -311,21 +311,21 @@ public boolean equals(java.lang.Object o) { return false; } IncomeByContactResponse incomeByContactResponse = (IncomeByContactResponse) o; - return Objects.equals(this.startDate, incomeByContactResponse.startDate) - && Objects.equals(this.endDate, incomeByContactResponse.endDate) - && Objects.equals(this.total, incomeByContactResponse.total) - && Objects.equals(this.totalDetail, incomeByContactResponse.totalDetail) - && Objects.equals(this.totalOther, incomeByContactResponse.totalOther) - && Objects.equals(this.contacts, incomeByContactResponse.contacts) - && Objects.equals(this.manualJournals, incomeByContactResponse.manualJournals); + return Objects.equals(this.startDate, incomeByContactResponse.startDate) && + Objects.equals(this.endDate, incomeByContactResponse.endDate) && + Objects.equals(this.total, incomeByContactResponse.total) && + Objects.equals(this.totalDetail, incomeByContactResponse.totalDetail) && + Objects.equals(this.totalOther, incomeByContactResponse.totalOther) && + Objects.equals(this.contacts, incomeByContactResponse.contacts) && + Objects.equals(this.manualJournals, incomeByContactResponse.manualJournals); } @Override public int hashCode() { - return Objects.hash( - startDate, endDate, total, totalDetail, totalOther, contacts, manualJournals); + return Objects.hash(startDate, endDate, total, totalDetail, totalOther, contacts, manualJournals); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -342,7 +342,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -350,4 +351,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/InvoiceResponse.java b/src/main/java/com/xero/models/finance/InvoiceResponse.java index 1feba06f6..8baf92781 100644 --- a/src/main/java/com/xero/models/finance/InvoiceResponse.java +++ b/src/main/java/com/xero/models/finance/InvoiceResponse.java @@ -9,17 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ContactResponse; +import com.xero.models.finance.LineItemResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * InvoiceResponse + */ -/** InvoiceResponse */ public class InvoiceResponse { StringUtil util = new StringUtil(); @@ -35,118 +54,106 @@ public class InvoiceResponse { @JsonProperty("lineItems") private List lineItems = new ArrayList(); /** - * Xero Identifier of invoice - * - * @param invoiceId UUID - * @return InvoiceResponse - */ + * Xero Identifier of invoice + * @param invoiceId UUID + * @return InvoiceResponse + **/ public InvoiceResponse invoiceId(UUID invoiceId) { this.invoiceId = invoiceId; return this; } - /** + /** * Xero Identifier of invoice - * * @return invoiceId - */ + **/ @ApiModelProperty(value = "Xero Identifier of invoice") - /** + /** * Xero Identifier of invoice - * * @return invoiceId UUID - */ + **/ public UUID getInvoiceId() { return invoiceId; } - /** - * Xero Identifier of invoice - * - * @param invoiceId UUID - */ + /** + * Xero Identifier of invoice + * @param invoiceId UUID + **/ + public void setInvoiceId(UUID invoiceId) { this.invoiceId = invoiceId; } /** - * contact - * - * @param contact ContactResponse - * @return InvoiceResponse - */ + * contact + * @param contact ContactResponse + * @return InvoiceResponse + **/ public InvoiceResponse contact(ContactResponse contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact ContactResponse - */ + **/ public ContactResponse getContact() { return contact; } - /** - * contact - * - * @param contact ContactResponse - */ + /** + * contact + * @param contact ContactResponse + **/ + public void setContact(ContactResponse contact) { this.contact = contact; } /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - * @return InvoiceResponse - */ + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + * @return InvoiceResponse + **/ public InvoiceResponse total(Double total) { this.total = total; return this; } - /** + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total - */ - @ApiModelProperty( - value = - "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") - /** + **/ + @ApiModelProperty(value = "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - */ + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - * @return InvoiceResponse - */ + * Not included in summary mode + * @param lineItems List<LineItemResponse> + * @return InvoiceResponse + **/ public InvoiceResponse lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -154,10 +161,9 @@ public InvoiceResponse lineItems(List lineItems) { /** * Not included in summary mode - * - * @param lineItemsItem LineItemResponse + * @param lineItemsItem LineItemResponse * @return InvoiceResponse - */ + **/ public InvoiceResponse addLineItemsItem(LineItemResponse lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -166,30 +172,29 @@ public InvoiceResponse addLineItemsItem(LineItemResponse lineItemsItem) { return this; } - /** + /** * Not included in summary mode - * * @return lineItems - */ + **/ @ApiModelProperty(value = "Not included in summary mode") - /** + /** * Not included in summary mode - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - */ + /** + * Not included in summary mode + * @param lineItems List<LineItemResponse> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -199,10 +204,10 @@ public boolean equals(java.lang.Object o) { return false; } InvoiceResponse invoiceResponse = (InvoiceResponse) o; - return Objects.equals(this.invoiceId, invoiceResponse.invoiceId) - && Objects.equals(this.contact, invoiceResponse.contact) - && Objects.equals(this.total, invoiceResponse.total) - && Objects.equals(this.lineItems, invoiceResponse.lineItems); + return Objects.equals(this.invoiceId, invoiceResponse.invoiceId) && + Objects.equals(this.contact, invoiceResponse.contact) && + Objects.equals(this.total, invoiceResponse.total) && + Objects.equals(this.lineItems, invoiceResponse.lineItems); } @Override @@ -210,6 +215,7 @@ public int hashCode() { return Objects.hash(invoiceId, contact, total, lineItems); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -223,7 +229,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -231,4 +238,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/LineItemResponse.java b/src/main/java/com/xero/models/finance/LineItemResponse.java index 5abb24b7e..c33991bd2 100644 --- a/src/main/java/com/xero/models/finance/LineItemResponse.java +++ b/src/main/java/com/xero/models/finance/LineItemResponse.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LineItemResponse + */ -/** LineItemResponse */ public class LineItemResponse { StringUtil util = new StringUtil(); @@ -33,145 +50,134 @@ public class LineItemResponse { @JsonProperty("accountType") private String accountType; /** - * Xero Identifier of account - * - * @param accountId UUID - * @return LineItemResponse - */ + * Xero Identifier of account + * @param accountId UUID + * @return LineItemResponse + **/ public LineItemResponse accountId(UUID accountId) { this.accountId = accountId; return this; } - /** + /** * Xero Identifier of account - * * @return accountId - */ + **/ @ApiModelProperty(value = "Xero Identifier of account") - /** + /** * Xero Identifier of account - * * @return accountId UUID - */ + **/ public UUID getAccountId() { return accountId; } - /** - * Xero Identifier of account - * - * @param accountId UUID - */ + /** + * Xero Identifier of account + * @param accountId UUID + **/ + public void setAccountId(UUID accountId) { this.accountId = accountId; } /** - * Shown if set - * - * @param reportingCode String - * @return LineItemResponse - */ + * Shown if set + * @param reportingCode String + * @return LineItemResponse + **/ public LineItemResponse reportingCode(String reportingCode) { this.reportingCode = reportingCode; return this; } - /** + /** * Shown if set - * * @return reportingCode - */ + **/ @ApiModelProperty(value = "Shown if set") - /** + /** * Shown if set - * * @return reportingCode String - */ + **/ public String getReportingCode() { return reportingCode; } - /** - * Shown if set - * - * @param reportingCode String - */ + /** + * Shown if set + * @param reportingCode String + **/ + public void setReportingCode(String reportingCode) { this.reportingCode = reportingCode; } /** - * Amount of line item - * - * @param lineAmount Double - * @return LineItemResponse - */ + * Amount of line item + * @param lineAmount Double + * @return LineItemResponse + **/ public LineItemResponse lineAmount(Double lineAmount) { this.lineAmount = lineAmount; return this; } - /** + /** * Amount of line item - * * @return lineAmount - */ + **/ @ApiModelProperty(value = "Amount of line item") - /** + /** * Amount of line item - * * @return lineAmount Double - */ + **/ public Double getLineAmount() { return lineAmount; } - /** - * Amount of line item - * - * @param lineAmount Double - */ + /** + * Amount of line item + * @param lineAmount Double + **/ + public void setLineAmount(Double lineAmount) { this.lineAmount = lineAmount; } /** - * Account type - * - * @param accountType String - * @return LineItemResponse - */ + * Account type + * @param accountType String + * @return LineItemResponse + **/ public LineItemResponse accountType(String accountType) { this.accountType = accountType; return this; } - /** + /** * Account type - * * @return accountType - */ + **/ @ApiModelProperty(value = "Account type") - /** + /** * Account type - * * @return accountType String - */ + **/ public String getAccountType() { return accountType; } - /** - * Account type - * - * @param accountType String - */ + /** + * Account type + * @param accountType String + **/ + public void setAccountType(String accountType) { this.accountType = accountType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } LineItemResponse lineItemResponse = (LineItemResponse) o; - return Objects.equals(this.accountId, lineItemResponse.accountId) - && Objects.equals(this.reportingCode, lineItemResponse.reportingCode) - && Objects.equals(this.lineAmount, lineItemResponse.lineAmount) - && Objects.equals(this.accountType, lineItemResponse.accountType); + return Objects.equals(this.accountId, lineItemResponse.accountId) && + Objects.equals(this.reportingCode, lineItemResponse.reportingCode) && + Objects.equals(this.lineAmount, lineItemResponse.lineAmount) && + Objects.equals(this.accountType, lineItemResponse.accountType); } @Override @@ -192,6 +198,7 @@ public int hashCode() { return Objects.hash(accountId, reportingCode, lineAmount, accountType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/LockHistoryModel.java b/src/main/java/com/xero/models/finance/LockHistoryModel.java index 9e2207e93..eb62881fb 100644 --- a/src/main/java/com/xero/models/finance/LockHistoryModel.java +++ b/src/main/java/com/xero/models/finance/LockHistoryModel.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LockHistoryModel + */ -/** LockHistoryModel */ public class LockHistoryModel { StringUtil util = new StringUtil(); @@ -31,110 +48,102 @@ public class LockHistoryModel { @JsonProperty("updatedDateUtc") private OffsetDateTime updatedDateUtc; /** - * Date the account hard lock was set - * - * @param hardLockDate LocalDate - * @return LockHistoryModel - */ + * Date the account hard lock was set + * @param hardLockDate LocalDate + * @return LockHistoryModel + **/ public LockHistoryModel hardLockDate(LocalDate hardLockDate) { this.hardLockDate = hardLockDate; return this; } - /** + /** * Date the account hard lock was set - * * @return hardLockDate - */ + **/ @ApiModelProperty(value = "Date the account hard lock was set") - /** + /** * Date the account hard lock was set - * * @return hardLockDate LocalDate - */ + **/ public LocalDate getHardLockDate() { return hardLockDate; } - /** - * Date the account hard lock was set - * - * @param hardLockDate LocalDate - */ + /** + * Date the account hard lock was set + * @param hardLockDate LocalDate + **/ + public void setHardLockDate(LocalDate hardLockDate) { this.hardLockDate = hardLockDate; } /** - * Date the account soft lock was set - * - * @param softLockDate LocalDate - * @return LockHistoryModel - */ + * Date the account soft lock was set + * @param softLockDate LocalDate + * @return LockHistoryModel + **/ public LockHistoryModel softLockDate(LocalDate softLockDate) { this.softLockDate = softLockDate; return this; } - /** + /** * Date the account soft lock was set - * * @return softLockDate - */ + **/ @ApiModelProperty(value = "Date the account soft lock was set") - /** + /** * Date the account soft lock was set - * * @return softLockDate LocalDate - */ + **/ public LocalDate getSoftLockDate() { return softLockDate; } - /** - * Date the account soft lock was set - * - * @param softLockDate LocalDate - */ + /** + * Date the account soft lock was set + * @param softLockDate LocalDate + **/ + public void setSoftLockDate(LocalDate softLockDate) { this.softLockDate = softLockDate; } /** - * The system date time that the lock was updated - * - * @param updatedDateUtc OffsetDateTime - * @return LockHistoryModel - */ + * The system date time that the lock was updated + * @param updatedDateUtc OffsetDateTime + * @return LockHistoryModel + **/ public LockHistoryModel updatedDateUtc(OffsetDateTime updatedDateUtc) { this.updatedDateUtc = updatedDateUtc; return this; } - /** + /** * The system date time that the lock was updated - * * @return updatedDateUtc - */ + **/ @ApiModelProperty(value = "The system date time that the lock was updated") - /** + /** * The system date time that the lock was updated - * * @return updatedDateUtc OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUtc() { return updatedDateUtc; } - /** - * The system date time that the lock was updated - * - * @param updatedDateUtc OffsetDateTime - */ + /** + * The system date time that the lock was updated + * @param updatedDateUtc OffsetDateTime + **/ + public void setUpdatedDateUtc(OffsetDateTime updatedDateUtc) { this.updatedDateUtc = updatedDateUtc; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -144,9 +153,9 @@ public boolean equals(java.lang.Object o) { return false; } LockHistoryModel lockHistoryModel = (LockHistoryModel) o; - return Objects.equals(this.hardLockDate, lockHistoryModel.hardLockDate) - && Objects.equals(this.softLockDate, lockHistoryModel.softLockDate) - && Objects.equals(this.updatedDateUtc, lockHistoryModel.updatedDateUtc); + return Objects.equals(this.hardLockDate, lockHistoryModel.hardLockDate) && + Objects.equals(this.softLockDate, lockHistoryModel.softLockDate) && + Objects.equals(this.updatedDateUtc, lockHistoryModel.updatedDateUtc); } @Override @@ -154,6 +163,7 @@ public int hashCode() { return Objects.hash(hardLockDate, softLockDate, updatedDateUtc); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -166,7 +176,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -174,4 +185,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/LockHistoryResponse.java b/src/main/java/com/xero/models/finance/LockHistoryResponse.java index d3b06e1a0..adc108f29 100644 --- a/src/main/java/com/xero/models/finance/LockHistoryResponse.java +++ b/src/main/java/com/xero/models/finance/LockHistoryResponse.java @@ -9,18 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.LockHistoryModel; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LockHistoryResponse + */ -/** LockHistoryResponse */ public class LockHistoryResponse { StringUtil util = new StringUtil(); @@ -33,81 +51,74 @@ public class LockHistoryResponse { @JsonProperty("lockDates") private List lockDates = new ArrayList(); /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - * @return LockHistoryResponse - */ + * The requested Organisation to which the data pertains + * @param organisationId UUID + * @return LockHistoryResponse + **/ public LockHistoryResponse organisationId(UUID organisationId) { this.organisationId = organisationId; return this; } - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId - */ + **/ @ApiModelProperty(value = "The requested Organisation to which the data pertains") - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId UUID - */ + **/ public UUID getOrganisationId() { return organisationId; } - /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - */ + /** + * The requested Organisation to which the data pertains + * @param organisationId UUID + **/ + public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; } /** - * The end date of the report - * - * @param endDate LocalDate - * @return LockHistoryResponse - */ + * The end date of the report + * @param endDate LocalDate + * @return LockHistoryResponse + **/ public LockHistoryResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The end date of the report - * * @return endDate - */ + **/ @ApiModelProperty(value = "The end date of the report") - /** + /** * The end date of the report - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The end date of the report - * - * @param endDate LocalDate - */ + /** + * The end date of the report + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * lockDates - * - * @param lockDates List<LockHistoryModel> - * @return LockHistoryResponse - */ + * lockDates + * @param lockDates List<LockHistoryModel> + * @return LockHistoryResponse + **/ public LockHistoryResponse lockDates(List lockDates) { this.lockDates = lockDates; return this; @@ -115,10 +126,9 @@ public LockHistoryResponse lockDates(List lockDates) { /** * lockDates - * - * @param lockDatesItem LockHistoryModel + * @param lockDatesItem LockHistoryModel * @return LockHistoryResponse - */ + **/ public LockHistoryResponse addLockDatesItem(LockHistoryModel lockDatesItem) { if (this.lockDates == null) { this.lockDates = new ArrayList(); @@ -127,30 +137,29 @@ public LockHistoryResponse addLockDatesItem(LockHistoryModel lockDatesItem) { return this; } - /** + /** * Get lockDates - * * @return lockDates - */ + **/ @ApiModelProperty(value = "") - /** + /** * lockDates - * * @return lockDates List - */ + **/ public List getLockDates() { return lockDates; } - /** - * lockDates - * - * @param lockDates List<LockHistoryModel> - */ + /** + * lockDates + * @param lockDates List<LockHistoryModel> + **/ + public void setLockDates(List lockDates) { this.lockDates = lockDates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } LockHistoryResponse lockHistoryResponse = (LockHistoryResponse) o; - return Objects.equals(this.organisationId, lockHistoryResponse.organisationId) - && Objects.equals(this.endDate, lockHistoryResponse.endDate) - && Objects.equals(this.lockDates, lockHistoryResponse.lockDates); + return Objects.equals(this.organisationId, lockHistoryResponse.organisationId) && + Objects.equals(this.endDate, lockHistoryResponse.endDate) && + Objects.equals(this.lockDates, lockHistoryResponse.lockDates); } @Override @@ -170,6 +179,7 @@ public int hashCode() { return Objects.hash(organisationId, endDate, lockDates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -182,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -190,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ManualJournalTotal.java b/src/main/java/com/xero/models/finance/ManualJournalTotal.java index af95ff847..c2d77604e 100644 --- a/src/main/java/com/xero/models/finance/ManualJournalTotal.java +++ b/src/main/java/com/xero/models/finance/ManualJournalTotal.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ManualJournalTotal + */ -/** ManualJournalTotal */ public class ManualJournalTotal { StringUtil util = new StringUtil(); @JsonProperty("total") private Double total; /** - * Total value of manual journals. - * - * @param total Double - * @return ManualJournalTotal - */ + * Total value of manual journals. + * @param total Double + * @return ManualJournalTotal + **/ public ManualJournalTotal total(Double total) { this.total = total; return this; } - /** + /** * Total value of manual journals. - * * @return total - */ + **/ @ApiModelProperty(value = "Total value of manual journals.") - /** + /** * Total value of manual journals. - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total value of manual journals. - * - * @param total Double - */ + /** + * Total value of manual journals. + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(total); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/OverpaymentResponse.java b/src/main/java/com/xero/models/finance/OverpaymentResponse.java index 9a9c0c382..c408d0a48 100644 --- a/src/main/java/com/xero/models/finance/OverpaymentResponse.java +++ b/src/main/java/com/xero/models/finance/OverpaymentResponse.java @@ -9,17 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ContactResponse; +import com.xero.models.finance.LineItemResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * OverpaymentResponse + */ -/** OverpaymentResponse */ public class OverpaymentResponse { StringUtil util = new StringUtil(); @@ -35,118 +54,106 @@ public class OverpaymentResponse { @JsonProperty("lineItems") private List lineItems = new ArrayList(); /** - * Xero Identifier of overpayment - * - * @param overpaymentId UUID - * @return OverpaymentResponse - */ + * Xero Identifier of overpayment + * @param overpaymentId UUID + * @return OverpaymentResponse + **/ public OverpaymentResponse overpaymentId(UUID overpaymentId) { this.overpaymentId = overpaymentId; return this; } - /** + /** * Xero Identifier of overpayment - * * @return overpaymentId - */ + **/ @ApiModelProperty(value = "Xero Identifier of overpayment") - /** + /** * Xero Identifier of overpayment - * * @return overpaymentId UUID - */ + **/ public UUID getOverpaymentId() { return overpaymentId; } - /** - * Xero Identifier of overpayment - * - * @param overpaymentId UUID - */ + /** + * Xero Identifier of overpayment + * @param overpaymentId UUID + **/ + public void setOverpaymentId(UUID overpaymentId) { this.overpaymentId = overpaymentId; } /** - * contact - * - * @param contact ContactResponse - * @return OverpaymentResponse - */ + * contact + * @param contact ContactResponse + * @return OverpaymentResponse + **/ public OverpaymentResponse contact(ContactResponse contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact ContactResponse - */ + **/ public ContactResponse getContact() { return contact; } - /** - * contact - * - * @param contact ContactResponse - */ + /** + * contact + * @param contact ContactResponse + **/ + public void setContact(ContactResponse contact) { this.contact = contact; } /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - * @return OverpaymentResponse - */ + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + * @return OverpaymentResponse + **/ public OverpaymentResponse total(Double total) { this.total = total; return this; } - /** + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total - */ - @ApiModelProperty( - value = - "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") - /** + **/ + @ApiModelProperty(value = "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - */ + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - * @return OverpaymentResponse - */ + * Not included in summary mode + * @param lineItems List<LineItemResponse> + * @return OverpaymentResponse + **/ public OverpaymentResponse lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -154,10 +161,9 @@ public OverpaymentResponse lineItems(List lineItems) { /** * Not included in summary mode - * - * @param lineItemsItem LineItemResponse + * @param lineItemsItem LineItemResponse * @return OverpaymentResponse - */ + **/ public OverpaymentResponse addLineItemsItem(LineItemResponse lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -166,30 +172,29 @@ public OverpaymentResponse addLineItemsItem(LineItemResponse lineItemsItem) { return this; } - /** + /** * Not included in summary mode - * * @return lineItems - */ + **/ @ApiModelProperty(value = "Not included in summary mode") - /** + /** * Not included in summary mode - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - */ + /** + * Not included in summary mode + * @param lineItems List<LineItemResponse> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -199,10 +204,10 @@ public boolean equals(java.lang.Object o) { return false; } OverpaymentResponse overpaymentResponse = (OverpaymentResponse) o; - return Objects.equals(this.overpaymentId, overpaymentResponse.overpaymentId) - && Objects.equals(this.contact, overpaymentResponse.contact) - && Objects.equals(this.total, overpaymentResponse.total) - && Objects.equals(this.lineItems, overpaymentResponse.lineItems); + return Objects.equals(this.overpaymentId, overpaymentResponse.overpaymentId) && + Objects.equals(this.contact, overpaymentResponse.contact) && + Objects.equals(this.total, overpaymentResponse.total) && + Objects.equals(this.lineItems, overpaymentResponse.lineItems); } @Override @@ -210,6 +215,7 @@ public int hashCode() { return Objects.hash(overpaymentId, contact, total, lineItems); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -223,7 +229,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -231,4 +238,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/PaymentResponse.java b/src/main/java/com/xero/models/finance/PaymentResponse.java index c164050c5..a3d1c0937 100644 --- a/src/main/java/com/xero/models/finance/PaymentResponse.java +++ b/src/main/java/com/xero/models/finance/PaymentResponse.java @@ -9,16 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.CreditNoteResponse; +import com.xero.models.finance.InvoiceResponse; +import com.xero.models.finance.OverpaymentResponse; +import com.xero.models.finance.PrepaymentResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentResponse + */ -/** PaymentResponse */ public class PaymentResponse { StringUtil util = new StringUtil(); @@ -52,365 +73,326 @@ public class PaymentResponse { @JsonProperty("overpayment") private OverpaymentResponse overpayment; /** - * Xero Identifier of payment - * - * @param paymentId UUID - * @return PaymentResponse - */ + * Xero Identifier of payment + * @param paymentId UUID + * @return PaymentResponse + **/ public PaymentResponse paymentId(UUID paymentId) { this.paymentId = paymentId; return this; } - /** + /** * Xero Identifier of payment - * * @return paymentId - */ + **/ @ApiModelProperty(value = "Xero Identifier of payment") - /** + /** * Xero Identifier of payment - * * @return paymentId UUID - */ + **/ public UUID getPaymentId() { return paymentId; } - /** - * Xero Identifier of payment - * - * @param paymentId UUID - */ + /** + * Xero Identifier of payment + * @param paymentId UUID + **/ + public void setPaymentId(UUID paymentId) { this.paymentId = paymentId; } /** - * Xero Identifier of batch payment. Present if the payment was created as part of a batch. - * - * @param batchPaymentId UUID - * @return PaymentResponse - */ + * Xero Identifier of batch payment. Present if the payment was created as part of a batch. + * @param batchPaymentId UUID + * @return PaymentResponse + **/ public PaymentResponse batchPaymentId(UUID batchPaymentId) { this.batchPaymentId = batchPaymentId; return this; } - /** + /** * Xero Identifier of batch payment. Present if the payment was created as part of a batch. - * * @return batchPaymentId - */ - @ApiModelProperty( - value = - "Xero Identifier of batch payment. Present if the payment was created as part of a" - + " batch.") - /** + **/ + @ApiModelProperty(value = "Xero Identifier of batch payment. Present if the payment was created as part of a batch.") + /** * Xero Identifier of batch payment. Present if the payment was created as part of a batch. - * * @return batchPaymentId UUID - */ + **/ public UUID getBatchPaymentId() { return batchPaymentId; } - /** - * Xero Identifier of batch payment. Present if the payment was created as part of a batch. - * - * @param batchPaymentId UUID - */ + /** + * Xero Identifier of batch payment. Present if the payment was created as part of a batch. + * @param batchPaymentId UUID + **/ + public void setBatchPaymentId(UUID batchPaymentId) { this.batchPaymentId = batchPaymentId; } /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date LocalDate - * @return PaymentResponse - */ + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date LocalDate + * @return PaymentResponse + **/ public PaymentResponse date(LocalDate date) { this.date = date; return this; } - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return date - */ + **/ @ApiModelProperty(value = "Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06") - /** + /** * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * * @return date LocalDate - */ + **/ public LocalDate getDate() { return date; } - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * - * @param date LocalDate - */ + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * @param date LocalDate + **/ + public void setDate(LocalDate date) { this.date = date; } /** - * The amount of the payment - * - * @param amount Double - * @return PaymentResponse - */ + * The amount of the payment + * @param amount Double + * @return PaymentResponse + **/ public PaymentResponse amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the payment - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the payment") - /** + /** * The amount of the payment - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the payment - * - * @param amount Double - */ + /** + * The amount of the payment + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The bank amount of the payment - * - * @param bankAmount Double - * @return PaymentResponse - */ + * The bank amount of the payment + * @param bankAmount Double + * @return PaymentResponse + **/ public PaymentResponse bankAmount(Double bankAmount) { this.bankAmount = bankAmount; return this; } - /** + /** * The bank amount of the payment - * * @return bankAmount - */ + **/ @ApiModelProperty(value = "The bank amount of the payment") - /** + /** * The bank amount of the payment - * * @return bankAmount Double - */ + **/ public Double getBankAmount() { return bankAmount; } - /** - * The bank amount of the payment - * - * @param bankAmount Double - */ + /** + * The bank amount of the payment + * @param bankAmount Double + **/ + public void setBankAmount(Double bankAmount) { this.bankAmount = bankAmount; } /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * - * @param currencyRate Double - * @return PaymentResponse - */ + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + * @param currencyRate Double + * @return PaymentResponse + **/ public PaymentResponse currencyRate(Double currencyRate) { this.currencyRate = currencyRate; return this; } - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 * @return currencyRate - */ - @ApiModelProperty( - value = - "Exchange rate when payment is received. Only used for non base currency invoices and" - + " credit notes e.g. 0.7500") - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * + **/ + @ApiModelProperty(value = "Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500") + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 * @return currencyRate Double - */ + **/ public Double getCurrencyRate() { return currencyRate; } - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit - * notes e.g. 0.7500 - * - * @param currencyRate Double - */ + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + * @param currencyRate Double + **/ + public void setCurrencyRate(Double currencyRate) { this.currencyRate = currencyRate; } /** - * invoice - * - * @param invoice InvoiceResponse - * @return PaymentResponse - */ + * invoice + * @param invoice InvoiceResponse + * @return PaymentResponse + **/ public PaymentResponse invoice(InvoiceResponse invoice) { this.invoice = invoice; return this; } - /** + /** * Get invoice - * * @return invoice - */ + **/ @ApiModelProperty(value = "") - /** + /** * invoice - * * @return invoice InvoiceResponse - */ + **/ public InvoiceResponse getInvoice() { return invoice; } - /** - * invoice - * - * @param invoice InvoiceResponse - */ + /** + * invoice + * @param invoice InvoiceResponse + **/ + public void setInvoice(InvoiceResponse invoice) { this.invoice = invoice; } /** - * creditNote - * - * @param creditNote CreditNoteResponse - * @return PaymentResponse - */ + * creditNote + * @param creditNote CreditNoteResponse + * @return PaymentResponse + **/ public PaymentResponse creditNote(CreditNoteResponse creditNote) { this.creditNote = creditNote; return this; } - /** + /** * Get creditNote - * * @return creditNote - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditNote - * * @return creditNote CreditNoteResponse - */ + **/ public CreditNoteResponse getCreditNote() { return creditNote; } - /** - * creditNote - * - * @param creditNote CreditNoteResponse - */ + /** + * creditNote + * @param creditNote CreditNoteResponse + **/ + public void setCreditNote(CreditNoteResponse creditNote) { this.creditNote = creditNote; } /** - * prepayment - * - * @param prepayment PrepaymentResponse - * @return PaymentResponse - */ + * prepayment + * @param prepayment PrepaymentResponse + * @return PaymentResponse + **/ public PaymentResponse prepayment(PrepaymentResponse prepayment) { this.prepayment = prepayment; return this; } - /** + /** * Get prepayment - * * @return prepayment - */ + **/ @ApiModelProperty(value = "") - /** + /** * prepayment - * * @return prepayment PrepaymentResponse - */ + **/ public PrepaymentResponse getPrepayment() { return prepayment; } - /** - * prepayment - * - * @param prepayment PrepaymentResponse - */ + /** + * prepayment + * @param prepayment PrepaymentResponse + **/ + public void setPrepayment(PrepaymentResponse prepayment) { this.prepayment = prepayment; } /** - * overpayment - * - * @param overpayment OverpaymentResponse - * @return PaymentResponse - */ + * overpayment + * @param overpayment OverpaymentResponse + * @return PaymentResponse + **/ public PaymentResponse overpayment(OverpaymentResponse overpayment) { this.overpayment = overpayment; return this; } - /** + /** * Get overpayment - * * @return overpayment - */ + **/ @ApiModelProperty(value = "") - /** + /** * overpayment - * * @return overpayment OverpaymentResponse - */ + **/ public OverpaymentResponse getOverpayment() { return overpayment; } - /** - * overpayment - * - * @param overpayment OverpaymentResponse - */ + /** + * overpayment + * @param overpayment OverpaymentResponse + **/ + public void setOverpayment(OverpaymentResponse overpayment) { this.overpayment = overpayment; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -420,33 +402,24 @@ public boolean equals(java.lang.Object o) { return false; } PaymentResponse paymentResponse = (PaymentResponse) o; - return Objects.equals(this.paymentId, paymentResponse.paymentId) - && Objects.equals(this.batchPaymentId, paymentResponse.batchPaymentId) - && Objects.equals(this.date, paymentResponse.date) - && Objects.equals(this.amount, paymentResponse.amount) - && Objects.equals(this.bankAmount, paymentResponse.bankAmount) - && Objects.equals(this.currencyRate, paymentResponse.currencyRate) - && Objects.equals(this.invoice, paymentResponse.invoice) - && Objects.equals(this.creditNote, paymentResponse.creditNote) - && Objects.equals(this.prepayment, paymentResponse.prepayment) - && Objects.equals(this.overpayment, paymentResponse.overpayment); + return Objects.equals(this.paymentId, paymentResponse.paymentId) && + Objects.equals(this.batchPaymentId, paymentResponse.batchPaymentId) && + Objects.equals(this.date, paymentResponse.date) && + Objects.equals(this.amount, paymentResponse.amount) && + Objects.equals(this.bankAmount, paymentResponse.bankAmount) && + Objects.equals(this.currencyRate, paymentResponse.currencyRate) && + Objects.equals(this.invoice, paymentResponse.invoice) && + Objects.equals(this.creditNote, paymentResponse.creditNote) && + Objects.equals(this.prepayment, paymentResponse.prepayment) && + Objects.equals(this.overpayment, paymentResponse.overpayment); } @Override public int hashCode() { - return Objects.hash( - paymentId, - batchPaymentId, - date, - amount, - bankAmount, - currencyRate, - invoice, - creditNote, - prepayment, - overpayment); + return Objects.hash(paymentId, batchPaymentId, date, amount, bankAmount, currencyRate, invoice, creditNote, prepayment, overpayment); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -466,7 +439,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -474,4 +448,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/PnlAccount.java b/src/main/java/com/xero/models/finance/PnlAccount.java index ef970ee8e..872754be3 100644 --- a/src/main/java/com/xero/models/finance/PnlAccount.java +++ b/src/main/java/com/xero/models/finance/PnlAccount.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PnlAccount + */ -/** PnlAccount */ public class PnlAccount { StringUtil util = new StringUtil(); @@ -39,227 +56,198 @@ public class PnlAccount { @JsonProperty("total") private Double total; /** - * ID of the account - * - * @param accountID UUID - * @return PnlAccount - */ + * ID of the account + * @param accountID UUID + * @return PnlAccount + **/ public PnlAccount accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * ID of the account - * * @return accountID - */ + **/ @ApiModelProperty(value = "ID of the account") - /** + /** * ID of the account - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * ID of the account - * - * @param accountID UUID - */ + /** + * ID of the account + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - * @return PnlAccount - */ + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + * @return PnlAccount + **/ public PnlAccount accountType(String accountType) { this.accountType = accountType; return this; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType - */ - @ApiModelProperty( - value = - "The type of the account. See Account" - + " Types") - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + **/ + @ApiModelProperty(value = "The type of the account. See Account Types") + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType String - */ + **/ public String getAccountType() { return accountType; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - */ + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + **/ + public void setAccountType(String accountType) { this.accountType = accountType; } /** - * Account code - * - * @param code String - * @return PnlAccount - */ + * Account code + * @param code String + * @return PnlAccount + **/ public PnlAccount code(String code) { this.code = code; return this; } - /** + /** * Account code - * * @return code - */ + **/ @ApiModelProperty(value = "Account code") - /** + /** * Account code - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * Account code - * - * @param code String - */ + /** + * Account code + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Account name - * - * @param name String - * @return PnlAccount - */ + * Account name + * @param name String + * @return PnlAccount + **/ public PnlAccount name(String name) { this.name = name; return this; } - /** + /** * Account name - * * @return name - */ + **/ @ApiModelProperty(value = "Account name") - /** + /** * Account name - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Account name - * - * @param name String - */ + /** + * Account name + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Reporting code (Shown if set) - * - * @param reportingCode String - * @return PnlAccount - */ + * Reporting code (Shown if set) + * @param reportingCode String + * @return PnlAccount + **/ public PnlAccount reportingCode(String reportingCode) { this.reportingCode = reportingCode; return this; } - /** + /** * Reporting code (Shown if set) - * * @return reportingCode - */ + **/ @ApiModelProperty(value = "Reporting code (Shown if set)") - /** + /** * Reporting code (Shown if set) - * * @return reportingCode String - */ + **/ public String getReportingCode() { return reportingCode; } - /** - * Reporting code (Shown if set) - * - * @param reportingCode String - */ + /** + * Reporting code (Shown if set) + * @param reportingCode String + **/ + public void setReportingCode(String reportingCode) { this.reportingCode = reportingCode; } /** - * Total movement on this account - * - * @param total Double - * @return PnlAccount - */ + * Total movement on this account + * @param total Double + * @return PnlAccount + **/ public PnlAccount total(Double total) { this.total = total; return this; } - /** + /** * Total movement on this account - * * @return total - */ + **/ @ApiModelProperty(value = "Total movement on this account") - /** + /** * Total movement on this account - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total movement on this account - * - * @param total Double - */ + /** + * Total movement on this account + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,12 +257,12 @@ public boolean equals(java.lang.Object o) { return false; } PnlAccount pnlAccount = (PnlAccount) o; - return Objects.equals(this.accountID, pnlAccount.accountID) - && Objects.equals(this.accountType, pnlAccount.accountType) - && Objects.equals(this.code, pnlAccount.code) - && Objects.equals(this.name, pnlAccount.name) - && Objects.equals(this.reportingCode, pnlAccount.reportingCode) - && Objects.equals(this.total, pnlAccount.total); + return Objects.equals(this.accountID, pnlAccount.accountID) && + Objects.equals(this.accountType, pnlAccount.accountType) && + Objects.equals(this.code, pnlAccount.code) && + Objects.equals(this.name, pnlAccount.name) && + Objects.equals(this.reportingCode, pnlAccount.reportingCode) && + Objects.equals(this.total, pnlAccount.total); } @Override @@ -282,6 +270,7 @@ public int hashCode() { return Objects.hash(accountID, accountType, code, name, reportingCode, total); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -297,7 +286,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -305,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/PnlAccountClass.java b/src/main/java/com/xero/models/finance/PnlAccountClass.java index 972c20840..de8849298 100644 --- a/src/main/java/com/xero/models/finance/PnlAccountClass.java +++ b/src/main/java/com/xero/models/finance/PnlAccountClass.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.PnlAccountType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PnlAccountClass + */ -/** PnlAccountClass */ public class PnlAccountClass { StringUtil util = new StringUtil(); @@ -28,61 +46,52 @@ public class PnlAccountClass { @JsonProperty("accountTypes") private List accountTypes = new ArrayList(); /** - * Total revenue/expense value - * - * @param total Double - * @return PnlAccountClass - */ + * Total revenue/expense value + * @param total Double + * @return PnlAccountClass + **/ public PnlAccountClass total(Double total) { this.total = total; return this; } - /** + /** * Total revenue/expense value - * * @return total - */ + **/ @ApiModelProperty(value = "Total revenue/expense value") - /** + /** * Total revenue/expense value - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total revenue/expense value - * - * @param total Double - */ + /** + * Total revenue/expense value + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Contains trading income and other income for revenue section / operating expenses and direct - * cost for expense section if the data is available for each section. Refer to the account type - * element below - * - * @param accountTypes List<PnlAccountType> - * @return PnlAccountClass - */ + * Contains trading income and other income for revenue section / operating expenses and direct cost for expense section if the data is available for each section. Refer to the account type element below + * @param accountTypes List<PnlAccountType> + * @return PnlAccountClass + **/ public PnlAccountClass accountTypes(List accountTypes) { this.accountTypes = accountTypes; return this; } /** - * Contains trading income and other income for revenue section / operating expenses and direct - * cost for expense section if the data is available for each section. Refer to the account type - * element below - * - * @param accountTypesItem PnlAccountType + * Contains trading income and other income for revenue section / operating expenses and direct cost for expense section if the data is available for each section. Refer to the account type element below + * @param accountTypesItem PnlAccountType * @return PnlAccountClass - */ + **/ public PnlAccountClass addAccountTypesItem(PnlAccountType accountTypesItem) { if (this.accountTypes == null) { this.accountTypes = new ArrayList(); @@ -91,40 +100,29 @@ public PnlAccountClass addAccountTypesItem(PnlAccountType accountTypesItem) { return this; } - /** - * Contains trading income and other income for revenue section / operating expenses and direct - * cost for expense section if the data is available for each section. Refer to the account type - * element below - * + /** + * Contains trading income and other income for revenue section / operating expenses and direct cost for expense section if the data is available for each section. Refer to the account type element below * @return accountTypes - */ - @ApiModelProperty( - value = - "Contains trading income and other income for revenue section / operating expenses and" - + " direct cost for expense section if the data is available for each section. Refer" - + " to the account type element below") - /** - * Contains trading income and other income for revenue section / operating expenses and direct - * cost for expense section if the data is available for each section. Refer to the account type - * element below - * + **/ + @ApiModelProperty(value = "Contains trading income and other income for revenue section / operating expenses and direct cost for expense section if the data is available for each section. Refer to the account type element below") + /** + * Contains trading income and other income for revenue section / operating expenses and direct cost for expense section if the data is available for each section. Refer to the account type element below * @return accountTypes List - */ + **/ public List getAccountTypes() { return accountTypes; } - /** - * Contains trading income and other income for revenue section / operating expenses and direct - * cost for expense section if the data is available for each section. Refer to the account type - * element below - * - * @param accountTypes List<PnlAccountType> - */ + /** + * Contains trading income and other income for revenue section / operating expenses and direct cost for expense section if the data is available for each section. Refer to the account type element below + * @param accountTypes List<PnlAccountType> + **/ + public void setAccountTypes(List accountTypes) { this.accountTypes = accountTypes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +132,8 @@ public boolean equals(java.lang.Object o) { return false; } PnlAccountClass pnlAccountClass = (PnlAccountClass) o; - return Objects.equals(this.total, pnlAccountClass.total) - && Objects.equals(this.accountTypes, pnlAccountClass.accountTypes); + return Objects.equals(this.total, pnlAccountClass.total) && + Objects.equals(this.accountTypes, pnlAccountClass.accountTypes); } @Override @@ -143,6 +141,7 @@ public int hashCode() { return Objects.hash(total, accountTypes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -154,7 +153,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -162,4 +162,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/PnlAccountType.java b/src/main/java/com/xero/models/finance/PnlAccountType.java index a8f7be10b..e85fc39d4 100644 --- a/src/main/java/com/xero/models/finance/PnlAccountType.java +++ b/src/main/java/com/xero/models/finance/PnlAccountType.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.PnlAccount; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PnlAccountType + */ -/** PnlAccountType */ public class PnlAccountType { StringUtil util = new StringUtil(); @@ -31,101 +49,84 @@ public class PnlAccountType { @JsonProperty("accounts") private List accounts = new ArrayList(); /** - * Total movement on this account type - * - * @param total Double - * @return PnlAccountType - */ + * Total movement on this account type + * @param total Double + * @return PnlAccountType + **/ public PnlAccountType total(Double total) { this.total = total; return this; } - /** + /** * Total movement on this account type - * * @return total - */ + **/ @ApiModelProperty(value = "Total movement on this account type") - /** + /** * Total movement on this account type - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total movement on this account type - * - * @param total Double - */ + /** + * Total movement on this account type + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Name of this account type, it will be either Trading Income or Other Income for Revenue section - * / Direct Cost or Operating Expenses for Expense section - * - * @param title String - * @return PnlAccountType - */ + * Name of this account type, it will be either Trading Income or Other Income for Revenue section / Direct Cost or Operating Expenses for Expense section + * @param title String + * @return PnlAccountType + **/ public PnlAccountType title(String title) { this.title = title; return this; } - /** - * Name of this account type, it will be either Trading Income or Other Income for Revenue section - * / Direct Cost or Operating Expenses for Expense section - * + /** + * Name of this account type, it will be either Trading Income or Other Income for Revenue section / Direct Cost or Operating Expenses for Expense section * @return title - */ - @ApiModelProperty( - value = - "Name of this account type, it will be either Trading Income or Other Income for Revenue" - + " section / Direct Cost or Operating Expenses for Expense section") - /** - * Name of this account type, it will be either Trading Income or Other Income for Revenue section - * / Direct Cost or Operating Expenses for Expense section - * + **/ + @ApiModelProperty(value = "Name of this account type, it will be either Trading Income or Other Income for Revenue section / Direct Cost or Operating Expenses for Expense section") + /** + * Name of this account type, it will be either Trading Income or Other Income for Revenue section / Direct Cost or Operating Expenses for Expense section * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Name of this account type, it will be either Trading Income or Other Income for Revenue section - * / Direct Cost or Operating Expenses for Expense section - * - * @param title String - */ + /** + * Name of this account type, it will be either Trading Income or Other Income for Revenue section / Direct Cost or Operating Expenses for Expense section + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * A list of the movement on each account detail during the query period. Refer to the account - * detail element below - * - * @param accounts List<PnlAccount> - * @return PnlAccountType - */ + * A list of the movement on each account detail during the query period. Refer to the account detail element below + * @param accounts List<PnlAccount> + * @return PnlAccountType + **/ public PnlAccountType accounts(List accounts) { this.accounts = accounts; return this; } /** - * A list of the movement on each account detail during the query period. Refer to the account - * detail element below - * - * @param accountsItem PnlAccount + * A list of the movement on each account detail during the query period. Refer to the account detail element below + * @param accountsItem PnlAccount * @return PnlAccountType - */ + **/ public PnlAccountType addAccountsItem(PnlAccount accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -134,36 +135,29 @@ public PnlAccountType addAccountsItem(PnlAccount accountsItem) { return this; } - /** - * A list of the movement on each account detail during the query period. Refer to the account - * detail element below - * + /** + * A list of the movement on each account detail during the query period. Refer to the account detail element below * @return accounts - */ - @ApiModelProperty( - value = - "A list of the movement on each account detail during the query period. Refer to the" - + " account detail element below") - /** - * A list of the movement on each account detail during the query period. Refer to the account - * detail element below - * + **/ + @ApiModelProperty(value = "A list of the movement on each account detail during the query period. Refer to the account detail element below") + /** + * A list of the movement on each account detail during the query period. Refer to the account detail element below * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * A list of the movement on each account detail during the query period. Refer to the account - * detail element below - * - * @param accounts List<PnlAccount> - */ + /** + * A list of the movement on each account detail during the query period. Refer to the account detail element below + * @param accounts List<PnlAccount> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,9 +167,9 @@ public boolean equals(java.lang.Object o) { return false; } PnlAccountType pnlAccountType = (PnlAccountType) o; - return Objects.equals(this.total, pnlAccountType.total) - && Objects.equals(this.title, pnlAccountType.title) - && Objects.equals(this.accounts, pnlAccountType.accounts); + return Objects.equals(this.total, pnlAccountType.total) && + Objects.equals(this.title, pnlAccountType.title) && + Objects.equals(this.accounts, pnlAccountType.accounts); } @Override @@ -183,6 +177,7 @@ public int hashCode() { return Objects.hash(total, title, accounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -195,7 +190,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -203,4 +199,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/PracticeResponse.java b/src/main/java/com/xero/models/finance/PracticeResponse.java index bf1967cac..87ba13200 100644 --- a/src/main/java/com/xero/models/finance/PracticeResponse.java +++ b/src/main/java/com/xero/models/finance/PracticeResponse.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PracticeResponse + */ -/** PracticeResponse */ public class PracticeResponse { StringUtil util = new StringUtil(); @@ -35,180 +52,166 @@ public class PracticeResponse { @JsonProperty("staffCertified") private Boolean staffCertified; /** - * Year of becoming a partner. - * - * @param xeroPartnerSince Integer - * @return PracticeResponse - */ + * Year of becoming a partner. + * @param xeroPartnerSince Integer + * @return PracticeResponse + **/ public PracticeResponse xeroPartnerSince(Integer xeroPartnerSince) { this.xeroPartnerSince = xeroPartnerSince; return this; } - /** + /** * Year of becoming a partner. - * * @return xeroPartnerSince - */ + **/ @ApiModelProperty(value = "Year of becoming a partner.") - /** + /** * Year of becoming a partner. - * * @return xeroPartnerSince Integer - */ + **/ public Integer getXeroPartnerSince() { return xeroPartnerSince; } - /** - * Year of becoming a partner. - * - * @param xeroPartnerSince Integer - */ + /** + * Year of becoming a partner. + * @param xeroPartnerSince Integer + **/ + public void setXeroPartnerSince(Integer xeroPartnerSince) { this.xeroPartnerSince = xeroPartnerSince; } /** - * Customer tier e.g. Silver - * - * @param tier String - * @return PracticeResponse - */ + * Customer tier e.g. Silver + * @param tier String + * @return PracticeResponse + **/ public PracticeResponse tier(String tier) { this.tier = tier; return this; } - /** + /** * Customer tier e.g. Silver - * * @return tier - */ + **/ @ApiModelProperty(value = "Customer tier e.g. Silver") - /** + /** * Customer tier e.g. Silver - * * @return tier String - */ + **/ public String getTier() { return tier; } - /** - * Customer tier e.g. Silver - * - * @param tier String - */ + /** + * Customer tier e.g. Silver + * @param tier String + **/ + public void setTier(String tier) { this.tier = tier; } /** - * Country of location. - * - * @param location String - * @return PracticeResponse - */ + * Country of location. + * @param location String + * @return PracticeResponse + **/ public PracticeResponse location(String location) { this.location = location; return this; } - /** + /** * Country of location. - * * @return location - */ + **/ @ApiModelProperty(value = "Country of location.") - /** + /** * Country of location. - * * @return location String - */ + **/ public String getLocation() { return location; } - /** - * Country of location. - * - * @param location String - */ + /** + * Country of location. + * @param location String + **/ + public void setLocation(String location) { this.location = location; } /** - * Organisation count. - * - * @param organisationCount Integer - * @return PracticeResponse - */ + * Organisation count. + * @param organisationCount Integer + * @return PracticeResponse + **/ public PracticeResponse organisationCount(Integer organisationCount) { this.organisationCount = organisationCount; return this; } - /** + /** * Organisation count. - * * @return organisationCount - */ + **/ @ApiModelProperty(value = "Organisation count.") - /** + /** * Organisation count. - * * @return organisationCount Integer - */ + **/ public Integer getOrganisationCount() { return organisationCount; } - /** - * Organisation count. - * - * @param organisationCount Integer - */ + /** + * Organisation count. + * @param organisationCount Integer + **/ + public void setOrganisationCount(Integer organisationCount) { this.organisationCount = organisationCount; } /** - * Staff certified (true/false). - * - * @param staffCertified Boolean - * @return PracticeResponse - */ + * Staff certified (true/false). + * @param staffCertified Boolean + * @return PracticeResponse + **/ public PracticeResponse staffCertified(Boolean staffCertified) { this.staffCertified = staffCertified; return this; } - /** + /** * Staff certified (true/false). - * * @return staffCertified - */ + **/ @ApiModelProperty(value = "Staff certified (true/false).") - /** + /** * Staff certified (true/false). - * * @return staffCertified Boolean - */ + **/ public Boolean getStaffCertified() { return staffCertified; } - /** - * Staff certified (true/false). - * - * @param staffCertified Boolean - */ + /** + * Staff certified (true/false). + * @param staffCertified Boolean + **/ + public void setStaffCertified(Boolean staffCertified) { this.staffCertified = staffCertified; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -218,11 +221,11 @@ public boolean equals(java.lang.Object o) { return false; } PracticeResponse practiceResponse = (PracticeResponse) o; - return Objects.equals(this.xeroPartnerSince, practiceResponse.xeroPartnerSince) - && Objects.equals(this.tier, practiceResponse.tier) - && Objects.equals(this.location, practiceResponse.location) - && Objects.equals(this.organisationCount, practiceResponse.organisationCount) - && Objects.equals(this.staffCertified, practiceResponse.staffCertified); + return Objects.equals(this.xeroPartnerSince, practiceResponse.xeroPartnerSince) && + Objects.equals(this.tier, practiceResponse.tier) && + Objects.equals(this.location, practiceResponse.location) && + Objects.equals(this.organisationCount, practiceResponse.organisationCount) && + Objects.equals(this.staffCertified, practiceResponse.staffCertified); } @Override @@ -230,6 +233,7 @@ public int hashCode() { return Objects.hash(xeroPartnerSince, tier, location, organisationCount, staffCertified); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -244,7 +248,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -252,4 +257,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/PrepaymentResponse.java b/src/main/java/com/xero/models/finance/PrepaymentResponse.java index d20e35ac8..c31e090ad 100644 --- a/src/main/java/com/xero/models/finance/PrepaymentResponse.java +++ b/src/main/java/com/xero/models/finance/PrepaymentResponse.java @@ -9,17 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ContactResponse; +import com.xero.models.finance.LineItemResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PrepaymentResponse + */ -/** PrepaymentResponse */ public class PrepaymentResponse { StringUtil util = new StringUtil(); @@ -35,118 +54,106 @@ public class PrepaymentResponse { @JsonProperty("lineItems") private List lineItems = new ArrayList(); /** - * Xero Identifier of prepayment - * - * @param prepaymentId UUID - * @return PrepaymentResponse - */ + * Xero Identifier of prepayment + * @param prepaymentId UUID + * @return PrepaymentResponse + **/ public PrepaymentResponse prepaymentId(UUID prepaymentId) { this.prepaymentId = prepaymentId; return this; } - /** + /** * Xero Identifier of prepayment - * * @return prepaymentId - */ + **/ @ApiModelProperty(value = "Xero Identifier of prepayment") - /** + /** * Xero Identifier of prepayment - * * @return prepaymentId UUID - */ + **/ public UUID getPrepaymentId() { return prepaymentId; } - /** - * Xero Identifier of prepayment - * - * @param prepaymentId UUID - */ + /** + * Xero Identifier of prepayment + * @param prepaymentId UUID + **/ + public void setPrepaymentId(UUID prepaymentId) { this.prepaymentId = prepaymentId; } /** - * contact - * - * @param contact ContactResponse - * @return PrepaymentResponse - */ + * contact + * @param contact ContactResponse + * @return PrepaymentResponse + **/ public PrepaymentResponse contact(ContactResponse contact) { this.contact = contact; return this; } - /** + /** * Get contact - * * @return contact - */ + **/ @ApiModelProperty(value = "") - /** + /** * contact - * * @return contact ContactResponse - */ + **/ public ContactResponse getContact() { return contact; } - /** - * contact - * - * @param contact ContactResponse - */ + /** + * contact + * @param contact ContactResponse + **/ + public void setContact(ContactResponse contact) { this.contact = contact; } /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - * @return PrepaymentResponse - */ + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + * @return PrepaymentResponse + **/ public PrepaymentResponse total(Double total) { this.total = total; return this; } - /** + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total - */ - @ApiModelProperty( - value = - "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") - /** + **/ + @ApiModelProperty(value = "Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode") + /** * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * * @return total Double - */ + **/ public Double getTotal() { return total; } - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode - * - * @param total Double - */ + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode + * @param total Double + **/ + public void setTotal(Double total) { this.total = total; } /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - * @return PrepaymentResponse - */ + * Not included in summary mode + * @param lineItems List<LineItemResponse> + * @return PrepaymentResponse + **/ public PrepaymentResponse lineItems(List lineItems) { this.lineItems = lineItems; return this; @@ -154,10 +161,9 @@ public PrepaymentResponse lineItems(List lineItems) { /** * Not included in summary mode - * - * @param lineItemsItem LineItemResponse + * @param lineItemsItem LineItemResponse * @return PrepaymentResponse - */ + **/ public PrepaymentResponse addLineItemsItem(LineItemResponse lineItemsItem) { if (this.lineItems == null) { this.lineItems = new ArrayList(); @@ -166,30 +172,29 @@ public PrepaymentResponse addLineItemsItem(LineItemResponse lineItemsItem) { return this; } - /** + /** * Not included in summary mode - * * @return lineItems - */ + **/ @ApiModelProperty(value = "Not included in summary mode") - /** + /** * Not included in summary mode - * * @return lineItems List - */ + **/ public List getLineItems() { return lineItems; } - /** - * Not included in summary mode - * - * @param lineItems List<LineItemResponse> - */ + /** + * Not included in summary mode + * @param lineItems List<LineItemResponse> + **/ + public void setLineItems(List lineItems) { this.lineItems = lineItems; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -199,10 +204,10 @@ public boolean equals(java.lang.Object o) { return false; } PrepaymentResponse prepaymentResponse = (PrepaymentResponse) o; - return Objects.equals(this.prepaymentId, prepaymentResponse.prepaymentId) - && Objects.equals(this.contact, prepaymentResponse.contact) - && Objects.equals(this.total, prepaymentResponse.total) - && Objects.equals(this.lineItems, prepaymentResponse.lineItems); + return Objects.equals(this.prepaymentId, prepaymentResponse.prepaymentId) && + Objects.equals(this.contact, prepaymentResponse.contact) && + Objects.equals(this.total, prepaymentResponse.total) && + Objects.equals(this.lineItems, prepaymentResponse.lineItems); } @Override @@ -210,6 +215,7 @@ public int hashCode() { return Objects.hash(prepaymentId, contact, total, lineItems); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -223,7 +229,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -231,4 +238,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/Problem.java b/src/main/java/com/xero/models/finance/Problem.java index e702cd35a..e82c05ba5 100644 --- a/src/main/java/com/xero/models/finance/Problem.java +++ b/src/main/java/com/xero/models/finance/Problem.java @@ -9,14 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ProblemType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Problem + */ -/** Problem */ public class Problem { StringUtil util = new StringUtil(); @@ -32,145 +50,134 @@ public class Problem { @JsonProperty("detail") private String detail; /** - * type - * - * @param type ProblemType - * @return Problem - */ + * type + * @param type ProblemType + * @return Problem + **/ public Problem type(ProblemType type) { this.type = type; return this; } - /** + /** * Get type - * * @return type - */ + **/ @ApiModelProperty(value = "") - /** + /** * type - * * @return type ProblemType - */ + **/ public ProblemType getType() { return type; } - /** - * type - * - * @param type ProblemType - */ + /** + * type + * @param type ProblemType + **/ + public void setType(ProblemType type) { this.type = type; } /** - * title - * - * @param title String - * @return Problem - */ + * title + * @param title String + * @return Problem + **/ public Problem title(String title) { this.title = title; return this; } - /** + /** * Get title - * * @return title - */ + **/ @ApiModelProperty(value = "") - /** + /** * title - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * title - * - * @param title String - */ + /** + * title + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * status - * - * @param status Integer - * @return Problem - */ + * status + * @param status Integer + * @return Problem + **/ public Problem status(Integer status) { this.status = status; return this; } - /** + /** * Get status - * * @return status - */ + **/ @ApiModelProperty(value = "") - /** + /** * status - * * @return status Integer - */ + **/ public Integer getStatus() { return status; } - /** - * status - * - * @param status Integer - */ + /** + * status + * @param status Integer + **/ + public void setStatus(Integer status) { this.status = status; } /** - * detail - * - * @param detail String - * @return Problem - */ + * detail + * @param detail String + * @return Problem + **/ public Problem detail(String detail) { this.detail = detail; return this; } - /** + /** * Get detail - * * @return detail - */ + **/ @ApiModelProperty(value = "") - /** + /** * detail - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * detail - * - * @param detail String - */ + /** + * detail + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } Problem problem = (Problem) o; - return Objects.equals(this.type, problem.type) - && Objects.equals(this.title, problem.title) - && Objects.equals(this.status, problem.status) - && Objects.equals(this.detail, problem.detail); + return Objects.equals(this.type, problem.type) && + Objects.equals(this.title, problem.title) && + Objects.equals(this.status, problem.status) && + Objects.equals(this.detail, problem.detail); } @Override @@ -191,6 +198,7 @@ public int hashCode() { return Objects.hash(type, title, status, detail); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -212,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ProblemType.java b/src/main/java/com/xero/models/finance/ProblemType.java index 5a166748b..6008cdeec 100644 --- a/src/main/java/com/xero/models/finance/ProblemType.java +++ b/src/main/java/com/xero/models/finance/ProblemType.java @@ -9,46 +9,79 @@ * Do not edit the class manually. */ -package com.xero.models.finance; - +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets ProblemType */ +/** + * Gets or Sets ProblemType + */ public enum ProblemType { - - /** NOTSET */ + + /** + * NOTSET + */ NOTSET("NotSet"), - - /** BANK_ACCOUNT_NOT_FOUND */ + + /** + * BANK_ACCOUNT_NOT_FOUND + */ BANK_ACCOUNT_NOT_FOUND("bank-account-not-found"), - - /** INTERNAL_ERROR */ + + /** + * INTERNAL_ERROR + */ INTERNAL_ERROR("internal-error"), - - /** INVALID_APPLICATION */ + + /** + * INVALID_APPLICATION + */ INVALID_APPLICATION("invalid-application"), - - /** INVALID_REQUEST */ + + /** + * INVALID_REQUEST + */ INVALID_REQUEST("invalid-request"), - - /** ORGANISATION_NOT_FOUND */ + + /** + * ORGANISATION_NOT_FOUND + */ ORGANISATION_NOT_FOUND("organisation-not-found"), - - /** ORGANISATION_OFFLINE */ + + /** + * ORGANISATION_OFFLINE + */ ORGANISATION_OFFLINE("organisation-offline"), - - /** REQUEST_TIMEOUT */ + + /** + * REQUEST_TIMEOUT + */ REQUEST_TIMEOUT("request-timeout"), - - /** SERVICE_UNAVAILABLE */ + + /** + * SERVICE_UNAVAILABLE + */ SERVICE_UNAVAILABLE("service-unavailable"), - - /** UNAUTHORIZED */ + + /** + * UNAUTHORIZED + */ UNAUTHORIZED("unauthorized"), - - /** RATE_LIMIT_ERROR */ + + /** + * RATE_LIMIT_ERROR + */ RATE_LIMIT_ERROR("rate-limit-error"); private String value; @@ -57,26 +90,24 @@ public enum ProblemType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static ProblemType fromValue(String value) { @@ -88,3 +119,4 @@ public static ProblemType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/finance/ProfitAndLossResponse.java b/src/main/java/com/xero/models/finance/ProfitAndLossResponse.java index f5450d1ae..ea7e71520 100644 --- a/src/main/java/com/xero/models/finance/ProfitAndLossResponse.java +++ b/src/main/java/com/xero/models/finance/ProfitAndLossResponse.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.PnlAccountClass; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ProfitAndLossResponse + */ -/** ProfitAndLossResponse */ public class ProfitAndLossResponse { StringUtil util = new StringUtil(); @@ -36,180 +54,166 @@ public class ProfitAndLossResponse { @JsonProperty("expense") private PnlAccountClass expense; /** - * Start date of the report - * - * @param startDate LocalDate - * @return ProfitAndLossResponse - */ + * Start date of the report + * @param startDate LocalDate + * @return ProfitAndLossResponse + **/ public ProfitAndLossResponse startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the report - * * @return startDate - */ + **/ @ApiModelProperty(value = "Start date of the report") - /** + /** * Start date of the report - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the report - * - * @param startDate LocalDate - */ + /** + * Start date of the report + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * End date of the report - * - * @param endDate LocalDate - * @return ProfitAndLossResponse - */ + * End date of the report + * @param endDate LocalDate + * @return ProfitAndLossResponse + **/ public ProfitAndLossResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * End date of the report - * * @return endDate - */ + **/ @ApiModelProperty(value = "End date of the report") - /** + /** * End date of the report - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * End date of the report - * - * @param endDate LocalDate - */ + /** + * End date of the report + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Net profit loss value - * - * @param netProfitLoss Double - * @return ProfitAndLossResponse - */ + * Net profit loss value + * @param netProfitLoss Double + * @return ProfitAndLossResponse + **/ public ProfitAndLossResponse netProfitLoss(Double netProfitLoss) { this.netProfitLoss = netProfitLoss; return this; } - /** + /** * Net profit loss value - * * @return netProfitLoss - */ + **/ @ApiModelProperty(value = "Net profit loss value") - /** + /** * Net profit loss value - * * @return netProfitLoss Double - */ + **/ public Double getNetProfitLoss() { return netProfitLoss; } - /** - * Net profit loss value - * - * @param netProfitLoss Double - */ + /** + * Net profit loss value + * @param netProfitLoss Double + **/ + public void setNetProfitLoss(Double netProfitLoss) { this.netProfitLoss = netProfitLoss; } /** - * revenue - * - * @param revenue PnlAccountClass - * @return ProfitAndLossResponse - */ + * revenue + * @param revenue PnlAccountClass + * @return ProfitAndLossResponse + **/ public ProfitAndLossResponse revenue(PnlAccountClass revenue) { this.revenue = revenue; return this; } - /** + /** * Get revenue - * * @return revenue - */ + **/ @ApiModelProperty(value = "") - /** + /** * revenue - * * @return revenue PnlAccountClass - */ + **/ public PnlAccountClass getRevenue() { return revenue; } - /** - * revenue - * - * @param revenue PnlAccountClass - */ + /** + * revenue + * @param revenue PnlAccountClass + **/ + public void setRevenue(PnlAccountClass revenue) { this.revenue = revenue; } /** - * expense - * - * @param expense PnlAccountClass - * @return ProfitAndLossResponse - */ + * expense + * @param expense PnlAccountClass + * @return ProfitAndLossResponse + **/ public ProfitAndLossResponse expense(PnlAccountClass expense) { this.expense = expense; return this; } - /** + /** * Get expense - * * @return expense - */ + **/ @ApiModelProperty(value = "") - /** + /** * expense - * * @return expense PnlAccountClass - */ + **/ public PnlAccountClass getExpense() { return expense; } - /** - * expense - * - * @param expense PnlAccountClass - */ + /** + * expense + * @param expense PnlAccountClass + **/ + public void setExpense(PnlAccountClass expense) { this.expense = expense; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } ProfitAndLossResponse profitAndLossResponse = (ProfitAndLossResponse) o; - return Objects.equals(this.startDate, profitAndLossResponse.startDate) - && Objects.equals(this.endDate, profitAndLossResponse.endDate) - && Objects.equals(this.netProfitLoss, profitAndLossResponse.netProfitLoss) - && Objects.equals(this.revenue, profitAndLossResponse.revenue) - && Objects.equals(this.expense, profitAndLossResponse.expense); + return Objects.equals(this.startDate, profitAndLossResponse.startDate) && + Objects.equals(this.endDate, profitAndLossResponse.endDate) && + Objects.equals(this.netProfitLoss, profitAndLossResponse.netProfitLoss) && + Objects.equals(this.revenue, profitAndLossResponse.revenue) && + Objects.equals(this.expense, profitAndLossResponse.expense); } @Override @@ -231,6 +235,7 @@ public int hashCode() { return Objects.hash(startDate, endDate, netProfitLoss, revenue, expense); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ReportHistoryModel.java b/src/main/java/com/xero/models/finance/ReportHistoryModel.java index 3d05975b5..4918097e7 100644 --- a/src/main/java/com/xero/models/finance/ReportHistoryModel.java +++ b/src/main/java/com/xero/models/finance/ReportHistoryModel.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportHistoryModel + */ -/** ReportHistoryModel */ public class ReportHistoryModel { StringUtil util = new StringUtil(); @@ -30,110 +47,102 @@ public class ReportHistoryModel { @JsonProperty("publishedDateUtc") private OffsetDateTime publishedDateUtc; /** - * Report code or report title - * - * @param reportName String - * @return ReportHistoryModel - */ + * Report code or report title + * @param reportName String + * @return ReportHistoryModel + **/ public ReportHistoryModel reportName(String reportName) { this.reportName = reportName; return this; } - /** + /** * Report code or report title - * * @return reportName - */ + **/ @ApiModelProperty(value = "Report code or report title") - /** + /** * Report code or report title - * * @return reportName String - */ + **/ public String getReportName() { return reportName; } - /** - * Report code or report title - * - * @param reportName String - */ + /** + * Report code or report title + * @param reportName String + **/ + public void setReportName(String reportName) { this.reportName = reportName; } /** - * The date or date range of the report - * - * @param reportDateText String - * @return ReportHistoryModel - */ + * The date or date range of the report + * @param reportDateText String + * @return ReportHistoryModel + **/ public ReportHistoryModel reportDateText(String reportDateText) { this.reportDateText = reportDateText; return this; } - /** + /** * The date or date range of the report - * * @return reportDateText - */ + **/ @ApiModelProperty(value = "The date or date range of the report") - /** + /** * The date or date range of the report - * * @return reportDateText String - */ + **/ public String getReportDateText() { return reportDateText; } - /** - * The date or date range of the report - * - * @param reportDateText String - */ + /** + * The date or date range of the report + * @param reportDateText String + **/ + public void setReportDateText(String reportDateText) { this.reportDateText = reportDateText; } /** - * The system date time that the report was published - * - * @param publishedDateUtc OffsetDateTime - * @return ReportHistoryModel - */ + * The system date time that the report was published + * @param publishedDateUtc OffsetDateTime + * @return ReportHistoryModel + **/ public ReportHistoryModel publishedDateUtc(OffsetDateTime publishedDateUtc) { this.publishedDateUtc = publishedDateUtc; return this; } - /** + /** * The system date time that the report was published - * * @return publishedDateUtc - */ + **/ @ApiModelProperty(value = "The system date time that the report was published") - /** + /** * The system date time that the report was published - * * @return publishedDateUtc OffsetDateTime - */ + **/ public OffsetDateTime getPublishedDateUtc() { return publishedDateUtc; } - /** - * The system date time that the report was published - * - * @param publishedDateUtc OffsetDateTime - */ + /** + * The system date time that the report was published + * @param publishedDateUtc OffsetDateTime + **/ + public void setPublishedDateUtc(OffsetDateTime publishedDateUtc) { this.publishedDateUtc = publishedDateUtc; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -143,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } ReportHistoryModel reportHistoryModel = (ReportHistoryModel) o; - return Objects.equals(this.reportName, reportHistoryModel.reportName) - && Objects.equals(this.reportDateText, reportHistoryModel.reportDateText) - && Objects.equals(this.publishedDateUtc, reportHistoryModel.publishedDateUtc); + return Objects.equals(this.reportName, reportHistoryModel.reportName) && + Objects.equals(this.reportDateText, reportHistoryModel.reportDateText) && + Objects.equals(this.publishedDateUtc, reportHistoryModel.publishedDateUtc); } @Override @@ -153,6 +162,7 @@ public int hashCode() { return Objects.hash(reportName, reportDateText, publishedDateUtc); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -165,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -173,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/ReportHistoryResponse.java b/src/main/java/com/xero/models/finance/ReportHistoryResponse.java index 5cca3ac4f..8afd9993d 100644 --- a/src/main/java/com/xero/models/finance/ReportHistoryResponse.java +++ b/src/main/java/com/xero/models/finance/ReportHistoryResponse.java @@ -9,18 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.ReportHistoryModel; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReportHistoryResponse + */ -/** ReportHistoryResponse */ public class ReportHistoryResponse { StringUtil util = new StringUtil(); @@ -33,81 +51,74 @@ public class ReportHistoryResponse { @JsonProperty("reports") private List reports = new ArrayList(); /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - * @return ReportHistoryResponse - */ + * The requested Organisation to which the data pertains + * @param organisationId UUID + * @return ReportHistoryResponse + **/ public ReportHistoryResponse organisationId(UUID organisationId) { this.organisationId = organisationId; return this; } - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId - */ + **/ @ApiModelProperty(value = "The requested Organisation to which the data pertains") - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId UUID - */ + **/ public UUID getOrganisationId() { return organisationId; } - /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - */ + /** + * The requested Organisation to which the data pertains + * @param organisationId UUID + **/ + public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; } /** - * The end date of the report - * - * @param endDate LocalDate - * @return ReportHistoryResponse - */ + * The end date of the report + * @param endDate LocalDate + * @return ReportHistoryResponse + **/ public ReportHistoryResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The end date of the report - * * @return endDate - */ + **/ @ApiModelProperty(value = "The end date of the report") - /** + /** * The end date of the report - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The end date of the report - * - * @param endDate LocalDate - */ + /** + * The end date of the report + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * reports - * - * @param reports List<ReportHistoryModel> - * @return ReportHistoryResponse - */ + * reports + * @param reports List<ReportHistoryModel> + * @return ReportHistoryResponse + **/ public ReportHistoryResponse reports(List reports) { this.reports = reports; return this; @@ -115,10 +126,9 @@ public ReportHistoryResponse reports(List reports) { /** * reports - * - * @param reportsItem ReportHistoryModel + * @param reportsItem ReportHistoryModel * @return ReportHistoryResponse - */ + **/ public ReportHistoryResponse addReportsItem(ReportHistoryModel reportsItem) { if (this.reports == null) { this.reports = new ArrayList(); @@ -127,30 +137,29 @@ public ReportHistoryResponse addReportsItem(ReportHistoryModel reportsItem) { return this; } - /** + /** * Get reports - * * @return reports - */ + **/ @ApiModelProperty(value = "") - /** + /** * reports - * * @return reports List - */ + **/ public List getReports() { return reports; } - /** - * reports - * - * @param reports List<ReportHistoryModel> - */ + /** + * reports + * @param reports List<ReportHistoryModel> + **/ + public void setReports(List reports) { this.reports = reports; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } ReportHistoryResponse reportHistoryResponse = (ReportHistoryResponse) o; - return Objects.equals(this.organisationId, reportHistoryResponse.organisationId) - && Objects.equals(this.endDate, reportHistoryResponse.endDate) - && Objects.equals(this.reports, reportHistoryResponse.reports); + return Objects.equals(this.organisationId, reportHistoryResponse.organisationId) && + Objects.equals(this.endDate, reportHistoryResponse.endDate) && + Objects.equals(this.reports, reportHistoryResponse.reports); } @Override @@ -170,6 +179,7 @@ public int hashCode() { return Objects.hash(organisationId, endDate, reports); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -182,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -190,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/StatementBalanceResponse.java b/src/main/java/com/xero/models/finance/StatementBalanceResponse.java index aa6ccae67..c4bad950a 100644 --- a/src/main/java/com/xero/models/finance/StatementBalanceResponse.java +++ b/src/main/java/com/xero/models/finance/StatementBalanceResponse.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatementBalanceResponse + */ -/** StatementBalanceResponse */ public class StatementBalanceResponse { StringUtil util = new StringUtil(); @@ -26,91 +43,70 @@ public class StatementBalanceResponse { @JsonProperty("type") private String type; /** - * Total closing balance of the account. This includes both reconciled and unreconciled bank - * statement lines. The closing balance will always be represented as a positive number, with it’s - * debit/credit status defined in the statementBalanceDebitCredit field. - * - * @param value Double - * @return StatementBalanceResponse - */ + * Total closing balance of the account. This includes both reconciled and unreconciled bank statement lines. The closing balance will always be represented as a positive number, with it’s debit/credit status defined in the statementBalanceDebitCredit field. + * @param value Double + * @return StatementBalanceResponse + **/ public StatementBalanceResponse value(Double value) { this.value = value; return this; } - /** - * Total closing balance of the account. This includes both reconciled and unreconciled bank - * statement lines. The closing balance will always be represented as a positive number, with it’s - * debit/credit status defined in the statementBalanceDebitCredit field. - * + /** + * Total closing balance of the account. This includes both reconciled and unreconciled bank statement lines. The closing balance will always be represented as a positive number, with it’s debit/credit status defined in the statementBalanceDebitCredit field. * @return value - */ - @ApiModelProperty( - value = - "Total closing balance of the account. This includes both reconciled and unreconciled" - + " bank statement lines. The closing balance will always be represented as a" - + " positive number, with it’s debit/credit status defined in the" - + " statementBalanceDebitCredit field.") - /** - * Total closing balance of the account. This includes both reconciled and unreconciled bank - * statement lines. The closing balance will always be represented as a positive number, with it’s - * debit/credit status defined in the statementBalanceDebitCredit field. - * + **/ + @ApiModelProperty(value = "Total closing balance of the account. This includes both reconciled and unreconciled bank statement lines. The closing balance will always be represented as a positive number, with it’s debit/credit status defined in the statementBalanceDebitCredit field.") + /** + * Total closing balance of the account. This includes both reconciled and unreconciled bank statement lines. The closing balance will always be represented as a positive number, with it’s debit/credit status defined in the statementBalanceDebitCredit field. * @return value Double - */ + **/ public Double getValue() { return value; } - /** - * Total closing balance of the account. This includes both reconciled and unreconciled bank - * statement lines. The closing balance will always be represented as a positive number, with it’s - * debit/credit status defined in the statementBalanceDebitCredit field. - * - * @param value Double - */ + /** + * Total closing balance of the account. This includes both reconciled and unreconciled bank statement lines. The closing balance will always be represented as a positive number, with it’s debit/credit status defined in the statementBalanceDebitCredit field. + * @param value Double + **/ + public void setValue(Double value) { this.value = value; } /** - * The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance. - * - * @param type String - * @return StatementBalanceResponse - */ + * The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance. + * @param type String + * @return StatementBalanceResponse + **/ public StatementBalanceResponse type(String type) { this.type = type; return this; } - /** + /** * The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance. - * * @return type - */ - @ApiModelProperty( - value = - "The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative" - + " balance.") - /** + **/ + @ApiModelProperty(value = "The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance.") + /** * The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance. - * * @return type String - */ + **/ public String getType() { return type; } - /** - * The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance. - * - * @param type String - */ + /** + * The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance. + * @param type String + **/ + public void setType(String type) { this.type = type; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } StatementBalanceResponse statementBalanceResponse = (StatementBalanceResponse) o; - return Objects.equals(this.value, statementBalanceResponse.value) - && Objects.equals(this.type, statementBalanceResponse.type); + return Objects.equals(this.value, statementBalanceResponse.value) && + Objects.equals(this.type, statementBalanceResponse.type); } @Override @@ -129,6 +125,7 @@ public int hashCode() { return Objects.hash(value, type); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/StatementLineResponse.java b/src/main/java/com/xero/models/finance/StatementLineResponse.java index 08c646b37..b9289cf07 100644 --- a/src/main/java/com/xero/models/finance/StatementLineResponse.java +++ b/src/main/java/com/xero/models/finance/StatementLineResponse.java @@ -9,18 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.BankTransactionResponse; +import com.xero.models.finance.PaymentResponse; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatementLineResponse + */ -/** StatementLineResponse */ public class StatementLineResponse { StringUtil util = new StringUtil(); @@ -66,431 +85,394 @@ public class StatementLineResponse { @JsonProperty("bankTransactions") private List bankTransactions = new ArrayList(); /** - * Xero Identifier of statement line - * - * @param statementLineId UUID - * @return StatementLineResponse - */ + * Xero Identifier of statement line + * @param statementLineId UUID + * @return StatementLineResponse + **/ public StatementLineResponse statementLineId(UUID statementLineId) { this.statementLineId = statementLineId; return this; } - /** + /** * Xero Identifier of statement line - * * @return statementLineId - */ + **/ @ApiModelProperty(value = "Xero Identifier of statement line") - /** + /** * Xero Identifier of statement line - * * @return statementLineId UUID - */ + **/ public UUID getStatementLineId() { return statementLineId; } - /** - * Xero Identifier of statement line - * - * @param statementLineId UUID - */ + /** + * Xero Identifier of statement line + * @param statementLineId UUID + **/ + public void setStatementLineId(UUID statementLineId) { this.statementLineId = statementLineId; } /** - * Date of when statement line was posted - * - * @param postedDate LocalDate - * @return StatementLineResponse - */ + * Date of when statement line was posted + * @param postedDate LocalDate + * @return StatementLineResponse + **/ public StatementLineResponse postedDate(LocalDate postedDate) { this.postedDate = postedDate; return this; } - /** + /** * Date of when statement line was posted - * * @return postedDate - */ + **/ @ApiModelProperty(value = "Date of when statement line was posted") - /** + /** * Date of when statement line was posted - * * @return postedDate LocalDate - */ + **/ public LocalDate getPostedDate() { return postedDate; } - /** - * Date of when statement line was posted - * - * @param postedDate LocalDate - */ + /** + * Date of when statement line was posted + * @param postedDate LocalDate + **/ + public void setPostedDate(LocalDate postedDate) { this.postedDate = postedDate; } /** - * Payee description of statement line - * - * @param payee String - * @return StatementLineResponse - */ + * Payee description of statement line + * @param payee String + * @return StatementLineResponse + **/ public StatementLineResponse payee(String payee) { this.payee = payee; return this; } - /** + /** * Payee description of statement line - * * @return payee - */ + **/ @ApiModelProperty(value = "Payee description of statement line") - /** + /** * Payee description of statement line - * * @return payee String - */ + **/ public String getPayee() { return payee; } - /** - * Payee description of statement line - * - * @param payee String - */ + /** + * Payee description of statement line + * @param payee String + **/ + public void setPayee(String payee) { this.payee = payee; } /** - * Reference description of statement line - * - * @param reference String - * @return StatementLineResponse - */ + * Reference description of statement line + * @param reference String + * @return StatementLineResponse + **/ public StatementLineResponse reference(String reference) { this.reference = reference; return this; } - /** + /** * Reference description of statement line - * * @return reference - */ + **/ @ApiModelProperty(value = "Reference description of statement line") - /** + /** * Reference description of statement line - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Reference description of statement line - * - * @param reference String - */ + /** + * Reference description of statement line + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * Notes description of statement line - * - * @param notes String - * @return StatementLineResponse - */ + * Notes description of statement line + * @param notes String + * @return StatementLineResponse + **/ public StatementLineResponse notes(String notes) { this.notes = notes; return this; } - /** + /** * Notes description of statement line - * * @return notes - */ + **/ @ApiModelProperty(value = "Notes description of statement line") - /** + /** * Notes description of statement line - * * @return notes String - */ + **/ public String getNotes() { return notes; } - /** - * Notes description of statement line - * - * @param notes String - */ + /** + * Notes description of statement line + * @param notes String + **/ + public void setNotes(String notes) { this.notes = notes; } /** - * Cheque number of statement line - * - * @param chequeNo String - * @return StatementLineResponse - */ + * Cheque number of statement line + * @param chequeNo String + * @return StatementLineResponse + **/ public StatementLineResponse chequeNo(String chequeNo) { this.chequeNo = chequeNo; return this; } - /** + /** * Cheque number of statement line - * * @return chequeNo - */ + **/ @ApiModelProperty(value = "Cheque number of statement line") - /** + /** * Cheque number of statement line - * * @return chequeNo String - */ + **/ public String getChequeNo() { return chequeNo; } - /** - * Cheque number of statement line - * - * @param chequeNo String - */ + /** + * Cheque number of statement line + * @param chequeNo String + **/ + public void setChequeNo(String chequeNo) { this.chequeNo = chequeNo; } /** - * Amount of statement line - * - * @param amount Double - * @return StatementLineResponse - */ + * Amount of statement line + * @param amount Double + * @return StatementLineResponse + **/ public StatementLineResponse amount(Double amount) { this.amount = amount; return this; } - /** + /** * Amount of statement line - * * @return amount - */ + **/ @ApiModelProperty(value = "Amount of statement line") - /** + /** * Amount of statement line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Amount of statement line - * - * @param amount Double - */ + /** + * Amount of statement line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Transaction date of statement line - * - * @param transactionDate LocalDate - * @return StatementLineResponse - */ + * Transaction date of statement line + * @param transactionDate LocalDate + * @return StatementLineResponse + **/ public StatementLineResponse transactionDate(LocalDate transactionDate) { this.transactionDate = transactionDate; return this; } - /** + /** * Transaction date of statement line - * * @return transactionDate - */ + **/ @ApiModelProperty(value = "Transaction date of statement line") - /** + /** * Transaction date of statement line - * * @return transactionDate LocalDate - */ + **/ public LocalDate getTransactionDate() { return transactionDate; } - /** - * Transaction date of statement line - * - * @param transactionDate LocalDate - */ + /** + * Transaction date of statement line + * @param transactionDate LocalDate + **/ + public void setTransactionDate(LocalDate transactionDate) { this.transactionDate = transactionDate; } /** - * Type of statement line - * - * @param type String - * @return StatementLineResponse - */ + * Type of statement line + * @param type String + * @return StatementLineResponse + **/ public StatementLineResponse type(String type) { this.type = type; return this; } - /** + /** * Type of statement line - * * @return type - */ + **/ @ApiModelProperty(value = "Type of statement line") - /** + /** * Type of statement line - * * @return type String - */ + **/ public String getType() { return type; } - /** - * Type of statement line - * - * @param type String - */ + /** + * Type of statement line + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * Boolean to show if statement line is reconciled - * - * @param isReconciled Boolean - * @return StatementLineResponse - */ + * Boolean to show if statement line is reconciled + * @param isReconciled Boolean + * @return StatementLineResponse + **/ public StatementLineResponse isReconciled(Boolean isReconciled) { this.isReconciled = isReconciled; return this; } - /** + /** * Boolean to show if statement line is reconciled - * * @return isReconciled - */ + **/ @ApiModelProperty(value = "Boolean to show if statement line is reconciled") - /** + /** * Boolean to show if statement line is reconciled - * * @return isReconciled Boolean - */ + **/ public Boolean getIsReconciled() { return isReconciled; } - /** - * Boolean to show if statement line is reconciled - * - * @param isReconciled Boolean - */ + /** + * Boolean to show if statement line is reconciled + * @param isReconciled Boolean + **/ + public void setIsReconciled(Boolean isReconciled) { this.isReconciled = isReconciled; } /** - * Boolean to show if statement line is duplicate - * - * @param isDuplicate Boolean - * @return StatementLineResponse - */ + * Boolean to show if statement line is duplicate + * @param isDuplicate Boolean + * @return StatementLineResponse + **/ public StatementLineResponse isDuplicate(Boolean isDuplicate) { this.isDuplicate = isDuplicate; return this; } - /** + /** * Boolean to show if statement line is duplicate - * * @return isDuplicate - */ + **/ @ApiModelProperty(value = "Boolean to show if statement line is duplicate") - /** + /** * Boolean to show if statement line is duplicate - * * @return isDuplicate Boolean - */ + **/ public Boolean getIsDuplicate() { return isDuplicate; } - /** - * Boolean to show if statement line is duplicate - * - * @param isDuplicate Boolean - */ + /** + * Boolean to show if statement line is duplicate + * @param isDuplicate Boolean + **/ + public void setIsDuplicate(Boolean isDuplicate) { this.isDuplicate = isDuplicate; } /** - * Boolean to show if statement line is deleted - * - * @param isDeleted Boolean - * @return StatementLineResponse - */ + * Boolean to show if statement line is deleted + * @param isDeleted Boolean + * @return StatementLineResponse + **/ public StatementLineResponse isDeleted(Boolean isDeleted) { this.isDeleted = isDeleted; return this; } - /** + /** * Boolean to show if statement line is deleted - * * @return isDeleted - */ + **/ @ApiModelProperty(value = "Boolean to show if statement line is deleted") - /** + /** * Boolean to show if statement line is deleted - * * @return isDeleted Boolean - */ + **/ public Boolean getIsDeleted() { return isDeleted; } - /** - * Boolean to show if statement line is deleted - * - * @param isDeleted Boolean - */ + /** + * Boolean to show if statement line is deleted + * @param isDeleted Boolean + **/ + public void setIsDeleted(Boolean isDeleted) { this.isDeleted = isDeleted; } /** - * List of payments associated with reconciled statement lines - * - * @param payments List<PaymentResponse> - * @return StatementLineResponse - */ + * List of payments associated with reconciled statement lines + * @param payments List<PaymentResponse> + * @return StatementLineResponse + **/ public StatementLineResponse payments(List payments) { this.payments = payments; return this; @@ -498,10 +480,9 @@ public StatementLineResponse payments(List payments) { /** * List of payments associated with reconciled statement lines - * - * @param paymentsItem PaymentResponse + * @param paymentsItem PaymentResponse * @return StatementLineResponse - */ + **/ public StatementLineResponse addPaymentsItem(PaymentResponse paymentsItem) { if (this.payments == null) { this.payments = new ArrayList(); @@ -510,36 +491,33 @@ public StatementLineResponse addPaymentsItem(PaymentResponse paymentsItem) { return this; } - /** + /** * List of payments associated with reconciled statement lines - * * @return payments - */ + **/ @ApiModelProperty(value = "List of payments associated with reconciled statement lines") - /** + /** * List of payments associated with reconciled statement lines - * * @return payments List - */ + **/ public List getPayments() { return payments; } - /** - * List of payments associated with reconciled statement lines - * - * @param payments List<PaymentResponse> - */ + /** + * List of payments associated with reconciled statement lines + * @param payments List<PaymentResponse> + **/ + public void setPayments(List payments) { this.payments = payments; } /** - * List of bank transactions associated with reconciled statement lines - * - * @param bankTransactions List<BankTransactionResponse> - * @return StatementLineResponse - */ + * List of bank transactions associated with reconciled statement lines + * @param bankTransactions List<BankTransactionResponse> + * @return StatementLineResponse + **/ public StatementLineResponse bankTransactions(List bankTransactions) { this.bankTransactions = bankTransactions; return this; @@ -547,12 +525,10 @@ public StatementLineResponse bankTransactions(List bank /** * List of bank transactions associated with reconciled statement lines - * - * @param bankTransactionsItem BankTransactionResponse + * @param bankTransactionsItem BankTransactionResponse * @return StatementLineResponse - */ - public StatementLineResponse addBankTransactionsItem( - BankTransactionResponse bankTransactionsItem) { + **/ + public StatementLineResponse addBankTransactionsItem(BankTransactionResponse bankTransactionsItem) { if (this.bankTransactions == null) { this.bankTransactions = new ArrayList(); } @@ -560,30 +536,29 @@ public StatementLineResponse addBankTransactionsItem( return this; } - /** + /** * List of bank transactions associated with reconciled statement lines - * * @return bankTransactions - */ + **/ @ApiModelProperty(value = "List of bank transactions associated with reconciled statement lines") - /** + /** * List of bank transactions associated with reconciled statement lines - * * @return bankTransactions List - */ + **/ public List getBankTransactions() { return bankTransactions; } - /** - * List of bank transactions associated with reconciled statement lines - * - * @param bankTransactions List<BankTransactionResponse> - */ + /** + * List of bank transactions associated with reconciled statement lines + * @param bankTransactions List<BankTransactionResponse> + **/ + public void setBankTransactions(List bankTransactions) { this.bankTransactions = bankTransactions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -593,41 +568,28 @@ public boolean equals(java.lang.Object o) { return false; } StatementLineResponse statementLineResponse = (StatementLineResponse) o; - return Objects.equals(this.statementLineId, statementLineResponse.statementLineId) - && Objects.equals(this.postedDate, statementLineResponse.postedDate) - && Objects.equals(this.payee, statementLineResponse.payee) - && Objects.equals(this.reference, statementLineResponse.reference) - && Objects.equals(this.notes, statementLineResponse.notes) - && Objects.equals(this.chequeNo, statementLineResponse.chequeNo) - && Objects.equals(this.amount, statementLineResponse.amount) - && Objects.equals(this.transactionDate, statementLineResponse.transactionDate) - && Objects.equals(this.type, statementLineResponse.type) - && Objects.equals(this.isReconciled, statementLineResponse.isReconciled) - && Objects.equals(this.isDuplicate, statementLineResponse.isDuplicate) - && Objects.equals(this.isDeleted, statementLineResponse.isDeleted) - && Objects.equals(this.payments, statementLineResponse.payments) - && Objects.equals(this.bankTransactions, statementLineResponse.bankTransactions); + return Objects.equals(this.statementLineId, statementLineResponse.statementLineId) && + Objects.equals(this.postedDate, statementLineResponse.postedDate) && + Objects.equals(this.payee, statementLineResponse.payee) && + Objects.equals(this.reference, statementLineResponse.reference) && + Objects.equals(this.notes, statementLineResponse.notes) && + Objects.equals(this.chequeNo, statementLineResponse.chequeNo) && + Objects.equals(this.amount, statementLineResponse.amount) && + Objects.equals(this.transactionDate, statementLineResponse.transactionDate) && + Objects.equals(this.type, statementLineResponse.type) && + Objects.equals(this.isReconciled, statementLineResponse.isReconciled) && + Objects.equals(this.isDuplicate, statementLineResponse.isDuplicate) && + Objects.equals(this.isDeleted, statementLineResponse.isDeleted) && + Objects.equals(this.payments, statementLineResponse.payments) && + Objects.equals(this.bankTransactions, statementLineResponse.bankTransactions); } @Override public int hashCode() { - return Objects.hash( - statementLineId, - postedDate, - payee, - reference, - notes, - chequeNo, - amount, - transactionDate, - type, - isReconciled, - isDuplicate, - isDeleted, - payments, - bankTransactions); + return Objects.hash(statementLineId, postedDate, payee, reference, notes, chequeNo, amount, transactionDate, type, isReconciled, isDuplicate, isDeleted, payments, bankTransactions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -651,7 +613,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -659,4 +622,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/StatementLinesResponse.java b/src/main/java/com/xero/models/finance/StatementLinesResponse.java index 1c15f6e89..844dbbd52 100644 --- a/src/main/java/com/xero/models/finance/StatementLinesResponse.java +++ b/src/main/java/com/xero/models/finance/StatementLinesResponse.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.DataSourceResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatementLinesResponse + */ -/** StatementLinesResponse */ public class StatementLinesResponse { StringUtil util = new StringUtil(); @@ -72,710 +90,550 @@ public class StatementLinesResponse { @JsonProperty("totalAmountNeg") private Double totalAmountNeg; /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is positive. - * - * @param unreconciledAmountPos Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is positive. + * @param unreconciledAmountPos Double + * @return StatementLinesResponse + **/ public StatementLinesResponse unreconciledAmountPos(Double unreconciledAmountPos) { this.unreconciledAmountPos = unreconciledAmountPos; return this; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is positive. - * + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is positive. * @return unreconciledAmountPos - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where both the reconciled flag is set to" - + " FALSE, and the amount is positive.") - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is positive. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is positive.") + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is positive. * @return unreconciledAmountPos Double - */ + **/ public Double getUnreconciledAmountPos() { return unreconciledAmountPos; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is positive. - * - * @param unreconciledAmountPos Double - */ + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is positive. + * @param unreconciledAmountPos Double + **/ + public void setUnreconciledAmountPos(Double unreconciledAmountPos) { this.unreconciledAmountPos = unreconciledAmountPos; } /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is negative. - * - * @param unreconciledAmountNeg Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is negative. + * @param unreconciledAmountNeg Double + * @return StatementLinesResponse + **/ public StatementLinesResponse unreconciledAmountNeg(Double unreconciledAmountNeg) { this.unreconciledAmountNeg = unreconciledAmountNeg; return this; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is negative. - * + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is negative. * @return unreconciledAmountNeg - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where both the reconciled flag is set to" - + " FALSE, and the amount is negative.") - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is negative. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is negative.") + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is negative. * @return unreconciledAmountNeg Double - */ + **/ public Double getUnreconciledAmountNeg() { return unreconciledAmountNeg; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and - * the amount is negative. - * - * @param unreconciledAmountNeg Double - */ + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is negative. + * @param unreconciledAmountNeg Double + **/ + public void setUnreconciledAmountNeg(Double unreconciledAmountNeg) { this.unreconciledAmountNeg = unreconciledAmountNeg; } /** - * Count of all statement lines where the reconciled flag is set to FALSE. - * - * @param unreconciledLines Integer - * @return StatementLinesResponse - */ + * Count of all statement lines where the reconciled flag is set to FALSE. + * @param unreconciledLines Integer + * @return StatementLinesResponse + **/ public StatementLinesResponse unreconciledLines(Integer unreconciledLines) { this.unreconciledLines = unreconciledLines; return this; } - /** + /** * Count of all statement lines where the reconciled flag is set to FALSE. - * * @return unreconciledLines - */ - @ApiModelProperty( - value = "Count of all statement lines where the reconciled flag is set to FALSE.") - /** + **/ + @ApiModelProperty(value = "Count of all statement lines where the reconciled flag is set to FALSE.") + /** * Count of all statement lines where the reconciled flag is set to FALSE. - * * @return unreconciledLines Integer - */ + **/ public Integer getUnreconciledLines() { return unreconciledLines; } - /** - * Count of all statement lines where the reconciled flag is set to FALSE. - * - * @param unreconciledLines Integer - */ + /** + * Count of all statement lines where the reconciled flag is set to FALSE. + * @param unreconciledLines Integer + **/ + public void setUnreconciledLines(Integer unreconciledLines) { this.unreconciledLines = unreconciledLines; } /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is positive. Provides an indication of the age of unreconciled - * transactions. - * - * @param avgDaysUnreconciledPos Double - * @return StatementLinesResponse - */ + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is positive. Provides an indication of the age of unreconciled transactions. + * @param avgDaysUnreconciledPos Double + * @return StatementLinesResponse + **/ public StatementLinesResponse avgDaysUnreconciledPos(Double avgDaysUnreconciledPos) { this.avgDaysUnreconciledPos = avgDaysUnreconciledPos; return this; } - /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is positive. Provides an indication of the age of unreconciled - * transactions. - * + /** + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is positive. Provides an indication of the age of unreconciled transactions. * @return avgDaysUnreconciledPos - */ - @ApiModelProperty( - value = - "Sum-product of age of statement line in days multiplied by transaction amount, divided" - + " by the sum of transaction amount - in for those statement lines in which the" - + " reconciled flag is set to FALSE, and the amount is positive. Provides an" - + " indication of the age of unreconciled transactions.") - /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is positive. Provides an indication of the age of unreconciled - * transactions. - * + **/ + @ApiModelProperty(value = "Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is positive. Provides an indication of the age of unreconciled transactions.") + /** + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is positive. Provides an indication of the age of unreconciled transactions. * @return avgDaysUnreconciledPos Double - */ + **/ public Double getAvgDaysUnreconciledPos() { return avgDaysUnreconciledPos; } - /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is positive. Provides an indication of the age of unreconciled - * transactions. - * - * @param avgDaysUnreconciledPos Double - */ + /** + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is positive. Provides an indication of the age of unreconciled transactions. + * @param avgDaysUnreconciledPos Double + **/ + public void setAvgDaysUnreconciledPos(Double avgDaysUnreconciledPos) { this.avgDaysUnreconciledPos = avgDaysUnreconciledPos; } /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is negative. Provides an indication of the age of unreconciled - * transactions. - * - * @param avgDaysUnreconciledNeg Double - * @return StatementLinesResponse - */ + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is negative. Provides an indication of the age of unreconciled transactions. + * @param avgDaysUnreconciledNeg Double + * @return StatementLinesResponse + **/ public StatementLinesResponse avgDaysUnreconciledNeg(Double avgDaysUnreconciledNeg) { this.avgDaysUnreconciledNeg = avgDaysUnreconciledNeg; return this; } - /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is negative. Provides an indication of the age of unreconciled - * transactions. - * + /** + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is negative. Provides an indication of the age of unreconciled transactions. * @return avgDaysUnreconciledNeg - */ - @ApiModelProperty( - value = - "Sum-product of age of statement line in days multiplied by transaction amount, divided" - + " by the sum of transaction amount - in for those statement lines in which the" - + " reconciled flag is set to FALSE, and the amount is negative. Provides an" - + " indication of the age of unreconciled transactions.") - /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is negative. Provides an indication of the age of unreconciled - * transactions. - * + **/ + @ApiModelProperty(value = "Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is negative. Provides an indication of the age of unreconciled transactions.") + /** + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is negative. Provides an indication of the age of unreconciled transactions. * @return avgDaysUnreconciledNeg Double - */ + **/ public Double getAvgDaysUnreconciledNeg() { return avgDaysUnreconciledNeg; } - /** - * Sum-product of age of statement line in days multiplied by transaction amount, divided by the - * sum of transaction amount - in for those statement lines in which the reconciled flag is set to - * FALSE, and the amount is negative. Provides an indication of the age of unreconciled - * transactions. - * - * @param avgDaysUnreconciledNeg Double - */ + /** + * Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is negative. Provides an indication of the age of unreconciled transactions. + * @param avgDaysUnreconciledNeg Double + **/ + public void setAvgDaysUnreconciledNeg(Double avgDaysUnreconciledNeg) { this.avgDaysUnreconciledNeg = avgDaysUnreconciledNeg; } /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to FALSE. This date is represented in ISO 8601 format. - * - * @param earliestUnreconciledTransaction LocalDate - * @return StatementLinesResponse - */ - public StatementLinesResponse earliestUnreconciledTransaction( - LocalDate earliestUnreconciledTransaction) { + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. + * @param earliestUnreconciledTransaction LocalDate + * @return StatementLinesResponse + **/ + public StatementLinesResponse earliestUnreconciledTransaction(LocalDate earliestUnreconciledTransaction) { this.earliestUnreconciledTransaction = earliestUnreconciledTransaction; return this; } - /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to FALSE. This date is represented in ISO 8601 format. - * + /** + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. * @return earliestUnreconciledTransaction - */ - @ApiModelProperty( - value = - "UTC Date which is the earliest transaction date of a statement line for which the" - + " reconciled flag is set to FALSE. This date is represented in ISO 8601 format.") - /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to FALSE. This date is represented in ISO 8601 format. - * + **/ + @ApiModelProperty(value = "UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format.") + /** + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. * @return earliestUnreconciledTransaction LocalDate - */ + **/ public LocalDate getEarliestUnreconciledTransaction() { return earliestUnreconciledTransaction; } - /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to FALSE. This date is represented in ISO 8601 format. - * - * @param earliestUnreconciledTransaction LocalDate - */ + /** + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. + * @param earliestUnreconciledTransaction LocalDate + **/ + public void setEarliestUnreconciledTransaction(LocalDate earliestUnreconciledTransaction) { this.earliestUnreconciledTransaction = earliestUnreconciledTransaction; } /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to FALSE. This date is represented in ISO 8601 format. - * - * @param latestUnreconciledTransaction LocalDate - * @return StatementLinesResponse - */ - public StatementLinesResponse latestUnreconciledTransaction( - LocalDate latestUnreconciledTransaction) { + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. + * @param latestUnreconciledTransaction LocalDate + * @return StatementLinesResponse + **/ + public StatementLinesResponse latestUnreconciledTransaction(LocalDate latestUnreconciledTransaction) { this.latestUnreconciledTransaction = latestUnreconciledTransaction; return this; } - /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to FALSE. This date is represented in ISO 8601 format. - * + /** + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. * @return latestUnreconciledTransaction - */ - @ApiModelProperty( - value = - "UTC Date which is the latest transaction date of a statement line for which the" - + " reconciled flag is set to FALSE. This date is represented in ISO 8601 format.") - /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to FALSE. This date is represented in ISO 8601 format. - * + **/ + @ApiModelProperty(value = "UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format.") + /** + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. * @return latestUnreconciledTransaction LocalDate - */ + **/ public LocalDate getLatestUnreconciledTransaction() { return latestUnreconciledTransaction; } - /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to FALSE. This date is represented in ISO 8601 format. - * - * @param latestUnreconciledTransaction LocalDate - */ + /** + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format. + * @param latestUnreconciledTransaction LocalDate + **/ + public void setLatestUnreconciledTransaction(LocalDate latestUnreconciledTransaction) { this.latestUnreconciledTransaction = latestUnreconciledTransaction; } /** - * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to - * duplication or otherwise. - * - * @param deletedAmount Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to duplication or otherwise. + * @param deletedAmount Double + * @return StatementLinesResponse + **/ public StatementLinesResponse deletedAmount(Double deletedAmount) { this.deletedAmount = deletedAmount; return this; } - /** - * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to - * duplication or otherwise. - * + /** + * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to duplication or otherwise. * @return deletedAmount - */ - @ApiModelProperty( - value = - "Sum of the amounts of all deleted statement lines. Transactions may be deleted due to" - + " duplication or otherwise.") - /** - * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to - * duplication or otherwise. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all deleted statement lines. Transactions may be deleted due to duplication or otherwise.") + /** + * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to duplication or otherwise. * @return deletedAmount Double - */ + **/ public Double getDeletedAmount() { return deletedAmount; } - /** - * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to - * duplication or otherwise. - * - * @param deletedAmount Double - */ + /** + * Sum of the amounts of all deleted statement lines. Transactions may be deleted due to duplication or otherwise. + * @param deletedAmount Double + **/ + public void setDeletedAmount(Double deletedAmount) { this.deletedAmount = deletedAmount; } /** - * Sum of the amounts of all statement lines. This is used as a metric of comparison to the - * unreconciled figures above. - * - * @param totalAmount Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all statement lines. This is used as a metric of comparison to the unreconciled figures above. + * @param totalAmount Double + * @return StatementLinesResponse + **/ public StatementLinesResponse totalAmount(Double totalAmount) { this.totalAmount = totalAmount; return this; } - /** - * Sum of the amounts of all statement lines. This is used as a metric of comparison to the - * unreconciled figures above. - * + /** + * Sum of the amounts of all statement lines. This is used as a metric of comparison to the unreconciled figures above. * @return totalAmount - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines. This is used as a metric of comparison to" - + " the unreconciled figures above.") - /** - * Sum of the amounts of all statement lines. This is used as a metric of comparison to the - * unreconciled figures above. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines. This is used as a metric of comparison to the unreconciled figures above.") + /** + * Sum of the amounts of all statement lines. This is used as a metric of comparison to the unreconciled figures above. * @return totalAmount Double - */ + **/ public Double getTotalAmount() { return totalAmount; } - /** - * Sum of the amounts of all statement lines. This is used as a metric of comparison to the - * unreconciled figures above. - * - * @param totalAmount Double - */ + /** + * Sum of the amounts of all statement lines. This is used as a metric of comparison to the unreconciled figures above. + * @param totalAmount Double + **/ + public void setTotalAmount(Double totalAmount) { this.totalAmount = totalAmount; } /** - * dataSource - * - * @param dataSource DataSourceResponse - * @return StatementLinesResponse - */ + * dataSource + * @param dataSource DataSourceResponse + * @return StatementLinesResponse + **/ public StatementLinesResponse dataSource(DataSourceResponse dataSource) { this.dataSource = dataSource; return this; } - /** + /** * Get dataSource - * * @return dataSource - */ + **/ @ApiModelProperty(value = "") - /** + /** * dataSource - * * @return dataSource DataSourceResponse - */ + **/ public DataSourceResponse getDataSource() { return dataSource; } - /** - * dataSource - * - * @param dataSource DataSourceResponse - */ + /** + * dataSource + * @param dataSource DataSourceResponse + **/ + public void setDataSource(DataSourceResponse dataSource) { this.dataSource = dataSource; } /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to TRUE. This date is represented in ISO 8601 format. - * - * @param earliestReconciledTransaction LocalDate - * @return StatementLinesResponse - */ - public StatementLinesResponse earliestReconciledTransaction( - LocalDate earliestReconciledTransaction) { + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. + * @param earliestReconciledTransaction LocalDate + * @return StatementLinesResponse + **/ + public StatementLinesResponse earliestReconciledTransaction(LocalDate earliestReconciledTransaction) { this.earliestReconciledTransaction = earliestReconciledTransaction; return this; } - /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to TRUE. This date is represented in ISO 8601 format. - * + /** + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. * @return earliestReconciledTransaction - */ - @ApiModelProperty( - value = - "UTC Date which is the earliest transaction date of a statement line for which the" - + " reconciled flag is set to TRUE. This date is represented in ISO 8601 format.") - /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to TRUE. This date is represented in ISO 8601 format. - * + **/ + @ApiModelProperty(value = "UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format.") + /** + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. * @return earliestReconciledTransaction LocalDate - */ + **/ public LocalDate getEarliestReconciledTransaction() { return earliestReconciledTransaction; } - /** - * UTC Date which is the earliest transaction date of a statement line for which the reconciled - * flag is set to TRUE. This date is represented in ISO 8601 format. - * - * @param earliestReconciledTransaction LocalDate - */ + /** + * UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. + * @param earliestReconciledTransaction LocalDate + **/ + public void setEarliestReconciledTransaction(LocalDate earliestReconciledTransaction) { this.earliestReconciledTransaction = earliestReconciledTransaction; } /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to TRUE. This date is represented in ISO 8601 format. - * - * @param latestReconciledTransaction LocalDate - * @return StatementLinesResponse - */ + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. + * @param latestReconciledTransaction LocalDate + * @return StatementLinesResponse + **/ public StatementLinesResponse latestReconciledTransaction(LocalDate latestReconciledTransaction) { this.latestReconciledTransaction = latestReconciledTransaction; return this; } - /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to TRUE. This date is represented in ISO 8601 format. - * + /** + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. * @return latestReconciledTransaction - */ - @ApiModelProperty( - value = - "UTC Date which is the latest transaction date of a statement line for which the" - + " reconciled flag is set to TRUE. This date is represented in ISO 8601 format.") - /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to TRUE. This date is represented in ISO 8601 format. - * + **/ + @ApiModelProperty(value = "UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format.") + /** + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. * @return latestReconciledTransaction LocalDate - */ + **/ public LocalDate getLatestReconciledTransaction() { return latestReconciledTransaction; } - /** - * UTC Date which is the latest transaction date of a statement line for which the reconciled flag - * is set to TRUE. This date is represented in ISO 8601 format. - * - * @param latestReconciledTransaction LocalDate - */ + /** + * UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format. + * @param latestReconciledTransaction LocalDate + **/ + public void setLatestReconciledTransaction(LocalDate latestReconciledTransaction) { this.latestReconciledTransaction = latestReconciledTransaction; } /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is positive. - * - * @param reconciledAmountPos Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is positive. + * @param reconciledAmountPos Double + * @return StatementLinesResponse + **/ public StatementLinesResponse reconciledAmountPos(Double reconciledAmountPos) { this.reconciledAmountPos = reconciledAmountPos; return this; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is positive. - * + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is positive. * @return reconciledAmountPos - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where both the reconciled flag is set to" - + " TRUE, and the amount is positive.") - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is positive. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is positive.") + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is positive. * @return reconciledAmountPos Double - */ + **/ public Double getReconciledAmountPos() { return reconciledAmountPos; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is positive. - * - * @param reconciledAmountPos Double - */ + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is positive. + * @param reconciledAmountPos Double + **/ + public void setReconciledAmountPos(Double reconciledAmountPos) { this.reconciledAmountPos = reconciledAmountPos; } /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is negative. - * - * @param reconciledAmountNeg Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is negative. + * @param reconciledAmountNeg Double + * @return StatementLinesResponse + **/ public StatementLinesResponse reconciledAmountNeg(Double reconciledAmountNeg) { this.reconciledAmountNeg = reconciledAmountNeg; return this; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is negative. - * + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is negative. * @return reconciledAmountNeg - */ - @ApiModelProperty( - value = - "Sum of the amounts of all statement lines where both the reconciled flag is set to" - + " TRUE, and the amount is negative.") - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is negative. - * + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is negative.") + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is negative. * @return reconciledAmountNeg Double - */ + **/ public Double getReconciledAmountNeg() { return reconciledAmountNeg; } - /** - * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and - * the amount is negative. - * - * @param reconciledAmountNeg Double - */ + /** + * Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is negative. + * @param reconciledAmountNeg Double + **/ + public void setReconciledAmountNeg(Double reconciledAmountNeg) { this.reconciledAmountNeg = reconciledAmountNeg; } /** - * Count of all statement lines where the reconciled flag is set to TRUE - * - * @param reconciledLines Integer - * @return StatementLinesResponse - */ + * Count of all statement lines where the reconciled flag is set to TRUE + * @param reconciledLines Integer + * @return StatementLinesResponse + **/ public StatementLinesResponse reconciledLines(Integer reconciledLines) { this.reconciledLines = reconciledLines; return this; } - /** + /** * Count of all statement lines where the reconciled flag is set to TRUE - * * @return reconciledLines - */ + **/ @ApiModelProperty(value = "Count of all statement lines where the reconciled flag is set to TRUE") - /** + /** * Count of all statement lines where the reconciled flag is set to TRUE - * * @return reconciledLines Integer - */ + **/ public Integer getReconciledLines() { return reconciledLines; } - /** - * Count of all statement lines where the reconciled flag is set to TRUE - * - * @param reconciledLines Integer - */ + /** + * Count of all statement lines where the reconciled flag is set to TRUE + * @param reconciledLines Integer + **/ + public void setReconciledLines(Integer reconciledLines) { this.reconciledLines = reconciledLines; } /** - * Sum of the amounts of all statement lines where the amount is positive - * - * @param totalAmountPos Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all statement lines where the amount is positive + * @param totalAmountPos Double + * @return StatementLinesResponse + **/ public StatementLinesResponse totalAmountPos(Double totalAmountPos) { this.totalAmountPos = totalAmountPos; return this; } - /** + /** * Sum of the amounts of all statement lines where the amount is positive - * * @return totalAmountPos - */ - @ApiModelProperty( - value = "Sum of the amounts of all statement lines where the amount is positive") - /** + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the amount is positive") + /** * Sum of the amounts of all statement lines where the amount is positive - * * @return totalAmountPos Double - */ + **/ public Double getTotalAmountPos() { return totalAmountPos; } - /** - * Sum of the amounts of all statement lines where the amount is positive - * - * @param totalAmountPos Double - */ + /** + * Sum of the amounts of all statement lines where the amount is positive + * @param totalAmountPos Double + **/ + public void setTotalAmountPos(Double totalAmountPos) { this.totalAmountPos = totalAmountPos; } /** - * Sum of the amounts of all statement lines where the amount is negative. - * - * @param totalAmountNeg Double - * @return StatementLinesResponse - */ + * Sum of the amounts of all statement lines where the amount is negative. + * @param totalAmountNeg Double + * @return StatementLinesResponse + **/ public StatementLinesResponse totalAmountNeg(Double totalAmountNeg) { this.totalAmountNeg = totalAmountNeg; return this; } - /** + /** * Sum of the amounts of all statement lines where the amount is negative. - * * @return totalAmountNeg - */ - @ApiModelProperty( - value = "Sum of the amounts of all statement lines where the amount is negative.") - /** + **/ + @ApiModelProperty(value = "Sum of the amounts of all statement lines where the amount is negative.") + /** * Sum of the amounts of all statement lines where the amount is negative. - * * @return totalAmountNeg Double - */ + **/ public Double getTotalAmountNeg() { return totalAmountNeg; } - /** - * Sum of the amounts of all statement lines where the amount is negative. - * - * @param totalAmountNeg Double - */ + /** + * Sum of the amounts of all statement lines where the amount is negative. + * @param totalAmountNeg Double + **/ + public void setTotalAmountNeg(Double totalAmountNeg) { this.totalAmountNeg = totalAmountNeg; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -785,94 +643,49 @@ public boolean equals(java.lang.Object o) { return false; } StatementLinesResponse statementLinesResponse = (StatementLinesResponse) o; - return Objects.equals(this.unreconciledAmountPos, statementLinesResponse.unreconciledAmountPos) - && Objects.equals(this.unreconciledAmountNeg, statementLinesResponse.unreconciledAmountNeg) - && Objects.equals(this.unreconciledLines, statementLinesResponse.unreconciledLines) - && Objects.equals( - this.avgDaysUnreconciledPos, statementLinesResponse.avgDaysUnreconciledPos) - && Objects.equals( - this.avgDaysUnreconciledNeg, statementLinesResponse.avgDaysUnreconciledNeg) - && Objects.equals( - this.earliestUnreconciledTransaction, - statementLinesResponse.earliestUnreconciledTransaction) - && Objects.equals( - this.latestUnreconciledTransaction, - statementLinesResponse.latestUnreconciledTransaction) - && Objects.equals(this.deletedAmount, statementLinesResponse.deletedAmount) - && Objects.equals(this.totalAmount, statementLinesResponse.totalAmount) - && Objects.equals(this.dataSource, statementLinesResponse.dataSource) - && Objects.equals( - this.earliestReconciledTransaction, - statementLinesResponse.earliestReconciledTransaction) - && Objects.equals( - this.latestReconciledTransaction, statementLinesResponse.latestReconciledTransaction) - && Objects.equals(this.reconciledAmountPos, statementLinesResponse.reconciledAmountPos) - && Objects.equals(this.reconciledAmountNeg, statementLinesResponse.reconciledAmountNeg) - && Objects.equals(this.reconciledLines, statementLinesResponse.reconciledLines) - && Objects.equals(this.totalAmountPos, statementLinesResponse.totalAmountPos) - && Objects.equals(this.totalAmountNeg, statementLinesResponse.totalAmountNeg); + return Objects.equals(this.unreconciledAmountPos, statementLinesResponse.unreconciledAmountPos) && + Objects.equals(this.unreconciledAmountNeg, statementLinesResponse.unreconciledAmountNeg) && + Objects.equals(this.unreconciledLines, statementLinesResponse.unreconciledLines) && + Objects.equals(this.avgDaysUnreconciledPos, statementLinesResponse.avgDaysUnreconciledPos) && + Objects.equals(this.avgDaysUnreconciledNeg, statementLinesResponse.avgDaysUnreconciledNeg) && + Objects.equals(this.earliestUnreconciledTransaction, statementLinesResponse.earliestUnreconciledTransaction) && + Objects.equals(this.latestUnreconciledTransaction, statementLinesResponse.latestUnreconciledTransaction) && + Objects.equals(this.deletedAmount, statementLinesResponse.deletedAmount) && + Objects.equals(this.totalAmount, statementLinesResponse.totalAmount) && + Objects.equals(this.dataSource, statementLinesResponse.dataSource) && + Objects.equals(this.earliestReconciledTransaction, statementLinesResponse.earliestReconciledTransaction) && + Objects.equals(this.latestReconciledTransaction, statementLinesResponse.latestReconciledTransaction) && + Objects.equals(this.reconciledAmountPos, statementLinesResponse.reconciledAmountPos) && + Objects.equals(this.reconciledAmountNeg, statementLinesResponse.reconciledAmountNeg) && + Objects.equals(this.reconciledLines, statementLinesResponse.reconciledLines) && + Objects.equals(this.totalAmountPos, statementLinesResponse.totalAmountPos) && + Objects.equals(this.totalAmountNeg, statementLinesResponse.totalAmountNeg); } @Override public int hashCode() { - return Objects.hash( - unreconciledAmountPos, - unreconciledAmountNeg, - unreconciledLines, - avgDaysUnreconciledPos, - avgDaysUnreconciledNeg, - earliestUnreconciledTransaction, - latestUnreconciledTransaction, - deletedAmount, - totalAmount, - dataSource, - earliestReconciledTransaction, - latestReconciledTransaction, - reconciledAmountPos, - reconciledAmountNeg, - reconciledLines, - totalAmountPos, - totalAmountNeg); + return Objects.hash(unreconciledAmountPos, unreconciledAmountNeg, unreconciledLines, avgDaysUnreconciledPos, avgDaysUnreconciledNeg, earliestUnreconciledTransaction, latestUnreconciledTransaction, deletedAmount, totalAmount, dataSource, earliestReconciledTransaction, latestReconciledTransaction, reconciledAmountPos, reconciledAmountNeg, reconciledLines, totalAmountPos, totalAmountNeg); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StatementLinesResponse {\n"); - sb.append(" unreconciledAmountPos: ") - .append(toIndentedString(unreconciledAmountPos)) - .append("\n"); - sb.append(" unreconciledAmountNeg: ") - .append(toIndentedString(unreconciledAmountNeg)) - .append("\n"); + sb.append(" unreconciledAmountPos: ").append(toIndentedString(unreconciledAmountPos)).append("\n"); + sb.append(" unreconciledAmountNeg: ").append(toIndentedString(unreconciledAmountNeg)).append("\n"); sb.append(" unreconciledLines: ").append(toIndentedString(unreconciledLines)).append("\n"); - sb.append(" avgDaysUnreconciledPos: ") - .append(toIndentedString(avgDaysUnreconciledPos)) - .append("\n"); - sb.append(" avgDaysUnreconciledNeg: ") - .append(toIndentedString(avgDaysUnreconciledNeg)) - .append("\n"); - sb.append(" earliestUnreconciledTransaction: ") - .append(toIndentedString(earliestUnreconciledTransaction)) - .append("\n"); - sb.append(" latestUnreconciledTransaction: ") - .append(toIndentedString(latestUnreconciledTransaction)) - .append("\n"); + sb.append(" avgDaysUnreconciledPos: ").append(toIndentedString(avgDaysUnreconciledPos)).append("\n"); + sb.append(" avgDaysUnreconciledNeg: ").append(toIndentedString(avgDaysUnreconciledNeg)).append("\n"); + sb.append(" earliestUnreconciledTransaction: ").append(toIndentedString(earliestUnreconciledTransaction)).append("\n"); + sb.append(" latestUnreconciledTransaction: ").append(toIndentedString(latestUnreconciledTransaction)).append("\n"); sb.append(" deletedAmount: ").append(toIndentedString(deletedAmount)).append("\n"); sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n"); sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); - sb.append(" earliestReconciledTransaction: ") - .append(toIndentedString(earliestReconciledTransaction)) - .append("\n"); - sb.append(" latestReconciledTransaction: ") - .append(toIndentedString(latestReconciledTransaction)) - .append("\n"); - sb.append(" reconciledAmountPos: ") - .append(toIndentedString(reconciledAmountPos)) - .append("\n"); - sb.append(" reconciledAmountNeg: ") - .append(toIndentedString(reconciledAmountNeg)) - .append("\n"); + sb.append(" earliestReconciledTransaction: ").append(toIndentedString(earliestReconciledTransaction)).append("\n"); + sb.append(" latestReconciledTransaction: ").append(toIndentedString(latestReconciledTransaction)).append("\n"); + sb.append(" reconciledAmountPos: ").append(toIndentedString(reconciledAmountPos)).append("\n"); + sb.append(" reconciledAmountNeg: ").append(toIndentedString(reconciledAmountNeg)).append("\n"); sb.append(" reconciledLines: ").append(toIndentedString(reconciledLines)).append("\n"); sb.append(" totalAmountPos: ").append(toIndentedString(totalAmountPos)).append("\n"); sb.append(" totalAmountNeg: ").append(toIndentedString(totalAmountNeg)).append("\n"); @@ -881,7 +694,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -889,4 +703,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/StatementResponse.java b/src/main/java/com/xero/models/finance/StatementResponse.java index 516eddd56..cc7e392f6 100644 --- a/src/main/java/com/xero/models/finance/StatementResponse.java +++ b/src/main/java/com/xero/models/finance/StatementResponse.java @@ -9,19 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.StatementLineResponse; +import io.swagger.annotations.ApiModel; 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; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatementResponse + */ -/** StatementResponse */ public class StatementResponse { StringUtil util = new StringUtil(); @@ -55,416 +73,298 @@ public class StatementResponse { @JsonProperty("statementLines") private List statementLines = new ArrayList(); /** - * Xero Identifier of statement - * - * @param statementId UUID - * @return StatementResponse - */ + * Xero Identifier of statement + * @param statementId UUID + * @return StatementResponse + **/ public StatementResponse statementId(UUID statementId) { this.statementId = statementId; return this; } - /** + /** * Xero Identifier of statement - * * @return statementId - */ + **/ @ApiModelProperty(value = "Xero Identifier of statement") - /** + /** * Xero Identifier of statement - * * @return statementId UUID - */ + **/ public UUID getStatementId() { return statementId; } - /** - * Xero Identifier of statement - * - * @param statementId UUID - */ + /** + * Xero Identifier of statement + * @param statementId UUID + **/ + public void setStatementId(UUID statementId) { this.statementId = statementId; } /** - * Start date of statement - * - * @param startDate LocalDate - * @return StatementResponse - */ + * Start date of statement + * @param startDate LocalDate + * @return StatementResponse + **/ public StatementResponse startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of statement - * * @return startDate - */ + **/ @ApiModelProperty(value = "Start date of statement") - /** + /** * Start date of statement - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of statement - * - * @param startDate LocalDate - */ + /** + * Start date of statement + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * End date of statement - * - * @param endDate LocalDate - * @return StatementResponse - */ + * End date of statement + * @param endDate LocalDate + * @return StatementResponse + **/ public StatementResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * End date of statement - * * @return endDate - */ + **/ @ApiModelProperty(value = "End date of statement") - /** + /** * End date of statement - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * End date of statement - * - * @param endDate LocalDate - */ + /** + * End date of statement + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Utc date time of when the statement was imported in Xero - * - * @param importedDateTimeUtc OffsetDateTime - * @return StatementResponse - */ + * Utc date time of when the statement was imported in Xero + * @param importedDateTimeUtc OffsetDateTime + * @return StatementResponse + **/ public StatementResponse importedDateTimeUtc(OffsetDateTime importedDateTimeUtc) { this.importedDateTimeUtc = importedDateTimeUtc; return this; } - /** + /** * Utc date time of when the statement was imported in Xero - * * @return importedDateTimeUtc - */ + **/ @ApiModelProperty(value = "Utc date time of when the statement was imported in Xero") - /** + /** * Utc date time of when the statement was imported in Xero - * * @return importedDateTimeUtc OffsetDateTime - */ + **/ public OffsetDateTime getImportedDateTimeUtc() { return importedDateTimeUtc; } - /** - * Utc date time of when the statement was imported in Xero - * - * @param importedDateTimeUtc OffsetDateTime - */ + /** + * Utc date time of when the statement was imported in Xero + * @param importedDateTimeUtc OffsetDateTime + **/ + public void setImportedDateTimeUtc(OffsetDateTime importedDateTimeUtc) { this.importedDateTimeUtc = importedDateTimeUtc; } /** - * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically - * loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded - * from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg - * STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). - * - * @param importSource String - * @return StatementResponse - */ + * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). + * @param importSource String + * @return StatementResponse + **/ public StatementResponse importSource(String importSource) { this.importSource = importSource; return this; } - /** - * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically - * loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded - * from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg - * STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). - * + /** + * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). * @return importSource - */ - @ApiModelProperty( - value = - "Identifies where the statement data in Xero was sourced, 1) direct bank feed," - + " automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank" - + " feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE);" - + " 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered" - + " statement data (STMTIMPORTSRC/MANUAL).") - /** - * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically - * loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded - * from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg - * STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). - * + **/ + @ApiModelProperty(value = "Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL).") + /** + * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). * @return importSource String - */ + **/ public String getImportSource() { return importSource; } - /** - * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically - * loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded - * from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg - * STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). - * - * @param importSource String - */ + /** + * Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). + * @param importSource String + **/ + public void setImportSource(String importSource) { this.importSource = importSource; } /** - * Opening balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * - * @param startBalance Double - * @return StatementResponse - */ + * Opening balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. + * @param startBalance Double + * @return StatementResponse + **/ public StatementResponse startBalance(Double startBalance) { this.startBalance = startBalance; return this; } - /** - * Opening balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * + /** + * Opening balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. * @return startBalance - */ - @ApiModelProperty( - value = - "Opening balance sourced from imported bank statements (if supplied). Note, for manually" - + " uploaded statements, this balance is also manual and usually not supplied. Where" - + " not supplied, the value will be 0.") - /** - * Opening balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * + **/ + @ApiModelProperty(value = "Opening balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0.") + /** + * Opening balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. * @return startBalance Double - */ + **/ public Double getStartBalance() { return startBalance; } - /** - * Opening balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * - * @param startBalance Double - */ + /** + * Opening balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. + * @param startBalance Double + **/ + public void setStartBalance(Double startBalance) { this.startBalance = startBalance; } /** - * Closing balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * - * @param endBalance Double - * @return StatementResponse - */ + * Closing balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. + * @param endBalance Double + * @return StatementResponse + **/ public StatementResponse endBalance(Double endBalance) { this.endBalance = endBalance; return this; } - /** - * Closing balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * + /** + * Closing balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. * @return endBalance - */ - @ApiModelProperty( - value = - "Closing balance sourced from imported bank statements (if supplied). Note, for manually" - + " uploaded statements, this balance is also manual and usually not supplied. Where" - + " not supplied, the value will be 0.") - /** - * Closing balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * + **/ + @ApiModelProperty(value = "Closing balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0.") + /** + * Closing balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. * @return endBalance Double - */ + **/ public Double getEndBalance() { return endBalance; } - /** - * Closing balance sourced from imported bank statements (if supplied). Note, for manually - * uploaded statements, this balance is also manual and usually not supplied. Where not supplied, - * the value will be 0. - * - * @param endBalance Double - */ + /** + * Closing balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0. + * @param endBalance Double + **/ + public void setEndBalance(Double endBalance) { this.endBalance = endBalance; } /** - * Opening statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * - * @param indicativeStartBalance Double - * @return StatementResponse - */ + * Opening statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true + * @param indicativeStartBalance Double + * @return StatementResponse + **/ public StatementResponse indicativeStartBalance(Double indicativeStartBalance) { this.indicativeStartBalance = indicativeStartBalance; return this; } - /** - * Opening statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * + /** + * Opening statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true * @return indicativeStartBalance - */ - @ApiModelProperty( - value = - "Opening statement balance calculated in Xero (= bank account conversion balance plus" - + " sum of imported bank statement lines). Note: If indicative statement balance" - + " doesn't match imported statement balance for the same date, either the" - + " conversion (opening at inception) balance in Xero is wrong or there's an error" - + " in the bank statement lines in Xero. Ref:" - + " https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true" - + " ") - /** - * Opening statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * + **/ + @ApiModelProperty(value = "Opening statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true ") + /** + * Opening statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true * @return indicativeStartBalance Double - */ + **/ public Double getIndicativeStartBalance() { return indicativeStartBalance; } - /** - * Opening statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * - * @param indicativeStartBalance Double - */ + /** + * Opening statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true + * @param indicativeStartBalance Double + **/ + public void setIndicativeStartBalance(Double indicativeStartBalance) { this.indicativeStartBalance = indicativeStartBalance; } /** - * Closing statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * - * @param indicativeEndBalance Double - * @return StatementResponse - */ + * Closing statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true + * @param indicativeEndBalance Double + * @return StatementResponse + **/ public StatementResponse indicativeEndBalance(Double indicativeEndBalance) { this.indicativeEndBalance = indicativeEndBalance; return this; } - /** - * Closing statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * + /** + * Closing statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true * @return indicativeEndBalance - */ - @ApiModelProperty( - value = - "Closing statement balance calculated in Xero (= bank account conversion balance plus" - + " sum of imported bank statement lines). Note: If indicative statement balance" - + " doesn't match imported statement balance for the same date, either the" - + " conversion (opening at inception) balance in Xero is wrong or there's an error" - + " in the bank statement lines in Xero. Ref:" - + " https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true" - + " ") - /** - * Closing statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * + **/ + @ApiModelProperty(value = "Closing statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true ") + /** + * Closing statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true * @return indicativeEndBalance Double - */ + **/ public Double getIndicativeEndBalance() { return indicativeEndBalance; } - /** - * Closing statement balance calculated in Xero (= bank account conversion balance plus sum - * of imported bank statement lines). Note: If indicative statement balance doesn't match - * imported statement balance for the same date, either the conversion (opening at inception) - * balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: - * https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true - * - * @param indicativeEndBalance Double - */ + /** + * Closing statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true + * @param indicativeEndBalance Double + **/ + public void setIndicativeEndBalance(Double indicativeEndBalance) { this.indicativeEndBalance = indicativeEndBalance; } /** - * List of statement lines - * - * @param statementLines List<StatementLineResponse> - * @return StatementResponse - */ + * List of statement lines + * @param statementLines List<StatementLineResponse> + * @return StatementResponse + **/ public StatementResponse statementLines(List statementLines) { this.statementLines = statementLines; return this; @@ -472,10 +372,9 @@ public StatementResponse statementLines(List statementLin /** * List of statement lines - * - * @param statementLinesItem StatementLineResponse + * @param statementLinesItem StatementLineResponse * @return StatementResponse - */ + **/ public StatementResponse addStatementLinesItem(StatementLineResponse statementLinesItem) { if (this.statementLines == null) { this.statementLines = new ArrayList(); @@ -484,30 +383,29 @@ public StatementResponse addStatementLinesItem(StatementLineResponse statementLi return this; } - /** + /** * List of statement lines - * * @return statementLines - */ + **/ @ApiModelProperty(value = "List of statement lines") - /** + /** * List of statement lines - * * @return statementLines List - */ + **/ public List getStatementLines() { return statementLines; } - /** - * List of statement lines - * - * @param statementLines List<StatementLineResponse> - */ + /** + * List of statement lines + * @param statementLines List<StatementLineResponse> + **/ + public void setStatementLines(List statementLines) { this.statementLines = statementLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -517,33 +415,24 @@ public boolean equals(java.lang.Object o) { return false; } StatementResponse statementResponse = (StatementResponse) o; - return Objects.equals(this.statementId, statementResponse.statementId) - && Objects.equals(this.startDate, statementResponse.startDate) - && Objects.equals(this.endDate, statementResponse.endDate) - && Objects.equals(this.importedDateTimeUtc, statementResponse.importedDateTimeUtc) - && Objects.equals(this.importSource, statementResponse.importSource) - && Objects.equals(this.startBalance, statementResponse.startBalance) - && Objects.equals(this.endBalance, statementResponse.endBalance) - && Objects.equals(this.indicativeStartBalance, statementResponse.indicativeStartBalance) - && Objects.equals(this.indicativeEndBalance, statementResponse.indicativeEndBalance) - && Objects.equals(this.statementLines, statementResponse.statementLines); + return Objects.equals(this.statementId, statementResponse.statementId) && + Objects.equals(this.startDate, statementResponse.startDate) && + Objects.equals(this.endDate, statementResponse.endDate) && + Objects.equals(this.importedDateTimeUtc, statementResponse.importedDateTimeUtc) && + Objects.equals(this.importSource, statementResponse.importSource) && + Objects.equals(this.startBalance, statementResponse.startBalance) && + Objects.equals(this.endBalance, statementResponse.endBalance) && + Objects.equals(this.indicativeStartBalance, statementResponse.indicativeStartBalance) && + Objects.equals(this.indicativeEndBalance, statementResponse.indicativeEndBalance) && + Objects.equals(this.statementLines, statementResponse.statementLines); } @Override public int hashCode() { - return Objects.hash( - statementId, - startDate, - endDate, - importedDateTimeUtc, - importSource, - startBalance, - endBalance, - indicativeStartBalance, - indicativeEndBalance, - statementLines); + return Objects.hash(statementId, startDate, endDate, importedDateTimeUtc, importSource, startBalance, endBalance, indicativeStartBalance, indicativeEndBalance, statementLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -551,25 +440,20 @@ public String toString() { sb.append(" statementId: ").append(toIndentedString(statementId)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); - sb.append(" importedDateTimeUtc: ") - .append(toIndentedString(importedDateTimeUtc)) - .append("\n"); + sb.append(" importedDateTimeUtc: ").append(toIndentedString(importedDateTimeUtc)).append("\n"); sb.append(" importSource: ").append(toIndentedString(importSource)).append("\n"); sb.append(" startBalance: ").append(toIndentedString(startBalance)).append("\n"); sb.append(" endBalance: ").append(toIndentedString(endBalance)).append("\n"); - sb.append(" indicativeStartBalance: ") - .append(toIndentedString(indicativeStartBalance)) - .append("\n"); - sb.append(" indicativeEndBalance: ") - .append(toIndentedString(indicativeEndBalance)) - .append("\n"); + sb.append(" indicativeStartBalance: ").append(toIndentedString(indicativeStartBalance)).append("\n"); + sb.append(" indicativeEndBalance: ").append(toIndentedString(indicativeEndBalance)).append("\n"); sb.append(" statementLines: ").append(toIndentedString(statementLines)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -577,4 +461,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/TotalDetail.java b/src/main/java/com/xero/models/finance/TotalDetail.java index 08e90aa31..d902ee5fb 100644 --- a/src/main/java/com/xero/models/finance/TotalDetail.java +++ b/src/main/java/com/xero/models/finance/TotalDetail.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TotalDetail + */ -/** TotalDetail */ public class TotalDetail { StringUtil util = new StringUtil(); @@ -29,110 +46,102 @@ public class TotalDetail { @JsonProperty("totalCreditedUnApplied") private Double totalCreditedUnApplied; /** - * Total paid invoice and cash value within the period. - * - * @param totalPaid Double - * @return TotalDetail - */ + * Total paid invoice and cash value within the period. + * @param totalPaid Double + * @return TotalDetail + **/ public TotalDetail totalPaid(Double totalPaid) { this.totalPaid = totalPaid; return this; } - /** + /** * Total paid invoice and cash value within the period. - * * @return totalPaid - */ + **/ @ApiModelProperty(value = "Total paid invoice and cash value within the period.") - /** + /** * Total paid invoice and cash value within the period. - * * @return totalPaid Double - */ + **/ public Double getTotalPaid() { return totalPaid; } - /** - * Total paid invoice and cash value within the period. - * - * @param totalPaid Double - */ + /** + * Total paid invoice and cash value within the period. + * @param totalPaid Double + **/ + public void setTotalPaid(Double totalPaid) { this.totalPaid = totalPaid; } /** - * Total outstanding invoice value within the period. - * - * @param totalOutstanding Double - * @return TotalDetail - */ + * Total outstanding invoice value within the period. + * @param totalOutstanding Double + * @return TotalDetail + **/ public TotalDetail totalOutstanding(Double totalOutstanding) { this.totalOutstanding = totalOutstanding; return this; } - /** + /** * Total outstanding invoice value within the period. - * * @return totalOutstanding - */ + **/ @ApiModelProperty(value = "Total outstanding invoice value within the period.") - /** + /** * Total outstanding invoice value within the period. - * * @return totalOutstanding Double - */ + **/ public Double getTotalOutstanding() { return totalOutstanding; } - /** - * Total outstanding invoice value within the period. - * - * @param totalOutstanding Double - */ + /** + * Total outstanding invoice value within the period. + * @param totalOutstanding Double + **/ + public void setTotalOutstanding(Double totalOutstanding) { this.totalOutstanding = totalOutstanding; } /** - * Total unapplied credited value within the period. - * - * @param totalCreditedUnApplied Double - * @return TotalDetail - */ + * Total unapplied credited value within the period. + * @param totalCreditedUnApplied Double + * @return TotalDetail + **/ public TotalDetail totalCreditedUnApplied(Double totalCreditedUnApplied) { this.totalCreditedUnApplied = totalCreditedUnApplied; return this; } - /** + /** * Total unapplied credited value within the period. - * * @return totalCreditedUnApplied - */ + **/ @ApiModelProperty(value = "Total unapplied credited value within the period.") - /** + /** * Total unapplied credited value within the period. - * * @return totalCreditedUnApplied Double - */ + **/ public Double getTotalCreditedUnApplied() { return totalCreditedUnApplied; } - /** - * Total unapplied credited value within the period. - * - * @param totalCreditedUnApplied Double - */ + /** + * Total unapplied credited value within the period. + * @param totalCreditedUnApplied Double + **/ + public void setTotalCreditedUnApplied(Double totalCreditedUnApplied) { this.totalCreditedUnApplied = totalCreditedUnApplied; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +151,9 @@ public boolean equals(java.lang.Object o) { return false; } TotalDetail totalDetail = (TotalDetail) o; - return Objects.equals(this.totalPaid, totalDetail.totalPaid) - && Objects.equals(this.totalOutstanding, totalDetail.totalOutstanding) - && Objects.equals(this.totalCreditedUnApplied, totalDetail.totalCreditedUnApplied); + return Objects.equals(this.totalPaid, totalDetail.totalPaid) && + Objects.equals(this.totalOutstanding, totalDetail.totalOutstanding) && + Objects.equals(this.totalCreditedUnApplied, totalDetail.totalCreditedUnApplied); } @Override @@ -152,21 +161,21 @@ public int hashCode() { return Objects.hash(totalPaid, totalOutstanding, totalCreditedUnApplied); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TotalDetail {\n"); sb.append(" totalPaid: ").append(toIndentedString(totalPaid)).append("\n"); sb.append(" totalOutstanding: ").append(toIndentedString(totalOutstanding)).append("\n"); - sb.append(" totalCreditedUnApplied: ") - .append(toIndentedString(totalCreditedUnApplied)) - .append("\n"); + sb.append(" totalCreditedUnApplied: ").append(toIndentedString(totalCreditedUnApplied)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -174,4 +183,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/TotalOther.java b/src/main/java/com/xero/models/finance/TotalOther.java index 8564256e4..b6bce4c87 100644 --- a/src/main/java/com/xero/models/finance/TotalOther.java +++ b/src/main/java/com/xero/models/finance/TotalOther.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TotalOther + */ -/** TotalOther */ public class TotalOther { StringUtil util = new StringUtil(); @@ -29,113 +46,102 @@ public class TotalOther { @JsonProperty("totalCredited") private Double totalCredited; /** - * Total outstanding invoice value within the period where the invoices are more than 90 days old - * - * @param totalOutstandingAged Double - * @return TotalOther - */ + * Total outstanding invoice value within the period where the invoices are more than 90 days old + * @param totalOutstandingAged Double + * @return TotalOther + **/ public TotalOther totalOutstandingAged(Double totalOutstandingAged) { this.totalOutstandingAged = totalOutstandingAged; return this; } - /** + /** * Total outstanding invoice value within the period where the invoices are more than 90 days old - * * @return totalOutstandingAged - */ - @ApiModelProperty( - value = - "Total outstanding invoice value within the period where the invoices are more than 90" - + " days old") - /** + **/ + @ApiModelProperty(value = "Total outstanding invoice value within the period where the invoices are more than 90 days old") + /** * Total outstanding invoice value within the period where the invoices are more than 90 days old - * * @return totalOutstandingAged Double - */ + **/ public Double getTotalOutstandingAged() { return totalOutstandingAged; } - /** - * Total outstanding invoice value within the period where the invoices are more than 90 days old - * - * @param totalOutstandingAged Double - */ + /** + * Total outstanding invoice value within the period where the invoices are more than 90 days old + * @param totalOutstandingAged Double + **/ + public void setTotalOutstandingAged(Double totalOutstandingAged) { this.totalOutstandingAged = totalOutstandingAged; } /** - * Total voided value. - * - * @param totalVoided Double - * @return TotalOther - */ + * Total voided value. + * @param totalVoided Double + * @return TotalOther + **/ public TotalOther totalVoided(Double totalVoided) { this.totalVoided = totalVoided; return this; } - /** + /** * Total voided value. - * * @return totalVoided - */ + **/ @ApiModelProperty(value = "Total voided value.") - /** + /** * Total voided value. - * * @return totalVoided Double - */ + **/ public Double getTotalVoided() { return totalVoided; } - /** - * Total voided value. - * - * @param totalVoided Double - */ + /** + * Total voided value. + * @param totalVoided Double + **/ + public void setTotalVoided(Double totalVoided) { this.totalVoided = totalVoided; } /** - * Total credited value. - * - * @param totalCredited Double - * @return TotalOther - */ + * Total credited value. + * @param totalCredited Double + * @return TotalOther + **/ public TotalOther totalCredited(Double totalCredited) { this.totalCredited = totalCredited; return this; } - /** + /** * Total credited value. - * * @return totalCredited - */ + **/ @ApiModelProperty(value = "Total credited value.") - /** + /** * Total credited value. - * * @return totalCredited Double - */ + **/ public Double getTotalCredited() { return totalCredited; } - /** - * Total credited value. - * - * @param totalCredited Double - */ + /** + * Total credited value. + * @param totalCredited Double + **/ + public void setTotalCredited(Double totalCredited) { this.totalCredited = totalCredited; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -145,9 +151,9 @@ public boolean equals(java.lang.Object o) { return false; } TotalOther totalOther = (TotalOther) o; - return Objects.equals(this.totalOutstandingAged, totalOther.totalOutstandingAged) - && Objects.equals(this.totalVoided, totalOther.totalVoided) - && Objects.equals(this.totalCredited, totalOther.totalCredited); + return Objects.equals(this.totalOutstandingAged, totalOther.totalOutstandingAged) && + Objects.equals(this.totalVoided, totalOther.totalVoided) && + Objects.equals(this.totalCredited, totalOther.totalCredited); } @Override @@ -155,13 +161,12 @@ public int hashCode() { return Objects.hash(totalOutstandingAged, totalVoided, totalCredited); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TotalOther {\n"); - sb.append(" totalOutstandingAged: ") - .append(toIndentedString(totalOutstandingAged)) - .append("\n"); + sb.append(" totalOutstandingAged: ").append(toIndentedString(totalOutstandingAged)).append("\n"); sb.append(" totalVoided: ").append(toIndentedString(totalVoided)).append("\n"); sb.append(" totalCredited: ").append(toIndentedString(totalCredited)).append("\n"); sb.append("}"); @@ -169,7 +174,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -177,4 +183,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/TrialBalanceAccount.java b/src/main/java/com/xero/models/finance/TrialBalanceAccount.java index 9795d6084..480b133c3 100644 --- a/src/main/java/com/xero/models/finance/TrialBalanceAccount.java +++ b/src/main/java/com/xero/models/finance/TrialBalanceAccount.java @@ -9,15 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.TrialBalanceEntry; +import com.xero.models.finance.TrialBalanceMovement; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrialBalanceAccount + */ -/** TrialBalanceAccount */ public class TrialBalanceAccount { StringUtil util = new StringUtil(); @@ -51,398 +70,326 @@ public class TrialBalanceAccount { @JsonProperty("accountMovement") private TrialBalanceMovement accountMovement; /** - * ID of the account - * - * @param accountId UUID - * @return TrialBalanceAccount - */ + * ID of the account + * @param accountId UUID + * @return TrialBalanceAccount + **/ public TrialBalanceAccount accountId(UUID accountId) { this.accountId = accountId; return this; } - /** + /** * ID of the account - * * @return accountId - */ + **/ @ApiModelProperty(value = "ID of the account") - /** + /** * ID of the account - * * @return accountId UUID - */ + **/ public UUID getAccountId() { return accountId; } - /** - * ID of the account - * - * @param accountId UUID - */ + /** + * ID of the account + * @param accountId UUID + **/ + public void setAccountId(UUID accountId) { this.accountId = accountId; } /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - * @return TrialBalanceAccount - */ + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + * @return TrialBalanceAccount + **/ public TrialBalanceAccount accountType(String accountType) { this.accountType = accountType; return this; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType - */ - @ApiModelProperty( - value = - "The type of the account. See Account" - + " Types") - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * + **/ + @ApiModelProperty(value = "The type of the account. See Account Types") + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> * @return accountType String - */ + **/ public String getAccountType() { return accountType; } - /** - * The type of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account - * Types</a> - * - * @param accountType String - */ + /** + * The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a> + * @param accountType String + **/ + public void setAccountType(String accountType) { this.accountType = accountType; } /** - * Customer defined alpha numeric account code e.g 200 or SALES - * - * @param accountCode String - * @return TrialBalanceAccount - */ + * Customer defined alpha numeric account code e.g 200 or SALES + * @param accountCode String + * @return TrialBalanceAccount + **/ public TrialBalanceAccount accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * Customer defined alpha numeric account code e.g 200 or SALES - * * @return accountCode - */ + **/ @ApiModelProperty(value = "Customer defined alpha numeric account code e.g 200 or SALES") - /** + /** * Customer defined alpha numeric account code e.g 200 or SALES - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * Customer defined alpha numeric account code e.g 200 or SALES - * - * @param accountCode String - */ + /** + * Customer defined alpha numeric account code e.g 200 or SALES + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * - * @param accountClass String - * @return TrialBalanceAccount - */ + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> + * @param accountClass String + * @return TrialBalanceAccount + **/ public TrialBalanceAccount accountClass(String accountClass) { this.accountClass = accountClass; return this; } - /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * + /** + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> * @return accountClass - */ - @ApiModelProperty( - value = - "The class of the account. See Account" - + " Class Types") - /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * + **/ + @ApiModelProperty(value = "The class of the account. See Account Class Types") + /** + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> * @return accountClass String - */ + **/ public String getAccountClass() { return accountClass; } - /** - * The class of the account. See <a - * href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account - * Class Types</a> - * - * @param accountClass String - */ + /** + * The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a> + * @param accountClass String + **/ + public void setAccountClass(String accountClass) { this.accountClass = accountClass; } /** - * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a - * href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account - * Status Codes</a> - * - * @param status String - * @return TrialBalanceAccount - */ + * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account Status Codes</a> + * @param status String + * @return TrialBalanceAccount + **/ public TrialBalanceAccount status(String status) { this.status = status; return this; } - /** - * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a - * href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account - * Status Codes</a> - * + /** + * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account Status Codes</a> * @return status - */ - @ApiModelProperty( - value = - "Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account" - + " Status Codes") - /** - * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a - * href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account - * Status Codes</a> - * + **/ + @ApiModelProperty(value = "Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes") + /** + * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account Status Codes</a> * @return status String - */ + **/ public String getStatus() { return status; } - /** - * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a - * href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account - * Status Codes</a> - * - * @param status String - */ + /** + * Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account Status Codes</a> + * @param status String + **/ + public void setStatus(String status) { this.status = status; } /** - * Reporting code (Shown if set) - * - * @param reportingCode String - * @return TrialBalanceAccount - */ + * Reporting code (Shown if set) + * @param reportingCode String + * @return TrialBalanceAccount + **/ public TrialBalanceAccount reportingCode(String reportingCode) { this.reportingCode = reportingCode; return this; } - /** + /** * Reporting code (Shown if set) - * * @return reportingCode - */ + **/ @ApiModelProperty(value = "Reporting code (Shown if set)") - /** + /** * Reporting code (Shown if set) - * * @return reportingCode String - */ + **/ public String getReportingCode() { return reportingCode; } - /** - * Reporting code (Shown if set) - * - * @param reportingCode String - */ + /** + * Reporting code (Shown if set) + * @param reportingCode String + **/ + public void setReportingCode(String reportingCode) { this.reportingCode = reportingCode; } /** - * Name of the account - * - * @param accountName String - * @return TrialBalanceAccount - */ + * Name of the account + * @param accountName String + * @return TrialBalanceAccount + **/ public TrialBalanceAccount accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * Name of the account - * * @return accountName - */ + **/ @ApiModelProperty(value = "Name of the account") - /** + /** * Name of the account - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * Name of the account - * - * @param accountName String - */ + /** + * Name of the account + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * balance - * - * @param balance TrialBalanceEntry - * @return TrialBalanceAccount - */ + * balance + * @param balance TrialBalanceEntry + * @return TrialBalanceAccount + **/ public TrialBalanceAccount balance(TrialBalanceEntry balance) { this.balance = balance; return this; } - /** + /** * Get balance - * * @return balance - */ + **/ @ApiModelProperty(value = "") - /** + /** * balance - * * @return balance TrialBalanceEntry - */ + **/ public TrialBalanceEntry getBalance() { return balance; } - /** - * balance - * - * @param balance TrialBalanceEntry - */ + /** + * balance + * @param balance TrialBalanceEntry + **/ + public void setBalance(TrialBalanceEntry balance) { this.balance = balance; } /** - * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * - * @param signedBalance Double - * @return TrialBalanceAccount - */ + * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative + * @param signedBalance Double + * @return TrialBalanceAccount + **/ public TrialBalanceAccount signedBalance(Double signedBalance) { this.signedBalance = signedBalance; return this; } - /** - * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * + /** + * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative * @return signedBalance - */ - @ApiModelProperty( - value = - "Value of balance. Expense and Asset accounts code debits as positive. Revenue," - + " Liability, and Equity accounts code debits as negative") - /** - * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * + **/ + @ApiModelProperty(value = "Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative") + /** + * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative * @return signedBalance Double - */ + **/ public Double getSignedBalance() { return signedBalance; } - /** - * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * - * @param signedBalance Double - */ + /** + * Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative + * @param signedBalance Double + **/ + public void setSignedBalance(Double signedBalance) { this.signedBalance = signedBalance; } /** - * accountMovement - * - * @param accountMovement TrialBalanceMovement - * @return TrialBalanceAccount - */ + * accountMovement + * @param accountMovement TrialBalanceMovement + * @return TrialBalanceAccount + **/ public TrialBalanceAccount accountMovement(TrialBalanceMovement accountMovement) { this.accountMovement = accountMovement; return this; } - /** + /** * Get accountMovement - * * @return accountMovement - */ + **/ @ApiModelProperty(value = "") - /** + /** * accountMovement - * * @return accountMovement TrialBalanceMovement - */ + **/ public TrialBalanceMovement getAccountMovement() { return accountMovement; } - /** - * accountMovement - * - * @param accountMovement TrialBalanceMovement - */ + /** + * accountMovement + * @param accountMovement TrialBalanceMovement + **/ + public void setAccountMovement(TrialBalanceMovement accountMovement) { this.accountMovement = accountMovement; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -452,33 +399,24 @@ public boolean equals(java.lang.Object o) { return false; } TrialBalanceAccount trialBalanceAccount = (TrialBalanceAccount) o; - return Objects.equals(this.accountId, trialBalanceAccount.accountId) - && Objects.equals(this.accountType, trialBalanceAccount.accountType) - && Objects.equals(this.accountCode, trialBalanceAccount.accountCode) - && Objects.equals(this.accountClass, trialBalanceAccount.accountClass) - && Objects.equals(this.status, trialBalanceAccount.status) - && Objects.equals(this.reportingCode, trialBalanceAccount.reportingCode) - && Objects.equals(this.accountName, trialBalanceAccount.accountName) - && Objects.equals(this.balance, trialBalanceAccount.balance) - && Objects.equals(this.signedBalance, trialBalanceAccount.signedBalance) - && Objects.equals(this.accountMovement, trialBalanceAccount.accountMovement); + return Objects.equals(this.accountId, trialBalanceAccount.accountId) && + Objects.equals(this.accountType, trialBalanceAccount.accountType) && + Objects.equals(this.accountCode, trialBalanceAccount.accountCode) && + Objects.equals(this.accountClass, trialBalanceAccount.accountClass) && + Objects.equals(this.status, trialBalanceAccount.status) && + Objects.equals(this.reportingCode, trialBalanceAccount.reportingCode) && + Objects.equals(this.accountName, trialBalanceAccount.accountName) && + Objects.equals(this.balance, trialBalanceAccount.balance) && + Objects.equals(this.signedBalance, trialBalanceAccount.signedBalance) && + Objects.equals(this.accountMovement, trialBalanceAccount.accountMovement); } @Override public int hashCode() { - return Objects.hash( - accountId, - accountType, - accountCode, - accountClass, - status, - reportingCode, - accountName, - balance, - signedBalance, - accountMovement); + return Objects.hash(accountId, accountType, accountCode, accountClass, status, reportingCode, accountName, balance, signedBalance, accountMovement); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -498,7 +436,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -506,4 +445,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/TrialBalanceEntry.java b/src/main/java/com/xero/models/finance/TrialBalanceEntry.java index 329a21fb7..f7988a299 100644 --- a/src/main/java/com/xero/models/finance/TrialBalanceEntry.java +++ b/src/main/java/com/xero/models/finance/TrialBalanceEntry.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrialBalanceEntry + */ -/** TrialBalanceEntry */ public class TrialBalanceEntry { StringUtil util = new StringUtil(); @@ -26,75 +43,70 @@ public class TrialBalanceEntry { @JsonProperty("entryType") private String entryType; /** - * Net movement or net balance in the account - * - * @param value Double - * @return TrialBalanceEntry - */ + * Net movement or net balance in the account + * @param value Double + * @return TrialBalanceEntry + **/ public TrialBalanceEntry value(Double value) { this.value = value; return this; } - /** + /** * Net movement or net balance in the account - * * @return value - */ + **/ @ApiModelProperty(value = "Net movement or net balance in the account") - /** + /** * Net movement or net balance in the account - * * @return value Double - */ + **/ public Double getValue() { return value; } - /** - * Net movement or net balance in the account - * - * @param value Double - */ + /** + * Net movement or net balance in the account + * @param value Double + **/ + public void setValue(Double value) { this.value = value; } /** - * Sign (Debit/Credit) of the movement of balance in the account - * - * @param entryType String - * @return TrialBalanceEntry - */ + * Sign (Debit/Credit) of the movement of balance in the account + * @param entryType String + * @return TrialBalanceEntry + **/ public TrialBalanceEntry entryType(String entryType) { this.entryType = entryType; return this; } - /** + /** * Sign (Debit/Credit) of the movement of balance in the account - * * @return entryType - */ + **/ @ApiModelProperty(value = "Sign (Debit/Credit) of the movement of balance in the account") - /** + /** * Sign (Debit/Credit) of the movement of balance in the account - * * @return entryType String - */ + **/ public String getEntryType() { return entryType; } - /** - * Sign (Debit/Credit) of the movement of balance in the account - * - * @param entryType String - */ + /** + * Sign (Debit/Credit) of the movement of balance in the account + * @param entryType String + **/ + public void setEntryType(String entryType) { this.entryType = entryType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } TrialBalanceEntry trialBalanceEntry = (TrialBalanceEntry) o; - return Objects.equals(this.value, trialBalanceEntry.value) - && Objects.equals(this.entryType, trialBalanceEntry.entryType); + return Objects.equals(this.value, trialBalanceEntry.value) && + Objects.equals(this.entryType, trialBalanceEntry.entryType); } @Override @@ -113,6 +125,7 @@ public int hashCode() { return Objects.hash(value, entryType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/TrialBalanceMovement.java b/src/main/java/com/xero/models/finance/TrialBalanceMovement.java index 52fe56e44..790aed3ef 100644 --- a/src/main/java/com/xero/models/finance/TrialBalanceMovement.java +++ b/src/main/java/com/xero/models/finance/TrialBalanceMovement.java @@ -9,14 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.TrialBalanceEntry; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrialBalanceMovement + */ -/** TrialBalanceMovement */ public class TrialBalanceMovement { StringUtil util = new StringUtil(); @@ -32,152 +50,134 @@ public class TrialBalanceMovement { @JsonProperty("signedMovement") private Double signedMovement; /** - * Debit amount - * - * @param debits Double - * @return TrialBalanceMovement - */ + * Debit amount + * @param debits Double + * @return TrialBalanceMovement + **/ public TrialBalanceMovement debits(Double debits) { this.debits = debits; return this; } - /** + /** * Debit amount - * * @return debits - */ + **/ @ApiModelProperty(value = "Debit amount") - /** + /** * Debit amount - * * @return debits Double - */ + **/ public Double getDebits() { return debits; } - /** - * Debit amount - * - * @param debits Double - */ + /** + * Debit amount + * @param debits Double + **/ + public void setDebits(Double debits) { this.debits = debits; } /** - * Credit amount - * - * @param credits Double - * @return TrialBalanceMovement - */ + * Credit amount + * @param credits Double + * @return TrialBalanceMovement + **/ public TrialBalanceMovement credits(Double credits) { this.credits = credits; return this; } - /** + /** * Credit amount - * * @return credits - */ + **/ @ApiModelProperty(value = "Credit amount") - /** + /** * Credit amount - * * @return credits Double - */ + **/ public Double getCredits() { return credits; } - /** - * Credit amount - * - * @param credits Double - */ + /** + * Credit amount + * @param credits Double + **/ + public void setCredits(Double credits) { this.credits = credits; } /** - * movement - * - * @param movement TrialBalanceEntry - * @return TrialBalanceMovement - */ + * movement + * @param movement TrialBalanceEntry + * @return TrialBalanceMovement + **/ public TrialBalanceMovement movement(TrialBalanceEntry movement) { this.movement = movement; return this; } - /** + /** * Get movement - * * @return movement - */ + **/ @ApiModelProperty(value = "") - /** + /** * movement - * * @return movement TrialBalanceEntry - */ + **/ public TrialBalanceEntry getMovement() { return movement; } - /** - * movement - * - * @param movement TrialBalanceEntry - */ + /** + * movement + * @param movement TrialBalanceEntry + **/ + public void setMovement(TrialBalanceEntry movement) { this.movement = movement; } /** - * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * - * @param signedMovement Double - * @return TrialBalanceMovement - */ + * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative + * @param signedMovement Double + * @return TrialBalanceMovement + **/ public TrialBalanceMovement signedMovement(Double signedMovement) { this.signedMovement = signedMovement; return this; } - /** - * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * + /** + * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative * @return signedMovement - */ - @ApiModelProperty( - value = - "Value of movement. Expense and Asset accounts code debits as positive. Revenue," - + " Liability, and Equity accounts code debits as negative") - /** - * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * + **/ + @ApiModelProperty(value = "Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative") + /** + * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative * @return signedMovement Double - */ + **/ public Double getSignedMovement() { return signedMovement; } - /** - * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and - * Equity accounts code debits as negative - * - * @param signedMovement Double - */ + /** + * Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative + * @param signedMovement Double + **/ + public void setSignedMovement(Double signedMovement) { this.signedMovement = signedMovement; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -187,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } TrialBalanceMovement trialBalanceMovement = (TrialBalanceMovement) o; - return Objects.equals(this.debits, trialBalanceMovement.debits) - && Objects.equals(this.credits, trialBalanceMovement.credits) - && Objects.equals(this.movement, trialBalanceMovement.movement) - && Objects.equals(this.signedMovement, trialBalanceMovement.signedMovement); + return Objects.equals(this.debits, trialBalanceMovement.debits) && + Objects.equals(this.credits, trialBalanceMovement.credits) && + Objects.equals(this.movement, trialBalanceMovement.movement) && + Objects.equals(this.signedMovement, trialBalanceMovement.signedMovement); } @Override @@ -198,6 +198,7 @@ public int hashCode() { return Objects.hash(debits, credits, movement, signedMovement); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -211,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -219,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/TrialBalanceResponse.java b/src/main/java/com/xero/models/finance/TrialBalanceResponse.java index 00448d9c2..bd2f4203e 100644 --- a/src/main/java/com/xero/models/finance/TrialBalanceResponse.java +++ b/src/main/java/com/xero/models/finance/TrialBalanceResponse.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.TrialBalanceAccount; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrialBalanceResponse + */ -/** TrialBalanceResponse */ public class TrialBalanceResponse { StringUtil util = new StringUtil(); @@ -32,81 +50,74 @@ public class TrialBalanceResponse { @JsonProperty("accounts") private List accounts = new ArrayList(); /** - * Start date of the report - * - * @param startDate LocalDate - * @return TrialBalanceResponse - */ + * Start date of the report + * @param startDate LocalDate + * @return TrialBalanceResponse + **/ public TrialBalanceResponse startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the report - * * @return startDate - */ + **/ @ApiModelProperty(value = "Start date of the report") - /** + /** * Start date of the report - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the report - * - * @param startDate LocalDate - */ + /** + * Start date of the report + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * End date of the report - * - * @param endDate LocalDate - * @return TrialBalanceResponse - */ + * End date of the report + * @param endDate LocalDate + * @return TrialBalanceResponse + **/ public TrialBalanceResponse endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * End date of the report - * * @return endDate - */ + **/ @ApiModelProperty(value = "End date of the report") - /** + /** * End date of the report - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * End date of the report - * - * @param endDate LocalDate - */ + /** + * End date of the report + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Refer to the accounts section below - * - * @param accounts List<TrialBalanceAccount> - * @return TrialBalanceResponse - */ + * Refer to the accounts section below + * @param accounts List<TrialBalanceAccount> + * @return TrialBalanceResponse + **/ public TrialBalanceResponse accounts(List accounts) { this.accounts = accounts; return this; @@ -114,10 +125,9 @@ public TrialBalanceResponse accounts(List accounts) { /** * Refer to the accounts section below - * - * @param accountsItem TrialBalanceAccount + * @param accountsItem TrialBalanceAccount * @return TrialBalanceResponse - */ + **/ public TrialBalanceResponse addAccountsItem(TrialBalanceAccount accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -126,30 +136,29 @@ public TrialBalanceResponse addAccountsItem(TrialBalanceAccount accountsItem) { return this; } - /** + /** * Refer to the accounts section below - * * @return accounts - */ + **/ @ApiModelProperty(value = "Refer to the accounts section below") - /** + /** * Refer to the accounts section below - * * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * Refer to the accounts section below - * - * @param accounts List<TrialBalanceAccount> - */ + /** + * Refer to the accounts section below + * @param accounts List<TrialBalanceAccount> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -159,9 +168,9 @@ public boolean equals(java.lang.Object o) { return false; } TrialBalanceResponse trialBalanceResponse = (TrialBalanceResponse) o; - return Objects.equals(this.startDate, trialBalanceResponse.startDate) - && Objects.equals(this.endDate, trialBalanceResponse.endDate) - && Objects.equals(this.accounts, trialBalanceResponse.accounts); + return Objects.equals(this.startDate, trialBalanceResponse.startDate) && + Objects.equals(this.endDate, trialBalanceResponse.endDate) && + Objects.equals(this.accounts, trialBalanceResponse.accounts); } @Override @@ -169,6 +178,7 @@ public int hashCode() { return Objects.hash(startDate, endDate, accounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -181,7 +191,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -189,4 +200,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/UserActivitiesResponse.java b/src/main/java/com/xero/models/finance/UserActivitiesResponse.java index ba8b4aaa1..394eda226 100644 --- a/src/main/java/com/xero/models/finance/UserActivitiesResponse.java +++ b/src/main/java/com/xero/models/finance/UserActivitiesResponse.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.UserResponse; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * UserActivitiesResponse + */ -/** UserActivitiesResponse */ public class UserActivitiesResponse { StringUtil util = new StringUtil(); @@ -32,81 +50,74 @@ public class UserActivitiesResponse { @JsonProperty("users") private List users = new ArrayList(); /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - * @return UserActivitiesResponse - */ + * The requested Organisation to which the data pertains + * @param organisationId UUID + * @return UserActivitiesResponse + **/ public UserActivitiesResponse organisationId(UUID organisationId) { this.organisationId = organisationId; return this; } - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId - */ + **/ @ApiModelProperty(value = "The requested Organisation to which the data pertains") - /** + /** * The requested Organisation to which the data pertains - * * @return organisationId UUID - */ + **/ public UUID getOrganisationId() { return organisationId; } - /** - * The requested Organisation to which the data pertains - * - * @param organisationId UUID - */ + /** + * The requested Organisation to which the data pertains + * @param organisationId UUID + **/ + public void setOrganisationId(UUID organisationId) { this.organisationId = organisationId; } /** - * The month of the report - * - * @param dataMonth String - * @return UserActivitiesResponse - */ + * The month of the report + * @param dataMonth String + * @return UserActivitiesResponse + **/ public UserActivitiesResponse dataMonth(String dataMonth) { this.dataMonth = dataMonth; return this; } - /** + /** * The month of the report - * * @return dataMonth - */ + **/ @ApiModelProperty(value = "The month of the report") - /** + /** * The month of the report - * * @return dataMonth String - */ + **/ public String getDataMonth() { return dataMonth; } - /** - * The month of the report - * - * @param dataMonth String - */ + /** + * The month of the report + * @param dataMonth String + **/ + public void setDataMonth(String dataMonth) { this.dataMonth = dataMonth; } /** - * users - * - * @param users List<UserResponse> - * @return UserActivitiesResponse - */ + * users + * @param users List<UserResponse> + * @return UserActivitiesResponse + **/ public UserActivitiesResponse users(List users) { this.users = users; return this; @@ -114,10 +125,9 @@ public UserActivitiesResponse users(List users) { /** * users - * - * @param usersItem UserResponse + * @param usersItem UserResponse * @return UserActivitiesResponse - */ + **/ public UserActivitiesResponse addUsersItem(UserResponse usersItem) { if (this.users == null) { this.users = new ArrayList(); @@ -126,30 +136,29 @@ public UserActivitiesResponse addUsersItem(UserResponse usersItem) { return this; } - /** + /** * Get users - * * @return users - */ + **/ @ApiModelProperty(value = "") - /** + /** * users - * * @return users List - */ + **/ public List getUsers() { return users; } - /** - * users - * - * @param users List<UserResponse> - */ + /** + * users + * @param users List<UserResponse> + **/ + public void setUsers(List users) { this.users = users; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -159,9 +168,9 @@ public boolean equals(java.lang.Object o) { return false; } UserActivitiesResponse userActivitiesResponse = (UserActivitiesResponse) o; - return Objects.equals(this.organisationId, userActivitiesResponse.organisationId) - && Objects.equals(this.dataMonth, userActivitiesResponse.dataMonth) - && Objects.equals(this.users, userActivitiesResponse.users); + return Objects.equals(this.organisationId, userActivitiesResponse.organisationId) && + Objects.equals(this.dataMonth, userActivitiesResponse.dataMonth) && + Objects.equals(this.users, userActivitiesResponse.users); } @Override @@ -169,6 +178,7 @@ public int hashCode() { return Objects.hash(organisationId, dataMonth, users); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -181,7 +191,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -189,4 +200,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/finance/UserResponse.java b/src/main/java/com/xero/models/finance/UserResponse.java index 95f7236ba..114c9d863 100644 --- a/src/main/java/com/xero/models/finance/UserResponse.java +++ b/src/main/java/com/xero/models/finance/UserResponse.java @@ -9,18 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.finance; +package com.xero.models.finance; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.finance.HistoryRecordResponse; +import com.xero.models.finance.PracticeResponse; +import io.swagger.annotations.ApiModel; 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.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * UserResponse + */ -/** UserResponse */ public class UserResponse { StringUtil util = new StringUtil(); @@ -60,361 +79,330 @@ public class UserResponse { @JsonProperty("historyRecords") private List historyRecords = new ArrayList(); /** - * The Xero identifier for the user - * - * @param userId UUID - * @return UserResponse - */ + * The Xero identifier for the user + * @param userId UUID + * @return UserResponse + **/ public UserResponse userId(UUID userId) { this.userId = userId; return this; } - /** + /** * The Xero identifier for the user - * * @return userId - */ + **/ @ApiModelProperty(value = "The Xero identifier for the user") - /** + /** * The Xero identifier for the user - * * @return userId UUID - */ + **/ public UUID getUserId() { return userId; } - /** - * The Xero identifier for the user - * - * @param userId UUID - */ + /** + * The Xero identifier for the user + * @param userId UUID + **/ + public void setUserId(UUID userId) { this.userId = userId; } /** - * Timestamp of user creation. - * - * @param userCreatedDateUtc OffsetDateTime - * @return UserResponse - */ + * Timestamp of user creation. + * @param userCreatedDateUtc OffsetDateTime + * @return UserResponse + **/ public UserResponse userCreatedDateUtc(OffsetDateTime userCreatedDateUtc) { this.userCreatedDateUtc = userCreatedDateUtc; return this; } - /** + /** * Timestamp of user creation. - * * @return userCreatedDateUtc - */ + **/ @ApiModelProperty(value = "Timestamp of user creation.") - /** + /** * Timestamp of user creation. - * * @return userCreatedDateUtc OffsetDateTime - */ + **/ public OffsetDateTime getUserCreatedDateUtc() { return userCreatedDateUtc; } - /** - * Timestamp of user creation. - * - * @param userCreatedDateUtc OffsetDateTime - */ + /** + * Timestamp of user creation. + * @param userCreatedDateUtc OffsetDateTime + **/ + public void setUserCreatedDateUtc(OffsetDateTime userCreatedDateUtc) { this.userCreatedDateUtc = userCreatedDateUtc; } /** - * Timestamp of user last login - * - * @param lastLoginDateUtc OffsetDateTime - * @return UserResponse - */ + * Timestamp of user last login + * @param lastLoginDateUtc OffsetDateTime + * @return UserResponse + **/ public UserResponse lastLoginDateUtc(OffsetDateTime lastLoginDateUtc) { this.lastLoginDateUtc = lastLoginDateUtc; return this; } - /** + /** * Timestamp of user last login - * * @return lastLoginDateUtc - */ + **/ @ApiModelProperty(value = "Timestamp of user last login") - /** + /** * Timestamp of user last login - * * @return lastLoginDateUtc OffsetDateTime - */ + **/ public OffsetDateTime getLastLoginDateUtc() { return lastLoginDateUtc; } - /** - * Timestamp of user last login - * - * @param lastLoginDateUtc OffsetDateTime - */ + /** + * Timestamp of user last login + * @param lastLoginDateUtc OffsetDateTime + **/ + public void setLastLoginDateUtc(OffsetDateTime lastLoginDateUtc) { this.lastLoginDateUtc = lastLoginDateUtc; } /** - * User is external partner. - * - * @param isExternalPartner Boolean - * @return UserResponse - */ + * User is external partner. + * @param isExternalPartner Boolean + * @return UserResponse + **/ public UserResponse isExternalPartner(Boolean isExternalPartner) { this.isExternalPartner = isExternalPartner; return this; } - /** + /** * User is external partner. - * * @return isExternalPartner - */ + **/ @ApiModelProperty(value = "User is external partner.") - /** + /** * User is external partner. - * * @return isExternalPartner Boolean - */ + **/ public Boolean getIsExternalPartner() { return isExternalPartner; } - /** - * User is external partner. - * - * @param isExternalPartner Boolean - */ + /** + * User is external partner. + * @param isExternalPartner Boolean + **/ + public void setIsExternalPartner(Boolean isExternalPartner) { this.isExternalPartner = isExternalPartner; } /** - * User has Accountant role. - * - * @param hasAccountantRole Boolean - * @return UserResponse - */ + * User has Accountant role. + * @param hasAccountantRole Boolean + * @return UserResponse + **/ public UserResponse hasAccountantRole(Boolean hasAccountantRole) { this.hasAccountantRole = hasAccountantRole; return this; } - /** + /** * User has Accountant role. - * * @return hasAccountantRole - */ + **/ @ApiModelProperty(value = "User has Accountant role.") - /** + /** * User has Accountant role. - * * @return hasAccountantRole Boolean - */ + **/ public Boolean getHasAccountantRole() { return hasAccountantRole; } - /** - * User has Accountant role. - * - * @param hasAccountantRole Boolean - */ + /** + * User has Accountant role. + * @param hasAccountantRole Boolean + **/ + public void setHasAccountantRole(Boolean hasAccountantRole) { this.hasAccountantRole = hasAccountantRole; } /** - * Month period in format yyyy-MM. - * - * @param monthPeriod String - * @return UserResponse - */ + * Month period in format yyyy-MM. + * @param monthPeriod String + * @return UserResponse + **/ public UserResponse monthPeriod(String monthPeriod) { this.monthPeriod = monthPeriod; return this; } - /** - * Month period in format yyyy-MM. - * + /** + * Month period in format yyyy-MM. * @return monthPeriod - */ + **/ @ApiModelProperty(value = "Month period in format yyyy-MM.") - /** - * Month period in format yyyy-MM. - * + /** + * Month period in format yyyy-MM. * @return monthPeriod String - */ + **/ public String getMonthPeriod() { return monthPeriod; } - /** - * Month period in format yyyy-MM. - * - * @param monthPeriod String - */ + /** + * Month period in format yyyy-MM. + * @param monthPeriod String + **/ + public void setMonthPeriod(String monthPeriod) { this.monthPeriod = monthPeriod; } /** - * Number of times the user has logged in. - * - * @param numberOfLogins Integer - * @return UserResponse - */ + * Number of times the user has logged in. + * @param numberOfLogins Integer + * @return UserResponse + **/ public UserResponse numberOfLogins(Integer numberOfLogins) { this.numberOfLogins = numberOfLogins; return this; } - /** + /** * Number of times the user has logged in. - * * @return numberOfLogins - */ + **/ @ApiModelProperty(value = "Number of times the user has logged in.") - /** + /** * Number of times the user has logged in. - * * @return numberOfLogins Integer - */ + **/ public Integer getNumberOfLogins() { return numberOfLogins; } - /** - * Number of times the user has logged in. - * - * @param numberOfLogins Integer - */ + /** + * Number of times the user has logged in. + * @param numberOfLogins Integer + **/ + public void setNumberOfLogins(Integer numberOfLogins) { this.numberOfLogins = numberOfLogins; } /** - * Number of documents created. - * - * @param numberOfDocumentsCreated Integer - * @return UserResponse - */ + * Number of documents created. + * @param numberOfDocumentsCreated Integer + * @return UserResponse + **/ public UserResponse numberOfDocumentsCreated(Integer numberOfDocumentsCreated) { this.numberOfDocumentsCreated = numberOfDocumentsCreated; return this; } - /** + /** * Number of documents created. - * * @return numberOfDocumentsCreated - */ + **/ @ApiModelProperty(value = "Number of documents created.") - /** + /** * Number of documents created. - * * @return numberOfDocumentsCreated Integer - */ + **/ public Integer getNumberOfDocumentsCreated() { return numberOfDocumentsCreated; } - /** - * Number of documents created. - * - * @param numberOfDocumentsCreated Integer - */ + /** + * Number of documents created. + * @param numberOfDocumentsCreated Integer + **/ + public void setNumberOfDocumentsCreated(Integer numberOfDocumentsCreated) { this.numberOfDocumentsCreated = numberOfDocumentsCreated; } /** - * Net value of documents created. - * - * @param netValueDocumentsCreated Double - * @return UserResponse - */ + * Net value of documents created. + * @param netValueDocumentsCreated Double + * @return UserResponse + **/ public UserResponse netValueDocumentsCreated(Double netValueDocumentsCreated) { this.netValueDocumentsCreated = netValueDocumentsCreated; return this; } - /** + /** * Net value of documents created. - * * @return netValueDocumentsCreated - */ + **/ @ApiModelProperty(value = "Net value of documents created.") - /** + /** * Net value of documents created. - * * @return netValueDocumentsCreated Double - */ + **/ public Double getNetValueDocumentsCreated() { return netValueDocumentsCreated; } - /** - * Net value of documents created. - * - * @param netValueDocumentsCreated Double - */ + /** + * Net value of documents created. + * @param netValueDocumentsCreated Double + **/ + public void setNetValueDocumentsCreated(Double netValueDocumentsCreated) { this.netValueDocumentsCreated = netValueDocumentsCreated; } /** - * Absolute value of documents created. - * - * @param absoluteValueDocumentsCreated Double - * @return UserResponse - */ + * Absolute value of documents created. + * @param absoluteValueDocumentsCreated Double + * @return UserResponse + **/ public UserResponse absoluteValueDocumentsCreated(Double absoluteValueDocumentsCreated) { this.absoluteValueDocumentsCreated = absoluteValueDocumentsCreated; return this; } - /** + /** * Absolute value of documents created. - * * @return absoluteValueDocumentsCreated - */ + **/ @ApiModelProperty(value = "Absolute value of documents created.") - /** + /** * Absolute value of documents created. - * * @return absoluteValueDocumentsCreated Double - */ + **/ public Double getAbsoluteValueDocumentsCreated() { return absoluteValueDocumentsCreated; } - /** - * Absolute value of documents created. - * - * @param absoluteValueDocumentsCreated Double - */ + /** + * Absolute value of documents created. + * @param absoluteValueDocumentsCreated Double + **/ + public void setAbsoluteValueDocumentsCreated(Double absoluteValueDocumentsCreated) { this.absoluteValueDocumentsCreated = absoluteValueDocumentsCreated; } /** - * attachedPractices - * - * @param attachedPractices List<PracticeResponse> - * @return UserResponse - */ + * attachedPractices + * @param attachedPractices List<PracticeResponse> + * @return UserResponse + **/ public UserResponse attachedPractices(List attachedPractices) { this.attachedPractices = attachedPractices; return this; @@ -422,10 +410,9 @@ public UserResponse attachedPractices(List attachedPractices) /** * attachedPractices - * - * @param attachedPracticesItem PracticeResponse + * @param attachedPracticesItem PracticeResponse * @return UserResponse - */ + **/ public UserResponse addAttachedPracticesItem(PracticeResponse attachedPracticesItem) { if (this.attachedPractices == null) { this.attachedPractices = new ArrayList(); @@ -434,36 +421,33 @@ public UserResponse addAttachedPracticesItem(PracticeResponse attachedPracticesI return this; } - /** + /** * Get attachedPractices - * * @return attachedPractices - */ + **/ @ApiModelProperty(value = "") - /** + /** * attachedPractices - * * @return attachedPractices List - */ + **/ public List getAttachedPractices() { return attachedPractices; } - /** - * attachedPractices - * - * @param attachedPractices List<PracticeResponse> - */ + /** + * attachedPractices + * @param attachedPractices List<PracticeResponse> + **/ + public void setAttachedPractices(List attachedPractices) { this.attachedPractices = attachedPractices; } /** - * historyRecords - * - * @param historyRecords List<HistoryRecordResponse> - * @return UserResponse - */ + * historyRecords + * @param historyRecords List<HistoryRecordResponse> + * @return UserResponse + **/ public UserResponse historyRecords(List historyRecords) { this.historyRecords = historyRecords; return this; @@ -471,10 +455,9 @@ public UserResponse historyRecords(List historyRecords) { /** * historyRecords - * - * @param historyRecordsItem HistoryRecordResponse + * @param historyRecordsItem HistoryRecordResponse * @return UserResponse - */ + **/ public UserResponse addHistoryRecordsItem(HistoryRecordResponse historyRecordsItem) { if (this.historyRecords == null) { this.historyRecords = new ArrayList(); @@ -483,30 +466,29 @@ public UserResponse addHistoryRecordsItem(HistoryRecordResponse historyRecordsIt return this; } - /** + /** * Get historyRecords - * * @return historyRecords - */ + **/ @ApiModelProperty(value = "") - /** + /** * historyRecords - * * @return historyRecords List - */ + **/ public List getHistoryRecords() { return historyRecords; } - /** - * historyRecords - * - * @param historyRecords List<HistoryRecordResponse> - */ + /** + * historyRecords + * @param historyRecords List<HistoryRecordResponse> + **/ + public void setHistoryRecords(List historyRecords) { this.historyRecords = historyRecords; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -516,38 +498,26 @@ public boolean equals(java.lang.Object o) { return false; } UserResponse userResponse = (UserResponse) o; - return Objects.equals(this.userId, userResponse.userId) - && Objects.equals(this.userCreatedDateUtc, userResponse.userCreatedDateUtc) - && Objects.equals(this.lastLoginDateUtc, userResponse.lastLoginDateUtc) - && Objects.equals(this.isExternalPartner, userResponse.isExternalPartner) - && Objects.equals(this.hasAccountantRole, userResponse.hasAccountantRole) - && Objects.equals(this.monthPeriod, userResponse.monthPeriod) - && Objects.equals(this.numberOfLogins, userResponse.numberOfLogins) - && Objects.equals(this.numberOfDocumentsCreated, userResponse.numberOfDocumentsCreated) - && Objects.equals(this.netValueDocumentsCreated, userResponse.netValueDocumentsCreated) - && Objects.equals( - this.absoluteValueDocumentsCreated, userResponse.absoluteValueDocumentsCreated) - && Objects.equals(this.attachedPractices, userResponse.attachedPractices) - && Objects.equals(this.historyRecords, userResponse.historyRecords); + return Objects.equals(this.userId, userResponse.userId) && + Objects.equals(this.userCreatedDateUtc, userResponse.userCreatedDateUtc) && + Objects.equals(this.lastLoginDateUtc, userResponse.lastLoginDateUtc) && + Objects.equals(this.isExternalPartner, userResponse.isExternalPartner) && + Objects.equals(this.hasAccountantRole, userResponse.hasAccountantRole) && + Objects.equals(this.monthPeriod, userResponse.monthPeriod) && + Objects.equals(this.numberOfLogins, userResponse.numberOfLogins) && + Objects.equals(this.numberOfDocumentsCreated, userResponse.numberOfDocumentsCreated) && + Objects.equals(this.netValueDocumentsCreated, userResponse.netValueDocumentsCreated) && + Objects.equals(this.absoluteValueDocumentsCreated, userResponse.absoluteValueDocumentsCreated) && + Objects.equals(this.attachedPractices, userResponse.attachedPractices) && + Objects.equals(this.historyRecords, userResponse.historyRecords); } @Override public int hashCode() { - return Objects.hash( - userId, - userCreatedDateUtc, - lastLoginDateUtc, - isExternalPartner, - hasAccountantRole, - monthPeriod, - numberOfLogins, - numberOfDocumentsCreated, - netValueDocumentsCreated, - absoluteValueDocumentsCreated, - attachedPractices, - historyRecords); + return Objects.hash(userId, userCreatedDateUtc, lastLoginDateUtc, isExternalPartner, hasAccountantRole, monthPeriod, numberOfLogins, numberOfDocumentsCreated, netValueDocumentsCreated, absoluteValueDocumentsCreated, attachedPractices, historyRecords); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -559,15 +529,9 @@ public String toString() { sb.append(" hasAccountantRole: ").append(toIndentedString(hasAccountantRole)).append("\n"); sb.append(" monthPeriod: ").append(toIndentedString(monthPeriod)).append("\n"); sb.append(" numberOfLogins: ").append(toIndentedString(numberOfLogins)).append("\n"); - sb.append(" numberOfDocumentsCreated: ") - .append(toIndentedString(numberOfDocumentsCreated)) - .append("\n"); - sb.append(" netValueDocumentsCreated: ") - .append(toIndentedString(netValueDocumentsCreated)) - .append("\n"); - sb.append(" absoluteValueDocumentsCreated: ") - .append(toIndentedString(absoluteValueDocumentsCreated)) - .append("\n"); + sb.append(" numberOfDocumentsCreated: ").append(toIndentedString(numberOfDocumentsCreated)).append("\n"); + sb.append(" netValueDocumentsCreated: ").append(toIndentedString(netValueDocumentsCreated)).append("\n"); + sb.append(" absoluteValueDocumentsCreated: ").append(toIndentedString(absoluteValueDocumentsCreated)).append("\n"); sb.append(" attachedPractices: ").append(toIndentedString(attachedPractices)).append("\n"); sb.append(" historyRecords: ").append(toIndentedString(historyRecords)).append("\n"); sb.append("}"); @@ -575,7 +539,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -583,4 +548,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/identity/AccessToken.java b/src/main/java/com/xero/models/identity/AccessToken.java index 6e481690b..935e1fbb5 100644 --- a/src/main/java/com/xero/models/identity/AccessToken.java +++ b/src/main/java/com/xero/models/identity/AccessToken.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.identity; +package com.xero.models.identity; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * AccessToken + */ -/** AccessToken */ public class AccessToken { StringUtil util = new StringUtil(); @@ -35,180 +52,166 @@ public class AccessToken { @JsonProperty("refresh_token") private String refreshToken; /** - * Xero unique identifier - * - * @param idToken String - * @return AccessToken - */ + * Xero unique identifier + * @param idToken String + * @return AccessToken + **/ public AccessToken idToken(String idToken) { this.idToken = idToken; return this; } - /** + /** * Xero unique identifier - * * @return idToken - */ + **/ @ApiModelProperty(value = "Xero unique identifier") - /** + /** * Xero unique identifier - * * @return idToken String - */ + **/ public String getIdToken() { return idToken; } - /** - * Xero unique identifier - * - * @param idToken String - */ + /** + * Xero unique identifier + * @param idToken String + **/ + public void setIdToken(String idToken) { this.idToken = idToken; } /** - * access token provided during authentication flow - * - * @param accessToken String - * @return AccessToken - */ + * access token provided during authentication flow + * @param accessToken String + * @return AccessToken + **/ public AccessToken accessToken(String accessToken) { this.accessToken = accessToken; return this; } - /** + /** * access token provided during authentication flow - * * @return accessToken - */ + **/ @ApiModelProperty(value = "access token provided during authentication flow") - /** + /** * access token provided during authentication flow - * * @return accessToken String - */ + **/ public String getAccessToken() { return accessToken; } - /** - * access token provided during authentication flow - * - * @param accessToken String - */ + /** + * access token provided during authentication flow + * @param accessToken String + **/ + public void setAccessToken(String accessToken) { this.accessToken = accessToken; } /** - * time in seconds until access token expires. - * - * @param expiresIn Long - * @return AccessToken - */ + * time in seconds until access token expires. + * @param expiresIn Long + * @return AccessToken + **/ public AccessToken expiresIn(Long expiresIn) { this.expiresIn = expiresIn; return this; } - /** + /** * time in seconds until access token expires. - * * @return expiresIn - */ + **/ @ApiModelProperty(value = "time in seconds until access token expires.") - /** + /** * time in seconds until access token expires. - * * @return expiresIn Long - */ + **/ public Long getExpiresIn() { return expiresIn; } - /** - * time in seconds until access token expires. - * - * @param expiresIn Long - */ + /** + * time in seconds until access token expires. + * @param expiresIn Long + **/ + public void setExpiresIn(Long expiresIn) { this.expiresIn = expiresIn; } /** - * type of token i.e. Bearer - * - * @param tokenType String - * @return AccessToken - */ + * type of token i.e. Bearer + * @param tokenType String + * @return AccessToken + **/ public AccessToken tokenType(String tokenType) { this.tokenType = tokenType; return this; } - /** + /** * type of token i.e. Bearer - * * @return tokenType - */ + **/ @ApiModelProperty(value = "type of token i.e. Bearer") - /** + /** * type of token i.e. Bearer - * * @return tokenType String - */ + **/ public String getTokenType() { return tokenType; } - /** - * type of token i.e. Bearer - * - * @param tokenType String - */ + /** + * type of token i.e. Bearer + * @param tokenType String + **/ + public void setTokenType(String tokenType) { this.tokenType = tokenType; } /** - * token used to refresh an expired access token - * - * @param refreshToken String - * @return AccessToken - */ + * token used to refresh an expired access token + * @param refreshToken String + * @return AccessToken + **/ public AccessToken refreshToken(String refreshToken) { this.refreshToken = refreshToken; return this; } - /** + /** * token used to refresh an expired access token - * * @return refreshToken - */ + **/ @ApiModelProperty(value = "token used to refresh an expired access token") - /** + /** * token used to refresh an expired access token - * * @return refreshToken String - */ + **/ public String getRefreshToken() { return refreshToken; } - /** - * token used to refresh an expired access token - * - * @param refreshToken String - */ + /** + * token used to refresh an expired access token + * @param refreshToken String + **/ + public void setRefreshToken(String refreshToken) { this.refreshToken = refreshToken; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -218,11 +221,11 @@ public boolean equals(java.lang.Object o) { return false; } AccessToken accessToken = (AccessToken) o; - return Objects.equals(this.idToken, accessToken.idToken) - && Objects.equals(this.accessToken, accessToken.accessToken) - && Objects.equals(this.expiresIn, accessToken.expiresIn) - && Objects.equals(this.tokenType, accessToken.tokenType) - && Objects.equals(this.refreshToken, accessToken.refreshToken); + return Objects.equals(this.idToken, accessToken.idToken) && + Objects.equals(this.accessToken, accessToken.accessToken) && + Objects.equals(this.expiresIn, accessToken.expiresIn) && + Objects.equals(this.tokenType, accessToken.tokenType) && + Objects.equals(this.refreshToken, accessToken.refreshToken); } @Override @@ -230,6 +233,7 @@ public int hashCode() { return Objects.hash(idToken, accessToken, expiresIn, tokenType, refreshToken); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -244,7 +248,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -252,4 +257,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/identity/Connection.java b/src/main/java/com/xero/models/identity/Connection.java index ff54be292..28bfaf515 100644 --- a/src/main/java/com/xero/models/identity/Connection.java +++ b/src/main/java/com/xero/models/identity/Connection.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.identity; +package com.xero.models.identity; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Connection + */ -/** Connection */ public class Connection { StringUtil util = new StringUtil(); @@ -43,258 +60,230 @@ public class Connection { @JsonProperty("updatedDateUtc") private LocalDateTime updatedDateUtc; /** - * Xero identifier - * - * @param id UUID - * @return Connection - */ + * Xero identifier + * @param id UUID + * @return Connection + **/ public Connection id(UUID id) { this.id = id; return this; } - /** + /** * Xero identifier - * * @return id - */ + **/ @ApiModelProperty(value = "Xero identifier") - /** + /** * Xero identifier - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * Xero identifier - * - * @param id UUID - */ + /** + * Xero identifier + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Xero identifier of organisation - * - * @param tenantId UUID - * @return Connection - */ + * Xero identifier of organisation + * @param tenantId UUID + * @return Connection + **/ public Connection tenantId(UUID tenantId) { this.tenantId = tenantId; return this; } - /** + /** * Xero identifier of organisation - * * @return tenantId - */ + **/ @ApiModelProperty(value = "Xero identifier of organisation") - /** + /** * Xero identifier of organisation - * * @return tenantId UUID - */ + **/ public UUID getTenantId() { return tenantId; } - /** - * Xero identifier of organisation - * - * @param tenantId UUID - */ + /** + * Xero identifier of organisation + * @param tenantId UUID + **/ + public void setTenantId(UUID tenantId) { this.tenantId = tenantId; } /** - * Identifier shared across connections authorised at the same time - * - * @param authEventId UUID - * @return Connection - */ + * Identifier shared across connections authorised at the same time + * @param authEventId UUID + * @return Connection + **/ public Connection authEventId(UUID authEventId) { this.authEventId = authEventId; return this; } - /** + /** * Identifier shared across connections authorised at the same time - * * @return authEventId - */ + **/ @ApiModelProperty(value = "Identifier shared across connections authorised at the same time") - /** + /** * Identifier shared across connections authorised at the same time - * * @return authEventId UUID - */ + **/ public UUID getAuthEventId() { return authEventId; } - /** - * Identifier shared across connections authorised at the same time - * - * @param authEventId UUID - */ + /** + * Identifier shared across connections authorised at the same time + * @param authEventId UUID + **/ + public void setAuthEventId(UUID authEventId) { this.authEventId = authEventId; } /** - * Xero tenant type (i.e. ORGANISATION, PRACTICE) - * - * @param tenantType String - * @return Connection - */ + * Xero tenant type (i.e. ORGANISATION, PRACTICE) + * @param tenantType String + * @return Connection + **/ public Connection tenantType(String tenantType) { this.tenantType = tenantType; return this; } - /** + /** * Xero tenant type (i.e. ORGANISATION, PRACTICE) - * * @return tenantType - */ + **/ @ApiModelProperty(value = "Xero tenant type (i.e. ORGANISATION, PRACTICE)") - /** + /** * Xero tenant type (i.e. ORGANISATION, PRACTICE) - * * @return tenantType String - */ + **/ public String getTenantType() { return tenantType; } - /** - * Xero tenant type (i.e. ORGANISATION, PRACTICE) - * - * @param tenantType String - */ + /** + * Xero tenant type (i.e. ORGANISATION, PRACTICE) + * @param tenantType String + **/ + public void setTenantType(String tenantType) { this.tenantType = tenantType; } /** - * Xero tenant name - * - * @param tenantName String - * @return Connection - */ + * Xero tenant name + * @param tenantName String + * @return Connection + **/ public Connection tenantName(String tenantName) { this.tenantName = tenantName; return this; } - /** + /** * Xero tenant name - * * @return tenantName - */ + **/ @ApiModelProperty(value = "Xero tenant name") - /** + /** * Xero tenant name - * * @return tenantName String - */ + **/ public String getTenantName() { return tenantName; } - /** - * Xero tenant name - * - * @param tenantName String - */ + /** + * Xero tenant name + * @param tenantName String + **/ + public void setTenantName(String tenantName) { this.tenantName = tenantName; } /** - * The date when the user connected this tenant to your app - * - * @param createdDateUtc LocalDateTime - * @return Connection - */ + * The date when the user connected this tenant to your app + * @param createdDateUtc LocalDateTime + * @return Connection + **/ public Connection createdDateUtc(LocalDateTime createdDateUtc) { this.createdDateUtc = createdDateUtc; return this; } - /** + /** * The date when the user connected this tenant to your app - * * @return createdDateUtc - */ + **/ @ApiModelProperty(value = "The date when the user connected this tenant to your app") - /** + /** * The date when the user connected this tenant to your app - * * @return createdDateUtc LocalDateTime - */ + **/ public LocalDateTime getCreatedDateUtc() { return createdDateUtc; } - /** - * The date when the user connected this tenant to your app - * - * @param createdDateUtc LocalDateTime - */ + /** + * The date when the user connected this tenant to your app + * @param createdDateUtc LocalDateTime + **/ + public void setCreatedDateUtc(LocalDateTime createdDateUtc) { this.createdDateUtc = createdDateUtc; } /** - * The date when the user most recently connected this tenant to your app. May differ to the - * created date if the user has disconnected and subsequently reconnected this tenant to your app. - * - * @param updatedDateUtc LocalDateTime - * @return Connection - */ + * The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. + * @param updatedDateUtc LocalDateTime + * @return Connection + **/ public Connection updatedDateUtc(LocalDateTime updatedDateUtc) { this.updatedDateUtc = updatedDateUtc; return this; } - /** - * The date when the user most recently connected this tenant to your app. May differ to the - * created date if the user has disconnected and subsequently reconnected this tenant to your app. - * + /** + * The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. * @return updatedDateUtc - */ - @ApiModelProperty( - value = - "The date when the user most recently connected this tenant to your app. May differ to" - + " the created date if the user has disconnected and subsequently reconnected this" - + " tenant to your app.") - /** - * The date when the user most recently connected this tenant to your app. May differ to the - * created date if the user has disconnected and subsequently reconnected this tenant to your app. - * + **/ + @ApiModelProperty(value = "The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app.") + /** + * The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. * @return updatedDateUtc LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUtc() { return updatedDateUtc; } - /** - * The date when the user most recently connected this tenant to your app. May differ to the - * created date if the user has disconnected and subsequently reconnected this tenant to your app. - * - * @param updatedDateUtc LocalDateTime - */ + /** + * The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. + * @param updatedDateUtc LocalDateTime + **/ + public void setUpdatedDateUtc(LocalDateTime updatedDateUtc) { this.updatedDateUtc = updatedDateUtc; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -304,21 +293,21 @@ public boolean equals(java.lang.Object o) { return false; } Connection connection = (Connection) o; - return Objects.equals(this.id, connection.id) - && Objects.equals(this.tenantId, connection.tenantId) - && Objects.equals(this.authEventId, connection.authEventId) - && Objects.equals(this.tenantType, connection.tenantType) - && Objects.equals(this.tenantName, connection.tenantName) - && Objects.equals(this.createdDateUtc, connection.createdDateUtc) - && Objects.equals(this.updatedDateUtc, connection.updatedDateUtc); + return Objects.equals(this.id, connection.id) && + Objects.equals(this.tenantId, connection.tenantId) && + Objects.equals(this.authEventId, connection.authEventId) && + Objects.equals(this.tenantType, connection.tenantType) && + Objects.equals(this.tenantName, connection.tenantName) && + Objects.equals(this.createdDateUtc, connection.createdDateUtc) && + Objects.equals(this.updatedDateUtc, connection.updatedDateUtc); } @Override public int hashCode() { - return Objects.hash( - id, tenantId, authEventId, tenantType, tenantName, createdDateUtc, updatedDateUtc); + return Objects.hash(id, tenantId, authEventId, tenantType, tenantName, createdDateUtc, updatedDateUtc); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -335,7 +324,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -343,4 +333,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/identity/RefreshToken.java b/src/main/java/com/xero/models/identity/RefreshToken.java index 7ba9e2117..2b3328150 100644 --- a/src/main/java/com/xero/models/identity/RefreshToken.java +++ b/src/main/java/com/xero/models/identity/RefreshToken.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.identity; +package com.xero.models.identity; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * RefreshToken + */ -/** RefreshToken */ public class RefreshToken { StringUtil util = new StringUtil(); @@ -32,145 +49,134 @@ public class RefreshToken { @JsonProperty("client_secret") private String clientSecret; /** - * Xero grant type - * - * @param grantType String - * @return RefreshToken - */ + * Xero grant type + * @param grantType String + * @return RefreshToken + **/ public RefreshToken grantType(String grantType) { this.grantType = grantType; return this; } - /** + /** * Xero grant type - * * @return grantType - */ + **/ @ApiModelProperty(value = "Xero grant type") - /** + /** * Xero grant type - * * @return grantType String - */ + **/ public String getGrantType() { return grantType; } - /** - * Xero grant type - * - * @param grantType String - */ + /** + * Xero grant type + * @param grantType String + **/ + public void setGrantType(String grantType) { this.grantType = grantType; } /** - * refresh token provided during authentication flow - * - * @param refreshToken String - * @return RefreshToken - */ + * refresh token provided during authentication flow + * @param refreshToken String + * @return RefreshToken + **/ public RefreshToken refreshToken(String refreshToken) { this.refreshToken = refreshToken; return this; } - /** + /** * refresh token provided during authentication flow - * * @return refreshToken - */ + **/ @ApiModelProperty(value = "refresh token provided during authentication flow") - /** + /** * refresh token provided during authentication flow - * * @return refreshToken String - */ + **/ public String getRefreshToken() { return refreshToken; } - /** - * refresh token provided during authentication flow - * - * @param refreshToken String - */ + /** + * refresh token provided during authentication flow + * @param refreshToken String + **/ + public void setRefreshToken(String refreshToken) { this.refreshToken = refreshToken; } /** - * client id for Xero app - * - * @param clientId String - * @return RefreshToken - */ + * client id for Xero app + * @param clientId String + * @return RefreshToken + **/ public RefreshToken clientId(String clientId) { this.clientId = clientId; return this; } - /** + /** * client id for Xero app - * * @return clientId - */ + **/ @ApiModelProperty(value = "client id for Xero app") - /** + /** * client id for Xero app - * * @return clientId String - */ + **/ public String getClientId() { return clientId; } - /** - * client id for Xero app - * - * @param clientId String - */ + /** + * client id for Xero app + * @param clientId String + **/ + public void setClientId(String clientId) { this.clientId = clientId; } /** - * client secret for Xero app 2 - * - * @param clientSecret String - * @return RefreshToken - */ + * client secret for Xero app 2 + * @param clientSecret String + * @return RefreshToken + **/ public RefreshToken clientSecret(String clientSecret) { this.clientSecret = clientSecret; return this; } - /** + /** * client secret for Xero app 2 - * * @return clientSecret - */ + **/ @ApiModelProperty(value = "client secret for Xero app 2") - /** + /** * client secret for Xero app 2 - * * @return clientSecret String - */ + **/ public String getClientSecret() { return clientSecret; } - /** - * client secret for Xero app 2 - * - * @param clientSecret String - */ + /** + * client secret for Xero app 2 + * @param clientSecret String + **/ + public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } RefreshToken refreshToken = (RefreshToken) o; - return Objects.equals(this.grantType, refreshToken.grantType) - && Objects.equals(this.refreshToken, refreshToken.refreshToken) - && Objects.equals(this.clientId, refreshToken.clientId) - && Objects.equals(this.clientSecret, refreshToken.clientSecret); + return Objects.equals(this.grantType, refreshToken.grantType) && + Objects.equals(this.refreshToken, refreshToken.refreshToken) && + Objects.equals(this.clientId, refreshToken.clientId) && + Objects.equals(this.clientSecret, refreshToken.clientSecret); } @Override @@ -191,6 +197,7 @@ public int hashCode() { return Objects.hash(grantType, refreshToken, clientId, clientSecret); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -212,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/Account.java b/src/main/java/com/xero/models/payrollau/Account.java index cde60867f..d8f861d13 100644 --- a/src/main/java/com/xero/models/payrollau/Account.java +++ b/src/main/java/com/xero/models/payrollau/Account.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.AccountType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Account + */ -/** Account */ public class Account { StringUtil util = new StringUtil(); @@ -33,147 +51,134 @@ public class Account { @JsonProperty("Name") private String name; /** - * Xero identifier for accounts - * - * @param accountID UUID - * @return Account - */ + * Xero identifier for accounts + * @param accountID UUID + * @return Account + **/ public Account accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * Xero identifier for accounts - * * @return accountID - */ - @ApiModelProperty( - example = "c56b19ef-75bf-45e8-98a4-e699a96609f7", - value = "Xero identifier for accounts") - /** + **/ + @ApiModelProperty(example = "c56b19ef-75bf-45e8-98a4-e699a96609f7", value = "Xero identifier for accounts") + /** * Xero identifier for accounts - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * Xero identifier for accounts - * - * @param accountID UUID - */ + /** + * Xero identifier for accounts + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * type - * - * @param type AccountType - * @return Account - */ + * type + * @param type AccountType + * @return Account + **/ public Account type(AccountType type) { this.type = type; return this; } - /** + /** * Get type - * * @return type - */ + **/ @ApiModelProperty(value = "") - /** + /** * type - * * @return type AccountType - */ + **/ public AccountType getType() { return type; } - /** - * type - * - * @param type AccountType - */ + /** + * type + * @param type AccountType + **/ + public void setType(AccountType type) { this.type = type; } /** - * Customer defined account code - * - * @param code String - * @return Account - */ + * Customer defined account code + * @param code String + * @return Account + **/ public Account code(String code) { this.code = code; return this; } - /** + /** * Customer defined account code - * * @return code - */ + **/ @ApiModelProperty(example = "420", value = "Customer defined account code") - /** + /** * Customer defined account code - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * Customer defined account code - * - * @param code String - */ + /** + * Customer defined account code + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Name of account - * - * @param name String - * @return Account - */ + * Name of account + * @param name String + * @return Account + **/ public Account name(String name) { this.name = name; return this; } - /** + /** * Name of account - * * @return name - */ + **/ @ApiModelProperty(example = "General expenses", value = "Name of account") - /** + /** * Name of account - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of account - * - * @param name String - */ + /** + * Name of account + * @param name String + **/ + public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -183,10 +188,10 @@ public boolean equals(java.lang.Object o) { return false; } Account account = (Account) o; - return Objects.equals(this.accountID, account.accountID) - && Objects.equals(this.type, account.type) - && Objects.equals(this.code, account.code) - && Objects.equals(this.name, account.name); + return Objects.equals(this.accountID, account.accountID) && + Objects.equals(this.type, account.type) && + Objects.equals(this.code, account.code) && + Objects.equals(this.name, account.name); } @Override @@ -194,6 +199,7 @@ public int hashCode() { return Objects.hash(accountID, type, code, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -207,7 +213,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -215,4 +222,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/AccountType.java b/src/main/java/com/xero/models/payrollau/AccountType.java index 63600280c..1d2c8dd53 100644 --- a/src/main/java/com/xero/models/payrollau/AccountType.java +++ b/src/main/java/com/xero/models/payrollau/AccountType.java @@ -9,82 +9,140 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** See Account Types */ +/** + * See Account Types + */ public enum AccountType { - - /** BANK */ + + /** + * BANK + */ BANK("BANK"), - - /** CURRENT */ + + /** + * CURRENT + */ CURRENT("CURRENT"), - - /** CURRLIAB */ + + /** + * CURRLIAB + */ CURRLIAB("CURRLIAB"), - - /** DEPRECIATN */ + + /** + * DEPRECIATN + */ DEPRECIATN("DEPRECIATN"), - - /** DIRECTCOSTS */ + + /** + * DIRECTCOSTS + */ DIRECTCOSTS("DIRECTCOSTS"), - - /** EQUITY */ + + /** + * EQUITY + */ EQUITY("EQUITY"), - - /** EXPENSE */ + + /** + * EXPENSE + */ EXPENSE("EXPENSE"), - - /** FIXED */ + + /** + * FIXED + */ FIXED("FIXED"), - - /** INVENTORY */ + + /** + * INVENTORY + */ INVENTORY("INVENTORY"), - - /** LIABILITY */ + + /** + * LIABILITY + */ LIABILITY("LIABILITY"), - - /** NONCURRENT */ + + /** + * NONCURRENT + */ NONCURRENT("NONCURRENT"), - - /** OTHERINCOME */ + + /** + * OTHERINCOME + */ OTHERINCOME("OTHERINCOME"), - - /** OVERHEADS */ + + /** + * OVERHEADS + */ OVERHEADS("OVERHEADS"), - - /** PREPAYMENT */ + + /** + * PREPAYMENT + */ PREPAYMENT("PREPAYMENT"), - - /** REVENUE */ + + /** + * REVENUE + */ REVENUE("REVENUE"), - - /** SALES */ + + /** + * SALES + */ SALES("SALES"), - - /** TERMLIAB */ + + /** + * TERMLIAB + */ TERMLIAB("TERMLIAB"), - - /** PAYGLIABILITY */ + + /** + * PAYGLIABILITY + */ PAYGLIABILITY("PAYGLIABILITY"), - - /** PAYG */ + + /** + * PAYG + */ PAYG("PAYG"), - - /** SUPERANNUATIONEXPENSE */ + + /** + * SUPERANNUATIONEXPENSE + */ SUPERANNUATIONEXPENSE("SUPERANNUATIONEXPENSE"), - - /** SUPERANNUATIONLIABILITY */ + + /** + * SUPERANNUATIONLIABILITY + */ SUPERANNUATIONLIABILITY("SUPERANNUATIONLIABILITY"), - - /** WAGESEXPENSE */ + + /** + * WAGESEXPENSE + */ WAGESEXPENSE("WAGESEXPENSE"), - - /** WAGESPAYABLELIABILITY */ + + /** + * WAGESPAYABLELIABILITY + */ WAGESPAYABLELIABILITY("WAGESPAYABLELIABILITY"); private String value; @@ -93,26 +151,24 @@ public enum AccountType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static AccountType fromValue(String value) { @@ -124,3 +180,4 @@ public static AccountType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/AllowanceCategory.java b/src/main/java/com/xero/models/payrollau/AllowanceCategory.java index bf999ffcd..c1174116c 100644 --- a/src/main/java/com/xero/models/payrollau/AllowanceCategory.java +++ b/src/main/java/com/xero/models/payrollau/AllowanceCategory.java @@ -9,34 +9,59 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets AllowanceCategory */ +/** + * Gets or Sets AllowanceCategory + */ public enum AllowanceCategory { - - /** NONDEDUCTIBLE */ + + /** + * NONDEDUCTIBLE + */ NONDEDUCTIBLE("NONDEDUCTIBLE"), - - /** UNIFORM */ + + /** + * UNIFORM + */ UNIFORM("UNIFORM"), - - /** PRIVATEVEHICLE */ + + /** + * PRIVATEVEHICLE + */ PRIVATEVEHICLE("PRIVATEVEHICLE"), - - /** HOMEOFFICE */ + + /** + * HOMEOFFICE + */ HOMEOFFICE("HOMEOFFICE"), - - /** TRANSPORT */ + + /** + * TRANSPORT + */ TRANSPORT("TRANSPORT"), - - /** GENERAL */ + + /** + * GENERAL + */ GENERAL("GENERAL"), - - /** OTHER */ + + /** + * OTHER + */ OTHER("OTHER"); private String value; @@ -45,26 +70,24 @@ public enum AllowanceCategory { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static AllowanceCategory fromValue(String value) { @@ -76,3 +99,4 @@ public static AllowanceCategory fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/AllowanceType.java b/src/main/java/com/xero/models/payrollau/AllowanceType.java index 47589379c..341e65e31 100644 --- a/src/main/java/com/xero/models/payrollau/AllowanceType.java +++ b/src/main/java/com/xero/models/payrollau/AllowanceType.java @@ -9,40 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets AllowanceType */ +/** + * Gets or Sets AllowanceType + */ public enum AllowanceType { - - /** CAR */ + + /** + * CAR + */ CAR("CAR"), - - /** TRANSPORT */ + + /** + * TRANSPORT + */ TRANSPORT("TRANSPORT"), - - /** LAUNDRY */ + + /** + * LAUNDRY + */ LAUNDRY("LAUNDRY"), - - /** MEALS */ + + /** + * MEALS + */ MEALS("MEALS"), - - /** TRAVEL */ + + /** + * TRAVEL + */ TRAVEL("TRAVEL"), - - /** OTHER */ + + /** + * OTHER + */ OTHER("OTHER"), - - /** TOOLS */ + + /** + * TOOLS + */ TOOLS("TOOLS"), - - /** TASKS */ + + /** + * TASKS + */ TASKS("TASKS"), - - /** QUALIFICATIONS */ + + /** + * QUALIFICATIONS + */ QUALIFICATIONS("QUALIFICATIONS"); private String value; @@ -51,26 +80,24 @@ public enum AllowanceType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static AllowanceType fromValue(String value) { @@ -82,3 +109,4 @@ public static AllowanceType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/BankAccount.java b/src/main/java/com/xero/models/payrollau/BankAccount.java index b9f393000..f34c230df 100644 --- a/src/main/java/com/xero/models/payrollau/BankAccount.java +++ b/src/main/java/com/xero/models/payrollau/BankAccount.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankAccount + */ -/** BankAccount */ public class BankAccount { StringUtil util = new StringUtil(); @@ -38,226 +55,198 @@ public class BankAccount { @JsonProperty("Amount") private Double amount; /** - * The text that will appear on your employee's bank statement when they receive payment - * - * @param statementText String - * @return BankAccount - */ + * The text that will appear on your employee's bank statement when they receive payment + * @param statementText String + * @return BankAccount + **/ public BankAccount statementText(String statementText) { this.statementText = statementText; return this; } - /** + /** * The text that will appear on your employee's bank statement when they receive payment - * * @return statementText - */ - @ApiModelProperty( - example = "Salary", - value = - "The text that will appear on your employee's bank statement when they receive payment") - /** + **/ + @ApiModelProperty(example = "Salary", value = "The text that will appear on your employee's bank statement when they receive payment") + /** * The text that will appear on your employee's bank statement when they receive payment - * * @return statementText String - */ + **/ public String getStatementText() { return statementText; } - /** - * The text that will appear on your employee's bank statement when they receive payment - * - * @param statementText String - */ + /** + * The text that will appear on your employee's bank statement when they receive payment + * @param statementText String + **/ + public void setStatementText(String statementText) { this.statementText = statementText; } /** - * The name of the account - * - * @param accountName String - * @return BankAccount - */ + * The name of the account + * @param accountName String + * @return BankAccount + **/ public BankAccount accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * The name of the account - * * @return accountName - */ + **/ @ApiModelProperty(example = "James Lebron Savings", value = "The name of the account") - /** + /** * The name of the account - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * The name of the account - * - * @param accountName String - */ + /** + * The name of the account + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * The BSB number of the account - * - * @param BSB String - * @return BankAccount - */ + * The BSB number of the account + * @param BSB String + * @return BankAccount + **/ public BankAccount BSB(String BSB) { this.BSB = BSB; return this; } - /** + /** * The BSB number of the account - * * @return BSB - */ + **/ @ApiModelProperty(example = "122344", value = "The BSB number of the account") - /** + /** * The BSB number of the account - * * @return BSB String - */ + **/ public String getBSB() { return BSB; } - /** - * The BSB number of the account - * - * @param BSB String - */ + /** + * The BSB number of the account + * @param BSB String + **/ + public void setBSB(String BSB) { this.BSB = BSB; } /** - * The account number - * - * @param accountNumber String - * @return BankAccount - */ + * The account number + * @param accountNumber String + * @return BankAccount + **/ public BankAccount accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** + /** * The account number - * * @return accountNumber - */ + **/ @ApiModelProperty(example = "345678", value = "The account number") - /** + /** * The account number - * * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * The account number - * - * @param accountNumber String - */ + /** + * The account number + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * If this account is the Remaining bank account - * - * @param remainder Boolean - * @return BankAccount - */ + * If this account is the Remaining bank account + * @param remainder Boolean + * @return BankAccount + **/ public BankAccount remainder(Boolean remainder) { this.remainder = remainder; return this; } - /** + /** * If this account is the Remaining bank account - * * @return remainder - */ + **/ @ApiModelProperty(example = "false", value = "If this account is the Remaining bank account") - /** + /** * If this account is the Remaining bank account - * * @return remainder Boolean - */ + **/ public Boolean getRemainder() { return remainder; } - /** - * If this account is the Remaining bank account - * - * @param remainder Boolean - */ + /** + * If this account is the Remaining bank account + * @param remainder Boolean + **/ + public void setRemainder(Boolean remainder) { this.remainder = remainder; } /** - * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to - * one account, and the remaining amount to another) - * - * @param amount Double - * @return BankAccount - */ + * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) + * @param amount Double + * @return BankAccount + **/ public BankAccount amount(Double amount) { this.amount = amount; return this; } - /** - * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to - * one account, and the remaining amount to another) - * + /** + * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) * @return amount - */ - @ApiModelProperty( - example = "200.0", - value = - "Fixed amounts (for example, if an employee wants to have $100 of their salary" - + " transferred to one account, and the remaining amount to another)") - /** - * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to - * one account, and the remaining amount to another) - * + **/ + @ApiModelProperty(example = "200.0", value = "Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another)") + /** + * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to - * one account, and the remaining amount to another) - * - * @param amount Double - */ + /** + * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -267,12 +256,12 @@ public boolean equals(java.lang.Object o) { return false; } BankAccount bankAccount = (BankAccount) o; - return Objects.equals(this.statementText, bankAccount.statementText) - && Objects.equals(this.accountName, bankAccount.accountName) - && Objects.equals(this.BSB, bankAccount.BSB) - && Objects.equals(this.accountNumber, bankAccount.accountNumber) - && Objects.equals(this.remainder, bankAccount.remainder) - && Objects.equals(this.amount, bankAccount.amount); + return Objects.equals(this.statementText, bankAccount.statementText) && + Objects.equals(this.accountName, bankAccount.accountName) && + Objects.equals(this.BSB, bankAccount.BSB) && + Objects.equals(this.accountNumber, bankAccount.accountNumber) && + Objects.equals(this.remainder, bankAccount.remainder) && + Objects.equals(this.amount, bankAccount.amount); } @Override @@ -280,6 +269,7 @@ public int hashCode() { return Objects.hash(statementText, accountName, BSB, accountNumber, remainder, amount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -295,7 +285,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -303,4 +294,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/CalendarType.java b/src/main/java/com/xero/models/payrollau/CalendarType.java index e0239f329..46b99a78d 100644 --- a/src/main/java/com/xero/models/payrollau/CalendarType.java +++ b/src/main/java/com/xero/models/payrollau/CalendarType.java @@ -9,31 +9,54 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets CalendarType */ +/** + * Gets or Sets CalendarType + */ public enum CalendarType { - - /** WEEKLY */ + + /** + * WEEKLY + */ WEEKLY("WEEKLY"), - - /** FORTNIGHTLY */ + + /** + * FORTNIGHTLY + */ FORTNIGHTLY("FORTNIGHTLY"), - - /** FOURWEEKLY */ + + /** + * FOURWEEKLY + */ FOURWEEKLY("FOURWEEKLY"), - - /** MONTHLY */ + + /** + * MONTHLY + */ MONTHLY("MONTHLY"), - - /** TWICEMONTHLY */ + + /** + * TWICEMONTHLY + */ TWICEMONTHLY("TWICEMONTHLY"), - - /** QUARTERLY */ + + /** + * QUARTERLY + */ QUARTERLY("QUARTERLY"); private String value; @@ -42,26 +65,24 @@ public enum CalendarType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CalendarType fromValue(String value) { @@ -73,3 +94,4 @@ public static CalendarType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/CountryOfResidence.java b/src/main/java/com/xero/models/payrollau/CountryOfResidence.java index 03e1a30a3..858b6356a 100644 --- a/src/main/java/com/xero/models/payrollau/CountryOfResidence.java +++ b/src/main/java/com/xero/models/payrollau/CountryOfResidence.java @@ -9,767 +9,1275 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * Country of residence as a valid ISO 3166-1 alpha-2 country code e.g. \"AU\", - * \"NZ\", \"CA\". Only applicable, and mandatory if income type is - * WORKINGHOLIDAYMAKER. + * Country of residence as a valid ISO 3166-1 alpha-2 country code e.g. \"AU\", \"NZ\", \"CA\". Only applicable, and mandatory if income type is WORKINGHOLIDAYMAKER. */ public enum CountryOfResidence { - - /** AF */ + + /** + * AF + */ AF("AF"), - - /** AX */ + + /** + * AX + */ AX("AX"), - - /** AL */ + + /** + * AL + */ AL("AL"), - - /** DZ */ + + /** + * DZ + */ DZ("DZ"), - - /** AS */ + + /** + * AS + */ AS("AS"), - - /** AD */ + + /** + * AD + */ AD("AD"), - - /** AO */ + + /** + * AO + */ AO("AO"), - - /** AI */ + + /** + * AI + */ AI("AI"), - - /** AQ */ + + /** + * AQ + */ AQ("AQ"), - - /** AG */ + + /** + * AG + */ AG("AG"), - - /** AR */ + + /** + * AR + */ AR("AR"), - - /** AM */ + + /** + * AM + */ AM("AM"), - - /** AW */ + + /** + * AW + */ AW("AW"), - - /** AU */ + + /** + * AU + */ AU("AU"), - - /** AT */ + + /** + * AT + */ AT("AT"), - - /** AZ */ + + /** + * AZ + */ AZ("AZ"), - - /** BS */ + + /** + * BS + */ BS("BS"), - - /** BH */ + + /** + * BH + */ BH("BH"), - - /** BD */ + + /** + * BD + */ BD("BD"), - - /** BB */ + + /** + * BB + */ BB("BB"), - - /** BY */ + + /** + * BY + */ BY("BY"), - - /** BE */ + + /** + * BE + */ BE("BE"), - - /** BZ */ + + /** + * BZ + */ BZ("BZ"), - - /** BJ */ + + /** + * BJ + */ BJ("BJ"), - - /** BM */ + + /** + * BM + */ BM("BM"), - - /** BT */ + + /** + * BT + */ BT("BT"), - - /** BO */ + + /** + * BO + */ BO("BO"), - - /** BA */ + + /** + * BA + */ BA("BA"), - - /** BW */ + + /** + * BW + */ BW("BW"), - - /** BV */ + + /** + * BV + */ BV("BV"), - - /** BR */ + + /** + * BR + */ BR("BR"), - - /** IO */ + + /** + * IO + */ IO("IO"), - - /** BN */ + + /** + * BN + */ BN("BN"), - - /** BG */ + + /** + * BG + */ BG("BG"), - - /** BF */ + + /** + * BF + */ BF("BF"), - - /** BI */ + + /** + * BI + */ BI("BI"), - - /** KH */ + + /** + * KH + */ KH("KH"), - - /** CM */ + + /** + * CM + */ CM("CM"), - - /** CA */ + + /** + * CA + */ CA("CA"), - - /** CV */ + + /** + * CV + */ CV("CV"), - - /** KY */ + + /** + * KY + */ KY("KY"), - - /** CF */ + + /** + * CF + */ CF("CF"), - - /** TD */ + + /** + * TD + */ TD("TD"), - - /** CL */ + + /** + * CL + */ CL("CL"), - - /** CN */ + + /** + * CN + */ CN("CN"), - - /** CX */ + + /** + * CX + */ CX("CX"), - - /** CC */ + + /** + * CC + */ CC("CC"), - - /** CO */ + + /** + * CO + */ CO("CO"), - - /** KM */ + + /** + * KM + */ KM("KM"), - - /** CG */ + + /** + * CG + */ CG("CG"), - - /** CD */ + + /** + * CD + */ CD("CD"), - - /** CK */ + + /** + * CK + */ CK("CK"), - - /** CR */ + + /** + * CR + */ CR("CR"), - - /** CI */ + + /** + * CI + */ CI("CI"), - - /** HR */ + + /** + * HR + */ HR("HR"), - - /** CU */ + + /** + * CU + */ CU("CU"), - - /** CY */ + + /** + * CY + */ CY("CY"), - - /** CZ */ + + /** + * CZ + */ CZ("CZ"), - - /** DK */ + + /** + * DK + */ DK("DK"), - - /** DJ */ + + /** + * DJ + */ DJ("DJ"), - - /** DM */ + + /** + * DM + */ DM("DM"), - - /** DO */ + + /** + * DO + */ DO("DO"), - - /** EC */ + + /** + * EC + */ EC("EC"), - - /** EG */ + + /** + * EG + */ EG("EG"), - - /** SV */ + + /** + * SV + */ SV("SV"), - - /** GQ */ + + /** + * GQ + */ GQ("GQ"), - - /** ER */ + + /** + * ER + */ ER("ER"), - - /** EE */ + + /** + * EE + */ EE("EE"), - - /** ET */ + + /** + * ET + */ ET("ET"), - - /** FK */ + + /** + * FK + */ FK("FK"), - - /** FO */ + + /** + * FO + */ FO("FO"), - - /** FJ */ + + /** + * FJ + */ FJ("FJ"), - - /** FI */ + + /** + * FI + */ FI("FI"), - - /** FR */ + + /** + * FR + */ FR("FR"), - - /** GF */ + + /** + * GF + */ GF("GF"), - - /** PF */ + + /** + * PF + */ PF("PF"), - - /** TF */ + + /** + * TF + */ TF("TF"), - - /** GA */ + + /** + * GA + */ GA("GA"), - - /** GM */ + + /** + * GM + */ GM("GM"), - - /** GE */ + + /** + * GE + */ GE("GE"), - - /** DE */ + + /** + * DE + */ DE("DE"), - - /** GH */ + + /** + * GH + */ GH("GH"), - - /** GI */ + + /** + * GI + */ GI("GI"), - - /** GR */ + + /** + * GR + */ GR("GR"), - - /** GL */ + + /** + * GL + */ GL("GL"), - - /** GD */ + + /** + * GD + */ GD("GD"), - - /** GP */ + + /** + * GP + */ GP("GP"), - - /** GU */ + + /** + * GU + */ GU("GU"), - - /** GT */ + + /** + * GT + */ GT("GT"), - - /** GG */ + + /** + * GG + */ GG("GG"), - - /** GN */ + + /** + * GN + */ GN("GN"), - - /** GW */ + + /** + * GW + */ GW("GW"), - - /** GY */ + + /** + * GY + */ GY("GY"), - - /** HT */ + + /** + * HT + */ HT("HT"), - - /** HM */ + + /** + * HM + */ HM("HM"), - - /** VA */ + + /** + * VA + */ VA("VA"), - - /** HN */ + + /** + * HN + */ HN("HN"), - - /** HK */ + + /** + * HK + */ HK("HK"), - - /** HU */ + + /** + * HU + */ HU("HU"), - - /** IS */ + + /** + * IS + */ IS("IS"), - - /** IN */ + + /** + * IN + */ IN("IN"), - - /** ID */ + + /** + * ID + */ ID("ID"), - - /** IR */ + + /** + * IR + */ IR("IR"), - - /** IQ */ + + /** + * IQ + */ IQ("IQ"), - - /** IE */ + + /** + * IE + */ IE("IE"), - - /** IM */ + + /** + * IM + */ IM("IM"), - - /** IL */ + + /** + * IL + */ IL("IL"), - - /** IT */ + + /** + * IT + */ IT("IT"), - - /** JM */ + + /** + * JM + */ JM("JM"), - - /** JP */ + + /** + * JP + */ JP("JP"), - - /** JE */ + + /** + * JE + */ JE("JE"), - - /** JO */ + + /** + * JO + */ JO("JO"), - - /** KZ */ + + /** + * KZ + */ KZ("KZ"), - - /** KE */ + + /** + * KE + */ KE("KE"), - - /** KI */ + + /** + * KI + */ KI("KI"), - - /** KP */ + + /** + * KP + */ KP("KP"), - - /** KR */ + + /** + * KR + */ KR("KR"), - - /** KW */ + + /** + * KW + */ KW("KW"), - - /** KG */ + + /** + * KG + */ KG("KG"), - - /** LA */ + + /** + * LA + */ LA("LA"), - - /** LV */ + + /** + * LV + */ LV("LV"), - - /** LB */ + + /** + * LB + */ LB("LB"), - - /** LS */ + + /** + * LS + */ LS("LS"), - - /** LR */ + + /** + * LR + */ LR("LR"), - - /** LY */ + + /** + * LY + */ LY("LY"), - - /** LI */ + + /** + * LI + */ LI("LI"), - - /** LT */ + + /** + * LT + */ LT("LT"), - - /** LU */ + + /** + * LU + */ LU("LU"), - - /** MO */ + + /** + * MO + */ MO("MO"), - - /** MK */ + + /** + * MK + */ MK("MK"), - - /** MG */ + + /** + * MG + */ MG("MG"), - - /** MW */ + + /** + * MW + */ MW("MW"), - - /** MY */ + + /** + * MY + */ MY("MY"), - - /** MV */ + + /** + * MV + */ MV("MV"), - - /** ML */ + + /** + * ML + */ ML("ML"), - - /** MT */ + + /** + * MT + */ MT("MT"), - - /** MH */ + + /** + * MH + */ MH("MH"), - - /** MQ */ + + /** + * MQ + */ MQ("MQ"), - - /** MR */ + + /** + * MR + */ MR("MR"), - - /** MU */ + + /** + * MU + */ MU("MU"), - - /** YT */ + + /** + * YT + */ YT("YT"), - - /** MX */ + + /** + * MX + */ MX("MX"), - - /** FM */ + + /** + * FM + */ FM("FM"), - - /** MD */ + + /** + * MD + */ MD("MD"), - - /** MC */ + + /** + * MC + */ MC("MC"), - - /** MN */ + + /** + * MN + */ MN("MN"), - - /** ME */ + + /** + * ME + */ ME("ME"), - - /** MS */ + + /** + * MS + */ MS("MS"), - - /** MA */ + + /** + * MA + */ MA("MA"), - - /** MZ */ + + /** + * MZ + */ MZ("MZ"), - - /** MM */ + + /** + * MM + */ MM("MM"), - - /** NA */ + + /** + * NA + */ NA("NA"), - - /** NR */ + + /** + * NR + */ NR("NR"), - - /** NP */ + + /** + * NP + */ NP("NP"), - - /** NL */ + + /** + * NL + */ NL("NL"), - - /** AN */ + + /** + * AN + */ AN("AN"), - - /** NC */ + + /** + * NC + */ NC("NC"), - - /** NZ */ + + /** + * NZ + */ NZ("NZ"), - - /** NI */ + + /** + * NI + */ NI("NI"), - - /** NE */ + + /** + * NE + */ NE("NE"), - - /** NG */ + + /** + * NG + */ NG("NG"), - - /** NU */ + + /** + * NU + */ NU("NU"), - - /** NF */ + + /** + * NF + */ NF("NF"), - - /** MP */ + + /** + * MP + */ MP("MP"), - - /** NO */ + + /** + * NO + */ NO("NO"), - - /** OM */ + + /** + * OM + */ OM("OM"), - - /** PK */ + + /** + * PK + */ PK("PK"), - - /** PW */ + + /** + * PW + */ PW("PW"), - - /** PS */ + + /** + * PS + */ PS("PS"), - - /** PA */ + + /** + * PA + */ PA("PA"), - - /** PG */ + + /** + * PG + */ PG("PG"), - - /** PY */ + + /** + * PY + */ PY("PY"), - - /** PE */ + + /** + * PE + */ PE("PE"), - - /** PH */ + + /** + * PH + */ PH("PH"), - - /** PN */ + + /** + * PN + */ PN("PN"), - - /** PL */ + + /** + * PL + */ PL("PL"), - - /** PT */ + + /** + * PT + */ PT("PT"), - - /** PR */ + + /** + * PR + */ PR("PR"), - - /** QA */ + + /** + * QA + */ QA("QA"), - - /** RE */ + + /** + * RE + */ RE("RE"), - - /** RO */ + + /** + * RO + */ RO("RO"), - - /** RU */ + + /** + * RU + */ RU("RU"), - - /** RW */ + + /** + * RW + */ RW("RW"), - - /** BL */ + + /** + * BL + */ BL("BL"), - - /** SH */ + + /** + * SH + */ SH("SH"), - - /** KN */ + + /** + * KN + */ KN("KN"), - - /** LC */ + + /** + * LC + */ LC("LC"), - - /** MF */ + + /** + * MF + */ MF("MF"), - - /** PM */ + + /** + * PM + */ PM("PM"), - - /** VC */ + + /** + * VC + */ VC("VC"), - - /** WS */ + + /** + * WS + */ WS("WS"), - - /** SM */ + + /** + * SM + */ SM("SM"), - - /** ST */ + + /** + * ST + */ ST("ST"), - - /** SA */ + + /** + * SA + */ SA("SA"), - - /** SN */ + + /** + * SN + */ SN("SN"), - - /** RS */ + + /** + * RS + */ RS("RS"), - - /** SC */ + + /** + * SC + */ SC("SC"), - - /** SL */ + + /** + * SL + */ SL("SL"), - - /** SG */ + + /** + * SG + */ SG("SG"), - - /** SK */ + + /** + * SK + */ SK("SK"), - - /** SI */ + + /** + * SI + */ SI("SI"), - - /** SB */ + + /** + * SB + */ SB("SB"), - - /** SO */ + + /** + * SO + */ SO("SO"), - - /** ZA */ + + /** + * ZA + */ ZA("ZA"), - - /** GS */ + + /** + * GS + */ GS("GS"), - - /** ES */ + + /** + * ES + */ ES("ES"), - - /** LK */ + + /** + * LK + */ LK("LK"), - - /** SD */ + + /** + * SD + */ SD("SD"), - - /** SR */ + + /** + * SR + */ SR("SR"), - - /** SJ */ + + /** + * SJ + */ SJ("SJ"), - - /** SZ */ + + /** + * SZ + */ SZ("SZ"), - - /** SE */ + + /** + * SE + */ SE("SE"), - - /** CH */ + + /** + * CH + */ CH("CH"), - - /** SY */ + + /** + * SY + */ SY("SY"), - - /** TW */ + + /** + * TW + */ TW("TW"), - - /** TJ */ + + /** + * TJ + */ TJ("TJ"), - - /** TZ */ + + /** + * TZ + */ TZ("TZ"), - - /** TH */ + + /** + * TH + */ TH("TH"), - - /** TL */ + + /** + * TL + */ TL("TL"), - - /** TG */ + + /** + * TG + */ TG("TG"), - - /** TK */ + + /** + * TK + */ TK("TK"), - - /** TO */ + + /** + * TO + */ TO("TO"), - - /** TT */ + + /** + * TT + */ TT("TT"), - - /** TN */ + + /** + * TN + */ TN("TN"), - - /** TR */ + + /** + * TR + */ TR("TR"), - - /** TM */ + + /** + * TM + */ TM("TM"), - - /** TC */ + + /** + * TC + */ TC("TC"), - - /** TV */ + + /** + * TV + */ TV("TV"), - - /** UG */ + + /** + * UG + */ UG("UG"), - - /** UA */ + + /** + * UA + */ UA("UA"), - - /** AE */ + + /** + * AE + */ AE("AE"), - - /** GB */ + + /** + * GB + */ GB("GB"), - - /** US */ + + /** + * US + */ US("US"), - - /** UM */ + + /** + * UM + */ UM("UM"), - - /** UY */ + + /** + * UY + */ UY("UY"), - - /** UZ */ + + /** + * UZ + */ UZ("UZ"), - - /** VU */ + + /** + * VU + */ VU("VU"), - - /** VE */ + + /** + * VE + */ VE("VE"), - - /** VN */ + + /** + * VN + */ VN("VN"), - - /** VG */ + + /** + * VG + */ VG("VG"), - - /** VI */ + + /** + * VI + */ VI("VI"), - - /** WF */ + + /** + * WF + */ WF("WF"), - - /** EH */ + + /** + * EH + */ EH("EH"), - - /** YE */ + + /** + * YE + */ YE("YE"), - - /** ZM */ + + /** + * ZM + */ ZM("ZM"), - - /** ZW */ + + /** + * ZW + */ ZW("ZW"), - - /** BQ */ + + /** + * BQ + */ BQ("BQ"), - - /** CW */ + + /** + * CW + */ CW("CW"), - - /** SX */ + + /** + * SX + */ SX("SX"), - - /** SS */ + + /** + * SS + */ SS("SS"); private String value; @@ -778,26 +1286,24 @@ public enum CountryOfResidence { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CountryOfResidence fromValue(String value) { @@ -809,3 +1315,4 @@ public static CountryOfResidence fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/DeductionLine.java b/src/main/java/com/xero/models/payrollau/DeductionLine.java index 70720e069..5447ecd6f 100644 --- a/src/main/java/com/xero/models/payrollau/DeductionLine.java +++ b/src/main/java/com/xero/models/payrollau/DeductionLine.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.DeductionTypeCalculationType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * DeductionLine + */ -/** DeductionLine */ public class DeductionLine { StringUtil util = new StringUtil(); @@ -36,183 +54,166 @@ public class DeductionLine { @JsonProperty("NumberOfUnits") private Double numberOfUnits; /** - * Xero deduction type identifier - * - * @param deductionTypeID UUID - * @return DeductionLine - */ + * Xero deduction type identifier + * @param deductionTypeID UUID + * @return DeductionLine + **/ public DeductionLine deductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; return this; } - /** + /** * Xero deduction type identifier - * * @return deductionTypeID - */ - @ApiModelProperty( - example = "59cd9d04-4521-4cc3-93ac-7841651ff407", - required = true, - value = "Xero deduction type identifier") - /** + **/ + @ApiModelProperty(example = "59cd9d04-4521-4cc3-93ac-7841651ff407", required = true, value = "Xero deduction type identifier") + /** * Xero deduction type identifier - * * @return deductionTypeID UUID - */ + **/ public UUID getDeductionTypeID() { return deductionTypeID; } - /** - * Xero deduction type identifier - * - * @param deductionTypeID UUID - */ + /** + * Xero deduction type identifier + * @param deductionTypeID UUID + **/ + public void setDeductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; } /** - * calculationType - * - * @param calculationType DeductionTypeCalculationType - * @return DeductionLine - */ + * calculationType + * @param calculationType DeductionTypeCalculationType + * @return DeductionLine + **/ public DeductionLine calculationType(DeductionTypeCalculationType calculationType) { this.calculationType = calculationType; return this; } - /** + /** * Get calculationType - * * @return calculationType - */ + **/ @ApiModelProperty(value = "") - /** + /** * calculationType - * * @return calculationType DeductionTypeCalculationType - */ + **/ public DeductionTypeCalculationType getCalculationType() { return calculationType; } - /** - * calculationType - * - * @param calculationType DeductionTypeCalculationType - */ + /** + * calculationType + * @param calculationType DeductionTypeCalculationType + **/ + public void setCalculationType(DeductionTypeCalculationType calculationType) { this.calculationType = calculationType; } /** - * Deduction type amount - * - * @param amount Double - * @return DeductionLine - */ + * Deduction type amount + * @param amount Double + * @return DeductionLine + **/ public DeductionLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Deduction type amount - * * @return amount - */ + **/ @ApiModelProperty(example = "10.0", value = "Deduction type amount") - /** + /** * Deduction type amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Deduction type amount - * - * @param amount Double - */ + /** + * Deduction type amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The Percentage of the Deduction - * - * @param percentage Double - * @return DeductionLine - */ + * The Percentage of the Deduction + * @param percentage Double + * @return DeductionLine + **/ public DeductionLine percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * The Percentage of the Deduction - * * @return percentage - */ + **/ @ApiModelProperty(example = "10.0", value = "The Percentage of the Deduction") - /** + /** * The Percentage of the Deduction - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * The Percentage of the Deduction - * - * @param percentage Double - */ + /** + * The Percentage of the Deduction + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } /** - * Deduction number of units - * - * @param numberOfUnits Double - * @return DeductionLine - */ + * Deduction number of units + * @param numberOfUnits Double + * @return DeductionLine + **/ public DeductionLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Deduction number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(example = "10.0", value = "Deduction number of units") - /** + /** * Deduction number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Deduction number of units - * - * @param numberOfUnits Double - */ + /** + * Deduction number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,11 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } DeductionLine deductionLine = (DeductionLine) o; - return Objects.equals(this.deductionTypeID, deductionLine.deductionTypeID) - && Objects.equals(this.calculationType, deductionLine.calculationType) - && Objects.equals(this.amount, deductionLine.amount) - && Objects.equals(this.percentage, deductionLine.percentage) - && Objects.equals(this.numberOfUnits, deductionLine.numberOfUnits); + return Objects.equals(this.deductionTypeID, deductionLine.deductionTypeID) && + Objects.equals(this.calculationType, deductionLine.calculationType) && + Objects.equals(this.amount, deductionLine.amount) && + Objects.equals(this.percentage, deductionLine.percentage) && + Objects.equals(this.numberOfUnits, deductionLine.numberOfUnits); } @Override @@ -234,6 +235,7 @@ public int hashCode() { return Objects.hash(deductionTypeID, calculationType, amount, percentage, numberOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -248,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -256,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/DeductionType.java b/src/main/java/com/xero/models/payrollau/DeductionType.java index d0146d545..559e2c663 100644 --- a/src/main/java/com/xero/models/payrollau/DeductionType.java +++ b/src/main/java/com/xero/models/payrollau/DeductionType.java @@ -9,19 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * DeductionType + */ -/** DeductionType */ public class DeductionType { StringUtil util = new StringUtil(); @@ -45,15 +58,23 @@ public class DeductionType { @JsonProperty("UpdatedDateUTC") private String updatedDateUTC; - /** Gets or Sets deductionCategory */ + /** + * Gets or Sets deductionCategory + */ public enum DeductionCategoryEnum { - /** NONE */ + /** + * NONE + */ NONE("NONE"), - - /** UNIONFEES */ + + /** + * UNIONFEES + */ UNIONFEES("UNIONFEES"), - - /** WORKPLACEGIVING */ + + /** + * WORKPLACEGIVING + */ WORKPLACEGIVING("WORKPLACEGIVING"); private String value; @@ -62,31 +83,25 @@ public enum DeductionCategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static DeductionCategoryEnum fromValue(String value) { for (DeductionCategoryEnum b : DeductionCategoryEnum.values()) { @@ -98,339 +113,296 @@ public static DeductionCategoryEnum fromValue(String value) { } } + @JsonProperty("DeductionCategory") private DeductionCategoryEnum deductionCategory; @JsonProperty("CurrentRecord") private Boolean currentRecord; /** - * Name of the earnings rate (max length = 100) - * - * @param name String - * @return DeductionType - */ + * Name of the earnings rate (max length = 100) + * @param name String + * @return DeductionType + **/ public DeductionType name(String name) { this.name = name; return this; } - /** + /** * Name of the earnings rate (max length = 100) - * * @return name - */ + **/ @ApiModelProperty(example = "PTO", value = "Name of the earnings rate (max length = 100)") - /** + /** * Name of the earnings rate (max length = 100) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earnings rate (max length = 100) - * - * @param name String - */ + /** + * Name of the earnings rate (max length = 100) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * See Accounts - * - * @param accountCode String - * @return DeductionType - */ + * See Accounts + * @param accountCode String + * @return DeductionType + **/ public DeductionType accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * See Accounts - * * @return accountCode - */ + **/ @ApiModelProperty(example = "720", value = "See Accounts") - /** + /** * See Accounts - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * See Accounts - * - * @param accountCode String - */ + /** + * See Accounts + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from - * an employee. - * - * @param reducesTax Boolean - * @return DeductionType - */ + * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. + * @param reducesTax Boolean + * @return DeductionType + **/ public DeductionType reducesTax(Boolean reducesTax) { this.reducesTax = reducesTax; return this; } - /** - * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from - * an employee. - * + /** + * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. * @return reducesTax - */ - @ApiModelProperty( - example = "false", - value = - "Indicates that this is a pre-tax deduction that will reduce the amount of tax you" - + " withhold from an employee.") - /** - * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from - * an employee. - * + **/ + @ApiModelProperty(example = "false", value = "Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee.") + /** + * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. * @return reducesTax Boolean - */ + **/ public Boolean getReducesTax() { return reducesTax; } - /** - * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from - * an employee. - * - * @param reducesTax Boolean - */ + /** + * Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. + * @param reducesTax Boolean + **/ + public void setReducesTax(Boolean reducesTax) { this.reducesTax = reducesTax; } /** - * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically - * you will not set any value for this. - * - * @param reducesSuper Boolean - * @return DeductionType - */ + * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. + * @param reducesSuper Boolean + * @return DeductionType + **/ public DeductionType reducesSuper(Boolean reducesSuper) { this.reducesSuper = reducesSuper; return this; } - /** - * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically - * you will not set any value for this. - * + /** + * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. * @return reducesSuper - */ - @ApiModelProperty( - example = "false", - value = - "Most deductions don’t reduce your superannuation guarantee contribution liability, so" - + " typically you will not set any value for this.") - /** - * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically - * you will not set any value for this. - * + **/ + @ApiModelProperty(example = "false", value = "Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this.") + /** + * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. * @return reducesSuper Boolean - */ + **/ public Boolean getReducesSuper() { return reducesSuper; } - /** - * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically - * you will not set any value for this. - * - * @param reducesSuper Boolean - */ + /** + * Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. + * @param reducesSuper Boolean + **/ + public void setReducesSuper(Boolean reducesSuper) { this.reducesSuper = reducesSuper; } /** - * Boolean to determine if the deduction type is reportable or exempt from W1 - * - * @param isExemptFromW1 Boolean - * @return DeductionType - */ + * Boolean to determine if the deduction type is reportable or exempt from W1 + * @param isExemptFromW1 Boolean + * @return DeductionType + **/ public DeductionType isExemptFromW1(Boolean isExemptFromW1) { this.isExemptFromW1 = isExemptFromW1; return this; } - /** + /** * Boolean to determine if the deduction type is reportable or exempt from W1 - * * @return isExemptFromW1 - */ - @ApiModelProperty( - example = "false", - value = "Boolean to determine if the deduction type is reportable or exempt from W1") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to determine if the deduction type is reportable or exempt from W1") + /** * Boolean to determine if the deduction type is reportable or exempt from W1 - * * @return isExemptFromW1 Boolean - */ + **/ public Boolean getIsExemptFromW1() { return isExemptFromW1; } - /** - * Boolean to determine if the deduction type is reportable or exempt from W1 - * - * @param isExemptFromW1 Boolean - */ + /** + * Boolean to determine if the deduction type is reportable or exempt from W1 + * @param isExemptFromW1 Boolean + **/ + public void setIsExemptFromW1(Boolean isExemptFromW1) { this.isExemptFromW1 = isExemptFromW1; } /** - * Xero identifier - * - * @param deductionTypeID UUID - * @return DeductionType - */ + * Xero identifier + * @param deductionTypeID UUID + * @return DeductionType + **/ public DeductionType deductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; return this; } - /** + /** * Xero identifier - * * @return deductionTypeID - */ + **/ @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier") - /** + /** * Xero identifier - * * @return deductionTypeID UUID - */ + **/ public UUID getDeductionTypeID() { return deductionTypeID; } - /** - * Xero identifier - * - * @param deductionTypeID UUID - */ + /** + * Xero identifier + * @param deductionTypeID UUID + **/ + public void setDeductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * deductionCategory - * - * @param deductionCategory DeductionCategoryEnum - * @return DeductionType - */ + * deductionCategory + * @param deductionCategory DeductionCategoryEnum + * @return DeductionType + **/ public DeductionType deductionCategory(DeductionCategoryEnum deductionCategory) { this.deductionCategory = deductionCategory; return this; } - /** + /** * Get deductionCategory - * * @return deductionCategory - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionCategory - * * @return deductionCategory DeductionCategoryEnum - */ + **/ public DeductionCategoryEnum getDeductionCategory() { return deductionCategory; } - /** - * deductionCategory - * - * @param deductionCategory DeductionCategoryEnum - */ + /** + * deductionCategory + * @param deductionCategory DeductionCategoryEnum + **/ + public void setDeductionCategory(DeductionCategoryEnum deductionCategory) { this.deductionCategory = deductionCategory; } /** - * Is the current record - * - * @param currentRecord Boolean - * @return DeductionType - */ + * Is the current record + * @param currentRecord Boolean + * @return DeductionType + **/ public DeductionType currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Is the current record - * * @return currentRecord - */ + **/ @ApiModelProperty(example = "true", value = "Is the current record") - /** + /** * Is the current record - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Is the current record - * - * @param currentRecord Boolean - */ + /** + * Is the current record + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -440,31 +412,23 @@ public boolean equals(java.lang.Object o) { return false; } DeductionType deductionType = (DeductionType) o; - return Objects.equals(this.name, deductionType.name) - && Objects.equals(this.accountCode, deductionType.accountCode) - && Objects.equals(this.reducesTax, deductionType.reducesTax) - && Objects.equals(this.reducesSuper, deductionType.reducesSuper) - && Objects.equals(this.isExemptFromW1, deductionType.isExemptFromW1) - && Objects.equals(this.deductionTypeID, deductionType.deductionTypeID) - && Objects.equals(this.updatedDateUTC, deductionType.updatedDateUTC) - && Objects.equals(this.deductionCategory, deductionType.deductionCategory) - && Objects.equals(this.currentRecord, deductionType.currentRecord); + return Objects.equals(this.name, deductionType.name) && + Objects.equals(this.accountCode, deductionType.accountCode) && + Objects.equals(this.reducesTax, deductionType.reducesTax) && + Objects.equals(this.reducesSuper, deductionType.reducesSuper) && + Objects.equals(this.isExemptFromW1, deductionType.isExemptFromW1) && + Objects.equals(this.deductionTypeID, deductionType.deductionTypeID) && + Objects.equals(this.updatedDateUTC, deductionType.updatedDateUTC) && + Objects.equals(this.deductionCategory, deductionType.deductionCategory) && + Objects.equals(this.currentRecord, deductionType.currentRecord); } @Override public int hashCode() { - return Objects.hash( - name, - accountCode, - reducesTax, - reducesSuper, - isExemptFromW1, - deductionTypeID, - updatedDateUTC, - deductionCategory, - currentRecord); + return Objects.hash(name, accountCode, reducesTax, reducesSuper, isExemptFromW1, deductionTypeID, updatedDateUTC, deductionCategory, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -483,7 +447,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -491,4 +456,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/DeductionTypeCalculationType.java b/src/main/java/com/xero/models/payrollau/DeductionTypeCalculationType.java index 51cd42dee..6ea00f905 100644 --- a/src/main/java/com/xero/models/payrollau/DeductionTypeCalculationType.java +++ b/src/main/java/com/xero/models/payrollau/DeductionTypeCalculationType.java @@ -9,22 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets DeductionTypeCalculationType */ +/** + * Gets or Sets DeductionTypeCalculationType + */ public enum DeductionTypeCalculationType { - - /** FIXEDAMOUNT */ + + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FIXEDAMOUNT"), - - /** PRETAX */ + + /** + * PRETAX + */ PRETAX("PRETAX"), - - /** POSTTAX */ + + /** + * POSTTAX + */ POSTTAX("POSTTAX"); private String value; @@ -33,26 +50,24 @@ public enum DeductionTypeCalculationType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static DeductionTypeCalculationType fromValue(String value) { @@ -64,3 +79,4 @@ public static DeductionTypeCalculationType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/EarningsLine.java b/src/main/java/com/xero/models/payrollau/EarningsLine.java index ef8b14f14..9ddfccaba 100644 --- a/src/main/java/com/xero/models/payrollau/EarningsLine.java +++ b/src/main/java/com/xero/models/payrollau/EarningsLine.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.EarningsRateCalculationType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsLine + */ -/** EarningsLine */ public class EarningsLine { StringUtil util = new StringUtil(); @@ -48,327 +66,294 @@ public class EarningsLine { @JsonProperty("FixedAmount") private Double fixedAmount; /** - * Xero unique id for earnings rate - * - * @param earningsRateID UUID - * @return EarningsLine - */ + * Xero unique id for earnings rate + * @param earningsRateID UUID + * @return EarningsLine + **/ public EarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero unique id for earnings rate - * * @return earningsRateID - */ - @ApiModelProperty( - example = "72e962d1-fcac-4083-8a71-742bb3e7ae14", - required = true, - value = "Xero unique id for earnings rate") - /** + **/ + @ApiModelProperty(example = "72e962d1-fcac-4083-8a71-742bb3e7ae14", required = true, value = "Xero unique id for earnings rate") + /** * Xero unique id for earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero unique id for earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero unique id for earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * calculationType - * - * @param calculationType EarningsRateCalculationType - * @return EarningsLine - */ + * calculationType + * @param calculationType EarningsRateCalculationType + * @return EarningsLine + **/ public EarningsLine calculationType(EarningsRateCalculationType calculationType) { this.calculationType = calculationType; return this; } - /** + /** * Get calculationType - * * @return calculationType - */ + **/ @ApiModelProperty(value = "") - /** + /** * calculationType - * * @return calculationType EarningsRateCalculationType - */ + **/ public EarningsRateCalculationType getCalculationType() { return calculationType; } - /** - * calculationType - * - * @param calculationType EarningsRateCalculationType - */ + /** + * calculationType + * @param calculationType EarningsRateCalculationType + **/ + public void setCalculationType(EarningsRateCalculationType calculationType) { this.calculationType = calculationType; } /** - * Annual salary for earnings line - * - * @param annualSalary Double - * @return EarningsLine - */ + * Annual salary for earnings line + * @param annualSalary Double + * @return EarningsLine + **/ public EarningsLine annualSalary(Double annualSalary) { this.annualSalary = annualSalary; return this; } - /** + /** * Annual salary for earnings line - * * @return annualSalary - */ + **/ @ApiModelProperty(example = "40000.0", value = "Annual salary for earnings line") - /** + /** * Annual salary for earnings line - * * @return annualSalary Double - */ + **/ public Double getAnnualSalary() { return annualSalary; } - /** - * Annual salary for earnings line - * - * @param annualSalary Double - */ + /** + * Annual salary for earnings line + * @param annualSalary Double + **/ + public void setAnnualSalary(Double annualSalary) { this.annualSalary = annualSalary; } /** - * number of units for earning line - * - * @param numberOfUnitsPerWeek Double - * @return EarningsLine - */ + * number of units for earning line + * @param numberOfUnitsPerWeek Double + * @return EarningsLine + **/ public EarningsLine numberOfUnitsPerWeek(Double numberOfUnitsPerWeek) { this.numberOfUnitsPerWeek = numberOfUnitsPerWeek; return this; } - /** + /** * number of units for earning line - * * @return numberOfUnitsPerWeek - */ + **/ @ApiModelProperty(example = "38.0", value = "number of units for earning line") - /** + /** * number of units for earning line - * * @return numberOfUnitsPerWeek Double - */ + **/ public Double getNumberOfUnitsPerWeek() { return numberOfUnitsPerWeek; } - /** - * number of units for earning line - * - * @param numberOfUnitsPerWeek Double - */ + /** + * number of units for earning line + * @param numberOfUnitsPerWeek Double + **/ + public void setNumberOfUnitsPerWeek(Double numberOfUnitsPerWeek) { this.numberOfUnitsPerWeek = numberOfUnitsPerWeek; } /** - * Rate per unit of the EarningsLine. - * - * @param ratePerUnit Double - * @return EarningsLine - */ + * Rate per unit of the EarningsLine. + * @param ratePerUnit Double + * @return EarningsLine + **/ public EarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit of the EarningsLine. - * * @return ratePerUnit - */ + **/ @ApiModelProperty(example = "38.0", value = "Rate per unit of the EarningsLine.") - /** + /** * Rate per unit of the EarningsLine. - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit of the EarningsLine. - * - * @param ratePerUnit Double - */ + /** + * Rate per unit of the EarningsLine. + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" - * - * @param normalNumberOfUnits Double - * @return EarningsLine - */ + * Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" + * @param normalNumberOfUnits Double + * @return EarningsLine + **/ public EarningsLine normalNumberOfUnits(Double normalNumberOfUnits) { this.normalNumberOfUnits = normalNumberOfUnits; return this; } - /** + /** * Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" - * * @return normalNumberOfUnits - */ - @ApiModelProperty( - example = "38.0", - value = "Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\"") - /** + **/ + @ApiModelProperty(example = "38.0", value = "Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\"") + /** * Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" - * * @return normalNumberOfUnits Double - */ + **/ public Double getNormalNumberOfUnits() { return normalNumberOfUnits; } - /** - * Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" - * - * @param normalNumberOfUnits Double - */ + /** + * Normal number of units for EarningsLine. Applicable when RateType is \"MULTIPLE\" + * @param normalNumberOfUnits Double + **/ + public void setNormalNumberOfUnits(Double normalNumberOfUnits) { this.normalNumberOfUnits = normalNumberOfUnits; } /** - * Earnings rate amount - * - * @param amount Double - * @return EarningsLine - */ + * Earnings rate amount + * @param amount Double + * @return EarningsLine + **/ public EarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Earnings rate amount - * * @return amount - */ + **/ @ApiModelProperty(example = "38.0", value = "Earnings rate amount") - /** + /** * Earnings rate amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Earnings rate amount - * - * @param amount Double - */ + /** + * Earnings rate amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Earnings rate number of units. - * - * @param numberOfUnits Double - * @return EarningsLine - */ + * Earnings rate number of units. + * @param numberOfUnits Double + * @return EarningsLine + **/ public EarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Earnings rate number of units. - * * @return numberOfUnits - */ + **/ @ApiModelProperty(example = "2.5", value = "Earnings rate number of units.") - /** + /** * Earnings rate number of units. - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Earnings rate number of units. - * - * @param numberOfUnits Double - */ + /** + * Earnings rate number of units. + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - * @return EarningsLine - */ + * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + * @return EarningsLine + **/ public EarningsLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount - */ - @ApiModelProperty( - example = "2.5", - value = "Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed") - /** + **/ + @ApiModelProperty(example = "2.5", value = "Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed") + /** * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - */ + /** + * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -378,31 +363,23 @@ public boolean equals(java.lang.Object o) { return false; } EarningsLine earningsLine = (EarningsLine) o; - return Objects.equals(this.earningsRateID, earningsLine.earningsRateID) - && Objects.equals(this.calculationType, earningsLine.calculationType) - && Objects.equals(this.annualSalary, earningsLine.annualSalary) - && Objects.equals(this.numberOfUnitsPerWeek, earningsLine.numberOfUnitsPerWeek) - && Objects.equals(this.ratePerUnit, earningsLine.ratePerUnit) - && Objects.equals(this.normalNumberOfUnits, earningsLine.normalNumberOfUnits) - && Objects.equals(this.amount, earningsLine.amount) - && Objects.equals(this.numberOfUnits, earningsLine.numberOfUnits) - && Objects.equals(this.fixedAmount, earningsLine.fixedAmount); + return Objects.equals(this.earningsRateID, earningsLine.earningsRateID) && + Objects.equals(this.calculationType, earningsLine.calculationType) && + Objects.equals(this.annualSalary, earningsLine.annualSalary) && + Objects.equals(this.numberOfUnitsPerWeek, earningsLine.numberOfUnitsPerWeek) && + Objects.equals(this.ratePerUnit, earningsLine.ratePerUnit) && + Objects.equals(this.normalNumberOfUnits, earningsLine.normalNumberOfUnits) && + Objects.equals(this.amount, earningsLine.amount) && + Objects.equals(this.numberOfUnits, earningsLine.numberOfUnits) && + Objects.equals(this.fixedAmount, earningsLine.fixedAmount); } @Override public int hashCode() { - return Objects.hash( - earningsRateID, - calculationType, - annualSalary, - numberOfUnitsPerWeek, - ratePerUnit, - normalNumberOfUnits, - amount, - numberOfUnits, - fixedAmount); + return Objects.hash(earningsRateID, calculationType, annualSalary, numberOfUnitsPerWeek, ratePerUnit, normalNumberOfUnits, amount, numberOfUnits, fixedAmount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -410,13 +387,9 @@ public String toString() { sb.append(" earningsRateID: ").append(toIndentedString(earningsRateID)).append("\n"); sb.append(" calculationType: ").append(toIndentedString(calculationType)).append("\n"); sb.append(" annualSalary: ").append(toIndentedString(annualSalary)).append("\n"); - sb.append(" numberOfUnitsPerWeek: ") - .append(toIndentedString(numberOfUnitsPerWeek)) - .append("\n"); + sb.append(" numberOfUnitsPerWeek: ").append(toIndentedString(numberOfUnitsPerWeek)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); - sb.append(" normalNumberOfUnits: ") - .append(toIndentedString(normalNumberOfUnits)) - .append("\n"); + sb.append(" normalNumberOfUnits: ").append(toIndentedString(normalNumberOfUnits)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); @@ -425,7 +398,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -433,4 +407,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/EarningsRate.java b/src/main/java/com/xero/models/payrollau/EarningsRate.java index 8157e1f32..c7fff6d8f 100644 --- a/src/main/java/com/xero/models/payrollau/EarningsRate.java +++ b/src/main/java/com/xero/models/payrollau/EarningsRate.java @@ -9,17 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.AllowanceCategory; +import com.xero.models.payrollau.AllowanceType; +import com.xero.models.payrollau.EarningsType; +import com.xero.models.payrollau.EmploymentTerminationPaymentType; +import com.xero.models.payrollau.RateType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsRate + */ -/** EarningsRate */ public class EarningsRate { StringUtil util = new StringUtil(); @@ -83,759 +103,641 @@ public class EarningsRate { @JsonProperty("AllowanceCategory") private AllowanceCategory allowanceCategory; /** - * Name of the earnings rate (max length = 100) - * - * @param name String - * @return EarningsRate - */ + * Name of the earnings rate (max length = 100) + * @param name String + * @return EarningsRate + **/ public EarningsRate name(String name) { this.name = name; return this; } - /** + /** * Name of the earnings rate (max length = 100) - * * @return name - */ + **/ @ApiModelProperty(example = "PTO", value = "Name of the earnings rate (max length = 100)") - /** + /** * Name of the earnings rate (max length = 100) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earnings rate (max length = 100) - * - * @param name String - */ + /** + * Name of the earnings rate (max length = 100) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * See Accounts - * - * @param accountCode String - * @return EarningsRate - */ + * See Accounts + * @param accountCode String + * @return EarningsRate + **/ public EarningsRate accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * See Accounts - * * @return accountCode - */ + **/ @ApiModelProperty(example = "720", value = "See Accounts") - /** + /** * See Accounts - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * See Accounts - * - * @param accountCode String - */ + /** + * See Accounts + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - * - * @param typeOfUnits String - * @return EarningsRate - */ + * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + * @param typeOfUnits String + * @return EarningsRate + **/ public EarningsRate typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - * * @return typeOfUnits - */ - @ApiModelProperty( - example = "Fixed", - value = - "Type of units used to record earnings (max length = 50). Only When RateType is" - + " RATEPERUNIT") - /** + **/ + @ApiModelProperty(example = "Fixed", value = "Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT") + /** * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - * - * @param typeOfUnits String - */ + /** + * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } /** - * Most payments are subject to tax, so you should only set this value if you are sure that a - * payment is exempt from PAYG withholding - * - * @param isExemptFromTax Boolean - * @return EarningsRate - */ + * Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding + * @param isExemptFromTax Boolean + * @return EarningsRate + **/ public EarningsRate isExemptFromTax(Boolean isExemptFromTax) { this.isExemptFromTax = isExemptFromTax; return this; } - /** - * Most payments are subject to tax, so you should only set this value if you are sure that a - * payment is exempt from PAYG withholding - * + /** + * Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding * @return isExemptFromTax - */ - @ApiModelProperty( - example = "false", - value = - "Most payments are subject to tax, so you should only set this value if you are sure" - + " that a payment is exempt from PAYG withholding") - /** - * Most payments are subject to tax, so you should only set this value if you are sure that a - * payment is exempt from PAYG withholding - * + **/ + @ApiModelProperty(example = "false", value = "Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding") + /** + * Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding * @return isExemptFromTax Boolean - */ + **/ public Boolean getIsExemptFromTax() { return isExemptFromTax; } - /** - * Most payments are subject to tax, so you should only set this value if you are sure that a - * payment is exempt from PAYG withholding - * - * @param isExemptFromTax Boolean - */ + /** + * Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding + * @param isExemptFromTax Boolean + **/ + public void setIsExemptFromTax(Boolean isExemptFromTax) { this.isExemptFromTax = isExemptFromTax; } /** - * See the ATO website for details of which payments are exempt from SGC - * - * @param isExemptFromSuper Boolean - * @return EarningsRate - */ + * See the ATO website for details of which payments are exempt from SGC + * @param isExemptFromSuper Boolean + * @return EarningsRate + **/ public EarningsRate isExemptFromSuper(Boolean isExemptFromSuper) { this.isExemptFromSuper = isExemptFromSuper; return this; } - /** + /** * See the ATO website for details of which payments are exempt from SGC - * * @return isExemptFromSuper - */ - @ApiModelProperty( - example = "false", - value = "See the ATO website for details of which payments are exempt from SGC") - /** + **/ + @ApiModelProperty(example = "false", value = "See the ATO website for details of which payments are exempt from SGC") + /** * See the ATO website for details of which payments are exempt from SGC - * * @return isExemptFromSuper Boolean - */ + **/ public Boolean getIsExemptFromSuper() { return isExemptFromSuper; } - /** - * See the ATO website for details of which payments are exempt from SGC - * - * @param isExemptFromSuper Boolean - */ + /** + * See the ATO website for details of which payments are exempt from SGC + * @param isExemptFromSuper Boolean + **/ + public void setIsExemptFromSuper(Boolean isExemptFromSuper) { this.isExemptFromSuper = isExemptFromSuper; } /** - * Boolean to determine if the earnings rate is reportable or exempt from W1 - * - * @param isReportableAsW1 Boolean - * @return EarningsRate - */ + * Boolean to determine if the earnings rate is reportable or exempt from W1 + * @param isReportableAsW1 Boolean + * @return EarningsRate + **/ public EarningsRate isReportableAsW1(Boolean isReportableAsW1) { this.isReportableAsW1 = isReportableAsW1; return this; } - /** + /** * Boolean to determine if the earnings rate is reportable or exempt from W1 - * * @return isReportableAsW1 - */ - @ApiModelProperty( - example = "false", - value = "Boolean to determine if the earnings rate is reportable or exempt from W1") - /** + **/ + @ApiModelProperty(example = "false", value = "Boolean to determine if the earnings rate is reportable or exempt from W1") + /** * Boolean to determine if the earnings rate is reportable or exempt from W1 - * * @return isReportableAsW1 Boolean - */ + **/ public Boolean getIsReportableAsW1() { return isReportableAsW1; } - /** - * Boolean to determine if the earnings rate is reportable or exempt from W1 - * - * @param isReportableAsW1 Boolean - */ + /** + * Boolean to determine if the earnings rate is reportable or exempt from W1 + * @param isReportableAsW1 Boolean + **/ + public void setIsReportableAsW1(Boolean isReportableAsW1) { this.isReportableAsW1 = isReportableAsW1; } /** - * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only - * applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * - * @param allowanceContributesToAnnualLeaveRate Boolean - * @return EarningsRate - */ - public EarningsRate allowanceContributesToAnnualLeaveRate( - Boolean allowanceContributesToAnnualLeaveRate) { + * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT + * @param allowanceContributesToAnnualLeaveRate Boolean + * @return EarningsRate + **/ + public EarningsRate allowanceContributesToAnnualLeaveRate(Boolean allowanceContributesToAnnualLeaveRate) { this.allowanceContributesToAnnualLeaveRate = allowanceContributesToAnnualLeaveRate; return this; } - /** - * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only - * applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * + /** + * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT * @return allowanceContributesToAnnualLeaveRate - */ - @ApiModelProperty( - example = "false", - value = - "Boolean to determine if the allowance earnings rate contributes towards annual leave" - + " rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT") - /** - * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only - * applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * + **/ + @ApiModelProperty(example = "false", value = "Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT") + /** + * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT * @return allowanceContributesToAnnualLeaveRate Boolean - */ + **/ public Boolean getAllowanceContributesToAnnualLeaveRate() { return allowanceContributesToAnnualLeaveRate; } - /** - * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only - * applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * - * @param allowanceContributesToAnnualLeaveRate Boolean - */ - public void setAllowanceContributesToAnnualLeaveRate( - Boolean allowanceContributesToAnnualLeaveRate) { + /** + * Boolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT + * @param allowanceContributesToAnnualLeaveRate Boolean + **/ + + public void setAllowanceContributesToAnnualLeaveRate(Boolean allowanceContributesToAnnualLeaveRate) { this.allowanceContributesToAnnualLeaveRate = allowanceContributesToAnnualLeaveRate; } /** - * Boolean to determine if the allowance earnings rate contributes towards overtime allowance - * rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * - * @param allowanceContributesToOvertimeRate Boolean - * @return EarningsRate - */ - public EarningsRate allowanceContributesToOvertimeRate( - Boolean allowanceContributesToOvertimeRate) { + * Boolean to determine if the allowance earnings rate contributes towards overtime allowance rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT + * @param allowanceContributesToOvertimeRate Boolean + * @return EarningsRate + **/ + public EarningsRate allowanceContributesToOvertimeRate(Boolean allowanceContributesToOvertimeRate) { this.allowanceContributesToOvertimeRate = allowanceContributesToOvertimeRate; return this; } - /** - * Boolean to determine if the allowance earnings rate contributes towards overtime allowance - * rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * + /** + * Boolean to determine if the allowance earnings rate contributes towards overtime allowance rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT * @return allowanceContributesToOvertimeRate - */ - @ApiModelProperty( - example = "false", - value = - "Boolean to determine if the allowance earnings rate contributes towards overtime" - + " allowance rate. Only applicable if EarningsType is ALLOWANCE and RateType is" - + " RATEPERUNIT") - /** - * Boolean to determine if the allowance earnings rate contributes towards overtime allowance - * rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * + **/ + @ApiModelProperty(example = "false", value = "Boolean to determine if the allowance earnings rate contributes towards overtime allowance rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT") + /** + * Boolean to determine if the allowance earnings rate contributes towards overtime allowance rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT * @return allowanceContributesToOvertimeRate Boolean - */ + **/ public Boolean getAllowanceContributesToOvertimeRate() { return allowanceContributesToOvertimeRate; } - /** - * Boolean to determine if the allowance earnings rate contributes towards overtime allowance - * rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - * - * @param allowanceContributesToOvertimeRate Boolean - */ + /** + * Boolean to determine if the allowance earnings rate contributes towards overtime allowance rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT + * @param allowanceContributesToOvertimeRate Boolean + **/ + public void setAllowanceContributesToOvertimeRate(Boolean allowanceContributesToOvertimeRate) { this.allowanceContributesToOvertimeRate = allowanceContributesToOvertimeRate; } /** - * earningsType - * - * @param earningsType EarningsType - * @return EarningsRate - */ + * earningsType + * @param earningsType EarningsType + * @return EarningsRate + **/ public EarningsRate earningsType(EarningsType earningsType) { this.earningsType = earningsType; return this; } - /** + /** * Get earningsType - * * @return earningsType - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsType - * * @return earningsType EarningsType - */ + **/ public EarningsType getEarningsType() { return earningsType; } - /** - * earningsType - * - * @param earningsType EarningsType - */ + /** + * earningsType + * @param earningsType EarningsType + **/ + public void setEarningsType(EarningsType earningsType) { this.earningsType = earningsType; } /** - * Xero identifier - * - * @param earningsRateID UUID - * @return EarningsRate - */ + * Xero identifier + * @param earningsRateID UUID + * @return EarningsRate + **/ public EarningsRate earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier - * * @return earningsRateID - */ + **/ @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier") - /** + /** * Xero identifier - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier - * - * @param earningsRateID UUID - */ + /** + * Xero identifier + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * rateType - * - * @param rateType RateType - * @return EarningsRate - */ + * rateType + * @param rateType RateType + * @return EarningsRate + **/ public EarningsRate rateType(RateType rateType) { this.rateType = rateType; return this; } - /** + /** * Get rateType - * * @return rateType - */ + **/ @ApiModelProperty(value = "") - /** + /** * rateType - * * @return rateType RateType - */ + **/ public RateType getRateType() { return rateType; } - /** - * rateType - * - * @param rateType RateType - */ + /** + * rateType + * @param rateType RateType + **/ + public void setRateType(RateType rateType) { this.rateType = rateType; } /** - * Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. - * - * @param ratePerUnit String - * @return EarningsRate - */ + * Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. + * @param ratePerUnit String + * @return EarningsRate + **/ public EarningsRate ratePerUnit(String ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. - * * @return ratePerUnit - */ - @ApiModelProperty( - example = "10", - value = "Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT.") - /** + **/ + @ApiModelProperty(example = "10", value = "Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT.") + /** * Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. - * * @return ratePerUnit String - */ + **/ public String getRatePerUnit() { return ratePerUnit; } - /** - * Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. - * - * @param ratePerUnit String - */ + /** + * Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. + * @param ratePerUnit String + **/ + public void setRatePerUnit(String ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MULTIPLE - * - * @param multiplier Double - * @return EarningsRate - */ + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + * @param multiplier Double + * @return EarningsRate + **/ public EarningsRate multiplier(Double multiplier) { this.multiplier = multiplier; return this; } - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MULTIPLE - * + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE * @return multiplier - */ - @ApiModelProperty( - example = "1.5", - value = - "This is the multiplier used to calculate the rate per unit, based on the employee’s" - + " ordinary earnings rate. For example, for time and a half enter 1.5. Only" - + " applicable if RateType is MULTIPLE") - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MULTIPLE - * + **/ + @ApiModelProperty(example = "1.5", value = "This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE") + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE * @return multiplier Double - */ + **/ public Double getMultiplier() { return multiplier; } - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MULTIPLE - * - * @param multiplier Double - */ + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + * @param multiplier Double + **/ + public void setMultiplier(Double multiplier) { this.multiplier = multiplier; } /** - * Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE - * - * @param accrueLeave Boolean - * @return EarningsRate - */ + * Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE + * @param accrueLeave Boolean + * @return EarningsRate + **/ public EarningsRate accrueLeave(Boolean accrueLeave) { this.accrueLeave = accrueLeave; return this; } - /** + /** * Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE - * * @return accrueLeave - */ - @ApiModelProperty( - example = "false", - value = - "Indicates that this earnings rate should accrue leave. Only applicable if RateType is" - + " MULTIPLE") - /** + **/ + @ApiModelProperty(example = "false", value = "Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE") + /** * Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE - * * @return accrueLeave Boolean - */ + **/ public Boolean getAccrueLeave() { return accrueLeave; } - /** - * Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE - * - * @param accrueLeave Boolean - */ + /** + * Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE + * @param accrueLeave Boolean + **/ + public void setAccrueLeave(Boolean accrueLeave) { this.accrueLeave = accrueLeave; } /** - * Optional Amount for FIXEDAMOUNT RateType EarningsRate - * - * @param amount Double - * @return EarningsRate - */ + * Optional Amount for FIXEDAMOUNT RateType EarningsRate + * @param amount Double + * @return EarningsRate + **/ public EarningsRate amount(Double amount) { this.amount = amount; return this; } - /** + /** * Optional Amount for FIXEDAMOUNT RateType EarningsRate - * * @return amount - */ - @ApiModelProperty( - example = "50.3", - value = "Optional Amount for FIXEDAMOUNT RateType EarningsRate") - /** + **/ + @ApiModelProperty(example = "50.3", value = "Optional Amount for FIXEDAMOUNT RateType EarningsRate") + /** * Optional Amount for FIXEDAMOUNT RateType EarningsRate - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Optional Amount for FIXEDAMOUNT RateType EarningsRate - * - * @param amount Double - */ + /** + * Optional Amount for FIXEDAMOUNT RateType EarningsRate + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * employmentTerminationPaymentType - * - * @param employmentTerminationPaymentType EmploymentTerminationPaymentType - * @return EarningsRate - */ - public EarningsRate employmentTerminationPaymentType( - EmploymentTerminationPaymentType employmentTerminationPaymentType) { + * employmentTerminationPaymentType + * @param employmentTerminationPaymentType EmploymentTerminationPaymentType + * @return EarningsRate + **/ + public EarningsRate employmentTerminationPaymentType(EmploymentTerminationPaymentType employmentTerminationPaymentType) { this.employmentTerminationPaymentType = employmentTerminationPaymentType; return this; } - /** + /** * Get employmentTerminationPaymentType - * * @return employmentTerminationPaymentType - */ + **/ @ApiModelProperty(value = "") - /** + /** * employmentTerminationPaymentType - * * @return employmentTerminationPaymentType EmploymentTerminationPaymentType - */ + **/ public EmploymentTerminationPaymentType getEmploymentTerminationPaymentType() { return employmentTerminationPaymentType; } - /** - * employmentTerminationPaymentType - * - * @param employmentTerminationPaymentType EmploymentTerminationPaymentType - */ - public void setEmploymentTerminationPaymentType( - EmploymentTerminationPaymentType employmentTerminationPaymentType) { + /** + * employmentTerminationPaymentType + * @param employmentTerminationPaymentType EmploymentTerminationPaymentType + **/ + + public void setEmploymentTerminationPaymentType(EmploymentTerminationPaymentType employmentTerminationPaymentType) { this.employmentTerminationPaymentType = employmentTerminationPaymentType; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Is the current record - * - * @param currentRecord Boolean - * @return EarningsRate - */ + * Is the current record + * @param currentRecord Boolean + * @return EarningsRate + **/ public EarningsRate currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Is the current record - * * @return currentRecord - */ + **/ @ApiModelProperty(example = "true", value = "Is the current record") - /** + /** * Is the current record - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Is the current record - * - * @param currentRecord Boolean - */ + /** + * Is the current record + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * allowanceType - * - * @param allowanceType AllowanceType - * @return EarningsRate - */ + * allowanceType + * @param allowanceType AllowanceType + * @return EarningsRate + **/ public EarningsRate allowanceType(AllowanceType allowanceType) { this.allowanceType = allowanceType; return this; } - /** + /** * Get allowanceType - * * @return allowanceType - */ + **/ @ApiModelProperty(value = "") - /** + /** * allowanceType - * * @return allowanceType AllowanceType - */ + **/ public AllowanceType getAllowanceType() { return allowanceType; } - /** - * allowanceType - * - * @param allowanceType AllowanceType - */ + /** + * allowanceType + * @param allowanceType AllowanceType + **/ + public void setAllowanceType(AllowanceType allowanceType) { this.allowanceType = allowanceType; } /** - * allowanceCategory - * - * @param allowanceCategory AllowanceCategory - * @return EarningsRate - */ + * allowanceCategory + * @param allowanceCategory AllowanceCategory + * @return EarningsRate + **/ public EarningsRate allowanceCategory(AllowanceCategory allowanceCategory) { this.allowanceCategory = allowanceCategory; return this; } - /** + /** * Get allowanceCategory - * * @return allowanceCategory - */ + **/ @ApiModelProperty(value = "") - /** + /** * allowanceCategory - * * @return allowanceCategory AllowanceCategory - */ + **/ public AllowanceCategory getAllowanceCategory() { return allowanceCategory; } - /** - * allowanceCategory - * - * @param allowanceCategory AllowanceCategory - */ + /** + * allowanceCategory + * @param allowanceCategory AllowanceCategory + **/ + public void setAllowanceCategory(AllowanceCategory allowanceCategory) { this.allowanceCategory = allowanceCategory; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -845,58 +747,34 @@ public boolean equals(java.lang.Object o) { return false; } EarningsRate earningsRate = (EarningsRate) o; - return Objects.equals(this.name, earningsRate.name) - && Objects.equals(this.accountCode, earningsRate.accountCode) - && Objects.equals(this.typeOfUnits, earningsRate.typeOfUnits) - && Objects.equals(this.isExemptFromTax, earningsRate.isExemptFromTax) - && Objects.equals(this.isExemptFromSuper, earningsRate.isExemptFromSuper) - && Objects.equals(this.isReportableAsW1, earningsRate.isReportableAsW1) - && Objects.equals( - this.allowanceContributesToAnnualLeaveRate, - earningsRate.allowanceContributesToAnnualLeaveRate) - && Objects.equals( - this.allowanceContributesToOvertimeRate, - earningsRate.allowanceContributesToOvertimeRate) - && Objects.equals(this.earningsType, earningsRate.earningsType) - && Objects.equals(this.earningsRateID, earningsRate.earningsRateID) - && Objects.equals(this.rateType, earningsRate.rateType) - && Objects.equals(this.ratePerUnit, earningsRate.ratePerUnit) - && Objects.equals(this.multiplier, earningsRate.multiplier) - && Objects.equals(this.accrueLeave, earningsRate.accrueLeave) - && Objects.equals(this.amount, earningsRate.amount) - && Objects.equals( - this.employmentTerminationPaymentType, earningsRate.employmentTerminationPaymentType) - && Objects.equals(this.updatedDateUTC, earningsRate.updatedDateUTC) - && Objects.equals(this.currentRecord, earningsRate.currentRecord) - && Objects.equals(this.allowanceType, earningsRate.allowanceType) - && Objects.equals(this.allowanceCategory, earningsRate.allowanceCategory); + return Objects.equals(this.name, earningsRate.name) && + Objects.equals(this.accountCode, earningsRate.accountCode) && + Objects.equals(this.typeOfUnits, earningsRate.typeOfUnits) && + Objects.equals(this.isExemptFromTax, earningsRate.isExemptFromTax) && + Objects.equals(this.isExemptFromSuper, earningsRate.isExemptFromSuper) && + Objects.equals(this.isReportableAsW1, earningsRate.isReportableAsW1) && + Objects.equals(this.allowanceContributesToAnnualLeaveRate, earningsRate.allowanceContributesToAnnualLeaveRate) && + Objects.equals(this.allowanceContributesToOvertimeRate, earningsRate.allowanceContributesToOvertimeRate) && + Objects.equals(this.earningsType, earningsRate.earningsType) && + Objects.equals(this.earningsRateID, earningsRate.earningsRateID) && + Objects.equals(this.rateType, earningsRate.rateType) && + Objects.equals(this.ratePerUnit, earningsRate.ratePerUnit) && + Objects.equals(this.multiplier, earningsRate.multiplier) && + Objects.equals(this.accrueLeave, earningsRate.accrueLeave) && + Objects.equals(this.amount, earningsRate.amount) && + Objects.equals(this.employmentTerminationPaymentType, earningsRate.employmentTerminationPaymentType) && + Objects.equals(this.updatedDateUTC, earningsRate.updatedDateUTC) && + Objects.equals(this.currentRecord, earningsRate.currentRecord) && + Objects.equals(this.allowanceType, earningsRate.allowanceType) && + Objects.equals(this.allowanceCategory, earningsRate.allowanceCategory); } @Override public int hashCode() { - return Objects.hash( - name, - accountCode, - typeOfUnits, - isExemptFromTax, - isExemptFromSuper, - isReportableAsW1, - allowanceContributesToAnnualLeaveRate, - allowanceContributesToOvertimeRate, - earningsType, - earningsRateID, - rateType, - ratePerUnit, - multiplier, - accrueLeave, - amount, - employmentTerminationPaymentType, - updatedDateUTC, - currentRecord, - allowanceType, - allowanceCategory); + return Objects.hash(name, accountCode, typeOfUnits, isExemptFromTax, isExemptFromSuper, isReportableAsW1, allowanceContributesToAnnualLeaveRate, allowanceContributesToOvertimeRate, earningsType, earningsRateID, rateType, ratePerUnit, multiplier, accrueLeave, amount, employmentTerminationPaymentType, updatedDateUTC, currentRecord, allowanceType, allowanceCategory); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -907,12 +785,8 @@ public String toString() { sb.append(" isExemptFromTax: ").append(toIndentedString(isExemptFromTax)).append("\n"); sb.append(" isExemptFromSuper: ").append(toIndentedString(isExemptFromSuper)).append("\n"); sb.append(" isReportableAsW1: ").append(toIndentedString(isReportableAsW1)).append("\n"); - sb.append(" allowanceContributesToAnnualLeaveRate: ") - .append(toIndentedString(allowanceContributesToAnnualLeaveRate)) - .append("\n"); - sb.append(" allowanceContributesToOvertimeRate: ") - .append(toIndentedString(allowanceContributesToOvertimeRate)) - .append("\n"); + sb.append(" allowanceContributesToAnnualLeaveRate: ").append(toIndentedString(allowanceContributesToAnnualLeaveRate)).append("\n"); + sb.append(" allowanceContributesToOvertimeRate: ").append(toIndentedString(allowanceContributesToOvertimeRate)).append("\n"); sb.append(" earningsType: ").append(toIndentedString(earningsType)).append("\n"); sb.append(" earningsRateID: ").append(toIndentedString(earningsRateID)).append("\n"); sb.append(" rateType: ").append(toIndentedString(rateType)).append("\n"); @@ -920,9 +794,7 @@ public String toString() { sb.append(" multiplier: ").append(toIndentedString(multiplier)).append("\n"); sb.append(" accrueLeave: ").append(toIndentedString(accrueLeave)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" employmentTerminationPaymentType: ") - .append(toIndentedString(employmentTerminationPaymentType)) - .append("\n"); + sb.append(" employmentTerminationPaymentType: ").append(toIndentedString(employmentTerminationPaymentType)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append(" allowanceType: ").append(toIndentedString(allowanceType)).append("\n"); @@ -932,7 +804,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -940,4 +813,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/EarningsRateCalculationType.java b/src/main/java/com/xero/models/payrollau/EarningsRateCalculationType.java index d4d9c5de5..589c9ffdb 100644 --- a/src/main/java/com/xero/models/payrollau/EarningsRateCalculationType.java +++ b/src/main/java/com/xero/models/payrollau/EarningsRateCalculationType.java @@ -9,22 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets EarningsRateCalculationType */ +/** + * Gets or Sets EarningsRateCalculationType + */ public enum EarningsRateCalculationType { - - /** USEEARNINGSRATE */ + + /** + * USEEARNINGSRATE + */ USEEARNINGSRATE("USEEARNINGSRATE"), - - /** ENTEREARNINGSRATE */ + + /** + * ENTEREARNINGSRATE + */ ENTEREARNINGSRATE("ENTEREARNINGSRATE"), - - /** ANNUALSALARY */ + + /** + * ANNUALSALARY + */ ANNUALSALARY("ANNUALSALARY"); private String value; @@ -33,26 +50,24 @@ public enum EarningsRateCalculationType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static EarningsRateCalculationType fromValue(String value) { @@ -64,3 +79,4 @@ public static EarningsRateCalculationType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/EarningsType.java b/src/main/java/com/xero/models/payrollau/EarningsType.java index ac50f8c84..7ea77d9c6 100644 --- a/src/main/java/com/xero/models/payrollau/EarningsType.java +++ b/src/main/java/com/xero/models/payrollau/EarningsType.java @@ -9,55 +9,94 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets EarningsType */ +/** + * Gets or Sets EarningsType + */ public enum EarningsType { - - /** FIXED */ + + /** + * FIXED + */ FIXED("FIXED"), - - /** ORDINARYTIMEEARNINGS */ + + /** + * ORDINARYTIMEEARNINGS + */ ORDINARYTIMEEARNINGS("ORDINARYTIMEEARNINGS"), - - /** OVERTIMEEARNINGS */ + + /** + * OVERTIMEEARNINGS + */ OVERTIMEEARNINGS("OVERTIMEEARNINGS"), - - /** ALLOWANCE */ + + /** + * ALLOWANCE + */ ALLOWANCE("ALLOWANCE"), - - /** LUMPSUMD */ + + /** + * LUMPSUMD + */ LUMPSUMD("LUMPSUMD"), - - /** EMPLOYMENTTERMINATIONPAYMENT */ + + /** + * EMPLOYMENTTERMINATIONPAYMENT + */ EMPLOYMENTTERMINATIONPAYMENT("EMPLOYMENTTERMINATIONPAYMENT"), - - /** LUMPSUMA */ + + /** + * LUMPSUMA + */ LUMPSUMA("LUMPSUMA"), - - /** LUMPSUMB */ + + /** + * LUMPSUMB + */ LUMPSUMB("LUMPSUMB"), - - /** BONUSESANDCOMMISSIONS */ + + /** + * BONUSESANDCOMMISSIONS + */ BONUSESANDCOMMISSIONS("BONUSESANDCOMMISSIONS"), - - /** LUMPSUME */ + + /** + * LUMPSUME + */ LUMPSUME("LUMPSUME"), - - /** LUMPSUMW */ + + /** + * LUMPSUMW + */ LUMPSUMW("LUMPSUMW"), - - /** DIRECTORSFEES */ + + /** + * DIRECTORSFEES + */ DIRECTORSFEES("DIRECTORSFEES"), - - /** PAIDPARENTALLEAVE */ + + /** + * PAIDPARENTALLEAVE + */ PAIDPARENTALLEAVE("PAIDPARENTALLEAVE"), - - /** WORKERSCOMPENSATION */ + + /** + * WORKERSCOMPENSATION + */ WORKERSCOMPENSATION("WORKERSCOMPENSATION"); private String value; @@ -66,26 +105,24 @@ public enum EarningsType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static EarningsType fromValue(String value) { @@ -97,3 +134,4 @@ public static EarningsType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/Employee.java b/src/main/java/com/xero/models/payrollau/Employee.java index 136a23678..00d085987 100644 --- a/src/main/java/com/xero/models/payrollau/Employee.java +++ b/src/main/java/com/xero/models/payrollau/Employee.java @@ -9,24 +9,47 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollau.BankAccount; +import com.xero.models.payrollau.CountryOfResidence; +import com.xero.models.payrollau.EmployeeStatus; +import com.xero.models.payrollau.EmploymentType; +import com.xero.models.payrollau.HomeAddress; +import com.xero.models.payrollau.IncomeType; +import com.xero.models.payrollau.LeaveBalance; +import com.xero.models.payrollau.LeaveLine; +import com.xero.models.payrollau.OpeningBalances; +import com.xero.models.payrollau.PayTemplate; +import com.xero.models.payrollau.SuperMembership; +import com.xero.models.payrollau.TaxDeclaration; +import com.xero.models.payrollau.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employee + */ -/** Employee */ public class Employee { StringUtil util = new StringUtil(); @@ -53,18 +76,28 @@ public class Employee { @JsonProperty("Email") private String email; - /** The employee’s gender. See Employee Gender */ + /** + * The employee’s gender. See Employee Gender + */ public enum GenderEnum { - /** N */ + /** + * N + */ N("N"), - - /** M */ + + /** + * M + */ M("M"), - - /** F */ + + /** + * F + */ F("F"), - - /** I */ + + /** + * I + */ I("I"); private String value; @@ -73,31 +106,25 @@ public enum GenderEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static GenderEnum fromValue(String value) { for (GenderEnum b : GenderEnum.values()) { @@ -109,6 +136,7 @@ public static GenderEnum fromValue(String value) { } } + @JsonProperty("Gender") private GenderEnum gender; @@ -148,41 +176,42 @@ public static GenderEnum fromValue(String value) { @JsonProperty("TerminationDate") private String terminationDate; /** - * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing - * necessity or abandonment of employment * `I` Ill health - An employee resignation due - * to medical condition that prevents the continuation of employment, such as for illness, - * ill-health, medical unfitness or total permanent disability * `D` Deceased - The - * death of an employee * `R` Redundancy - An employer-initiated termination of - * employment due to a genuine redundancy or approved early retirement scheme * `F` - * Dismissal - An employer-initiated termination of employment due to dismissal, inability to - * perform the required work, misconduct or inefficiency * `C` Contract cessation - The - * natural conclusion of a limited employment relationship due to contract/engagement duration or - * task completion, seasonal work completion, or to cease casuals that are no longer required * - * `T` Transfer - The administrative arrangements performed to transfer employees across - * payroll systems, move them temporarily to another employer (machinery of government for public - * servants), transfer of business, move them to outsourcing arrangements or other such technical - * activities. + * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing necessity or abandonment of employment * `I` Ill health - An employee resignation due to medical condition that prevents the continuation of employment, such as for illness, ill-health, medical unfitness or total permanent disability * `D` Deceased - The death of an employee * `R` Redundancy - An employer-initiated termination of employment due to a genuine redundancy or approved early retirement scheme * `F` Dismissal - An employer-initiated termination of employment due to dismissal, inability to perform the required work, misconduct or inefficiency * `C` Contract cessation - The natural conclusion of a limited employment relationship due to contract/engagement duration or task completion, seasonal work completion, or to cease casuals that are no longer required * `T` Transfer - The administrative arrangements performed to transfer employees across payroll systems, move them temporarily to another employer (machinery of government for public servants), transfer of business, move them to outsourcing arrangements or other such technical activities. */ public enum TerminationReasonEnum { - /** V */ + /** + * V + */ V("V"), - - /** I */ + + /** + * I + */ I("I"), - - /** D */ + + /** + * D + */ D("D"), - - /** R */ + + /** + * R + */ R("R"), - - /** F */ + + /** + * F + */ F("F"), - - /** C */ + + /** + * C + */ C("C"), - - /** T */ + + /** + * T + */ T("T"); private String value; @@ -191,31 +220,25 @@ public enum TerminationReasonEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TerminationReasonEnum fromValue(String value) { for (TerminationReasonEnum b : TerminationReasonEnum.values()) { @@ -227,6 +250,7 @@ public static TerminationReasonEnum fromValue(String value) { } } + @JsonProperty("TerminationReason") private TerminationReasonEnum terminationReason; @@ -272,956 +296,792 @@ public static TerminationReasonEnum fromValue(String value) { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * First name of employee - * - * @param firstName String - * @return Employee - */ + * First name of employee + * @param firstName String + * @return Employee + **/ public Employee firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of employee - * * @return firstName - */ + **/ @ApiModelProperty(example = "Karen", required = true, value = "First name of employee") - /** + /** * First name of employee - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of employee - * - * @param firstName String - */ + /** + * First name of employee + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of employee - * - * @param lastName String - * @return Employee - */ + * Last name of employee + * @param lastName String + * @return Employee + **/ public Employee lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of employee - * * @return lastName - */ + **/ @ApiModelProperty(example = "Jones", required = true, value = "Last name of employee") - /** + /** * Last name of employee - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of employee - * - * @param lastName String - */ + /** + * Last name of employee + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Date of birth of the employee (YYYY-MM-DD) - * - * @param dateOfBirth String - * @return Employee - */ + * Date of birth of the employee (YYYY-MM-DD) + * @param dateOfBirth String + * @return Employee + **/ public Employee dateOfBirth(String dateOfBirth) { this.dateOfBirth = dateOfBirth; return this; } - /** + /** * Date of birth of the employee (YYYY-MM-DD) - * * @return dateOfBirth - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - required = true, - value = "Date of birth of the employee (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", required = true, value = "Date of birth of the employee (YYYY-MM-DD)") + /** * Date of birth of the employee (YYYY-MM-DD) - * * @return dateOfBirth String - */ + **/ public String getDateOfBirth() { return dateOfBirth; } - /** + /** * Date of birth of the employee (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getDateOfBirthAsDate() { if (this.dateOfBirth != null) { try { return util.convertStringToDate(this.dateOfBirth); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Date of birth of the employee (YYYY-MM-DD) - * - * @param dateOfBirth String - */ + /** + * Date of birth of the employee (YYYY-MM-DD) + * @param dateOfBirth String + **/ + public void setDateOfBirth(String dateOfBirth) { this.dateOfBirth = dateOfBirth; } - /** - * Date of birth of the employee (YYYY-MM-DD) - * - * @param dateOfBirth LocalDateTime - */ + /** + * Date of birth of the employee (YYYY-MM-DD) + * @param dateOfBirth LocalDateTime + **/ public void setDateOfBirth(LocalDate dateOfBirth) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = dateOfBirth.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = dateOfBirth.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.dateOfBirth = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * homeAddress - * - * @param homeAddress HomeAddress - * @return Employee - */ + * homeAddress + * @param homeAddress HomeAddress + * @return Employee + **/ public Employee homeAddress(HomeAddress homeAddress) { this.homeAddress = homeAddress; return this; } - /** + /** * Get homeAddress - * * @return homeAddress - */ + **/ @ApiModelProperty(value = "") - /** + /** * homeAddress - * * @return homeAddress HomeAddress - */ + **/ public HomeAddress getHomeAddress() { return homeAddress; } - /** - * homeAddress - * - * @param homeAddress HomeAddress - */ + /** + * homeAddress + * @param homeAddress HomeAddress + **/ + public void setHomeAddress(HomeAddress homeAddress) { this.homeAddress = homeAddress; } /** - * Start date for an employee (YYYY-MM-DD) - * - * @param startDate String - * @return Employee - */ + * Start date for an employee (YYYY-MM-DD) + * @param startDate String + * @return Employee + **/ public Employee startDate(String startDate) { this.startDate = startDate; return this; } - /** + /** * Start date for an employee (YYYY-MM-DD) - * * @return startDate - */ - @ApiModelProperty( - example = "/Date(320284900000+0000)/", - value = "Start date for an employee (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(320284900000+0000)/", value = "Start date for an employee (YYYY-MM-DD)") + /** * Start date for an employee (YYYY-MM-DD) - * * @return startDate String - */ + **/ public String getStartDate() { return startDate; } - /** + /** * Start date for an employee (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getStartDateAsDate() { if (this.startDate != null) { try { return util.convertStringToDate(this.startDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Start date for an employee (YYYY-MM-DD) - * - * @param startDate String - */ + /** + * Start date for an employee (YYYY-MM-DD) + * @param startDate String + **/ + public void setStartDate(String startDate) { this.startDate = startDate; } - /** - * Start date for an employee (YYYY-MM-DD) - * - * @param startDate LocalDateTime - */ + /** + * Start date for an employee (YYYY-MM-DD) + * @param startDate LocalDateTime + **/ public void setStartDate(LocalDate startDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.startDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Title of the employee - * - * @param title String - * @return Employee - */ + * Title of the employee + * @param title String + * @return Employee + **/ public Employee title(String title) { this.title = title; return this; } - /** + /** * Title of the employee - * * @return title - */ + **/ @ApiModelProperty(example = "Mrs", value = "Title of the employee") - /** + /** * Title of the employee - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Title of the employee - * - * @param title String - */ + /** + * Title of the employee + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * Middle name(s) of the employee - * - * @param middleNames String - * @return Employee - */ + * Middle name(s) of the employee + * @param middleNames String + * @return Employee + **/ public Employee middleNames(String middleNames) { this.middleNames = middleNames; return this; } - /** + /** * Middle name(s) of the employee - * * @return middleNames - */ + **/ @ApiModelProperty(example = "Adena", value = "Middle name(s) of the employee") - /** + /** * Middle name(s) of the employee - * * @return middleNames String - */ + **/ public String getMiddleNames() { return middleNames; } - /** - * Middle name(s) of the employee - * - * @param middleNames String - */ + /** + * Middle name(s) of the employee + * @param middleNames String + **/ + public void setMiddleNames(String middleNames) { this.middleNames = middleNames; } /** - * The email address for the employee - * - * @param email String - * @return Employee - */ + * The email address for the employee + * @param email String + * @return Employee + **/ public Employee email(String email) { this.email = email; return this; } - /** + /** * The email address for the employee - * * @return email - */ + **/ @ApiModelProperty(example = "developer@me.com", value = "The email address for the employee") - /** + /** * The email address for the employee - * * @return email String - */ + **/ public String getEmail() { return email; } - /** - * The email address for the employee - * - * @param email String - */ + /** + * The email address for the employee + * @param email String + **/ + public void setEmail(String email) { this.email = email; } /** - * The employee’s gender. See Employee Gender - * - * @param gender GenderEnum - * @return Employee - */ + * The employee’s gender. See Employee Gender + * @param gender GenderEnum + * @return Employee + **/ public Employee gender(GenderEnum gender) { this.gender = gender; return this; } - /** + /** * The employee’s gender. See Employee Gender - * * @return gender - */ + **/ @ApiModelProperty(example = "F", value = "The employee’s gender. See Employee Gender") - /** + /** * The employee’s gender. See Employee Gender - * * @return gender GenderEnum - */ + **/ public GenderEnum getGender() { return gender; } - /** - * The employee’s gender. See Employee Gender - * - * @param gender GenderEnum - */ + /** + * The employee’s gender. See Employee Gender + * @param gender GenderEnum + **/ + public void setGender(GenderEnum gender) { this.gender = gender; } /** - * Employee phone number - * - * @param phone String - * @return Employee - */ + * Employee phone number + * @param phone String + * @return Employee + **/ public Employee phone(String phone) { this.phone = phone; return this; } - /** + /** * Employee phone number - * * @return phone - */ + **/ @ApiModelProperty(example = "415-555-1212", value = "Employee phone number") - /** + /** * Employee phone number - * * @return phone String - */ + **/ public String getPhone() { return phone; } - /** - * Employee phone number - * - * @param phone String - */ + /** + * Employee phone number + * @param phone String + **/ + public void setPhone(String phone) { this.phone = phone; } /** - * Employee mobile number - * - * @param mobile String - * @return Employee - */ + * Employee mobile number + * @param mobile String + * @return Employee + **/ public Employee mobile(String mobile) { this.mobile = mobile; return this; } - /** + /** * Employee mobile number - * * @return mobile - */ + **/ @ApiModelProperty(example = "415-234-5678", value = "Employee mobile number") - /** + /** * Employee mobile number - * * @return mobile String - */ + **/ public String getMobile() { return mobile; } - /** - * Employee mobile number - * - * @param mobile String - */ + /** + * Employee mobile number + * @param mobile String + **/ + public void setMobile(String mobile) { this.mobile = mobile; } /** - * Employee’s twitter name - * - * @param twitterUserName String - * @return Employee - */ + * Employee’s twitter name + * @param twitterUserName String + * @return Employee + **/ public Employee twitterUserName(String twitterUserName) { this.twitterUserName = twitterUserName; return this; } - /** + /** * Employee’s twitter name - * * @return twitterUserName - */ + **/ @ApiModelProperty(example = "xeroapi", value = "Employee’s twitter name") - /** + /** * Employee’s twitter name - * * @return twitterUserName String - */ + **/ public String getTwitterUserName() { return twitterUserName; } - /** - * Employee’s twitter name - * - * @param twitterUserName String - */ + /** + * Employee’s twitter name + * @param twitterUserName String + **/ + public void setTwitterUserName(String twitterUserName) { this.twitterUserName = twitterUserName; } /** - * Authorised to approve other employees' leave requests - * - * @param isAuthorisedToApproveLeave Boolean - * @return Employee - */ + * Authorised to approve other employees' leave requests + * @param isAuthorisedToApproveLeave Boolean + * @return Employee + **/ public Employee isAuthorisedToApproveLeave(Boolean isAuthorisedToApproveLeave) { this.isAuthorisedToApproveLeave = isAuthorisedToApproveLeave; return this; } - /** + /** * Authorised to approve other employees' leave requests - * * @return isAuthorisedToApproveLeave - */ - @ApiModelProperty( - example = "false", - value = "Authorised to approve other employees' leave requests") - /** + **/ + @ApiModelProperty(example = "false", value = "Authorised to approve other employees' leave requests") + /** * Authorised to approve other employees' leave requests - * * @return isAuthorisedToApproveLeave Boolean - */ + **/ public Boolean getIsAuthorisedToApproveLeave() { return isAuthorisedToApproveLeave; } - /** - * Authorised to approve other employees' leave requests - * - * @param isAuthorisedToApproveLeave Boolean - */ + /** + * Authorised to approve other employees' leave requests + * @param isAuthorisedToApproveLeave Boolean + **/ + public void setIsAuthorisedToApproveLeave(Boolean isAuthorisedToApproveLeave) { this.isAuthorisedToApproveLeave = isAuthorisedToApproveLeave; } /** - * Authorised to approve timesheets - * - * @param isAuthorisedToApproveTimesheets Boolean - * @return Employee - */ + * Authorised to approve timesheets + * @param isAuthorisedToApproveTimesheets Boolean + * @return Employee + **/ public Employee isAuthorisedToApproveTimesheets(Boolean isAuthorisedToApproveTimesheets) { this.isAuthorisedToApproveTimesheets = isAuthorisedToApproveTimesheets; return this; } - /** + /** * Authorised to approve timesheets - * * @return isAuthorisedToApproveTimesheets - */ + **/ @ApiModelProperty(example = "true", value = "Authorised to approve timesheets") - /** + /** * Authorised to approve timesheets - * * @return isAuthorisedToApproveTimesheets Boolean - */ + **/ public Boolean getIsAuthorisedToApproveTimesheets() { return isAuthorisedToApproveTimesheets; } - /** - * Authorised to approve timesheets - * - * @param isAuthorisedToApproveTimesheets Boolean - */ + /** + * Authorised to approve timesheets + * @param isAuthorisedToApproveTimesheets Boolean + **/ + public void setIsAuthorisedToApproveTimesheets(Boolean isAuthorisedToApproveTimesheets) { this.isAuthorisedToApproveTimesheets = isAuthorisedToApproveTimesheets; } /** - * JobTitle of the employee - * - * @param jobTitle String - * @return Employee - */ + * JobTitle of the employee + * @param jobTitle String + * @return Employee + **/ public Employee jobTitle(String jobTitle) { this.jobTitle = jobTitle; return this; } - /** + /** * JobTitle of the employee - * * @return jobTitle - */ + **/ @ApiModelProperty(example = "Manager", value = "JobTitle of the employee") - /** + /** * JobTitle of the employee - * * @return jobTitle String - */ + **/ public String getJobTitle() { return jobTitle; } - /** - * JobTitle of the employee - * - * @param jobTitle String - */ + /** + * JobTitle of the employee + * @param jobTitle String + **/ + public void setJobTitle(String jobTitle) { this.jobTitle = jobTitle; } /** - * Employees classification - * - * @param classification String - * @return Employee - */ + * Employees classification + * @param classification String + * @return Employee + **/ public Employee classification(String classification) { this.classification = classification; return this; } - /** + /** * Employees classification - * * @return classification - */ + **/ @ApiModelProperty(example = "99383", value = "Employees classification") - /** + /** * Employees classification - * * @return classification String - */ + **/ public String getClassification() { return classification; } - /** - * Employees classification - * - * @param classification String - */ + /** + * Employees classification + * @param classification String + **/ + public void setClassification(String classification) { this.classification = classification; } /** - * Xero unique identifier for earnings rate - * - * @param ordinaryEarningsRateID UUID - * @return Employee - */ + * Xero unique identifier for earnings rate + * @param ordinaryEarningsRateID UUID + * @return Employee + **/ public Employee ordinaryEarningsRateID(UUID ordinaryEarningsRateID) { this.ordinaryEarningsRateID = ordinaryEarningsRateID; return this; } - /** + /** * Xero unique identifier for earnings rate - * * @return ordinaryEarningsRateID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for earnings rate") - /** + /** * Xero unique identifier for earnings rate - * * @return ordinaryEarningsRateID UUID - */ + **/ public UUID getOrdinaryEarningsRateID() { return ordinaryEarningsRateID; } - /** - * Xero unique identifier for earnings rate - * - * @param ordinaryEarningsRateID UUID - */ + /** + * Xero unique identifier for earnings rate + * @param ordinaryEarningsRateID UUID + **/ + public void setOrdinaryEarningsRateID(UUID ordinaryEarningsRateID) { this.ordinaryEarningsRateID = ordinaryEarningsRateID; } /** - * Xero unique identifier for payroll calendar for the employee - * - * @param payrollCalendarID UUID - * @return Employee - */ + * Xero unique identifier for payroll calendar for the employee + * @param payrollCalendarID UUID + * @return Employee + **/ public Employee payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for payroll calendar for the employee - * * @return payrollCalendarID - */ - @ApiModelProperty( - example = "2ee8e5cc-9835-40d5-bb18-09fdb118db9c", - value = "Xero unique identifier for payroll calendar for the employee") - /** + **/ + @ApiModelProperty(example = "2ee8e5cc-9835-40d5-bb18-09fdb118db9c", value = "Xero unique identifier for payroll calendar for the employee") + /** * Xero unique identifier for payroll calendar for the employee - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for payroll calendar for the employee - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for payroll calendar for the employee + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * The Employee Group allows you to report on payroll expenses and liabilities for each group of - * employees - * - * @param employeeGroupName String - * @return Employee - */ + * The Employee Group allows you to report on payroll expenses and liabilities for each group of employees + * @param employeeGroupName String + * @return Employee + **/ public Employee employeeGroupName(String employeeGroupName) { this.employeeGroupName = employeeGroupName; return this; } - /** - * The Employee Group allows you to report on payroll expenses and liabilities for each group of - * employees - * + /** + * The Employee Group allows you to report on payroll expenses and liabilities for each group of employees * @return employeeGroupName - */ - @ApiModelProperty( - example = "marketing", - value = - "The Employee Group allows you to report on payroll expenses and liabilities for each" - + " group of employees") - /** - * The Employee Group allows you to report on payroll expenses and liabilities for each group of - * employees - * + **/ + @ApiModelProperty(example = "marketing", value = "The Employee Group allows you to report on payroll expenses and liabilities for each group of employees") + /** + * The Employee Group allows you to report on payroll expenses and liabilities for each group of employees * @return employeeGroupName String - */ + **/ public String getEmployeeGroupName() { return employeeGroupName; } - /** - * The Employee Group allows you to report on payroll expenses and liabilities for each group of - * employees - * - * @param employeeGroupName String - */ + /** + * The Employee Group allows you to report on payroll expenses and liabilities for each group of employees + * @param employeeGroupName String + **/ + public void setEmployeeGroupName(String employeeGroupName) { this.employeeGroupName = employeeGroupName; } /** - * Xero unique identifier for an Employee - * - * @param employeeID UUID - * @return Employee - */ + * Xero unique identifier for an Employee + * @param employeeID UUID + * @return Employee + **/ public Employee employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * Xero unique identifier for an Employee - * * @return employeeID - */ - @ApiModelProperty( - example = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c", - value = "Xero unique identifier for an Employee") - /** + **/ + @ApiModelProperty(example = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c", value = "Xero unique identifier for an Employee") + /** * Xero unique identifier for an Employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * Xero unique identifier for an Employee - * - * @param employeeID UUID - */ + /** + * Xero unique identifier for an Employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * Employee Termination Date (YYYY-MM-DD) - * - * @param terminationDate String - * @return Employee - */ + * Employee Termination Date (YYYY-MM-DD) + * @param terminationDate String + * @return Employee + **/ public Employee terminationDate(String terminationDate) { this.terminationDate = terminationDate; return this; } - /** + /** * Employee Termination Date (YYYY-MM-DD) - * * @return terminationDate - */ - @ApiModelProperty( - example = "/Date(1584662400000+0000)/", - value = "Employee Termination Date (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(1584662400000+0000)/", value = "Employee Termination Date (YYYY-MM-DD)") + /** * Employee Termination Date (YYYY-MM-DD) - * * @return terminationDate String - */ + **/ public String getTerminationDate() { return terminationDate; } - /** + /** * Employee Termination Date (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getTerminationDateAsDate() { if (this.terminationDate != null) { try { return util.convertStringToDate(this.terminationDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Employee Termination Date (YYYY-MM-DD) - * - * @param terminationDate String - */ + /** + * Employee Termination Date (YYYY-MM-DD) + * @param terminationDate String + **/ + public void setTerminationDate(String terminationDate) { this.terminationDate = terminationDate; } - /** - * Employee Termination Date (YYYY-MM-DD) - * - * @param terminationDate LocalDateTime - */ + /** + * Employee Termination Date (YYYY-MM-DD) + * @param terminationDate LocalDateTime + **/ public void setTerminationDate(LocalDate terminationDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = terminationDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = terminationDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.terminationDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing - * necessity or abandonment of employment * `I` Ill health - An employee resignation due - * to medical condition that prevents the continuation of employment, such as for illness, - * ill-health, medical unfitness or total permanent disability * `D` Deceased - The - * death of an employee * `R` Redundancy - An employer-initiated termination of - * employment due to a genuine redundancy or approved early retirement scheme * `F` - * Dismissal - An employer-initiated termination of employment due to dismissal, inability to - * perform the required work, misconduct or inefficiency * `C` Contract cessation - The - * natural conclusion of a limited employment relationship due to contract/engagement duration or - * task completion, seasonal work completion, or to cease casuals that are no longer required * - * `T` Transfer - The administrative arrangements performed to transfer employees across - * payroll systems, move them temporarily to another employer (machinery of government for public - * servants), transfer of business, move them to outsourcing arrangements or other such technical - * activities. - * - * @param terminationReason TerminationReasonEnum - * @return Employee - */ + * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing necessity or abandonment of employment * `I` Ill health - An employee resignation due to medical condition that prevents the continuation of employment, such as for illness, ill-health, medical unfitness or total permanent disability * `D` Deceased - The death of an employee * `R` Redundancy - An employer-initiated termination of employment due to a genuine redundancy or approved early retirement scheme * `F` Dismissal - An employer-initiated termination of employment due to dismissal, inability to perform the required work, misconduct or inefficiency * `C` Contract cessation - The natural conclusion of a limited employment relationship due to contract/engagement duration or task completion, seasonal work completion, or to cease casuals that are no longer required * `T` Transfer - The administrative arrangements performed to transfer employees across payroll systems, move them temporarily to another employer (machinery of government for public servants), transfer of business, move them to outsourcing arrangements or other such technical activities. + * @param terminationReason TerminationReasonEnum + * @return Employee + **/ public Employee terminationReason(TerminationReasonEnum terminationReason) { this.terminationReason = terminationReason; return this; } - /** - * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing - * necessity or abandonment of employment * `I` Ill health - An employee resignation due - * to medical condition that prevents the continuation of employment, such as for illness, - * ill-health, medical unfitness or total permanent disability * `D` Deceased - The - * death of an employee * `R` Redundancy - An employer-initiated termination of - * employment due to a genuine redundancy or approved early retirement scheme * `F` - * Dismissal - An employer-initiated termination of employment due to dismissal, inability to - * perform the required work, misconduct or inefficiency * `C` Contract cessation - The - * natural conclusion of a limited employment relationship due to contract/engagement duration or - * task completion, seasonal work completion, or to cease casuals that are no longer required * - * `T` Transfer - The administrative arrangements performed to transfer employees across - * payroll systems, move them temporarily to another employer (machinery of government for public - * servants), transfer of business, move them to outsourcing arrangements or other such technical - * activities. - * + /** + * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing necessity or abandonment of employment * `I` Ill health - An employee resignation due to medical condition that prevents the continuation of employment, such as for illness, ill-health, medical unfitness or total permanent disability * `D` Deceased - The death of an employee * `R` Redundancy - An employer-initiated termination of employment due to a genuine redundancy or approved early retirement scheme * `F` Dismissal - An employer-initiated termination of employment due to dismissal, inability to perform the required work, misconduct or inefficiency * `C` Contract cessation - The natural conclusion of a limited employment relationship due to contract/engagement duration or task completion, seasonal work completion, or to cease casuals that are no longer required * `T` Transfer - The administrative arrangements performed to transfer employees across payroll systems, move them temporarily to another employer (machinery of government for public servants), transfer of business, move them to outsourcing arrangements or other such technical activities. * @return terminationReason - */ - @ApiModelProperty( - example = "F", - value = - "* `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing" - + " necessity or abandonment of employment * `I` Ill health - An employee" - + " resignation due to medical condition that prevents the continuation of" - + " employment, such as for illness, ill-health, medical unfitness or total" - + " permanent disability * `D` Deceased - The death of an employee * `R` Redundancy" - + " - An employer-initiated termination of employment due to a genuine redundancy or" - + " approved early retirement scheme * `F` Dismissal - An employer-initiated" - + " termination of employment due to dismissal, inability to perform the required" - + " work, misconduct or inefficiency * `C` Contract cessation - The natural" - + " conclusion of a limited employment relationship due to contract/engagement" - + " duration or task completion, seasonal work completion, or to cease casuals that" - + " are no longer required * `T` Transfer - The administrative arrangements" - + " performed to transfer employees across payroll systems, move them temporarily to" - + " another employer (machinery of government for public servants), transfer of" - + " business, move them to outsourcing arrangements or other such technical" - + " activities. ") - /** - * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing - * necessity or abandonment of employment * `I` Ill health - An employee resignation due - * to medical condition that prevents the continuation of employment, such as for illness, - * ill-health, medical unfitness or total permanent disability * `D` Deceased - The - * death of an employee * `R` Redundancy - An employer-initiated termination of - * employment due to a genuine redundancy or approved early retirement scheme * `F` - * Dismissal - An employer-initiated termination of employment due to dismissal, inability to - * perform the required work, misconduct or inefficiency * `C` Contract cessation - The - * natural conclusion of a limited employment relationship due to contract/engagement duration or - * task completion, seasonal work completion, or to cease casuals that are no longer required * - * `T` Transfer - The administrative arrangements performed to transfer employees across - * payroll systems, move them temporarily to another employer (machinery of government for public - * servants), transfer of business, move them to outsourcing arrangements or other such technical - * activities. - * + **/ + @ApiModelProperty(example = "F", value = "* `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing necessity or abandonment of employment * `I` Ill health - An employee resignation due to medical condition that prevents the continuation of employment, such as for illness, ill-health, medical unfitness or total permanent disability * `D` Deceased - The death of an employee * `R` Redundancy - An employer-initiated termination of employment due to a genuine redundancy or approved early retirement scheme * `F` Dismissal - An employer-initiated termination of employment due to dismissal, inability to perform the required work, misconduct or inefficiency * `C` Contract cessation - The natural conclusion of a limited employment relationship due to contract/engagement duration or task completion, seasonal work completion, or to cease casuals that are no longer required * `T` Transfer - The administrative arrangements performed to transfer employees across payroll systems, move them temporarily to another employer (machinery of government for public servants), transfer of business, move them to outsourcing arrangements or other such technical activities. ") + /** + * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing necessity or abandonment of employment * `I` Ill health - An employee resignation due to medical condition that prevents the continuation of employment, such as for illness, ill-health, medical unfitness or total permanent disability * `D` Deceased - The death of an employee * `R` Redundancy - An employer-initiated termination of employment due to a genuine redundancy or approved early retirement scheme * `F` Dismissal - An employer-initiated termination of employment due to dismissal, inability to perform the required work, misconduct or inefficiency * `C` Contract cessation - The natural conclusion of a limited employment relationship due to contract/engagement duration or task completion, seasonal work completion, or to cease casuals that are no longer required * `T` Transfer - The administrative arrangements performed to transfer employees across payroll systems, move them temporarily to another employer (machinery of government for public servants), transfer of business, move them to outsourcing arrangements or other such technical activities. * @return terminationReason TerminationReasonEnum - */ + **/ public TerminationReasonEnum getTerminationReason() { return terminationReason; } - /** - * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing - * necessity or abandonment of employment * `I` Ill health - An employee resignation due - * to medical condition that prevents the continuation of employment, such as for illness, - * ill-health, medical unfitness or total permanent disability * `D` Deceased - The - * death of an employee * `R` Redundancy - An employer-initiated termination of - * employment due to a genuine redundancy or approved early retirement scheme * `F` - * Dismissal - An employer-initiated termination of employment due to dismissal, inability to - * perform the required work, misconduct or inefficiency * `C` Contract cessation - The - * natural conclusion of a limited employment relationship due to contract/engagement duration or - * task completion, seasonal work completion, or to cease casuals that are no longer required * - * `T` Transfer - The administrative arrangements performed to transfer employees across - * payroll systems, move them temporarily to another employer (machinery of government for public - * servants), transfer of business, move them to outsourcing arrangements or other such technical - * activities. - * - * @param terminationReason TerminationReasonEnum - */ + /** + * * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing necessity or abandonment of employment * `I` Ill health - An employee resignation due to medical condition that prevents the continuation of employment, such as for illness, ill-health, medical unfitness or total permanent disability * `D` Deceased - The death of an employee * `R` Redundancy - An employer-initiated termination of employment due to a genuine redundancy or approved early retirement scheme * `F` Dismissal - An employer-initiated termination of employment due to dismissal, inability to perform the required work, misconduct or inefficiency * `C` Contract cessation - The natural conclusion of a limited employment relationship due to contract/engagement duration or task completion, seasonal work completion, or to cease casuals that are no longer required * `T` Transfer - The administrative arrangements performed to transfer employees across payroll systems, move them temporarily to another employer (machinery of government for public servants), transfer of business, move them to outsourcing arrangements or other such technical activities. + * @param terminationReason TerminationReasonEnum + **/ + public void setTerminationReason(TerminationReasonEnum terminationReason) { this.terminationReason = terminationReason; } /** - * bankAccounts - * - * @param bankAccounts List<BankAccount> - * @return Employee - */ + * bankAccounts + * @param bankAccounts List<BankAccount> + * @return Employee + **/ public Employee bankAccounts(List bankAccounts) { this.bankAccounts = bankAccounts; return this; @@ -1229,10 +1089,9 @@ public Employee bankAccounts(List bankAccounts) { /** * bankAccounts - * - * @param bankAccountsItem BankAccount + * @param bankAccountsItem BankAccount * @return Employee - */ + **/ public Employee addBankAccountsItem(BankAccount bankAccountsItem) { if (this.bankAccounts == null) { this.bankAccounts = new ArrayList(); @@ -1241,289 +1100,257 @@ public Employee addBankAccountsItem(BankAccount bankAccountsItem) { return this; } - /** + /** * Get bankAccounts - * * @return bankAccounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * bankAccounts - * * @return bankAccounts List - */ + **/ public List getBankAccounts() { return bankAccounts; } - /** - * bankAccounts - * - * @param bankAccounts List<BankAccount> - */ + /** + * bankAccounts + * @param bankAccounts List<BankAccount> + **/ + public void setBankAccounts(List bankAccounts) { this.bankAccounts = bankAccounts; } /** - * payTemplate - * - * @param payTemplate PayTemplate - * @return Employee - */ + * payTemplate + * @param payTemplate PayTemplate + * @return Employee + **/ public Employee payTemplate(PayTemplate payTemplate) { this.payTemplate = payTemplate; return this; } - /** + /** * Get payTemplate - * * @return payTemplate - */ + **/ @ApiModelProperty(value = "") - /** + /** * payTemplate - * * @return payTemplate PayTemplate - */ + **/ public PayTemplate getPayTemplate() { return payTemplate; } - /** - * payTemplate - * - * @param payTemplate PayTemplate - */ + /** + * payTemplate + * @param payTemplate PayTemplate + **/ + public void setPayTemplate(PayTemplate payTemplate) { this.payTemplate = payTemplate; } /** - * openingBalances - * - * @param openingBalances OpeningBalances - * @return Employee - */ + * openingBalances + * @param openingBalances OpeningBalances + * @return Employee + **/ public Employee openingBalances(OpeningBalances openingBalances) { this.openingBalances = openingBalances; return this; } - /** + /** * Get openingBalances - * * @return openingBalances - */ + **/ @ApiModelProperty(value = "") - /** + /** * openingBalances - * * @return openingBalances OpeningBalances - */ + **/ public OpeningBalances getOpeningBalances() { return openingBalances; } - /** - * openingBalances - * - * @param openingBalances OpeningBalances - */ + /** + * openingBalances + * @param openingBalances OpeningBalances + **/ + public void setOpeningBalances(OpeningBalances openingBalances) { this.openingBalances = openingBalances; } /** - * taxDeclaration - * - * @param taxDeclaration TaxDeclaration - * @return Employee - */ + * taxDeclaration + * @param taxDeclaration TaxDeclaration + * @return Employee + **/ public Employee taxDeclaration(TaxDeclaration taxDeclaration) { this.taxDeclaration = taxDeclaration; return this; } - /** + /** * Get taxDeclaration - * * @return taxDeclaration - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxDeclaration - * * @return taxDeclaration TaxDeclaration - */ + **/ public TaxDeclaration getTaxDeclaration() { return taxDeclaration; } - /** - * taxDeclaration - * - * @param taxDeclaration TaxDeclaration - */ + /** + * taxDeclaration + * @param taxDeclaration TaxDeclaration + **/ + public void setTaxDeclaration(TaxDeclaration taxDeclaration) { this.taxDeclaration = taxDeclaration; } /** - * incomeType - * - * @param incomeType IncomeType - * @return Employee - */ + * incomeType + * @param incomeType IncomeType + * @return Employee + **/ public Employee incomeType(IncomeType incomeType) { this.incomeType = incomeType; return this; } - /** + /** * Get incomeType - * * @return incomeType - */ + **/ @ApiModelProperty(value = "") - /** + /** * incomeType - * * @return incomeType IncomeType - */ + **/ public IncomeType getIncomeType() { return incomeType; } - /** - * incomeType - * - * @param incomeType IncomeType - */ + /** + * incomeType + * @param incomeType IncomeType + **/ + public void setIncomeType(IncomeType incomeType) { this.incomeType = incomeType; } /** - * employmentType - * - * @param employmentType EmploymentType - * @return Employee - */ + * employmentType + * @param employmentType EmploymentType + * @return Employee + **/ public Employee employmentType(EmploymentType employmentType) { this.employmentType = employmentType; return this; } - /** + /** * Get employmentType - * * @return employmentType - */ + **/ @ApiModelProperty(value = "") - /** + /** * employmentType - * * @return employmentType EmploymentType - */ + **/ public EmploymentType getEmploymentType() { return employmentType; } - /** - * employmentType - * - * @param employmentType EmploymentType - */ + /** + * employmentType + * @param employmentType EmploymentType + **/ + public void setEmploymentType(EmploymentType employmentType) { this.employmentType = employmentType; } /** - * countryOfResidence - * - * @param countryOfResidence CountryOfResidence - * @return Employee - */ + * countryOfResidence + * @param countryOfResidence CountryOfResidence + * @return Employee + **/ public Employee countryOfResidence(CountryOfResidence countryOfResidence) { this.countryOfResidence = countryOfResidence; return this; } - /** + /** * Get countryOfResidence - * * @return countryOfResidence - */ + **/ @ApiModelProperty(value = "") - /** + /** * countryOfResidence - * * @return countryOfResidence CountryOfResidence - */ + **/ public CountryOfResidence getCountryOfResidence() { return countryOfResidence; } - /** - * countryOfResidence - * - * @param countryOfResidence CountryOfResidence - */ + /** + * countryOfResidence + * @param countryOfResidence CountryOfResidence + **/ + public void setCountryOfResidence(CountryOfResidence countryOfResidence) { this.countryOfResidence = countryOfResidence; } /** - * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate - * that the employee is payable. - * - * @param isSTP2Qualified Boolean - * @return Employee - */ + * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate that the employee is payable. + * @param isSTP2Qualified Boolean + * @return Employee + **/ public Employee isSTP2Qualified(Boolean isSTP2Qualified) { this.isSTP2Qualified = isSTP2Qualified; return this; } - /** - * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate - * that the employee is payable. - * + /** + * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate that the employee is payable. * @return isSTP2Qualified - */ - @ApiModelProperty( - example = "true", - value = - "Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate" - + " that the employee is payable.") - /** - * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate - * that the employee is payable. - * + **/ + @ApiModelProperty(example = "true", value = "Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate that the employee is payable.") + /** + * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate that the employee is payable. * @return isSTP2Qualified Boolean - */ + **/ public Boolean getIsSTP2Qualified() { return isSTP2Qualified; } - /** - * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate - * that the employee is payable. - * - * @param isSTP2Qualified Boolean - */ + /** + * Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate that the employee is payable. + * @param isSTP2Qualified Boolean + **/ + public void setIsSTP2Qualified(Boolean isSTP2Qualified) { this.isSTP2Qualified = isSTP2Qualified; } /** - * leaveBalances - * - * @param leaveBalances List<LeaveBalance> - * @return Employee - */ + * leaveBalances + * @param leaveBalances List<LeaveBalance> + * @return Employee + **/ public Employee leaveBalances(List leaveBalances) { this.leaveBalances = leaveBalances; return this; @@ -1531,10 +1358,9 @@ public Employee leaveBalances(List leaveBalances) { /** * leaveBalances - * - * @param leaveBalancesItem LeaveBalance + * @param leaveBalancesItem LeaveBalance * @return Employee - */ + **/ public Employee addLeaveBalancesItem(LeaveBalance leaveBalancesItem) { if (this.leaveBalances == null) { this.leaveBalances = new ArrayList(); @@ -1543,36 +1369,33 @@ public Employee addLeaveBalancesItem(LeaveBalance leaveBalancesItem) { return this; } - /** + /** * Get leaveBalances - * * @return leaveBalances - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveBalances - * * @return leaveBalances List - */ + **/ public List getLeaveBalances() { return leaveBalances; } - /** - * leaveBalances - * - * @param leaveBalances List<LeaveBalance> - */ + /** + * leaveBalances + * @param leaveBalances List<LeaveBalance> + **/ + public void setLeaveBalances(List leaveBalances) { this.leaveBalances = leaveBalances; } /** - * leaveLines - * - * @param leaveLines List<LeaveLine> - * @return Employee - */ + * leaveLines + * @param leaveLines List<LeaveLine> + * @return Employee + **/ public Employee leaveLines(List leaveLines) { this.leaveLines = leaveLines; return this; @@ -1580,10 +1403,9 @@ public Employee leaveLines(List leaveLines) { /** * leaveLines - * - * @param leaveLinesItem LeaveLine + * @param leaveLinesItem LeaveLine * @return Employee - */ + **/ public Employee addLeaveLinesItem(LeaveLine leaveLinesItem) { if (this.leaveLines == null) { this.leaveLines = new ArrayList(); @@ -1592,36 +1414,33 @@ public Employee addLeaveLinesItem(LeaveLine leaveLinesItem) { return this; } - /** + /** * Get leaveLines - * * @return leaveLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveLines - * * @return leaveLines List - */ + **/ public List getLeaveLines() { return leaveLines; } - /** - * leaveLines - * - * @param leaveLines List<LeaveLine> - */ + /** + * leaveLines + * @param leaveLines List<LeaveLine> + **/ + public void setLeaveLines(List leaveLines) { this.leaveLines = leaveLines; } /** - * superMemberships - * - * @param superMemberships List<SuperMembership> - * @return Employee - */ + * superMemberships + * @param superMemberships List<SuperMembership> + * @return Employee + **/ public Employee superMemberships(List superMemberships) { this.superMemberships = superMemberships; return this; @@ -1629,10 +1448,9 @@ public Employee superMemberships(List superMemberships) { /** * superMemberships - * - * @param superMembershipsItem SuperMembership + * @param superMembershipsItem SuperMembership * @return Employee - */ + **/ public Employee addSuperMembershipsItem(SuperMembership superMembershipsItem) { if (this.superMemberships == null) { this.superMemberships = new ArrayList(); @@ -1641,101 +1459,92 @@ public Employee addSuperMembershipsItem(SuperMembership superMembershipsItem) { return this; } - /** + /** * Get superMemberships - * * @return superMemberships - */ + **/ @ApiModelProperty(value = "") - /** + /** * superMemberships - * * @return superMemberships List - */ + **/ public List getSuperMemberships() { return superMemberships; } - /** - * superMemberships - * - * @param superMemberships List<SuperMembership> - */ + /** + * superMemberships + * @param superMemberships List<SuperMembership> + **/ + public void setSuperMemberships(List superMemberships) { this.superMemberships = superMemberships; } /** - * status - * - * @param status EmployeeStatus - * @return Employee - */ + * status + * @param status EmployeeStatus + * @return Employee + **/ public Employee status(EmployeeStatus status) { this.status = status; return this; } - /** + /** * Get status - * * @return status - */ + **/ @ApiModelProperty(value = "") - /** + /** * status - * * @return status EmployeeStatus - */ + **/ public EmployeeStatus getStatus() { return status; } - /** - * status - * - * @param status EmployeeStatus - */ + /** + * status + * @param status EmployeeStatus + **/ + public void setStatus(EmployeeStatus status) { this.status = status; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Employee - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Employee + **/ public Employee validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -1743,10 +1552,9 @@ public Employee validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Employee - */ + **/ public Employee addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -1755,30 +1563,29 @@ public Employee addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1788,86 +1595,50 @@ public boolean equals(java.lang.Object o) { return false; } Employee employee = (Employee) o; - return Objects.equals(this.firstName, employee.firstName) - && Objects.equals(this.lastName, employee.lastName) - && Objects.equals(this.dateOfBirth, employee.dateOfBirth) - && Objects.equals(this.homeAddress, employee.homeAddress) - && Objects.equals(this.startDate, employee.startDate) - && Objects.equals(this.title, employee.title) - && Objects.equals(this.middleNames, employee.middleNames) - && Objects.equals(this.email, employee.email) - && Objects.equals(this.gender, employee.gender) - && Objects.equals(this.phone, employee.phone) - && Objects.equals(this.mobile, employee.mobile) - && Objects.equals(this.twitterUserName, employee.twitterUserName) - && Objects.equals(this.isAuthorisedToApproveLeave, employee.isAuthorisedToApproveLeave) - && Objects.equals( - this.isAuthorisedToApproveTimesheets, employee.isAuthorisedToApproveTimesheets) - && Objects.equals(this.jobTitle, employee.jobTitle) - && Objects.equals(this.classification, employee.classification) - && Objects.equals(this.ordinaryEarningsRateID, employee.ordinaryEarningsRateID) - && Objects.equals(this.payrollCalendarID, employee.payrollCalendarID) - && Objects.equals(this.employeeGroupName, employee.employeeGroupName) - && Objects.equals(this.employeeID, employee.employeeID) - && Objects.equals(this.terminationDate, employee.terminationDate) - && Objects.equals(this.terminationReason, employee.terminationReason) - && Objects.equals(this.bankAccounts, employee.bankAccounts) - && Objects.equals(this.payTemplate, employee.payTemplate) - && Objects.equals(this.openingBalances, employee.openingBalances) - && Objects.equals(this.taxDeclaration, employee.taxDeclaration) - && Objects.equals(this.incomeType, employee.incomeType) - && Objects.equals(this.employmentType, employee.employmentType) - && Objects.equals(this.countryOfResidence, employee.countryOfResidence) - && Objects.equals(this.isSTP2Qualified, employee.isSTP2Qualified) - && Objects.equals(this.leaveBalances, employee.leaveBalances) - && Objects.equals(this.leaveLines, employee.leaveLines) - && Objects.equals(this.superMemberships, employee.superMemberships) - && Objects.equals(this.status, employee.status) - && Objects.equals(this.updatedDateUTC, employee.updatedDateUTC) - && Objects.equals(this.validationErrors, employee.validationErrors); + return Objects.equals(this.firstName, employee.firstName) && + Objects.equals(this.lastName, employee.lastName) && + Objects.equals(this.dateOfBirth, employee.dateOfBirth) && + Objects.equals(this.homeAddress, employee.homeAddress) && + Objects.equals(this.startDate, employee.startDate) && + Objects.equals(this.title, employee.title) && + Objects.equals(this.middleNames, employee.middleNames) && + Objects.equals(this.email, employee.email) && + Objects.equals(this.gender, employee.gender) && + Objects.equals(this.phone, employee.phone) && + Objects.equals(this.mobile, employee.mobile) && + Objects.equals(this.twitterUserName, employee.twitterUserName) && + Objects.equals(this.isAuthorisedToApproveLeave, employee.isAuthorisedToApproveLeave) && + Objects.equals(this.isAuthorisedToApproveTimesheets, employee.isAuthorisedToApproveTimesheets) && + Objects.equals(this.jobTitle, employee.jobTitle) && + Objects.equals(this.classification, employee.classification) && + Objects.equals(this.ordinaryEarningsRateID, employee.ordinaryEarningsRateID) && + Objects.equals(this.payrollCalendarID, employee.payrollCalendarID) && + Objects.equals(this.employeeGroupName, employee.employeeGroupName) && + Objects.equals(this.employeeID, employee.employeeID) && + Objects.equals(this.terminationDate, employee.terminationDate) && + Objects.equals(this.terminationReason, employee.terminationReason) && + Objects.equals(this.bankAccounts, employee.bankAccounts) && + Objects.equals(this.payTemplate, employee.payTemplate) && + Objects.equals(this.openingBalances, employee.openingBalances) && + Objects.equals(this.taxDeclaration, employee.taxDeclaration) && + Objects.equals(this.incomeType, employee.incomeType) && + Objects.equals(this.employmentType, employee.employmentType) && + Objects.equals(this.countryOfResidence, employee.countryOfResidence) && + Objects.equals(this.isSTP2Qualified, employee.isSTP2Qualified) && + Objects.equals(this.leaveBalances, employee.leaveBalances) && + Objects.equals(this.leaveLines, employee.leaveLines) && + Objects.equals(this.superMemberships, employee.superMemberships) && + Objects.equals(this.status, employee.status) && + Objects.equals(this.updatedDateUTC, employee.updatedDateUTC) && + Objects.equals(this.validationErrors, employee.validationErrors); } @Override public int hashCode() { - return Objects.hash( - firstName, - lastName, - dateOfBirth, - homeAddress, - startDate, - title, - middleNames, - email, - gender, - phone, - mobile, - twitterUserName, - isAuthorisedToApproveLeave, - isAuthorisedToApproveTimesheets, - jobTitle, - classification, - ordinaryEarningsRateID, - payrollCalendarID, - employeeGroupName, - employeeID, - terminationDate, - terminationReason, - bankAccounts, - payTemplate, - openingBalances, - taxDeclaration, - incomeType, - employmentType, - countryOfResidence, - isSTP2Qualified, - leaveBalances, - leaveLines, - superMemberships, - status, - updatedDateUTC, - validationErrors); + return Objects.hash(firstName, lastName, dateOfBirth, homeAddress, startDate, title, middleNames, email, gender, phone, mobile, twitterUserName, isAuthorisedToApproveLeave, isAuthorisedToApproveTimesheets, jobTitle, classification, ordinaryEarningsRateID, payrollCalendarID, employeeGroupName, employeeID, terminationDate, terminationReason, bankAccounts, payTemplate, openingBalances, taxDeclaration, incomeType, employmentType, countryOfResidence, isSTP2Qualified, leaveBalances, leaveLines, superMemberships, status, updatedDateUTC, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1884,17 +1655,11 @@ public String toString() { sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); sb.append(" twitterUserName: ").append(toIndentedString(twitterUserName)).append("\n"); - sb.append(" isAuthorisedToApproveLeave: ") - .append(toIndentedString(isAuthorisedToApproveLeave)) - .append("\n"); - sb.append(" isAuthorisedToApproveTimesheets: ") - .append(toIndentedString(isAuthorisedToApproveTimesheets)) - .append("\n"); + sb.append(" isAuthorisedToApproveLeave: ").append(toIndentedString(isAuthorisedToApproveLeave)).append("\n"); + sb.append(" isAuthorisedToApproveTimesheets: ").append(toIndentedString(isAuthorisedToApproveTimesheets)).append("\n"); sb.append(" jobTitle: ").append(toIndentedString(jobTitle)).append("\n"); sb.append(" classification: ").append(toIndentedString(classification)).append("\n"); - sb.append(" ordinaryEarningsRateID: ") - .append(toIndentedString(ordinaryEarningsRateID)) - .append("\n"); + sb.append(" ordinaryEarningsRateID: ").append(toIndentedString(ordinaryEarningsRateID)).append("\n"); sb.append(" payrollCalendarID: ").append(toIndentedString(payrollCalendarID)).append("\n"); sb.append(" employeeGroupName: ").append(toIndentedString(employeeGroupName)).append("\n"); sb.append(" employeeID: ").append(toIndentedString(employeeID)).append("\n"); @@ -1919,7 +1684,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1927,4 +1693,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/EmployeeStatus.java b/src/main/java/com/xero/models/payrollau/EmployeeStatus.java index 42bcefaff..44c5b4038 100644 --- a/src/main/java/com/xero/models/payrollau/EmployeeStatus.java +++ b/src/main/java/com/xero/models/payrollau/EmployeeStatus.java @@ -9,19 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Employee Status Types */ +/** + * Employee Status Types + */ public enum EmployeeStatus { - - /** ACTIVE */ + + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** TERMINATED */ + + /** + * TERMINATED + */ TERMINATED("TERMINATED"); private String value; @@ -30,26 +46,24 @@ public enum EmployeeStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static EmployeeStatus fromValue(String value) { @@ -61,3 +75,4 @@ public static EmployeeStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/Employees.java b/src/main/java/com/xero/models/payrollau/Employees.java index 08f39f74e..47550e5f8 100644 --- a/src/main/java/com/xero/models/payrollau/Employees.java +++ b/src/main/java/com/xero/models/payrollau/Employees.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.Employee; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employees + */ -/** Employees */ public class Employees { StringUtil util = new StringUtil(); @JsonProperty("Employees") private List employees = new ArrayList(); /** - * employees - * - * @param employees List<Employee> - * @return Employees - */ + * employees + * @param employees List<Employee> + * @return Employees + **/ public Employees employees(List employees) { this.employees = employees; return this; @@ -37,10 +54,9 @@ public Employees employees(List employees) { /** * employees - * - * @param employeesItem Employee + * @param employeesItem Employee * @return Employees - */ + **/ public Employees addEmployeesItem(Employee employeesItem) { if (this.employees == null) { this.employees = new ArrayList(); @@ -49,30 +65,29 @@ public Employees addEmployeesItem(Employee employeesItem) { return this; } - /** + /** * Get employees - * * @return employees - */ + **/ @ApiModelProperty(value = "") - /** + /** * employees - * * @return employees List - */ + **/ public List getEmployees() { return employees; } - /** - * employees - * - * @param employees List<Employee> - */ + /** + * employees + * @param employees List<Employee> + **/ + public void setEmployees(List employees) { this.employees = employees; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(employees); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/EmploymentBasis.java b/src/main/java/com/xero/models/payrollau/EmploymentBasis.java index a4138d015..0e3278971 100644 --- a/src/main/java/com/xero/models/payrollau/EmploymentBasis.java +++ b/src/main/java/com/xero/models/payrollau/EmploymentBasis.java @@ -9,31 +9,54 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets EmploymentBasis */ +/** + * Gets or Sets EmploymentBasis + */ public enum EmploymentBasis { - - /** FULLTIME */ + + /** + * FULLTIME + */ FULLTIME("FULLTIME"), - - /** PARTTIME */ + + /** + * PARTTIME + */ PARTTIME("PARTTIME"), - - /** CASUAL */ + + /** + * CASUAL + */ CASUAL("CASUAL"), - - /** LABOURHIRE */ + + /** + * LABOURHIRE + */ LABOURHIRE("LABOURHIRE"), - - /** SUPERINCOMESTREAM */ + + /** + * SUPERINCOMESTREAM + */ SUPERINCOMESTREAM("SUPERINCOMESTREAM"), - - /** NONEMPLOYEE */ + + /** + * NONEMPLOYEE + */ NONEMPLOYEE("NONEMPLOYEE"); private String value; @@ -42,26 +65,24 @@ public enum EmploymentBasis { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static EmploymentBasis fromValue(String value) { @@ -73,3 +94,4 @@ public static EmploymentBasis fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/EmploymentTerminationPaymentType.java b/src/main/java/com/xero/models/payrollau/EmploymentTerminationPaymentType.java index 3b2a6caa9..dd74b462c 100644 --- a/src/main/java/com/xero/models/payrollau/EmploymentTerminationPaymentType.java +++ b/src/main/java/com/xero/models/payrollau/EmploymentTerminationPaymentType.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets EmploymentTerminationPaymentType */ +/** + * Gets or Sets EmploymentTerminationPaymentType + */ public enum EmploymentTerminationPaymentType { - - /** O */ + + /** + * O + */ O("O"), - - /** R */ + + /** + * R + */ R("R"); private String value; @@ -30,26 +45,24 @@ public enum EmploymentTerminationPaymentType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static EmploymentTerminationPaymentType fromValue(String value) { @@ -61,3 +74,4 @@ public static EmploymentTerminationPaymentType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/EmploymentType.java b/src/main/java/com/xero/models/payrollau/EmploymentType.java index 900d2880b..e13da4d41 100644 --- a/src/main/java/com/xero/models/payrollau/EmploymentType.java +++ b/src/main/java/com/xero/models/payrollau/EmploymentType.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets EmploymentType */ +/** + * Gets or Sets EmploymentType + */ public enum EmploymentType { - - /** EMPLOYEE */ + + /** + * EMPLOYEE + */ EMPLOYEE("EMPLOYEE"), - - /** CONTRACTOR */ + + /** + * CONTRACTOR + */ CONTRACTOR("CONTRACTOR"); private String value; @@ -30,26 +45,24 @@ public enum EmploymentType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static EmploymentType fromValue(String value) { @@ -61,3 +74,4 @@ public static EmploymentType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/EntitlementFinalPayPayoutType.java b/src/main/java/com/xero/models/payrollau/EntitlementFinalPayPayoutType.java index eba354777..7f194a9a2 100644 --- a/src/main/java/com/xero/models/payrollau/EntitlementFinalPayPayoutType.java +++ b/src/main/java/com/xero/models/payrollau/EntitlementFinalPayPayoutType.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets EntitlementFinalPayPayoutType */ +/** + * Gets or Sets EntitlementFinalPayPayoutType + */ public enum EntitlementFinalPayPayoutType { - - /** NOTPAIDOUT */ + + /** + * NOTPAIDOUT + */ NOTPAIDOUT("NOTPAIDOUT"), - - /** PAIDOUT */ + + /** + * PAIDOUT + */ PAIDOUT("PAIDOUT"); private String value; @@ -30,26 +45,24 @@ public enum EntitlementFinalPayPayoutType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static EntitlementFinalPayPayoutType fromValue(String value) { @@ -61,3 +74,4 @@ public static EntitlementFinalPayPayoutType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/HomeAddress.java b/src/main/java/com/xero/models/payrollau/HomeAddress.java index 2d6993542..4dd2c4781 100644 --- a/src/main/java/com/xero/models/payrollau/HomeAddress.java +++ b/src/main/java/com/xero/models/payrollau/HomeAddress.java @@ -9,14 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.State; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * HomeAddress + */ -/** HomeAddress */ public class HomeAddress { StringUtil util = new StringUtil(); @@ -38,218 +56,198 @@ public class HomeAddress { @JsonProperty("Country") private String country; /** - * Address line 1 for employee home address - * - * @param addressLine1 String - * @return HomeAddress - */ + * Address line 1 for employee home address + * @param addressLine1 String + * @return HomeAddress + **/ public HomeAddress addressLine1(String addressLine1) { this.addressLine1 = addressLine1; return this; } - /** + /** * Address line 1 for employee home address - * * @return addressLine1 - */ - @ApiModelProperty( - example = "123 Main St", - required = true, - value = "Address line 1 for employee home address") - /** + **/ + @ApiModelProperty(example = "123 Main St", required = true, value = "Address line 1 for employee home address") + /** * Address line 1 for employee home address - * * @return addressLine1 String - */ + **/ public String getAddressLine1() { return addressLine1; } - /** - * Address line 1 for employee home address - * - * @param addressLine1 String - */ + /** + * Address line 1 for employee home address + * @param addressLine1 String + **/ + public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } /** - * Address line 2 for employee home address - * - * @param addressLine2 String - * @return HomeAddress - */ + * Address line 2 for employee home address + * @param addressLine2 String + * @return HomeAddress + **/ public HomeAddress addressLine2(String addressLine2) { this.addressLine2 = addressLine2; return this; } - /** + /** * Address line 2 for employee home address - * * @return addressLine2 - */ + **/ @ApiModelProperty(example = "Apt 4", value = "Address line 2 for employee home address") - /** + /** * Address line 2 for employee home address - * * @return addressLine2 String - */ + **/ public String getAddressLine2() { return addressLine2; } - /** - * Address line 2 for employee home address - * - * @param addressLine2 String - */ + /** + * Address line 2 for employee home address + * @param addressLine2 String + **/ + public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } /** - * Suburb for employee home address - * - * @param city String - * @return HomeAddress - */ + * Suburb for employee home address + * @param city String + * @return HomeAddress + **/ public HomeAddress city(String city) { this.city = city; return this; } - /** + /** * Suburb for employee home address - * * @return city - */ + **/ @ApiModelProperty(example = "St. Kilda", value = "Suburb for employee home address") - /** + /** * Suburb for employee home address - * * @return city String - */ + **/ public String getCity() { return city; } - /** - * Suburb for employee home address - * - * @param city String - */ + /** + * Suburb for employee home address + * @param city String + **/ + public void setCity(String city) { this.city = city; } /** - * region - * - * @param region State - * @return HomeAddress - */ + * region + * @param region State + * @return HomeAddress + **/ public HomeAddress region(State region) { this.region = region; return this; } - /** + /** * Get region - * * @return region - */ + **/ @ApiModelProperty(value = "") - /** + /** * region - * * @return region State - */ + **/ public State getRegion() { return region; } - /** - * region - * - * @param region State - */ + /** + * region + * @param region State + **/ + public void setRegion(State region) { this.region = region; } /** - * PostCode for employee home address - * - * @param postalCode String - * @return HomeAddress - */ + * PostCode for employee home address + * @param postalCode String + * @return HomeAddress + **/ public HomeAddress postalCode(String postalCode) { this.postalCode = postalCode; return this; } - /** + /** * PostCode for employee home address - * * @return postalCode - */ + **/ @ApiModelProperty(example = "3182", value = "PostCode for employee home address") - /** + /** * PostCode for employee home address - * * @return postalCode String - */ + **/ public String getPostalCode() { return postalCode; } - /** - * PostCode for employee home address - * - * @param postalCode String - */ + /** + * PostCode for employee home address + * @param postalCode String + **/ + public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** - * Country of HomeAddress - * - * @param country String - * @return HomeAddress - */ + * Country of HomeAddress + * @param country String + * @return HomeAddress + **/ public HomeAddress country(String country) { this.country = country; return this; } - /** + /** * Country of HomeAddress - * * @return country - */ + **/ @ApiModelProperty(example = "AUSTRALIA", value = "Country of HomeAddress") - /** + /** * Country of HomeAddress - * * @return country String - */ + **/ public String getCountry() { return country; } - /** - * Country of HomeAddress - * - * @param country String - */ + /** + * Country of HomeAddress + * @param country String + **/ + public void setCountry(String country) { this.country = country; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -259,12 +257,12 @@ public boolean equals(java.lang.Object o) { return false; } HomeAddress homeAddress = (HomeAddress) o; - return Objects.equals(this.addressLine1, homeAddress.addressLine1) - && Objects.equals(this.addressLine2, homeAddress.addressLine2) - && Objects.equals(this.city, homeAddress.city) - && Objects.equals(this.region, homeAddress.region) - && Objects.equals(this.postalCode, homeAddress.postalCode) - && Objects.equals(this.country, homeAddress.country); + return Objects.equals(this.addressLine1, homeAddress.addressLine1) && + Objects.equals(this.addressLine2, homeAddress.addressLine2) && + Objects.equals(this.city, homeAddress.city) && + Objects.equals(this.region, homeAddress.region) && + Objects.equals(this.postalCode, homeAddress.postalCode) && + Objects.equals(this.country, homeAddress.country); } @Override @@ -272,6 +270,7 @@ public int hashCode() { return Objects.hash(addressLine1, addressLine2, city, region, postalCode, country); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -287,7 +286,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -295,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/IncomeType.java b/src/main/java/com/xero/models/payrollau/IncomeType.java index 7267e509a..2e72c61b0 100644 --- a/src/main/java/com/xero/models/payrollau/IncomeType.java +++ b/src/main/java/com/xero/models/payrollau/IncomeType.java @@ -9,28 +9,49 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets IncomeType */ +/** + * Gets or Sets IncomeType + */ public enum IncomeType { - - /** SALARYANDWAGES */ + + /** + * SALARYANDWAGES + */ SALARYANDWAGES("SALARYANDWAGES"), - - /** WORKINGHOLIDAYMAKER */ + + /** + * WORKINGHOLIDAYMAKER + */ WORKINGHOLIDAYMAKER("WORKINGHOLIDAYMAKER"), - - /** NONEMPLOYEE */ + + /** + * NONEMPLOYEE + */ NONEMPLOYEE("NONEMPLOYEE"), - - /** CLOSELYHELDPAYEES */ + + /** + * CLOSELYHELDPAYEES + */ CLOSELYHELDPAYEES("CLOSELYHELDPAYEES"), - - /** LABOURHIRE */ + + /** + * LABOURHIRE + */ LABOURHIRE("LABOURHIRE"); private String value; @@ -39,26 +60,24 @@ public enum IncomeType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static IncomeType fromValue(String value) { @@ -70,3 +89,4 @@ public static IncomeType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveAccrualLine.java b/src/main/java/com/xero/models/payrollau/LeaveAccrualLine.java index 1c623f3aa..352cc2764 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveAccrualLine.java +++ b/src/main/java/com/xero/models/payrollau/LeaveAccrualLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveAccrualLine + */ -/** LeaveAccrualLine */ public class LeaveAccrualLine { StringUtil util = new StringUtil(); @@ -30,112 +47,102 @@ public class LeaveAccrualLine { @JsonProperty("AutoCalculate") private Boolean autoCalculate; /** - * Xero identifier for the Leave type. - * - * @param leaveTypeID UUID - * @return LeaveAccrualLine - */ + * Xero identifier for the Leave type. + * @param leaveTypeID UUID + * @return LeaveAccrualLine + **/ public LeaveAccrualLine leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero identifier for the Leave type. - * * @return leaveTypeID - */ - @ApiModelProperty( - example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", - value = "Xero identifier for the Leave type.") - /** + **/ + @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier for the Leave type.") + /** * Xero identifier for the Leave type. - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero identifier for the Leave type. - * - * @param leaveTypeID UUID - */ + /** + * Xero identifier for the Leave type. + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * Leave Accrual number of units - * - * @param numberOfUnits Double - * @return LeaveAccrualLine - */ + * Leave Accrual number of units + * @param numberOfUnits Double + * @return LeaveAccrualLine + **/ public LeaveAccrualLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Leave Accrual number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(example = "105.5", value = "Leave Accrual number of units") - /** + /** * Leave Accrual number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Leave Accrual number of units - * - * @param numberOfUnits Double - */ + /** + * Leave Accrual number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * If you want to auto calculate leave. - * - * @param autoCalculate Boolean - * @return LeaveAccrualLine - */ + * If you want to auto calculate leave. + * @param autoCalculate Boolean + * @return LeaveAccrualLine + **/ public LeaveAccrualLine autoCalculate(Boolean autoCalculate) { this.autoCalculate = autoCalculate; return this; } - /** + /** * If you want to auto calculate leave. - * * @return autoCalculate - */ + **/ @ApiModelProperty(example = "true", value = "If you want to auto calculate leave.") - /** + /** * If you want to auto calculate leave. - * * @return autoCalculate Boolean - */ + **/ public Boolean getAutoCalculate() { return autoCalculate; } - /** - * If you want to auto calculate leave. - * - * @param autoCalculate Boolean - */ + /** + * If you want to auto calculate leave. + * @param autoCalculate Boolean + **/ + public void setAutoCalculate(Boolean autoCalculate) { this.autoCalculate = autoCalculate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -145,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } LeaveAccrualLine leaveAccrualLine = (LeaveAccrualLine) o; - return Objects.equals(this.leaveTypeID, leaveAccrualLine.leaveTypeID) - && Objects.equals(this.numberOfUnits, leaveAccrualLine.numberOfUnits) - && Objects.equals(this.autoCalculate, leaveAccrualLine.autoCalculate); + return Objects.equals(this.leaveTypeID, leaveAccrualLine.leaveTypeID) && + Objects.equals(this.numberOfUnits, leaveAccrualLine.numberOfUnits) && + Objects.equals(this.autoCalculate, leaveAccrualLine.autoCalculate); } @Override @@ -155,6 +162,7 @@ public int hashCode() { return Objects.hash(leaveTypeID, numberOfUnits, autoCalculate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -167,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -175,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveApplication.java b/src/main/java/com/xero/models/payrollau/LeaveApplication.java index bd200d58e..791de39a1 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveApplication.java +++ b/src/main/java/com/xero/models/payrollau/LeaveApplication.java @@ -9,22 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.LeavePeriod; +import com.xero.models.payrollau.PayOutType; +import com.xero.models.payrollau.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveApplication + */ -/** LeaveApplication */ public class LeaveApplication { StringUtil util = new StringUtil(); @@ -61,357 +76,318 @@ public class LeaveApplication { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * The Xero identifier for Payroll Employee - * - * @param leaveApplicationID UUID - * @return LeaveApplication - */ + * The Xero identifier for Payroll Employee + * @param leaveApplicationID UUID + * @return LeaveApplication + **/ public LeaveApplication leaveApplicationID(UUID leaveApplicationID) { this.leaveApplicationID = leaveApplicationID; return this; } - /** + /** * The Xero identifier for Payroll Employee - * * @return leaveApplicationID - */ - @ApiModelProperty( - example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", - value = "The Xero identifier for Payroll Employee") - /** + **/ + @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "The Xero identifier for Payroll Employee") + /** * The Xero identifier for Payroll Employee - * * @return leaveApplicationID UUID - */ + **/ public UUID getLeaveApplicationID() { return leaveApplicationID; } - /** - * The Xero identifier for Payroll Employee - * - * @param leaveApplicationID UUID - */ + /** + * The Xero identifier for Payroll Employee + * @param leaveApplicationID UUID + **/ + public void setLeaveApplicationID(UUID leaveApplicationID) { this.leaveApplicationID = leaveApplicationID; } /** - * The Xero identifier for Payroll Employee - * - * @param employeeID UUID - * @return LeaveApplication - */ + * The Xero identifier for Payroll Employee + * @param employeeID UUID + * @return LeaveApplication + **/ public LeaveApplication employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for Payroll Employee - * * @return employeeID - */ - @ApiModelProperty( - example = "fb4ebd68-6568-41eb-96ab-628a0f54b4b8", - value = "The Xero identifier for Payroll Employee") - /** + **/ + @ApiModelProperty(example = "fb4ebd68-6568-41eb-96ab-628a0f54b4b8", value = "The Xero identifier for Payroll Employee") + /** * The Xero identifier for Payroll Employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for Payroll Employee - * - * @param employeeID UUID - */ + /** + * The Xero identifier for Payroll Employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The Xero identifier for Leave Type - * - * @param leaveTypeID UUID - * @return LeaveApplication - */ + * The Xero identifier for Leave Type + * @param leaveTypeID UUID + * @return LeaveApplication + **/ public LeaveApplication leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * The Xero identifier for Leave Type - * * @return leaveTypeID - */ - @ApiModelProperty( - example = "742998cb-7584-4ecf-aa88-d694f59c50f9", - value = "The Xero identifier for Leave Type") - /** + **/ + @ApiModelProperty(example = "742998cb-7584-4ecf-aa88-d694f59c50f9", value = "The Xero identifier for Leave Type") + /** * The Xero identifier for Leave Type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The Xero identifier for Leave Type - * - * @param leaveTypeID UUID - */ + /** + * The Xero identifier for Leave Type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The title of the leave - * - * @param title String - * @return LeaveApplication - */ + * The title of the leave + * @param title String + * @return LeaveApplication + **/ public LeaveApplication title(String title) { this.title = title; return this; } - /** + /** * The title of the leave - * * @return title - */ + **/ @ApiModelProperty(example = "Annual Leave", value = "The title of the leave") - /** + /** * The title of the leave - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * The title of the leave - * - * @param title String - */ + /** + * The title of the leave + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * Start date of the leave (YYYY-MM-DD) - * - * @param startDate String - * @return LeaveApplication - */ + * Start date of the leave (YYYY-MM-DD) + * @param startDate String + * @return LeaveApplication + **/ public LeaveApplication startDate(String startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the leave (YYYY-MM-DD) - * * @return startDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "Start date of the leave (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "Start date of the leave (YYYY-MM-DD)") + /** * Start date of the leave (YYYY-MM-DD) - * * @return startDate String - */ + **/ public String getStartDate() { return startDate; } - /** + /** * Start date of the leave (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getStartDateAsDate() { if (this.startDate != null) { try { return util.convertStringToDate(this.startDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Start date of the leave (YYYY-MM-DD) - * - * @param startDate String - */ + /** + * Start date of the leave (YYYY-MM-DD) + * @param startDate String + **/ + public void setStartDate(String startDate) { this.startDate = startDate; } - /** - * Start date of the leave (YYYY-MM-DD) - * - * @param startDate LocalDateTime - */ + /** + * Start date of the leave (YYYY-MM-DD) + * @param startDate LocalDateTime + **/ public void setStartDate(LocalDate startDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.startDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * End date of the leave (YYYY-MM-DD) - * - * @param endDate String - * @return LeaveApplication - */ + * End date of the leave (YYYY-MM-DD) + * @param endDate String + * @return LeaveApplication + **/ public LeaveApplication endDate(String endDate) { this.endDate = endDate; return this; } - /** + /** * End date of the leave (YYYY-MM-DD) - * * @return endDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "End date of the leave (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "End date of the leave (YYYY-MM-DD)") + /** * End date of the leave (YYYY-MM-DD) - * * @return endDate String - */ + **/ public String getEndDate() { return endDate; } - /** + /** * End date of the leave (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getEndDateAsDate() { if (this.endDate != null) { try { return util.convertStringToDate(this.endDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * End date of the leave (YYYY-MM-DD) - * - * @param endDate String - */ + /** + * End date of the leave (YYYY-MM-DD) + * @param endDate String + **/ + public void setEndDate(String endDate) { this.endDate = endDate; } - /** - * End date of the leave (YYYY-MM-DD) - * - * @param endDate LocalDateTime - */ + /** + * End date of the leave (YYYY-MM-DD) + * @param endDate LocalDateTime + **/ public void setEndDate(LocalDate endDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = endDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = endDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.endDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * The Description of the Leave - * - * @param description String - * @return LeaveApplication - */ + * The Description of the Leave + * @param description String + * @return LeaveApplication + **/ public LeaveApplication description(String description) { this.description = description; return this; } - /** + /** * The Description of the Leave - * * @return description - */ + **/ @ApiModelProperty(example = "My leave", value = "The Description of the Leave") - /** + /** * The Description of the Leave - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * The Description of the Leave - * - * @param description String - */ + /** + * The Description of the Leave + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * payOutType - * - * @param payOutType PayOutType - * @return LeaveApplication - */ + * payOutType + * @param payOutType PayOutType + * @return LeaveApplication + **/ public LeaveApplication payOutType(PayOutType payOutType) { this.payOutType = payOutType; return this; } - /** + /** * Get payOutType - * * @return payOutType - */ + **/ @ApiModelProperty(value = "") - /** + /** * payOutType - * * @return payOutType PayOutType - */ + **/ public PayOutType getPayOutType() { return payOutType; } - /** - * payOutType - * - * @param payOutType PayOutType - */ + /** + * payOutType + * @param payOutType PayOutType + **/ + public void setPayOutType(PayOutType payOutType) { this.payOutType = payOutType; } /** - * leavePeriods - * - * @param leavePeriods List<LeavePeriod> - * @return LeaveApplication - */ + * leavePeriods + * @param leavePeriods List<LeavePeriod> + * @return LeaveApplication + **/ public LeaveApplication leavePeriods(List leavePeriods) { this.leavePeriods = leavePeriods; return this; @@ -419,10 +395,9 @@ public LeaveApplication leavePeriods(List leavePeriods) { /** * leavePeriods - * - * @param leavePeriodsItem LeavePeriod + * @param leavePeriodsItem LeavePeriod * @return LeaveApplication - */ + **/ public LeaveApplication addLeavePeriodsItem(LeavePeriod leavePeriodsItem) { if (this.leavePeriods == null) { this.leavePeriods = new ArrayList(); @@ -431,66 +406,60 @@ public LeaveApplication addLeavePeriodsItem(LeavePeriod leavePeriodsItem) { return this; } - /** + /** * Get leavePeriods - * * @return leavePeriods - */ + **/ @ApiModelProperty(value = "") - /** + /** * leavePeriods - * * @return leavePeriods List - */ + **/ public List getLeavePeriods() { return leavePeriods; } - /** - * leavePeriods - * - * @param leavePeriods List<LeavePeriod> - */ + /** + * leavePeriods + * @param leavePeriods List<LeavePeriod> + **/ + public void setLeavePeriods(List leavePeriods) { this.leavePeriods = leavePeriods; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return LeaveApplication - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return LeaveApplication + **/ public LeaveApplication validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -498,10 +467,9 @@ public LeaveApplication validationErrors(List validationErrors) /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return LeaveApplication - */ + **/ public LeaveApplication addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -510,30 +478,29 @@ public LeaveApplication addValidationErrorsItem(ValidationError validationErrors return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -543,35 +510,25 @@ public boolean equals(java.lang.Object o) { return false; } LeaveApplication leaveApplication = (LeaveApplication) o; - return Objects.equals(this.leaveApplicationID, leaveApplication.leaveApplicationID) - && Objects.equals(this.employeeID, leaveApplication.employeeID) - && Objects.equals(this.leaveTypeID, leaveApplication.leaveTypeID) - && Objects.equals(this.title, leaveApplication.title) - && Objects.equals(this.startDate, leaveApplication.startDate) - && Objects.equals(this.endDate, leaveApplication.endDate) - && Objects.equals(this.description, leaveApplication.description) - && Objects.equals(this.payOutType, leaveApplication.payOutType) - && Objects.equals(this.leavePeriods, leaveApplication.leavePeriods) - && Objects.equals(this.updatedDateUTC, leaveApplication.updatedDateUTC) - && Objects.equals(this.validationErrors, leaveApplication.validationErrors); + return Objects.equals(this.leaveApplicationID, leaveApplication.leaveApplicationID) && + Objects.equals(this.employeeID, leaveApplication.employeeID) && + Objects.equals(this.leaveTypeID, leaveApplication.leaveTypeID) && + Objects.equals(this.title, leaveApplication.title) && + Objects.equals(this.startDate, leaveApplication.startDate) && + Objects.equals(this.endDate, leaveApplication.endDate) && + Objects.equals(this.description, leaveApplication.description) && + Objects.equals(this.payOutType, leaveApplication.payOutType) && + Objects.equals(this.leavePeriods, leaveApplication.leavePeriods) && + Objects.equals(this.updatedDateUTC, leaveApplication.updatedDateUTC) && + Objects.equals(this.validationErrors, leaveApplication.validationErrors); } @Override public int hashCode() { - return Objects.hash( - leaveApplicationID, - employeeID, - leaveTypeID, - title, - startDate, - endDate, - description, - payOutType, - leavePeriods, - updatedDateUTC, - validationErrors); + return Objects.hash(leaveApplicationID, employeeID, leaveTypeID, title, startDate, endDate, description, payOutType, leavePeriods, updatedDateUTC, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -592,7 +549,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -600,4 +558,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveApplications.java b/src/main/java/com/xero/models/payrollau/LeaveApplications.java index 5db169a0a..31f4033f6 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveApplications.java +++ b/src/main/java/com/xero/models/payrollau/LeaveApplications.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.LeaveApplication; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveApplications + */ -/** LeaveApplications */ public class LeaveApplications { StringUtil util = new StringUtil(); @JsonProperty("LeaveApplications") private List leaveApplications = new ArrayList(); /** - * leaveApplications - * - * @param leaveApplications List<LeaveApplication> - * @return LeaveApplications - */ + * leaveApplications + * @param leaveApplications List<LeaveApplication> + * @return LeaveApplications + **/ public LeaveApplications leaveApplications(List leaveApplications) { this.leaveApplications = leaveApplications; return this; @@ -37,10 +54,9 @@ public LeaveApplications leaveApplications(List leaveApplicati /** * leaveApplications - * - * @param leaveApplicationsItem LeaveApplication + * @param leaveApplicationsItem LeaveApplication * @return LeaveApplications - */ + **/ public LeaveApplications addLeaveApplicationsItem(LeaveApplication leaveApplicationsItem) { if (this.leaveApplications == null) { this.leaveApplications = new ArrayList(); @@ -49,30 +65,29 @@ public LeaveApplications addLeaveApplicationsItem(LeaveApplication leaveApplicat return this; } - /** + /** * Get leaveApplications - * * @return leaveApplications - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveApplications - * * @return leaveApplications List - */ + **/ public List getLeaveApplications() { return leaveApplications; } - /** - * leaveApplications - * - * @param leaveApplications List<LeaveApplication> - */ + /** + * leaveApplications + * @param leaveApplications List<LeaveApplication> + **/ + public void setLeaveApplications(List leaveApplications) { this.leaveApplications = leaveApplications; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(leaveApplications); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveBalance.java b/src/main/java/com/xero/models/payrollau/LeaveBalance.java index 6bf31de2f..6ad5c80fd 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveBalance.java +++ b/src/main/java/com/xero/models/payrollau/LeaveBalance.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveBalance + */ -/** LeaveBalance */ public class LeaveBalance { StringUtil util = new StringUtil(); @@ -32,149 +49,134 @@ public class LeaveBalance { @JsonProperty("TypeOfUnits") private String typeOfUnits; /** - * The name of the leave type - * - * @param leaveName String - * @return LeaveBalance - */ + * The name of the leave type + * @param leaveName String + * @return LeaveBalance + **/ public LeaveBalance leaveName(String leaveName) { this.leaveName = leaveName; return this; } - /** + /** * The name of the leave type - * * @return leaveName - */ + **/ @ApiModelProperty(example = "Annual Leave", value = "The name of the leave type") - /** + /** * The name of the leave type - * * @return leaveName String - */ + **/ public String getLeaveName() { return leaveName; } - /** - * The name of the leave type - * - * @param leaveName String - */ + /** + * The name of the leave type + * @param leaveName String + **/ + public void setLeaveName(String leaveName) { this.leaveName = leaveName; } /** - * Identifier of the leave type (see PayItems) - * - * @param leaveTypeID String - * @return LeaveBalance - */ + * Identifier of the leave type (see PayItems) + * @param leaveTypeID String + * @return LeaveBalance + **/ public LeaveBalance leaveTypeID(String leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Identifier of the leave type (see PayItems) - * * @return leaveTypeID - */ - @ApiModelProperty( - example = "544d9292-4329-4512-bfff-a9f15236d776", - value = "Identifier of the leave type (see PayItems)") - /** + **/ + @ApiModelProperty(example = "544d9292-4329-4512-bfff-a9f15236d776", value = "Identifier of the leave type (see PayItems)") + /** * Identifier of the leave type (see PayItems) - * * @return leaveTypeID String - */ + **/ public String getLeaveTypeID() { return leaveTypeID; } - /** - * Identifier of the leave type (see PayItems) - * - * @param leaveTypeID String - */ + /** + * Identifier of the leave type (see PayItems) + * @param leaveTypeID String + **/ + public void setLeaveTypeID(String leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The balance of the leave available - * - * @param numberOfUnits Double - * @return LeaveBalance - */ + * The balance of the leave available + * @param numberOfUnits Double + * @return LeaveBalance + **/ public LeaveBalance numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The balance of the leave available - * * @return numberOfUnits - */ + **/ @ApiModelProperty(example = "81.2602", value = "The balance of the leave available") - /** + /** * The balance of the leave available - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The balance of the leave available - * - * @param numberOfUnits Double - */ + /** + * The balance of the leave available + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * The type of units as specified by the LeaveType (see PayItems) - * - * @param typeOfUnits String - * @return LeaveBalance - */ + * The type of units as specified by the LeaveType (see PayItems) + * @param typeOfUnits String + * @return LeaveBalance + **/ public LeaveBalance typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * The type of units as specified by the LeaveType (see PayItems) - * * @return typeOfUnits - */ - @ApiModelProperty( - example = "Hours", - value = "The type of units as specified by the LeaveType (see PayItems)") - /** + **/ + @ApiModelProperty(example = "Hours", value = "The type of units as specified by the LeaveType (see PayItems)") + /** * The type of units as specified by the LeaveType (see PayItems) - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of units as specified by the LeaveType (see PayItems) - * - * @param typeOfUnits String - */ + /** + * The type of units as specified by the LeaveType (see PayItems) + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } LeaveBalance leaveBalance = (LeaveBalance) o; - return Objects.equals(this.leaveName, leaveBalance.leaveName) - && Objects.equals(this.leaveTypeID, leaveBalance.leaveTypeID) - && Objects.equals(this.numberOfUnits, leaveBalance.numberOfUnits) - && Objects.equals(this.typeOfUnits, leaveBalance.typeOfUnits); + return Objects.equals(this.leaveName, leaveBalance.leaveName) && + Objects.equals(this.leaveTypeID, leaveBalance.leaveTypeID) && + Objects.equals(this.numberOfUnits, leaveBalance.numberOfUnits) && + Objects.equals(this.typeOfUnits, leaveBalance.typeOfUnits); } @Override @@ -195,6 +197,7 @@ public int hashCode() { return Objects.hash(leaveName, leaveTypeID, numberOfUnits, typeOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -208,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -216,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveCategoryCode.java b/src/main/java/com/xero/models/payrollau/LeaveCategoryCode.java index 4fc5981a8..e678efcb8 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveCategoryCode.java +++ b/src/main/java/com/xero/models/payrollau/LeaveCategoryCode.java @@ -9,49 +9,85 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Code used to identify the Leave Category */ +/** + * Code used to identify the Leave Category + */ public enum LeaveCategoryCode { - - /** ANNUALLEAVE */ + + /** + * ANNUALLEAVE + */ ANNUALLEAVE("ANNUALLEAVE"), - - /** LONGSERVICELEAVE */ + + /** + * LONGSERVICELEAVE + */ LONGSERVICELEAVE("LONGSERVICELEAVE"), - - /** PERSONALSICKCARERSLEAVE */ + + /** + * PERSONALSICKCARERSLEAVE + */ PERSONALSICKCARERSLEAVE("PERSONALSICKCARERSLEAVE"), - - /** ROSTEREDDAYOFF */ + + /** + * ROSTEREDDAYOFF + */ ROSTEREDDAYOFF("ROSTEREDDAYOFF"), - - /** TIMEOFFINLIEU */ + + /** + * TIMEOFFINLIEU + */ TIMEOFFINLIEU("TIMEOFFINLIEU"), - - /** COMPASSIONATEANDBEREAVEMENTLEAVE */ + + /** + * COMPASSIONATEANDBEREAVEMENTLEAVE + */ COMPASSIONATEANDBEREAVEMENTLEAVE("COMPASSIONATEANDBEREAVEMENTLEAVE"), - - /** STUDYLEAVE */ + + /** + * STUDYLEAVE + */ STUDYLEAVE("STUDYLEAVE"), - - /** FAMILYANDDOMESTICVIOLENCELEAVE */ + + /** + * FAMILYANDDOMESTICVIOLENCELEAVE + */ FAMILYANDDOMESTICVIOLENCELEAVE("FAMILYANDDOMESTICVIOLENCELEAVE"), - - /** SPECIALPAIDLEAVE */ + + /** + * SPECIALPAIDLEAVE + */ SPECIALPAIDLEAVE("SPECIALPAIDLEAVE"), - - /** COMMUNITYSERVICELEAVE */ + + /** + * COMMUNITYSERVICELEAVE + */ COMMUNITYSERVICELEAVE("COMMUNITYSERVICELEAVE"), - - /** JURYDUTYLEAVE */ + + /** + * JURYDUTYLEAVE + */ JURYDUTYLEAVE("JURYDUTYLEAVE"), - - /** DEFENCERESERVELEAVE */ + + /** + * DEFENCERESERVELEAVE + */ DEFENCERESERVELEAVE("DEFENCERESERVELEAVE"); private String value; @@ -60,26 +96,24 @@ public enum LeaveCategoryCode { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static LeaveCategoryCode fromValue(String value) { @@ -91,3 +125,4 @@ public static LeaveCategoryCode fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveEarningsLine.java b/src/main/java/com/xero/models/payrollau/LeaveEarningsLine.java index 5f628c4db..62a24084c 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveEarningsLine.java +++ b/src/main/java/com/xero/models/payrollau/LeaveEarningsLine.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.PayOutType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveEarningsLine + */ -/** LeaveEarningsLine */ public class LeaveEarningsLine { StringUtil util = new StringUtil(); @@ -33,145 +51,134 @@ public class LeaveEarningsLine { @JsonProperty("PayOutType") private PayOutType payOutType; /** - * Xero identifier - * - * @param earningsRateID UUID - * @return LeaveEarningsLine - */ + * Xero identifier + * @param earningsRateID UUID + * @return LeaveEarningsLine + **/ public LeaveEarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier - * * @return earningsRateID - */ + **/ @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier") - /** + /** * Xero identifier - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier - * - * @param earningsRateID UUID - */ + /** + * Xero identifier + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * Rate per unit of the EarningsLine. - * - * @param ratePerUnit Double - * @return LeaveEarningsLine - */ + * Rate per unit of the EarningsLine. + * @param ratePerUnit Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit of the EarningsLine. - * * @return ratePerUnit - */ + **/ @ApiModelProperty(example = "38.0", value = "Rate per unit of the EarningsLine.") - /** + /** * Rate per unit of the EarningsLine. - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit of the EarningsLine. - * - * @param ratePerUnit Double - */ + /** + * Rate per unit of the EarningsLine. + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Earnings rate number of units. - * - * @param numberOfUnits Double - * @return LeaveEarningsLine - */ + * Earnings rate number of units. + * @param numberOfUnits Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Earnings rate number of units. - * * @return numberOfUnits - */ + **/ @ApiModelProperty(example = "2.5", value = "Earnings rate number of units.") - /** + /** * Earnings rate number of units. - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Earnings rate number of units. - * - * @param numberOfUnits Double - */ + /** + * Earnings rate number of units. + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * payOutType - * - * @param payOutType PayOutType - * @return LeaveEarningsLine - */ + * payOutType + * @param payOutType PayOutType + * @return LeaveEarningsLine + **/ public LeaveEarningsLine payOutType(PayOutType payOutType) { this.payOutType = payOutType; return this; } - /** + /** * Get payOutType - * * @return payOutType - */ + **/ @ApiModelProperty(value = "") - /** + /** * payOutType - * * @return payOutType PayOutType - */ + **/ public PayOutType getPayOutType() { return payOutType; } - /** - * payOutType - * - * @param payOutType PayOutType - */ + /** + * payOutType + * @param payOutType PayOutType + **/ + public void setPayOutType(PayOutType payOutType) { this.payOutType = payOutType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +188,10 @@ public boolean equals(java.lang.Object o) { return false; } LeaveEarningsLine leaveEarningsLine = (LeaveEarningsLine) o; - return Objects.equals(this.earningsRateID, leaveEarningsLine.earningsRateID) - && Objects.equals(this.ratePerUnit, leaveEarningsLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, leaveEarningsLine.numberOfUnits) - && Objects.equals(this.payOutType, leaveEarningsLine.payOutType); + return Objects.equals(this.earningsRateID, leaveEarningsLine.earningsRateID) && + Objects.equals(this.ratePerUnit, leaveEarningsLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, leaveEarningsLine.numberOfUnits) && + Objects.equals(this.payOutType, leaveEarningsLine.payOutType); } @Override @@ -192,6 +199,7 @@ public int hashCode() { return Objects.hash(earningsRateID, ratePerUnit, numberOfUnits, payOutType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +213,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +222,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveLine.java b/src/main/java/com/xero/models/payrollau/LeaveLine.java index 7c950c4d4..749892606 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveLine.java +++ b/src/main/java/com/xero/models/payrollau/LeaveLine.java @@ -9,15 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.EmploymentTerminationPaymentType; +import com.xero.models.payrollau.EntitlementFinalPayPayoutType; +import com.xero.models.payrollau.LeaveLineCalculationType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveLine + */ -/** LeaveLine */ public class LeaveLine { StringUtil util = new StringUtil(); @@ -45,295 +65,262 @@ public class LeaveLine { @JsonProperty("FullTimeNumberOfUnitsPerPeriod") private Double fullTimeNumberOfUnitsPerPeriod; /** - * Xero leave type identifier - * - * @param leaveTypeID UUID - * @return LeaveLine - */ + * Xero leave type identifier + * @param leaveTypeID UUID + * @return LeaveLine + **/ public LeaveLine leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero leave type identifier - * * @return leaveTypeID - */ - @ApiModelProperty( - example = "742998cb-7584-4ecf-aa88-d694f59c50f9", - value = "Xero leave type identifier") - /** + **/ + @ApiModelProperty(example = "742998cb-7584-4ecf-aa88-d694f59c50f9", value = "Xero leave type identifier") + /** * Xero leave type identifier - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero leave type identifier - * - * @param leaveTypeID UUID - */ + /** + * Xero leave type identifier + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * calculationType - * - * @param calculationType LeaveLineCalculationType - * @return LeaveLine - */ + * calculationType + * @param calculationType LeaveLineCalculationType + * @return LeaveLine + **/ public LeaveLine calculationType(LeaveLineCalculationType calculationType) { this.calculationType = calculationType; return this; } - /** + /** * Get calculationType - * * @return calculationType - */ + **/ @ApiModelProperty(value = "") - /** + /** * calculationType - * * @return calculationType LeaveLineCalculationType - */ + **/ public LeaveLineCalculationType getCalculationType() { return calculationType; } - /** - * calculationType - * - * @param calculationType LeaveLineCalculationType - */ + /** + * calculationType + * @param calculationType LeaveLineCalculationType + **/ + public void setCalculationType(LeaveLineCalculationType calculationType) { this.calculationType = calculationType; } /** - * entitlementFinalPayPayoutType - * - * @param entitlementFinalPayPayoutType EntitlementFinalPayPayoutType - * @return LeaveLine - */ - public LeaveLine entitlementFinalPayPayoutType( - EntitlementFinalPayPayoutType entitlementFinalPayPayoutType) { + * entitlementFinalPayPayoutType + * @param entitlementFinalPayPayoutType EntitlementFinalPayPayoutType + * @return LeaveLine + **/ + public LeaveLine entitlementFinalPayPayoutType(EntitlementFinalPayPayoutType entitlementFinalPayPayoutType) { this.entitlementFinalPayPayoutType = entitlementFinalPayPayoutType; return this; } - /** + /** * Get entitlementFinalPayPayoutType - * * @return entitlementFinalPayPayoutType - */ + **/ @ApiModelProperty(value = "") - /** + /** * entitlementFinalPayPayoutType - * * @return entitlementFinalPayPayoutType EntitlementFinalPayPayoutType - */ + **/ public EntitlementFinalPayPayoutType getEntitlementFinalPayPayoutType() { return entitlementFinalPayPayoutType; } - /** - * entitlementFinalPayPayoutType - * - * @param entitlementFinalPayPayoutType EntitlementFinalPayPayoutType - */ - public void setEntitlementFinalPayPayoutType( - EntitlementFinalPayPayoutType entitlementFinalPayPayoutType) { + /** + * entitlementFinalPayPayoutType + * @param entitlementFinalPayPayoutType EntitlementFinalPayPayoutType + **/ + + public void setEntitlementFinalPayPayoutType(EntitlementFinalPayPayoutType entitlementFinalPayPayoutType) { this.entitlementFinalPayPayoutType = entitlementFinalPayPayoutType; } /** - * employmentTerminationPaymentType - * - * @param employmentTerminationPaymentType EmploymentTerminationPaymentType - * @return LeaveLine - */ - public LeaveLine employmentTerminationPaymentType( - EmploymentTerminationPaymentType employmentTerminationPaymentType) { + * employmentTerminationPaymentType + * @param employmentTerminationPaymentType EmploymentTerminationPaymentType + * @return LeaveLine + **/ + public LeaveLine employmentTerminationPaymentType(EmploymentTerminationPaymentType employmentTerminationPaymentType) { this.employmentTerminationPaymentType = employmentTerminationPaymentType; return this; } - /** + /** * Get employmentTerminationPaymentType - * * @return employmentTerminationPaymentType - */ + **/ @ApiModelProperty(value = "") - /** + /** * employmentTerminationPaymentType - * * @return employmentTerminationPaymentType EmploymentTerminationPaymentType - */ + **/ public EmploymentTerminationPaymentType getEmploymentTerminationPaymentType() { return employmentTerminationPaymentType; } - /** - * employmentTerminationPaymentType - * - * @param employmentTerminationPaymentType EmploymentTerminationPaymentType - */ - public void setEmploymentTerminationPaymentType( - EmploymentTerminationPaymentType employmentTerminationPaymentType) { + /** + * employmentTerminationPaymentType + * @param employmentTerminationPaymentType EmploymentTerminationPaymentType + **/ + + public void setEmploymentTerminationPaymentType(EmploymentTerminationPaymentType employmentTerminationPaymentType) { this.employmentTerminationPaymentType = employmentTerminationPaymentType; } /** - * amount of leave line - * - * @param includeSuperannuationGuaranteeContribution Boolean - * @return LeaveLine - */ - public LeaveLine includeSuperannuationGuaranteeContribution( - Boolean includeSuperannuationGuaranteeContribution) { + * amount of leave line + * @param includeSuperannuationGuaranteeContribution Boolean + * @return LeaveLine + **/ + public LeaveLine includeSuperannuationGuaranteeContribution(Boolean includeSuperannuationGuaranteeContribution) { this.includeSuperannuationGuaranteeContribution = includeSuperannuationGuaranteeContribution; return this; } - /** + /** * amount of leave line - * * @return includeSuperannuationGuaranteeContribution - */ + **/ @ApiModelProperty(example = "true", value = "amount of leave line") - /** + /** * amount of leave line - * * @return includeSuperannuationGuaranteeContribution Boolean - */ + **/ public Boolean getIncludeSuperannuationGuaranteeContribution() { return includeSuperannuationGuaranteeContribution; } - /** - * amount of leave line - * - * @param includeSuperannuationGuaranteeContribution Boolean - */ - public void setIncludeSuperannuationGuaranteeContribution( - Boolean includeSuperannuationGuaranteeContribution) { + /** + * amount of leave line + * @param includeSuperannuationGuaranteeContribution Boolean + **/ + + public void setIncludeSuperannuationGuaranteeContribution(Boolean includeSuperannuationGuaranteeContribution) { this.includeSuperannuationGuaranteeContribution = includeSuperannuationGuaranteeContribution; } /** - * Number of units for leave line. - * - * @param numberOfUnits Double - * @return LeaveLine - */ + * Number of units for leave line. + * @param numberOfUnits Double + * @return LeaveLine + **/ public LeaveLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Number of units for leave line. - * * @return numberOfUnits - */ + **/ @ApiModelProperty(example = "2.5", value = "Number of units for leave line.") - /** + /** * Number of units for leave line. - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Number of units for leave line. - * - * @param numberOfUnits Double - */ + /** + * Number of units for leave line. + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Hours of leave accrued each year - * - * @param annualNumberOfUnits Double - * @return LeaveLine - */ + * Hours of leave accrued each year + * @param annualNumberOfUnits Double + * @return LeaveLine + **/ public LeaveLine annualNumberOfUnits(Double annualNumberOfUnits) { this.annualNumberOfUnits = annualNumberOfUnits; return this; } - /** + /** * Hours of leave accrued each year - * * @return annualNumberOfUnits - */ + **/ @ApiModelProperty(example = "2.5", value = "Hours of leave accrued each year") - /** + /** * Hours of leave accrued each year - * * @return annualNumberOfUnits Double - */ + **/ public Double getAnnualNumberOfUnits() { return annualNumberOfUnits; } - /** - * Hours of leave accrued each year - * - * @param annualNumberOfUnits Double - */ + /** + * Hours of leave accrued each year + * @param annualNumberOfUnits Double + **/ + public void setAnnualNumberOfUnits(Double annualNumberOfUnits) { this.annualNumberOfUnits = annualNumberOfUnits; } /** - * Normal ordinary earnings number of units for leave line. - * - * @param fullTimeNumberOfUnitsPerPeriod Double - * @return LeaveLine - */ + * Normal ordinary earnings number of units for leave line. + * @param fullTimeNumberOfUnitsPerPeriod Double + * @return LeaveLine + **/ public LeaveLine fullTimeNumberOfUnitsPerPeriod(Double fullTimeNumberOfUnitsPerPeriod) { this.fullTimeNumberOfUnitsPerPeriod = fullTimeNumberOfUnitsPerPeriod; return this; } - /** + /** * Normal ordinary earnings number of units for leave line. - * * @return fullTimeNumberOfUnitsPerPeriod - */ - @ApiModelProperty( - example = "2.5", - value = "Normal ordinary earnings number of units for leave line.") - /** + **/ + @ApiModelProperty(example = "2.5", value = "Normal ordinary earnings number of units for leave line.") + /** * Normal ordinary earnings number of units for leave line. - * * @return fullTimeNumberOfUnitsPerPeriod Double - */ + **/ public Double getFullTimeNumberOfUnitsPerPeriod() { return fullTimeNumberOfUnitsPerPeriod; } - /** - * Normal ordinary earnings number of units for leave line. - * - * @param fullTimeNumberOfUnitsPerPeriod Double - */ + /** + * Normal ordinary earnings number of units for leave line. + * @param fullTimeNumberOfUnitsPerPeriod Double + **/ + public void setFullTimeNumberOfUnitsPerPeriod(Double fullTimeNumberOfUnitsPerPeriod) { this.fullTimeNumberOfUnitsPerPeriod = fullTimeNumberOfUnitsPerPeriod; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -343,62 +330,41 @@ public boolean equals(java.lang.Object o) { return false; } LeaveLine leaveLine = (LeaveLine) o; - return Objects.equals(this.leaveTypeID, leaveLine.leaveTypeID) - && Objects.equals(this.calculationType, leaveLine.calculationType) - && Objects.equals( - this.entitlementFinalPayPayoutType, leaveLine.entitlementFinalPayPayoutType) - && Objects.equals( - this.employmentTerminationPaymentType, leaveLine.employmentTerminationPaymentType) - && Objects.equals( - this.includeSuperannuationGuaranteeContribution, - leaveLine.includeSuperannuationGuaranteeContribution) - && Objects.equals(this.numberOfUnits, leaveLine.numberOfUnits) - && Objects.equals(this.annualNumberOfUnits, leaveLine.annualNumberOfUnits) - && Objects.equals( - this.fullTimeNumberOfUnitsPerPeriod, leaveLine.fullTimeNumberOfUnitsPerPeriod); + return Objects.equals(this.leaveTypeID, leaveLine.leaveTypeID) && + Objects.equals(this.calculationType, leaveLine.calculationType) && + Objects.equals(this.entitlementFinalPayPayoutType, leaveLine.entitlementFinalPayPayoutType) && + Objects.equals(this.employmentTerminationPaymentType, leaveLine.employmentTerminationPaymentType) && + Objects.equals(this.includeSuperannuationGuaranteeContribution, leaveLine.includeSuperannuationGuaranteeContribution) && + Objects.equals(this.numberOfUnits, leaveLine.numberOfUnits) && + Objects.equals(this.annualNumberOfUnits, leaveLine.annualNumberOfUnits) && + Objects.equals(this.fullTimeNumberOfUnitsPerPeriod, leaveLine.fullTimeNumberOfUnitsPerPeriod); } @Override public int hashCode() { - return Objects.hash( - leaveTypeID, - calculationType, - entitlementFinalPayPayoutType, - employmentTerminationPaymentType, - includeSuperannuationGuaranteeContribution, - numberOfUnits, - annualNumberOfUnits, - fullTimeNumberOfUnitsPerPeriod); + return Objects.hash(leaveTypeID, calculationType, entitlementFinalPayPayoutType, employmentTerminationPaymentType, includeSuperannuationGuaranteeContribution, numberOfUnits, annualNumberOfUnits, fullTimeNumberOfUnitsPerPeriod); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LeaveLine {\n"); sb.append(" leaveTypeID: ").append(toIndentedString(leaveTypeID)).append("\n"); sb.append(" calculationType: ").append(toIndentedString(calculationType)).append("\n"); - sb.append(" entitlementFinalPayPayoutType: ") - .append(toIndentedString(entitlementFinalPayPayoutType)) - .append("\n"); - sb.append(" employmentTerminationPaymentType: ") - .append(toIndentedString(employmentTerminationPaymentType)) - .append("\n"); - sb.append(" includeSuperannuationGuaranteeContribution: ") - .append(toIndentedString(includeSuperannuationGuaranteeContribution)) - .append("\n"); + sb.append(" entitlementFinalPayPayoutType: ").append(toIndentedString(entitlementFinalPayPayoutType)).append("\n"); + sb.append(" employmentTerminationPaymentType: ").append(toIndentedString(employmentTerminationPaymentType)).append("\n"); + sb.append(" includeSuperannuationGuaranteeContribution: ").append(toIndentedString(includeSuperannuationGuaranteeContribution)).append("\n"); sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); - sb.append(" annualNumberOfUnits: ") - .append(toIndentedString(annualNumberOfUnits)) - .append("\n"); - sb.append(" fullTimeNumberOfUnitsPerPeriod: ") - .append(toIndentedString(fullTimeNumberOfUnitsPerPeriod)) - .append("\n"); + sb.append(" annualNumberOfUnits: ").append(toIndentedString(annualNumberOfUnits)).append("\n"); + sb.append(" fullTimeNumberOfUnitsPerPeriod: ").append(toIndentedString(fullTimeNumberOfUnitsPerPeriod)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -406,4 +372,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveLineCalculationType.java b/src/main/java/com/xero/models/payrollau/LeaveLineCalculationType.java index 303413ae6..50be7ec7d 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveLineCalculationType.java +++ b/src/main/java/com/xero/models/payrollau/LeaveLineCalculationType.java @@ -9,25 +9,45 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Calculation type for leave line for Opening Balance on Employee */ +/** + * Calculation type for leave line for Opening Balance on Employee + */ public enum LeaveLineCalculationType { - - /** NOCALCULATIONREQUIRED */ + + /** + * NOCALCULATIONREQUIRED + */ NOCALCULATIONREQUIRED("NOCALCULATIONREQUIRED"), - - /** FIXEDAMOUNTEACHPERIOD */ + + /** + * FIXEDAMOUNTEACHPERIOD + */ FIXEDAMOUNTEACHPERIOD("FIXEDAMOUNTEACHPERIOD"), - - /** ENTERRATEINPAYTEMPLATE */ + + /** + * ENTERRATEINPAYTEMPLATE + */ ENTERRATEINPAYTEMPLATE("ENTERRATEINPAYTEMPLATE"), - - /** BASEDONORDINARYEARNINGS */ + + /** + * BASEDONORDINARYEARNINGS + */ BASEDONORDINARYEARNINGS("BASEDONORDINARYEARNINGS"); private String value; @@ -36,26 +56,24 @@ public enum LeaveLineCalculationType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static LeaveLineCalculationType fromValue(String value) { @@ -67,3 +85,4 @@ public static LeaveLineCalculationType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveLines.java b/src/main/java/com/xero/models/payrollau/LeaveLines.java index 9fdd3d85b..5662ecb8d 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveLines.java +++ b/src/main/java/com/xero/models/payrollau/LeaveLines.java @@ -9,29 +9,45 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.LeaveLine; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -/** The leave type lines */ +/** + * The leave type lines + */ @ApiModel(description = "The leave type lines") + public class LeaveLines { StringUtil util = new StringUtil(); @JsonProperty("Employee") private List employee = new ArrayList(); /** - * employee - * - * @param employee List<LeaveLine> - * @return LeaveLines - */ + * employee + * @param employee List<LeaveLine> + * @return LeaveLines + **/ public LeaveLines employee(List employee) { this.employee = employee; return this; @@ -39,10 +55,9 @@ public LeaveLines employee(List employee) { /** * employee - * - * @param employeeItem LeaveLine + * @param employeeItem LeaveLine * @return LeaveLines - */ + **/ public LeaveLines addEmployeeItem(LeaveLine employeeItem) { if (this.employee == null) { this.employee = new ArrayList(); @@ -51,30 +66,29 @@ public LeaveLines addEmployeeItem(LeaveLine employeeItem) { return this; } - /** + /** * Get employee - * * @return employee - */ + **/ @ApiModelProperty(value = "") - /** + /** * employee - * * @return employee List - */ + **/ public List getEmployee() { return employee; } - /** - * employee - * - * @param employee List<LeaveLine> - */ + /** + * employee + * @param employee List<LeaveLine> + **/ + public void setEmployee(List employee) { this.employee = employee; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,6 +106,7 @@ public int hashCode() { return Objects.hash(employee); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -102,7 +117,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -110,4 +126,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeavePeriod.java b/src/main/java/com/xero/models/payrollau/LeavePeriod.java index 1b420f757..b1ba45f47 100644 --- a/src/main/java/com/xero/models/payrollau/LeavePeriod.java +++ b/src/main/java/com/xero/models/payrollau/LeavePeriod.java @@ -9,18 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.LeavePeriodStatus; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Objects; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; import org.threeten.bp.Instant; import org.threeten.bp.LocalDate; -import org.threeten.bp.ZoneId; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeavePeriod + */ -/** LeavePeriod */ public class LeavePeriod { StringUtil util = new StringUtil(); @@ -36,205 +50,186 @@ public class LeavePeriod { @JsonProperty("LeavePeriodStatus") private LeavePeriodStatus leavePeriodStatus; /** - * The Number of Units for the leave - * - * @param numberOfUnits Double - * @return LeavePeriod - */ + * The Number of Units for the leave + * @param numberOfUnits Double + * @return LeavePeriod + **/ public LeavePeriod numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The Number of Units for the leave - * * @return numberOfUnits - */ + **/ @ApiModelProperty(example = "22.8", value = "The Number of Units for the leave") - /** + /** * The Number of Units for the leave - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The Number of Units for the leave - * - * @param numberOfUnits Double - */ + /** + * The Number of Units for the leave + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * The Pay Period End Date (YYYY-MM-DD) - * - * @param payPeriodEndDate String - * @return LeavePeriod - */ + * The Pay Period End Date (YYYY-MM-DD) + * @param payPeriodEndDate String + * @return LeavePeriod + **/ public LeavePeriod payPeriodEndDate(String payPeriodEndDate) { this.payPeriodEndDate = payPeriodEndDate; return this; } - /** + /** * The Pay Period End Date (YYYY-MM-DD) - * * @return payPeriodEndDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "The Pay Period End Date (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "The Pay Period End Date (YYYY-MM-DD)") + /** * The Pay Period End Date (YYYY-MM-DD) - * * @return payPeriodEndDate String - */ + **/ public String getPayPeriodEndDate() { return payPeriodEndDate; } - /** + /** * The Pay Period End Date (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getPayPeriodEndDateAsDate() { if (this.payPeriodEndDate != null) { try { return util.convertStringToDate(this.payPeriodEndDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The Pay Period End Date (YYYY-MM-DD) - * - * @param payPeriodEndDate String - */ + /** + * The Pay Period End Date (YYYY-MM-DD) + * @param payPeriodEndDate String + **/ + public void setPayPeriodEndDate(String payPeriodEndDate) { this.payPeriodEndDate = payPeriodEndDate; } - /** - * The Pay Period End Date (YYYY-MM-DD) - * - * @param payPeriodEndDate LocalDateTime - */ + /** + * The Pay Period End Date (YYYY-MM-DD) + * @param payPeriodEndDate LocalDateTime + **/ public void setPayPeriodEndDate(LocalDate payPeriodEndDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = payPeriodEndDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = payPeriodEndDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.payPeriodEndDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * The Pay Period Start Date (YYYY-MM-DD) - * - * @param payPeriodStartDate String - * @return LeavePeriod - */ + * The Pay Period Start Date (YYYY-MM-DD) + * @param payPeriodStartDate String + * @return LeavePeriod + **/ public LeavePeriod payPeriodStartDate(String payPeriodStartDate) { this.payPeriodStartDate = payPeriodStartDate; return this; } - /** + /** * The Pay Period Start Date (YYYY-MM-DD) - * * @return payPeriodStartDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "The Pay Period Start Date (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "The Pay Period Start Date (YYYY-MM-DD)") + /** * The Pay Period Start Date (YYYY-MM-DD) - * * @return payPeriodStartDate String - */ + **/ public String getPayPeriodStartDate() { return payPeriodStartDate; } - /** + /** * The Pay Period Start Date (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getPayPeriodStartDateAsDate() { if (this.payPeriodStartDate != null) { try { return util.convertStringToDate(this.payPeriodStartDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The Pay Period Start Date (YYYY-MM-DD) - * - * @param payPeriodStartDate String - */ + /** + * The Pay Period Start Date (YYYY-MM-DD) + * @param payPeriodStartDate String + **/ + public void setPayPeriodStartDate(String payPeriodStartDate) { this.payPeriodStartDate = payPeriodStartDate; } - /** - * The Pay Period Start Date (YYYY-MM-DD) - * - * @param payPeriodStartDate LocalDateTime - */ + /** + * The Pay Period Start Date (YYYY-MM-DD) + * @param payPeriodStartDate LocalDateTime + **/ public void setPayPeriodStartDate(LocalDate payPeriodStartDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = payPeriodStartDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = payPeriodStartDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.payPeriodStartDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * leavePeriodStatus - * - * @param leavePeriodStatus LeavePeriodStatus - * @return LeavePeriod - */ + * leavePeriodStatus + * @param leavePeriodStatus LeavePeriodStatus + * @return LeavePeriod + **/ public LeavePeriod leavePeriodStatus(LeavePeriodStatus leavePeriodStatus) { this.leavePeriodStatus = leavePeriodStatus; return this; } - /** + /** * Get leavePeriodStatus - * * @return leavePeriodStatus - */ + **/ @ApiModelProperty(value = "") - /** + /** * leavePeriodStatus - * * @return leavePeriodStatus LeavePeriodStatus - */ + **/ public LeavePeriodStatus getLeavePeriodStatus() { return leavePeriodStatus; } - /** - * leavePeriodStatus - * - * @param leavePeriodStatus LeavePeriodStatus - */ + /** + * leavePeriodStatus + * @param leavePeriodStatus LeavePeriodStatus + **/ + public void setLeavePeriodStatus(LeavePeriodStatus leavePeriodStatus) { this.leavePeriodStatus = leavePeriodStatus; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -244,10 +239,10 @@ public boolean equals(java.lang.Object o) { return false; } LeavePeriod leavePeriod = (LeavePeriod) o; - return Objects.equals(this.numberOfUnits, leavePeriod.numberOfUnits) - && Objects.equals(this.payPeriodEndDate, leavePeriod.payPeriodEndDate) - && Objects.equals(this.payPeriodStartDate, leavePeriod.payPeriodStartDate) - && Objects.equals(this.leavePeriodStatus, leavePeriod.leavePeriodStatus); + return Objects.equals(this.numberOfUnits, leavePeriod.numberOfUnits) && + Objects.equals(this.payPeriodEndDate, leavePeriod.payPeriodEndDate) && + Objects.equals(this.payPeriodStartDate, leavePeriod.payPeriodStartDate) && + Objects.equals(this.leavePeriodStatus, leavePeriod.leavePeriodStatus); } @Override @@ -255,6 +250,7 @@ public int hashCode() { return Objects.hash(numberOfUnits, payPeriodEndDate, payPeriodStartDate, leavePeriodStatus); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -268,7 +264,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -276,4 +273,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeavePeriodStatus.java b/src/main/java/com/xero/models/payrollau/LeavePeriodStatus.java index a5904dfa8..1ed7f43e4 100644 --- a/src/main/java/com/xero/models/payrollau/LeavePeriodStatus.java +++ b/src/main/java/com/xero/models/payrollau/LeavePeriodStatus.java @@ -9,25 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets LeavePeriodStatus */ +/** + * Gets or Sets LeavePeriodStatus + */ public enum LeavePeriodStatus { - - /** SCHEDULED */ + + /** + * SCHEDULED + */ SCHEDULED("SCHEDULED"), - - /** PROCESSED */ + + /** + * PROCESSED + */ PROCESSED("PROCESSED"), - - /** REQUESTED */ + + /** + * REQUESTED + */ REQUESTED("REQUESTED"), - - /** REJECTED */ + + /** + * REJECTED + */ REJECTED("REJECTED"); private String value; @@ -36,26 +55,24 @@ public enum LeavePeriodStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static LeavePeriodStatus fromValue(String value) { @@ -67,3 +84,4 @@ public static LeavePeriodStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveType.java b/src/main/java/com/xero/models/payrollau/LeaveType.java index 808294d84..7c740b610 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveType.java +++ b/src/main/java/com/xero/models/payrollau/LeaveType.java @@ -9,17 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.LeaveCategoryCode; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveType + */ -/** LeaveType */ public class LeaveType { StringUtil util = new StringUtil(); @@ -56,413 +72,353 @@ public class LeaveType { @JsonProperty("SGCExempt") private Boolean sgCExempt; /** - * Name of the earnings rate (max length = 100) - * - * @param name String - * @return LeaveType - */ + * Name of the earnings rate (max length = 100) + * @param name String + * @return LeaveType + **/ public LeaveType name(String name) { this.name = name; return this; } - /** + /** * Name of the earnings rate (max length = 100) - * * @return name - */ + **/ @ApiModelProperty(example = "PTO", value = "Name of the earnings rate (max length = 100)") - /** + /** * Name of the earnings rate (max length = 100) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earnings rate (max length = 100) - * - * @param name String - */ + /** + * Name of the earnings rate (max length = 100) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The type of units by which leave entitlements are normally tracked. These are typically the - * same as the type of units used for the employee’s ordinary earnings rate - * - * @param typeOfUnits String - * @return LeaveType - */ + * The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate + * @param typeOfUnits String + * @return LeaveType + **/ public LeaveType typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** - * The type of units by which leave entitlements are normally tracked. These are typically the - * same as the type of units used for the employee’s ordinary earnings rate - * + /** + * The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate * @return typeOfUnits - */ - @ApiModelProperty( - example = "Hours", - value = - "The type of units by which leave entitlements are normally tracked. These are typically" - + " the same as the type of units used for the employee’s ordinary earnings rate") - /** - * The type of units by which leave entitlements are normally tracked. These are typically the - * same as the type of units used for the employee’s ordinary earnings rate - * + **/ + @ApiModelProperty(example = "Hours", value = "The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate") + /** + * The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of units by which leave entitlements are normally tracked. These are typically the - * same as the type of units used for the employee’s ordinary earnings rate - * - * @param typeOfUnits String - */ + /** + * The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } /** - * Xero identifier - * - * @param leaveTypeID UUID - * @return LeaveType - */ + * Xero identifier + * @param leaveTypeID UUID + * @return LeaveType + **/ public LeaveType leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero identifier - * * @return leaveTypeID - */ + **/ @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier") - /** + /** * Xero identifier - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero identifier - * - * @param leaveTypeID UUID - */ + /** + * Xero identifier + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The number of units the employee is entitled to each year - * - * @param normalEntitlement Double - * @return LeaveType - */ + * The number of units the employee is entitled to each year + * @param normalEntitlement Double + * @return LeaveType + **/ public LeaveType normalEntitlement(Double normalEntitlement) { this.normalEntitlement = normalEntitlement; return this; } - /** + /** * The number of units the employee is entitled to each year - * * @return normalEntitlement - */ - @ApiModelProperty( - example = "152.0", - value = "The number of units the employee is entitled to each year") - /** + **/ + @ApiModelProperty(example = "152.0", value = "The number of units the employee is entitled to each year") + /** * The number of units the employee is entitled to each year - * * @return normalEntitlement Double - */ + **/ public Double getNormalEntitlement() { return normalEntitlement; } - /** - * The number of units the employee is entitled to each year - * - * @param normalEntitlement Double - */ + /** + * The number of units the employee is entitled to each year + * @param normalEntitlement Double + **/ + public void setNormalEntitlement(Double normalEntitlement) { this.normalEntitlement = normalEntitlement; } /** - * Enter an amount here if your organisation pays an additional percentage on top of ordinary - * earnings when your employees take leave (typically 17.5%) - * - * @param leaveLoadingRate Double - * @return LeaveType - */ + * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) + * @param leaveLoadingRate Double + * @return LeaveType + **/ public LeaveType leaveLoadingRate(Double leaveLoadingRate) { this.leaveLoadingRate = leaveLoadingRate; return this; } - /** - * Enter an amount here if your organisation pays an additional percentage on top of ordinary - * earnings when your employees take leave (typically 17.5%) - * + /** + * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) * @return leaveLoadingRate - */ - @ApiModelProperty( - example = "2.0", - value = - "Enter an amount here if your organisation pays an additional percentage on top of" - + " ordinary earnings when your employees take leave (typically 17.5%)") - /** - * Enter an amount here if your organisation pays an additional percentage on top of ordinary - * earnings when your employees take leave (typically 17.5%) - * + **/ + @ApiModelProperty(example = "2.0", value = "Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%)") + /** + * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) * @return leaveLoadingRate Double - */ + **/ public Double getLeaveLoadingRate() { return leaveLoadingRate; } - /** - * Enter an amount here if your organisation pays an additional percentage on top of ordinary - * earnings when your employees take leave (typically 17.5%) - * - * @param leaveLoadingRate Double - */ + /** + * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) + * @param leaveLoadingRate Double + **/ + public void setLeaveLoadingRate(Double leaveLoadingRate) { this.leaveLoadingRate = leaveLoadingRate; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Set this to indicate that an employee will be paid when taking this type of leave - * - * @param isPaidLeave Boolean - * @return LeaveType - */ + * Set this to indicate that an employee will be paid when taking this type of leave + * @param isPaidLeave Boolean + * @return LeaveType + **/ public LeaveType isPaidLeave(Boolean isPaidLeave) { this.isPaidLeave = isPaidLeave; return this; } - /** + /** * Set this to indicate that an employee will be paid when taking this type of leave - * * @return isPaidLeave - */ - @ApiModelProperty( - example = "true", - value = "Set this to indicate that an employee will be paid when taking this type of leave") - /** + **/ + @ApiModelProperty(example = "true", value = "Set this to indicate that an employee will be paid when taking this type of leave") + /** * Set this to indicate that an employee will be paid when taking this type of leave - * * @return isPaidLeave Boolean - */ + **/ public Boolean getIsPaidLeave() { return isPaidLeave; } - /** - * Set this to indicate that an employee will be paid when taking this type of leave - * - * @param isPaidLeave Boolean - */ + /** + * Set this to indicate that an employee will be paid when taking this type of leave + * @param isPaidLeave Boolean + **/ + public void setIsPaidLeave(Boolean isPaidLeave) { this.isPaidLeave = isPaidLeave; } /** - * Set this if you want a balance for this leave type to be shown on your employee’s payslips - * - * @param showOnPayslip Boolean - * @return LeaveType - */ + * Set this if you want a balance for this leave type to be shown on your employee’s payslips + * @param showOnPayslip Boolean + * @return LeaveType + **/ public LeaveType showOnPayslip(Boolean showOnPayslip) { this.showOnPayslip = showOnPayslip; return this; } - /** + /** * Set this if you want a balance for this leave type to be shown on your employee’s payslips - * * @return showOnPayslip - */ - @ApiModelProperty( - example = "true", - value = - "Set this if you want a balance for this leave type to be shown on your employee’s" - + " payslips") - /** + **/ + @ApiModelProperty(example = "true", value = "Set this if you want a balance for this leave type to be shown on your employee’s payslips") + /** * Set this if you want a balance for this leave type to be shown on your employee’s payslips - * * @return showOnPayslip Boolean - */ + **/ public Boolean getShowOnPayslip() { return showOnPayslip; } - /** - * Set this if you want a balance for this leave type to be shown on your employee’s payslips - * - * @param showOnPayslip Boolean - */ + /** + * Set this if you want a balance for this leave type to be shown on your employee’s payslips + * @param showOnPayslip Boolean + **/ + public void setShowOnPayslip(Boolean showOnPayslip) { this.showOnPayslip = showOnPayslip; } /** - * Is the current record - * - * @param currentRecord Boolean - * @return LeaveType - */ + * Is the current record + * @param currentRecord Boolean + * @return LeaveType + **/ public LeaveType currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Is the current record - * * @return currentRecord - */ + **/ @ApiModelProperty(example = "true", value = "Is the current record") - /** + /** * Is the current record - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Is the current record - * - * @param currentRecord Boolean - */ + /** + * Is the current record + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * leaveCategoryCode - * - * @param leaveCategoryCode LeaveCategoryCode - * @return LeaveType - */ + * leaveCategoryCode + * @param leaveCategoryCode LeaveCategoryCode + * @return LeaveType + **/ public LeaveType leaveCategoryCode(LeaveCategoryCode leaveCategoryCode) { this.leaveCategoryCode = leaveCategoryCode; return this; } - /** + /** * Get leaveCategoryCode - * * @return leaveCategoryCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveCategoryCode - * * @return leaveCategoryCode LeaveCategoryCode - */ + **/ public LeaveCategoryCode getLeaveCategoryCode() { return leaveCategoryCode; } - /** - * leaveCategoryCode - * - * @param leaveCategoryCode LeaveCategoryCode - */ + /** + * leaveCategoryCode + * @param leaveCategoryCode LeaveCategoryCode + **/ + public void setLeaveCategoryCode(LeaveCategoryCode leaveCategoryCode) { this.leaveCategoryCode = leaveCategoryCode; } /** - * Set this to indicate that the leave type is exempt from superannuation guarantee contribution - * - * @param sgCExempt Boolean - * @return LeaveType - */ + * Set this to indicate that the leave type is exempt from superannuation guarantee contribution + * @param sgCExempt Boolean + * @return LeaveType + **/ public LeaveType sgCExempt(Boolean sgCExempt) { this.sgCExempt = sgCExempt; return this; } - /** + /** * Set this to indicate that the leave type is exempt from superannuation guarantee contribution - * * @return sgCExempt - */ - @ApiModelProperty( - example = "true", - value = - "Set this to indicate that the leave type is exempt from superannuation guarantee" - + " contribution") - /** + **/ + @ApiModelProperty(example = "true", value = "Set this to indicate that the leave type is exempt from superannuation guarantee contribution") + /** * Set this to indicate that the leave type is exempt from superannuation guarantee contribution - * * @return sgCExempt Boolean - */ + **/ public Boolean getSgCExempt() { return sgCExempt; } - /** - * Set this to indicate that the leave type is exempt from superannuation guarantee contribution - * - * @param sgCExempt Boolean - */ + /** + * Set this to indicate that the leave type is exempt from superannuation guarantee contribution + * @param sgCExempt Boolean + **/ + public void setSgCExempt(Boolean sgCExempt) { this.sgCExempt = sgCExempt; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -472,35 +428,25 @@ public boolean equals(java.lang.Object o) { return false; } LeaveType leaveType = (LeaveType) o; - return Objects.equals(this.name, leaveType.name) - && Objects.equals(this.typeOfUnits, leaveType.typeOfUnits) - && Objects.equals(this.leaveTypeID, leaveType.leaveTypeID) - && Objects.equals(this.normalEntitlement, leaveType.normalEntitlement) - && Objects.equals(this.leaveLoadingRate, leaveType.leaveLoadingRate) - && Objects.equals(this.updatedDateUTC, leaveType.updatedDateUTC) - && Objects.equals(this.isPaidLeave, leaveType.isPaidLeave) - && Objects.equals(this.showOnPayslip, leaveType.showOnPayslip) - && Objects.equals(this.currentRecord, leaveType.currentRecord) - && Objects.equals(this.leaveCategoryCode, leaveType.leaveCategoryCode) - && Objects.equals(this.sgCExempt, leaveType.sgCExempt); + return Objects.equals(this.name, leaveType.name) && + Objects.equals(this.typeOfUnits, leaveType.typeOfUnits) && + Objects.equals(this.leaveTypeID, leaveType.leaveTypeID) && + Objects.equals(this.normalEntitlement, leaveType.normalEntitlement) && + Objects.equals(this.leaveLoadingRate, leaveType.leaveLoadingRate) && + Objects.equals(this.updatedDateUTC, leaveType.updatedDateUTC) && + Objects.equals(this.isPaidLeave, leaveType.isPaidLeave) && + Objects.equals(this.showOnPayslip, leaveType.showOnPayslip) && + Objects.equals(this.currentRecord, leaveType.currentRecord) && + Objects.equals(this.leaveCategoryCode, leaveType.leaveCategoryCode) && + Objects.equals(this.sgCExempt, leaveType.sgCExempt); } @Override public int hashCode() { - return Objects.hash( - name, - typeOfUnits, - leaveTypeID, - normalEntitlement, - leaveLoadingRate, - updatedDateUTC, - isPaidLeave, - showOnPayslip, - currentRecord, - leaveCategoryCode, - sgCExempt); + return Objects.hash(name, typeOfUnits, leaveTypeID, normalEntitlement, leaveLoadingRate, updatedDateUTC, isPaidLeave, showOnPayslip, currentRecord, leaveCategoryCode, sgCExempt); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -521,7 +467,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -529,4 +476,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/LeaveTypeContributionType.java b/src/main/java/com/xero/models/payrollau/LeaveTypeContributionType.java index 43a67f37b..5f667a3ed 100644 --- a/src/main/java/com/xero/models/payrollau/LeaveTypeContributionType.java +++ b/src/main/java/com/xero/models/payrollau/LeaveTypeContributionType.java @@ -9,25 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets LeaveTypeContributionType */ +/** + * Gets or Sets LeaveTypeContributionType + */ public enum LeaveTypeContributionType { - - /** SGC */ + + /** + * SGC + */ SGC("SGC"), - - /** SALARYSACRIFICE */ + + /** + * SALARYSACRIFICE + */ SALARYSACRIFICE("SALARYSACRIFICE"), - - /** EMPLOYERADDITIONAL */ + + /** + * EMPLOYERADDITIONAL + */ EMPLOYERADDITIONAL("EMPLOYERADDITIONAL"), - - /** EMPLOYEE */ + + /** + * EMPLOYEE + */ EMPLOYEE("EMPLOYEE"); private String value; @@ -36,26 +55,24 @@ public enum LeaveTypeContributionType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static LeaveTypeContributionType fromValue(String value) { @@ -67,3 +84,4 @@ public static LeaveTypeContributionType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/ManualTaxType.java b/src/main/java/com/xero/models/payrollau/ManualTaxType.java index 690a62ed0..b1b4172f0 100644 --- a/src/main/java/com/xero/models/payrollau/ManualTaxType.java +++ b/src/main/java/com/xero/models/payrollau/ManualTaxType.java @@ -9,31 +9,54 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets ManualTaxType */ +/** + * Gets or Sets ManualTaxType + */ public enum ManualTaxType { - - /** PAYGMANUAL */ + + /** + * PAYGMANUAL + */ PAYGMANUAL("PAYGMANUAL"), - - /** ETPOMANUAL */ + + /** + * ETPOMANUAL + */ ETPOMANUAL("ETPOMANUAL"), - - /** ETPRMANUAL */ + + /** + * ETPRMANUAL + */ ETPRMANUAL("ETPRMANUAL"), - - /** SCHEDULE5MANUAL */ + + /** + * SCHEDULE5MANUAL + */ SCHEDULE5MANUAL("SCHEDULE5MANUAL"), - - /** SCHEDULE5STSLMANUAL */ + + /** + * SCHEDULE5STSLMANUAL + */ SCHEDULE5STSLMANUAL("SCHEDULE5STSLMANUAL"), - - /** SCHEDULE4MANUAL */ + + /** + * SCHEDULE4MANUAL + */ SCHEDULE4MANUAL("SCHEDULE4MANUAL"); private String value; @@ -42,26 +65,24 @@ public enum ManualTaxType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static ManualTaxType fromValue(String value) { @@ -73,3 +94,4 @@ public static ManualTaxType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/ModelAPIException.java b/src/main/java/com/xero/models/payrollau/ModelAPIException.java index 1a7a71fdf..6d97f7e71 100644 --- a/src/main/java/com/xero/models/payrollau/ModelAPIException.java +++ b/src/main/java/com/xero/models/payrollau/ModelAPIException.java @@ -9,17 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import java.util.Objects; +import java.io.IOException; -/** The object returned for a bad request */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The object returned for a bad request + */ @ApiModel(description = "The object returned for a bad request") + public class ModelAPIException { StringUtil util = new StringUtil(); @@ -32,112 +48,102 @@ public class ModelAPIException { @JsonProperty("Message") private String message; /** - * The error number - * - * @param errorNumber BigDecimal - * @return ModelAPIException - */ + * The error number + * @param errorNumber BigDecimal + * @return ModelAPIException + **/ public ModelAPIException errorNumber(BigDecimal errorNumber) { this.errorNumber = errorNumber; return this; } - /** + /** * The error number - * * @return errorNumber - */ + **/ @ApiModelProperty(example = "16", value = "The error number") - /** + /** * The error number - * * @return errorNumber BigDecimal - */ + **/ public BigDecimal getErrorNumber() { return errorNumber; } - /** - * The error number - * - * @param errorNumber BigDecimal - */ + /** + * The error number + * @param errorNumber BigDecimal + **/ + public void setErrorNumber(BigDecimal errorNumber) { this.errorNumber = errorNumber; } /** - * The type of error - * - * @param type String - * @return ModelAPIException - */ + * The type of error + * @param type String + * @return ModelAPIException + **/ public ModelAPIException type(String type) { this.type = type; return this; } - /** + /** * The type of error - * * @return type - */ + **/ @ApiModelProperty(example = "QueryParseException", value = "The type of error") - /** + /** * The type of error - * * @return type String - */ + **/ public String getType() { return type; } - /** - * The type of error - * - * @param type String - */ + /** + * The type of error + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * The message describing the error - * - * @param message String - * @return ModelAPIException - */ + * The message describing the error + * @param message String + * @return ModelAPIException + **/ public ModelAPIException message(String message) { this.message = message; return this; } - /** + /** * The message describing the error - * * @return message - */ - @ApiModelProperty( - example = "No property or field 'hi' exists in type 'Employee' (at index 0)", - value = "The message describing the error") - /** + **/ + @ApiModelProperty(example = "No property or field 'hi' exists in type 'Employee' (at index 0)", value = "The message describing the error") + /** * The message describing the error - * * @return message String - */ + **/ public String getMessage() { return message; } - /** - * The message describing the error - * - * @param message String - */ + /** + * The message describing the error + * @param message String + **/ + public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -147,9 +153,9 @@ public boolean equals(java.lang.Object o) { return false; } ModelAPIException _apIException = (ModelAPIException) o; - return Objects.equals(this.errorNumber, _apIException.errorNumber) - && Objects.equals(this.type, _apIException.type) - && Objects.equals(this.message, _apIException.message); + return Objects.equals(this.errorNumber, _apIException.errorNumber) && + Objects.equals(this.type, _apIException.type) && + Objects.equals(this.message, _apIException.message); } @Override @@ -157,6 +163,7 @@ public int hashCode() { return Objects.hash(errorNumber, type, message); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -169,7 +176,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -177,4 +185,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/OpeningBalances.java b/src/main/java/com/xero/models/payrollau/OpeningBalances.java index ff0534c49..67a26905d 100644 --- a/src/main/java/com/xero/models/payrollau/OpeningBalances.java +++ b/src/main/java/com/xero/models/payrollau/OpeningBalances.java @@ -9,20 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.DeductionLine; +import com.xero.models.payrollau.EarningsLine; +import com.xero.models.payrollau.LeaveLine; +import com.xero.models.payrollau.PaidLeaveEarningsLine; +import com.xero.models.payrollau.ReimbursementLine; +import com.xero.models.payrollau.SuperLine; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; import org.threeten.bp.Instant; import org.threeten.bp.LocalDate; -import org.threeten.bp.ZoneId; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * OpeningBalances + */ -/** OpeningBalances */ public class OpeningBalances { StringUtil util = new StringUtil(); @@ -48,114 +67,102 @@ public class OpeningBalances { private List leaveLines = new ArrayList(); @JsonProperty("PaidLeaveEarningsLines") - private List paidLeaveEarningsLines = - new ArrayList(); + private List paidLeaveEarningsLines = new ArrayList(); /** - * Opening Balance Date. (YYYY-MM-DD) - * - * @param openingBalanceDate String - * @return OpeningBalances - */ + * Opening Balance Date. (YYYY-MM-DD) + * @param openingBalanceDate String + * @return OpeningBalances + **/ public OpeningBalances openingBalanceDate(String openingBalanceDate) { this.openingBalanceDate = openingBalanceDate; return this; } - /** + /** * Opening Balance Date. (YYYY-MM-DD) - * * @return openingBalanceDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "Opening Balance Date. (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "Opening Balance Date. (YYYY-MM-DD)") + /** * Opening Balance Date. (YYYY-MM-DD) - * * @return openingBalanceDate String - */ + **/ public String getOpeningBalanceDate() { return openingBalanceDate; } - /** + /** * Opening Balance Date. (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getOpeningBalanceDateAsDate() { if (this.openingBalanceDate != null) { try { return util.convertStringToDate(this.openingBalanceDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Opening Balance Date. (YYYY-MM-DD) - * - * @param openingBalanceDate String - */ + /** + * Opening Balance Date. (YYYY-MM-DD) + * @param openingBalanceDate String + **/ + public void setOpeningBalanceDate(String openingBalanceDate) { this.openingBalanceDate = openingBalanceDate; } - /** - * Opening Balance Date. (YYYY-MM-DD) - * - * @param openingBalanceDate LocalDateTime - */ + /** + * Opening Balance Date. (YYYY-MM-DD) + * @param openingBalanceDate LocalDateTime + **/ public void setOpeningBalanceDate(LocalDate openingBalanceDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = openingBalanceDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = openingBalanceDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.openingBalanceDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Opening Balance tax - * - * @param tax String - * @return OpeningBalances - */ + * Opening Balance tax + * @param tax String + * @return OpeningBalances + **/ public OpeningBalances tax(String tax) { this.tax = tax; return this; } - /** + /** * Opening Balance tax - * * @return tax - */ + **/ @ApiModelProperty(example = "4333d5cd-53a5-4c31-98e5-a8b4e5676b0b", value = "Opening Balance tax") - /** + /** * Opening Balance tax - * * @return tax String - */ + **/ public String getTax() { return tax; } - /** - * Opening Balance tax - * - * @param tax String - */ + /** + * Opening Balance tax + * @param tax String + **/ + public void setTax(String tax) { this.tax = tax; } /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - * @return OpeningBalances - */ + * earningsLines + * @param earningsLines List<EarningsLine> + * @return OpeningBalances + **/ public OpeningBalances earningsLines(List earningsLines) { this.earningsLines = earningsLines; return this; @@ -163,10 +170,9 @@ public OpeningBalances earningsLines(List earningsLines) { /** * earningsLines - * - * @param earningsLinesItem EarningsLine + * @param earningsLinesItem EarningsLine * @return OpeningBalances - */ + **/ public OpeningBalances addEarningsLinesItem(EarningsLine earningsLinesItem) { if (this.earningsLines == null) { this.earningsLines = new ArrayList(); @@ -175,36 +181,33 @@ public OpeningBalances addEarningsLinesItem(EarningsLine earningsLinesItem) { return this; } - /** + /** * Get earningsLines - * * @return earningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsLines - * * @return earningsLines List - */ + **/ public List getEarningsLines() { return earningsLines; } - /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - */ + /** + * earningsLines + * @param earningsLines List<EarningsLine> + **/ + public void setEarningsLines(List earningsLines) { this.earningsLines = earningsLines; } /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - * @return OpeningBalances - */ + * deductionLines + * @param deductionLines List<DeductionLine> + * @return OpeningBalances + **/ public OpeningBalances deductionLines(List deductionLines) { this.deductionLines = deductionLines; return this; @@ -212,10 +215,9 @@ public OpeningBalances deductionLines(List deductionLines) { /** * deductionLines - * - * @param deductionLinesItem DeductionLine + * @param deductionLinesItem DeductionLine * @return OpeningBalances - */ + **/ public OpeningBalances addDeductionLinesItem(DeductionLine deductionLinesItem) { if (this.deductionLines == null) { this.deductionLines = new ArrayList(); @@ -224,36 +226,33 @@ public OpeningBalances addDeductionLinesItem(DeductionLine deductionLinesItem) { return this; } - /** + /** * Get deductionLines - * * @return deductionLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionLines - * * @return deductionLines List - */ + **/ public List getDeductionLines() { return deductionLines; } - /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - */ + /** + * deductionLines + * @param deductionLines List<DeductionLine> + **/ + public void setDeductionLines(List deductionLines) { this.deductionLines = deductionLines; } /** - * superLines - * - * @param superLines List<SuperLine> - * @return OpeningBalances - */ + * superLines + * @param superLines List<SuperLine> + * @return OpeningBalances + **/ public OpeningBalances superLines(List superLines) { this.superLines = superLines; return this; @@ -261,10 +260,9 @@ public OpeningBalances superLines(List superLines) { /** * superLines - * - * @param superLinesItem SuperLine + * @param superLinesItem SuperLine * @return OpeningBalances - */ + **/ public OpeningBalances addSuperLinesItem(SuperLine superLinesItem) { if (this.superLines == null) { this.superLines = new ArrayList(); @@ -273,36 +271,33 @@ public OpeningBalances addSuperLinesItem(SuperLine superLinesItem) { return this; } - /** + /** * Get superLines - * * @return superLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * superLines - * * @return superLines List - */ + **/ public List getSuperLines() { return superLines; } - /** - * superLines - * - * @param superLines List<SuperLine> - */ + /** + * superLines + * @param superLines List<SuperLine> + **/ + public void setSuperLines(List superLines) { this.superLines = superLines; } /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - * @return OpeningBalances - */ + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + * @return OpeningBalances + **/ public OpeningBalances reimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; return this; @@ -310,10 +305,9 @@ public OpeningBalances reimbursementLines(List reimbursementL /** * reimbursementLines - * - * @param reimbursementLinesItem ReimbursementLine + * @param reimbursementLinesItem ReimbursementLine * @return OpeningBalances - */ + **/ public OpeningBalances addReimbursementLinesItem(ReimbursementLine reimbursementLinesItem) { if (this.reimbursementLines == null) { this.reimbursementLines = new ArrayList(); @@ -322,36 +316,33 @@ public OpeningBalances addReimbursementLinesItem(ReimbursementLine reimbursement return this; } - /** + /** * Get reimbursementLines - * * @return reimbursementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementLines - * * @return reimbursementLines List - */ + **/ public List getReimbursementLines() { return reimbursementLines; } - /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - */ + /** + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + **/ + public void setReimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; } /** - * leaveLines - * - * @param leaveLines List<LeaveLine> - * @return OpeningBalances - */ + * leaveLines + * @param leaveLines List<LeaveLine> + * @return OpeningBalances + **/ public OpeningBalances leaveLines(List leaveLines) { this.leaveLines = leaveLines; return this; @@ -359,10 +350,9 @@ public OpeningBalances leaveLines(List leaveLines) { /** * leaveLines - * - * @param leaveLinesItem LeaveLine + * @param leaveLinesItem LeaveLine * @return OpeningBalances - */ + **/ public OpeningBalances addLeaveLinesItem(LeaveLine leaveLinesItem) { if (this.leaveLines == null) { this.leaveLines = new ArrayList(); @@ -371,50 +361,44 @@ public OpeningBalances addLeaveLinesItem(LeaveLine leaveLinesItem) { return this; } - /** + /** * Get leaveLines - * * @return leaveLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveLines - * * @return leaveLines List - */ + **/ public List getLeaveLines() { return leaveLines; } - /** - * leaveLines - * - * @param leaveLines List<LeaveLine> - */ + /** + * leaveLines + * @param leaveLines List<LeaveLine> + **/ + public void setLeaveLines(List leaveLines) { this.leaveLines = leaveLines; } /** - * paidLeaveEarningsLines - * - * @param paidLeaveEarningsLines List<PaidLeaveEarningsLine> - * @return OpeningBalances - */ - public OpeningBalances paidLeaveEarningsLines( - List paidLeaveEarningsLines) { + * paidLeaveEarningsLines + * @param paidLeaveEarningsLines List<PaidLeaveEarningsLine> + * @return OpeningBalances + **/ + public OpeningBalances paidLeaveEarningsLines(List paidLeaveEarningsLines) { this.paidLeaveEarningsLines = paidLeaveEarningsLines; return this; } /** * paidLeaveEarningsLines - * - * @param paidLeaveEarningsLinesItem PaidLeaveEarningsLine + * @param paidLeaveEarningsLinesItem PaidLeaveEarningsLine * @return OpeningBalances - */ - public OpeningBalances addPaidLeaveEarningsLinesItem( - PaidLeaveEarningsLine paidLeaveEarningsLinesItem) { + **/ + public OpeningBalances addPaidLeaveEarningsLinesItem(PaidLeaveEarningsLine paidLeaveEarningsLinesItem) { if (this.paidLeaveEarningsLines == null) { this.paidLeaveEarningsLines = new ArrayList(); } @@ -422,30 +406,29 @@ public OpeningBalances addPaidLeaveEarningsLinesItem( return this; } - /** + /** * Get paidLeaveEarningsLines - * * @return paidLeaveEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * paidLeaveEarningsLines - * * @return paidLeaveEarningsLines List - */ + **/ public List getPaidLeaveEarningsLines() { return paidLeaveEarningsLines; } - /** - * paidLeaveEarningsLines - * - * @param paidLeaveEarningsLines List<PaidLeaveEarningsLine> - */ + /** + * paidLeaveEarningsLines + * @param paidLeaveEarningsLines List<PaidLeaveEarningsLine> + **/ + public void setPaidLeaveEarningsLines(List paidLeaveEarningsLines) { this.paidLeaveEarningsLines = paidLeaveEarningsLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -455,29 +438,22 @@ public boolean equals(java.lang.Object o) { return false; } OpeningBalances openingBalances = (OpeningBalances) o; - return Objects.equals(this.openingBalanceDate, openingBalances.openingBalanceDate) - && Objects.equals(this.tax, openingBalances.tax) - && Objects.equals(this.earningsLines, openingBalances.earningsLines) - && Objects.equals(this.deductionLines, openingBalances.deductionLines) - && Objects.equals(this.superLines, openingBalances.superLines) - && Objects.equals(this.reimbursementLines, openingBalances.reimbursementLines) - && Objects.equals(this.leaveLines, openingBalances.leaveLines) - && Objects.equals(this.paidLeaveEarningsLines, openingBalances.paidLeaveEarningsLines); + return Objects.equals(this.openingBalanceDate, openingBalances.openingBalanceDate) && + Objects.equals(this.tax, openingBalances.tax) && + Objects.equals(this.earningsLines, openingBalances.earningsLines) && + Objects.equals(this.deductionLines, openingBalances.deductionLines) && + Objects.equals(this.superLines, openingBalances.superLines) && + Objects.equals(this.reimbursementLines, openingBalances.reimbursementLines) && + Objects.equals(this.leaveLines, openingBalances.leaveLines) && + Objects.equals(this.paidLeaveEarningsLines, openingBalances.paidLeaveEarningsLines); } @Override public int hashCode() { - return Objects.hash( - openingBalanceDate, - tax, - earningsLines, - deductionLines, - superLines, - reimbursementLines, - leaveLines, - paidLeaveEarningsLines); + return Objects.hash(openingBalanceDate, tax, earningsLines, deductionLines, superLines, reimbursementLines, leaveLines, paidLeaveEarningsLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -489,15 +465,14 @@ public String toString() { sb.append(" superLines: ").append(toIndentedString(superLines)).append("\n"); sb.append(" reimbursementLines: ").append(toIndentedString(reimbursementLines)).append("\n"); sb.append(" leaveLines: ").append(toIndentedString(leaveLines)).append("\n"); - sb.append(" paidLeaveEarningsLines: ") - .append(toIndentedString(paidLeaveEarningsLines)) - .append("\n"); + sb.append(" paidLeaveEarningsLines: ").append(toIndentedString(paidLeaveEarningsLines)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -505,4 +480,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PaidLeaveEarningsLine.java b/src/main/java/com/xero/models/payrollau/PaidLeaveEarningsLine.java index e97eda244..0c2be5b9b 100644 --- a/src/main/java/com/xero/models/payrollau/PaidLeaveEarningsLine.java +++ b/src/main/java/com/xero/models/payrollau/PaidLeaveEarningsLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaidLeaveEarningsLine + */ -/** PaidLeaveEarningsLine */ public class PaidLeaveEarningsLine { StringUtil util = new StringUtil(); @@ -36,209 +53,166 @@ public class PaidLeaveEarningsLine { @JsonProperty("ResetSTPCategorisation") private Boolean resetSTPCategorisation; /** - * Xero leave type identifier - * - * @param leaveTypeID UUID - * @return PaidLeaveEarningsLine - */ + * Xero leave type identifier + * @param leaveTypeID UUID + * @return PaidLeaveEarningsLine + **/ public PaidLeaveEarningsLine leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero leave type identifier - * * @return leaveTypeID - */ - @ApiModelProperty( - example = "742998cb-7584-4ecf-aa88-d694f59c50f9", - required = true, - value = "Xero leave type identifier") - /** + **/ + @ApiModelProperty(example = "742998cb-7584-4ecf-aa88-d694f59c50f9", required = true, value = "Xero leave type identifier") + /** * Xero leave type identifier - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero leave type identifier - * - * @param leaveTypeID UUID - */ + /** + * Xero leave type identifier + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * Paid leave amount - * - * @param amount Double - * @return PaidLeaveEarningsLine - */ + * Paid leave amount + * @param amount Double + * @return PaidLeaveEarningsLine + **/ public PaidLeaveEarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Paid leave amount - * * @return amount - */ + **/ @ApiModelProperty(example = "500.0", required = true, value = "Paid leave amount") - /** + /** * Paid leave amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Paid leave amount - * - * @param amount Double - */ + /** + * Paid leave amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The amount of leave loading applied for the leave type that is subject to Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * - * @param sgCAppliedLeaveLoadingAmount Double - * @return PaidLeaveEarningsLine - */ + * The amount of leave loading applied for the leave type that is subject to Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories + * @param sgCAppliedLeaveLoadingAmount Double + * @return PaidLeaveEarningsLine + **/ public PaidLeaveEarningsLine sgCAppliedLeaveLoadingAmount(Double sgCAppliedLeaveLoadingAmount) { this.sgCAppliedLeaveLoadingAmount = sgCAppliedLeaveLoadingAmount; return this; } - /** - * The amount of leave loading applied for the leave type that is subject to Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * + /** + * The amount of leave loading applied for the leave type that is subject to Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories * @return sgCAppliedLeaveLoadingAmount - */ - @ApiModelProperty( - example = "50.0", - value = - "The amount of leave loading applied for the leave type that is subject to" - + " Superannuation Guarantee Contributions. *Only applicable for Leave Types with" - + " Annual Leave Categories") - /** - * The amount of leave loading applied for the leave type that is subject to Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * + **/ + @ApiModelProperty(example = "50.0", value = "The amount of leave loading applied for the leave type that is subject to Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories") + /** + * The amount of leave loading applied for the leave type that is subject to Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories * @return sgCAppliedLeaveLoadingAmount Double - */ + **/ public Double getSgCAppliedLeaveLoadingAmount() { return sgCAppliedLeaveLoadingAmount; } - /** - * The amount of leave loading applied for the leave type that is subject to Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * - * @param sgCAppliedLeaveLoadingAmount Double - */ + /** + * The amount of leave loading applied for the leave type that is subject to Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories + * @param sgCAppliedLeaveLoadingAmount Double + **/ + public void setSgCAppliedLeaveLoadingAmount(Double sgCAppliedLeaveLoadingAmount) { this.sgCAppliedLeaveLoadingAmount = sgCAppliedLeaveLoadingAmount; } /** - * The amount of leave loading applied for the leave type that is exempt from Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * - * @param sgCExemptedLeaveLoadingAmount Double - * @return PaidLeaveEarningsLine - */ + * The amount of leave loading applied for the leave type that is exempt from Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories + * @param sgCExemptedLeaveLoadingAmount Double + * @return PaidLeaveEarningsLine + **/ public PaidLeaveEarningsLine sgCExemptedLeaveLoadingAmount(Double sgCExemptedLeaveLoadingAmount) { this.sgCExemptedLeaveLoadingAmount = sgCExemptedLeaveLoadingAmount; return this; } - /** - * The amount of leave loading applied for the leave type that is exempt from Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * + /** + * The amount of leave loading applied for the leave type that is exempt from Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories * @return sgCExemptedLeaveLoadingAmount - */ - @ApiModelProperty( - example = "60.0", - value = - "The amount of leave loading applied for the leave type that is exempt from" - + " Superannuation Guarantee Contributions. *Only applicable for Leave Types with" - + " Annual Leave Categories") - /** - * The amount of leave loading applied for the leave type that is exempt from Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * + **/ + @ApiModelProperty(example = "60.0", value = "The amount of leave loading applied for the leave type that is exempt from Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories") + /** + * The amount of leave loading applied for the leave type that is exempt from Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories * @return sgCExemptedLeaveLoadingAmount Double - */ + **/ public Double getSgCExemptedLeaveLoadingAmount() { return sgCExemptedLeaveLoadingAmount; } - /** - * The amount of leave loading applied for the leave type that is exempt from Superannuation - * Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories - * - * @param sgCExemptedLeaveLoadingAmount Double - */ + /** + * The amount of leave loading applied for the leave type that is exempt from Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories + * @param sgCExemptedLeaveLoadingAmount Double + **/ + public void setSgCExemptedLeaveLoadingAmount(Double sgCExemptedLeaveLoadingAmount) { this.sgCExemptedLeaveLoadingAmount = sgCExemptedLeaveLoadingAmount; } /** - * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual - * Leave Categories - * - * @param resetSTPCategorisation Boolean - * @return PaidLeaveEarningsLine - */ + * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual Leave Categories + * @param resetSTPCategorisation Boolean + * @return PaidLeaveEarningsLine + **/ public PaidLeaveEarningsLine resetSTPCategorisation(Boolean resetSTPCategorisation) { this.resetSTPCategorisation = resetSTPCategorisation; return this; } - /** - * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual - * Leave Categories - * + /** + * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual Leave Categories * @return resetSTPCategorisation - */ - @ApiModelProperty( - example = "true", - value = - "Reset the STP categorisations for the leave type. *Only applicable for Leave Types with" - + " Annual Leave Categories") - /** - * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual - * Leave Categories - * + **/ + @ApiModelProperty(example = "true", value = "Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual Leave Categories") + /** + * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual Leave Categories * @return resetSTPCategorisation Boolean - */ + **/ public Boolean getResetSTPCategorisation() { return resetSTPCategorisation; } - /** - * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual - * Leave Categories - * - * @param resetSTPCategorisation Boolean - */ + /** + * Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual Leave Categories + * @param resetSTPCategorisation Boolean + **/ + public void setResetSTPCategorisation(Boolean resetSTPCategorisation) { this.resetSTPCategorisation = resetSTPCategorisation; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -248,47 +222,35 @@ public boolean equals(java.lang.Object o) { return false; } PaidLeaveEarningsLine paidLeaveEarningsLine = (PaidLeaveEarningsLine) o; - return Objects.equals(this.leaveTypeID, paidLeaveEarningsLine.leaveTypeID) - && Objects.equals(this.amount, paidLeaveEarningsLine.amount) - && Objects.equals( - this.sgCAppliedLeaveLoadingAmount, paidLeaveEarningsLine.sgCAppliedLeaveLoadingAmount) - && Objects.equals( - this.sgCExemptedLeaveLoadingAmount, paidLeaveEarningsLine.sgCExemptedLeaveLoadingAmount) - && Objects.equals( - this.resetSTPCategorisation, paidLeaveEarningsLine.resetSTPCategorisation); + return Objects.equals(this.leaveTypeID, paidLeaveEarningsLine.leaveTypeID) && + Objects.equals(this.amount, paidLeaveEarningsLine.amount) && + Objects.equals(this.sgCAppliedLeaveLoadingAmount, paidLeaveEarningsLine.sgCAppliedLeaveLoadingAmount) && + Objects.equals(this.sgCExemptedLeaveLoadingAmount, paidLeaveEarningsLine.sgCExemptedLeaveLoadingAmount) && + Objects.equals(this.resetSTPCategorisation, paidLeaveEarningsLine.resetSTPCategorisation); } @Override public int hashCode() { - return Objects.hash( - leaveTypeID, - amount, - sgCAppliedLeaveLoadingAmount, - sgCExemptedLeaveLoadingAmount, - resetSTPCategorisation); + return Objects.hash(leaveTypeID, amount, sgCAppliedLeaveLoadingAmount, sgCExemptedLeaveLoadingAmount, resetSTPCategorisation); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PaidLeaveEarningsLine {\n"); sb.append(" leaveTypeID: ").append(toIndentedString(leaveTypeID)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" sgCAppliedLeaveLoadingAmount: ") - .append(toIndentedString(sgCAppliedLeaveLoadingAmount)) - .append("\n"); - sb.append(" sgCExemptedLeaveLoadingAmount: ") - .append(toIndentedString(sgCExemptedLeaveLoadingAmount)) - .append("\n"); - sb.append(" resetSTPCategorisation: ") - .append(toIndentedString(resetSTPCategorisation)) - .append("\n"); + sb.append(" sgCAppliedLeaveLoadingAmount: ").append(toIndentedString(sgCAppliedLeaveLoadingAmount)).append("\n"); + sb.append(" sgCExemptedLeaveLoadingAmount: ").append(toIndentedString(sgCExemptedLeaveLoadingAmount)).append("\n"); + sb.append(" resetSTPCategorisation: ").append(toIndentedString(resetSTPCategorisation)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -296,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayItem.java b/src/main/java/com/xero/models/payrollau/PayItem.java index 4c84a5c5a..9cb8e0ee7 100644 --- a/src/main/java/com/xero/models/payrollau/PayItem.java +++ b/src/main/java/com/xero/models/payrollau/PayItem.java @@ -9,16 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.DeductionType; +import com.xero.models.payrollau.EarningsRate; +import com.xero.models.payrollau.LeaveType; +import com.xero.models.payrollau.ReimbursementType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayItem + */ -/** PayItem */ public class PayItem { StringUtil util = new StringUtil(); @@ -34,11 +55,10 @@ public class PayItem { @JsonProperty("ReimbursementTypes") private List reimbursementTypes = new ArrayList(); /** - * earningsRates - * - * @param earningsRates List<EarningsRate> - * @return PayItem - */ + * earningsRates + * @param earningsRates List<EarningsRate> + * @return PayItem + **/ public PayItem earningsRates(List earningsRates) { this.earningsRates = earningsRates; return this; @@ -46,10 +66,9 @@ public PayItem earningsRates(List earningsRates) { /** * earningsRates - * - * @param earningsRatesItem EarningsRate + * @param earningsRatesItem EarningsRate * @return PayItem - */ + **/ public PayItem addEarningsRatesItem(EarningsRate earningsRatesItem) { if (this.earningsRates == null) { this.earningsRates = new ArrayList(); @@ -58,36 +77,33 @@ public PayItem addEarningsRatesItem(EarningsRate earningsRatesItem) { return this; } - /** + /** * Get earningsRates - * * @return earningsRates - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsRates - * * @return earningsRates List - */ + **/ public List getEarningsRates() { return earningsRates; } - /** - * earningsRates - * - * @param earningsRates List<EarningsRate> - */ + /** + * earningsRates + * @param earningsRates List<EarningsRate> + **/ + public void setEarningsRates(List earningsRates) { this.earningsRates = earningsRates; } /** - * deductionTypes - * - * @param deductionTypes List<DeductionType> - * @return PayItem - */ + * deductionTypes + * @param deductionTypes List<DeductionType> + * @return PayItem + **/ public PayItem deductionTypes(List deductionTypes) { this.deductionTypes = deductionTypes; return this; @@ -95,10 +111,9 @@ public PayItem deductionTypes(List deductionTypes) { /** * deductionTypes - * - * @param deductionTypesItem DeductionType + * @param deductionTypesItem DeductionType * @return PayItem - */ + **/ public PayItem addDeductionTypesItem(DeductionType deductionTypesItem) { if (this.deductionTypes == null) { this.deductionTypes = new ArrayList(); @@ -107,36 +122,33 @@ public PayItem addDeductionTypesItem(DeductionType deductionTypesItem) { return this; } - /** + /** * Get deductionTypes - * * @return deductionTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionTypes - * * @return deductionTypes List - */ + **/ public List getDeductionTypes() { return deductionTypes; } - /** - * deductionTypes - * - * @param deductionTypes List<DeductionType> - */ + /** + * deductionTypes + * @param deductionTypes List<DeductionType> + **/ + public void setDeductionTypes(List deductionTypes) { this.deductionTypes = deductionTypes; } /** - * leaveTypes - * - * @param leaveTypes List<LeaveType> - * @return PayItem - */ + * leaveTypes + * @param leaveTypes List<LeaveType> + * @return PayItem + **/ public PayItem leaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; return this; @@ -144,10 +156,9 @@ public PayItem leaveTypes(List leaveTypes) { /** * leaveTypes - * - * @param leaveTypesItem LeaveType + * @param leaveTypesItem LeaveType * @return PayItem - */ + **/ public PayItem addLeaveTypesItem(LeaveType leaveTypesItem) { if (this.leaveTypes == null) { this.leaveTypes = new ArrayList(); @@ -156,36 +167,33 @@ public PayItem addLeaveTypesItem(LeaveType leaveTypesItem) { return this; } - /** + /** * Get leaveTypes - * * @return leaveTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveTypes - * * @return leaveTypes List - */ + **/ public List getLeaveTypes() { return leaveTypes; } - /** - * leaveTypes - * - * @param leaveTypes List<LeaveType> - */ + /** + * leaveTypes + * @param leaveTypes List<LeaveType> + **/ + public void setLeaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; } /** - * reimbursementTypes - * - * @param reimbursementTypes List<ReimbursementType> - * @return PayItem - */ + * reimbursementTypes + * @param reimbursementTypes List<ReimbursementType> + * @return PayItem + **/ public PayItem reimbursementTypes(List reimbursementTypes) { this.reimbursementTypes = reimbursementTypes; return this; @@ -193,10 +201,9 @@ public PayItem reimbursementTypes(List reimbursementTypes) { /** * reimbursementTypes - * - * @param reimbursementTypesItem ReimbursementType + * @param reimbursementTypesItem ReimbursementType * @return PayItem - */ + **/ public PayItem addReimbursementTypesItem(ReimbursementType reimbursementTypesItem) { if (this.reimbursementTypes == null) { this.reimbursementTypes = new ArrayList(); @@ -205,30 +212,29 @@ public PayItem addReimbursementTypesItem(ReimbursementType reimbursementTypesIte return this; } - /** + /** * Get reimbursementTypes - * * @return reimbursementTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementTypes - * * @return reimbursementTypes List - */ + **/ public List getReimbursementTypes() { return reimbursementTypes; } - /** - * reimbursementTypes - * - * @param reimbursementTypes List<ReimbursementType> - */ + /** + * reimbursementTypes + * @param reimbursementTypes List<ReimbursementType> + **/ + public void setReimbursementTypes(List reimbursementTypes) { this.reimbursementTypes = reimbursementTypes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -238,10 +244,10 @@ public boolean equals(java.lang.Object o) { return false; } PayItem payItem = (PayItem) o; - return Objects.equals(this.earningsRates, payItem.earningsRates) - && Objects.equals(this.deductionTypes, payItem.deductionTypes) - && Objects.equals(this.leaveTypes, payItem.leaveTypes) - && Objects.equals(this.reimbursementTypes, payItem.reimbursementTypes); + return Objects.equals(this.earningsRates, payItem.earningsRates) && + Objects.equals(this.deductionTypes, payItem.deductionTypes) && + Objects.equals(this.leaveTypes, payItem.leaveTypes) && + Objects.equals(this.reimbursementTypes, payItem.reimbursementTypes); } @Override @@ -249,6 +255,7 @@ public int hashCode() { return Objects.hash(earningsRates, deductionTypes, leaveTypes, reimbursementTypes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,7 +269,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -270,4 +278,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayItems.java b/src/main/java/com/xero/models/payrollau/PayItems.java index 56a0b06a3..ef957c11d 100644 --- a/src/main/java/com/xero/models/payrollau/PayItems.java +++ b/src/main/java/com/xero/models/payrollau/PayItems.java @@ -9,54 +9,70 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.PayItem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayItems + */ -/** PayItems */ public class PayItems { StringUtil util = new StringUtil(); @JsonProperty("PayItems") private PayItem payItems; /** - * payItems - * - * @param payItems PayItem - * @return PayItems - */ + * payItems + * @param payItems PayItem + * @return PayItems + **/ public PayItems payItems(PayItem payItems) { this.payItems = payItems; return this; } - /** + /** * Get payItems - * * @return payItems - */ + **/ @ApiModelProperty(value = "") - /** + /** * payItems - * * @return payItems PayItem - */ + **/ public PayItem getPayItems() { return payItems; } - /** - * payItems - * - * @param payItems PayItem - */ + /** + * payItems + * @param payItems PayItem + **/ + public void setPayItems(PayItem payItems) { this.payItems = payItems; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +90,7 @@ public int hashCode() { return Objects.hash(payItems); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +101,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +110,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayOutType.java b/src/main/java/com/xero/models/payrollau/PayOutType.java index 961db41db..4f1f27f51 100644 --- a/src/main/java/com/xero/models/payrollau/PayOutType.java +++ b/src/main/java/com/xero/models/payrollau/PayOutType.java @@ -9,19 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** How the requested leave will be paid out, e.g. cashed out. */ +/** + * How the requested leave will be paid out, e.g. cashed out. + */ public enum PayOutType { - - /** DEFAULT */ + + /** + * DEFAULT + */ DEFAULT("DEFAULT"), - - /** CASHED_OUT */ + + /** + * CASHED_OUT + */ CASHED_OUT("CASHED_OUT"); private String value; @@ -30,26 +46,24 @@ public enum PayOutType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static PayOutType fromValue(String value) { @@ -61,3 +75,4 @@ public static PayOutType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/PayRun.java b/src/main/java/com/xero/models/payrollau/PayRun.java index 3ac72a6e7..42e9e7642 100644 --- a/src/main/java/com/xero/models/payrollau/PayRun.java +++ b/src/main/java/com/xero/models/payrollau/PayRun.java @@ -9,22 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.PayRunStatus; +import com.xero.models.payrollau.PayslipSummary; +import com.xero.models.payrollau.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRun + */ -/** PayRun */ public class PayRun { StringUtil util = new StringUtil(); @@ -76,381 +91,339 @@ public class PayRun { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * Xero identifier for pay run - * - * @param payrollCalendarID UUID - * @return PayRun - */ + * Xero identifier for pay run + * @param payrollCalendarID UUID + * @return PayRun + **/ public PayRun payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero identifier for pay run - * * @return payrollCalendarID - */ - @ApiModelProperty( - example = "bfac31bd-ea62-4fc8-a5e7-7965d9504b15", - required = true, - value = "Xero identifier for pay run") - /** + **/ + @ApiModelProperty(example = "bfac31bd-ea62-4fc8-a5e7-7965d9504b15", required = true, value = "Xero identifier for pay run") + /** * Xero identifier for pay run - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero identifier for pay run - * - * @param payrollCalendarID UUID - */ + /** + * Xero identifier for pay run + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * Xero identifier for pay run - * - * @param payRunID UUID - * @return PayRun - */ + * Xero identifier for pay run + * @param payRunID UUID + * @return PayRun + **/ public PayRun payRunID(UUID payRunID) { this.payRunID = payRunID; return this; } - /** + /** * Xero identifier for pay run - * * @return payRunID - */ - @ApiModelProperty( - example = "bba1d10f-63b1-4692-b5c5-a99f869523a4", - value = "Xero identifier for pay run") - /** + **/ + @ApiModelProperty(example = "bba1d10f-63b1-4692-b5c5-a99f869523a4", value = "Xero identifier for pay run") + /** * Xero identifier for pay run - * * @return payRunID UUID - */ + **/ public UUID getPayRunID() { return payRunID; } - /** - * Xero identifier for pay run - * - * @param payRunID UUID - */ + /** + * Xero identifier for pay run + * @param payRunID UUID + **/ + public void setPayRunID(UUID payRunID) { this.payRunID = payRunID; } /** - * Period Start Date for the PayRun (YYYY-MM-DD) - * - * @param payRunPeriodStartDate String - * @return PayRun - */ + * Period Start Date for the PayRun (YYYY-MM-DD) + * @param payRunPeriodStartDate String + * @return PayRun + **/ public PayRun payRunPeriodStartDate(String payRunPeriodStartDate) { this.payRunPeriodStartDate = payRunPeriodStartDate; return this; } - /** + /** * Period Start Date for the PayRun (YYYY-MM-DD) - * * @return payRunPeriodStartDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "Period Start Date for the PayRun (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "Period Start Date for the PayRun (YYYY-MM-DD)") + /** * Period Start Date for the PayRun (YYYY-MM-DD) - * * @return payRunPeriodStartDate String - */ + **/ public String getPayRunPeriodStartDate() { return payRunPeriodStartDate; } - /** + /** * Period Start Date for the PayRun (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getPayRunPeriodStartDateAsDate() { if (this.payRunPeriodStartDate != null) { try { return util.convertStringToDate(this.payRunPeriodStartDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Period Start Date for the PayRun (YYYY-MM-DD) - * - * @param payRunPeriodStartDate String - */ + /** + * Period Start Date for the PayRun (YYYY-MM-DD) + * @param payRunPeriodStartDate String + **/ + public void setPayRunPeriodStartDate(String payRunPeriodStartDate) { this.payRunPeriodStartDate = payRunPeriodStartDate; } - /** - * Period Start Date for the PayRun (YYYY-MM-DD) - * - * @param payRunPeriodStartDate LocalDateTime - */ + /** + * Period Start Date for the PayRun (YYYY-MM-DD) + * @param payRunPeriodStartDate LocalDateTime + **/ public void setPayRunPeriodStartDate(LocalDate payRunPeriodStartDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = payRunPeriodStartDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = payRunPeriodStartDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.payRunPeriodStartDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Period End Date for the PayRun (YYYY-MM-DD) - * - * @param payRunPeriodEndDate String - * @return PayRun - */ + * Period End Date for the PayRun (YYYY-MM-DD) + * @param payRunPeriodEndDate String + * @return PayRun + **/ public PayRun payRunPeriodEndDate(String payRunPeriodEndDate) { this.payRunPeriodEndDate = payRunPeriodEndDate; return this; } - /** + /** * Period End Date for the PayRun (YYYY-MM-DD) - * * @return payRunPeriodEndDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "Period End Date for the PayRun (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "Period End Date for the PayRun (YYYY-MM-DD)") + /** * Period End Date for the PayRun (YYYY-MM-DD) - * * @return payRunPeriodEndDate String - */ + **/ public String getPayRunPeriodEndDate() { return payRunPeriodEndDate; } - /** + /** * Period End Date for the PayRun (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getPayRunPeriodEndDateAsDate() { if (this.payRunPeriodEndDate != null) { try { return util.convertStringToDate(this.payRunPeriodEndDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Period End Date for the PayRun (YYYY-MM-DD) - * - * @param payRunPeriodEndDate String - */ + /** + * Period End Date for the PayRun (YYYY-MM-DD) + * @param payRunPeriodEndDate String + **/ + public void setPayRunPeriodEndDate(String payRunPeriodEndDate) { this.payRunPeriodEndDate = payRunPeriodEndDate; } - /** - * Period End Date for the PayRun (YYYY-MM-DD) - * - * @param payRunPeriodEndDate LocalDateTime - */ + /** + * Period End Date for the PayRun (YYYY-MM-DD) + * @param payRunPeriodEndDate LocalDateTime + **/ public void setPayRunPeriodEndDate(LocalDate payRunPeriodEndDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = payRunPeriodEndDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = payRunPeriodEndDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.payRunPeriodEndDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * payRunStatus - * - * @param payRunStatus PayRunStatus - * @return PayRun - */ + * payRunStatus + * @param payRunStatus PayRunStatus + * @return PayRun + **/ public PayRun payRunStatus(PayRunStatus payRunStatus) { this.payRunStatus = payRunStatus; return this; } - /** + /** * Get payRunStatus - * * @return payRunStatus - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRunStatus - * * @return payRunStatus PayRunStatus - */ + **/ public PayRunStatus getPayRunStatus() { return payRunStatus; } - /** - * payRunStatus - * - * @param payRunStatus PayRunStatus - */ + /** + * payRunStatus + * @param payRunStatus PayRunStatus + **/ + public void setPayRunStatus(PayRunStatus payRunStatus) { this.payRunStatus = payRunStatus; } /** - * Payment Date for the PayRun (YYYY-MM-DD) - * - * @param paymentDate String - * @return PayRun - */ + * Payment Date for the PayRun (YYYY-MM-DD) + * @param paymentDate String + * @return PayRun + **/ public PayRun paymentDate(String paymentDate) { this.paymentDate = paymentDate; return this; } - /** + /** * Payment Date for the PayRun (YYYY-MM-DD) - * * @return paymentDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "Payment Date for the PayRun (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "Payment Date for the PayRun (YYYY-MM-DD)") + /** * Payment Date for the PayRun (YYYY-MM-DD) - * * @return paymentDate String - */ + **/ public String getPaymentDate() { return paymentDate; } - /** + /** * Payment Date for the PayRun (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getPaymentDateAsDate() { if (this.paymentDate != null) { try { return util.convertStringToDate(this.paymentDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Payment Date for the PayRun (YYYY-MM-DD) - * - * @param paymentDate String - */ + /** + * Payment Date for the PayRun (YYYY-MM-DD) + * @param paymentDate String + **/ + public void setPaymentDate(String paymentDate) { this.paymentDate = paymentDate; } - /** - * Payment Date for the PayRun (YYYY-MM-DD) - * - * @param paymentDate LocalDateTime - */ + /** + * Payment Date for the PayRun (YYYY-MM-DD) + * @param paymentDate LocalDateTime + **/ public void setPaymentDate(LocalDate paymentDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = paymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = paymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.paymentDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Payslip message for the PayRun - * - * @param payslipMessage String - * @return PayRun - */ + * Payslip message for the PayRun + * @param payslipMessage String + * @return PayRun + **/ public PayRun payslipMessage(String payslipMessage) { this.payslipMessage = payslipMessage; return this; } - /** + /** * Payslip message for the PayRun - * * @return payslipMessage - */ + **/ @ApiModelProperty(example = "Thanks for being awesome", value = "Payslip message for the PayRun") - /** + /** * Payslip message for the PayRun - * * @return payslipMessage String - */ + **/ public String getPayslipMessage() { return payslipMessage; } - /** - * Payslip message for the PayRun - * - * @param payslipMessage String - */ + /** + * Payslip message for the PayRun + * @param payslipMessage String + **/ + public void setPayslipMessage(String payslipMessage) { this.payslipMessage = payslipMessage; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * The payslips in the payrun - * - * @param payslips List<PayslipSummary> - * @return PayRun - */ + * The payslips in the payrun + * @param payslips List<PayslipSummary> + * @return PayRun + **/ public PayRun payslips(List payslips) { this.payslips = payslips; return this; @@ -458,10 +431,9 @@ public PayRun payslips(List payslips) { /** * The payslips in the payrun - * - * @param payslipsItem PayslipSummary + * @param payslipsItem PayslipSummary * @return PayRun - */ + **/ public PayRun addPayslipsItem(PayslipSummary payslipsItem) { if (this.payslips == null) { this.payslips = new ArrayList(); @@ -470,246 +442,225 @@ public PayRun addPayslipsItem(PayslipSummary payslipsItem) { return this; } - /** + /** * The payslips in the payrun - * * @return payslips - */ + **/ @ApiModelProperty(value = "The payslips in the payrun") - /** + /** * The payslips in the payrun - * * @return payslips List - */ + **/ public List getPayslips() { return payslips; } - /** - * The payslips in the payrun - * - * @param payslips List<PayslipSummary> - */ + /** + * The payslips in the payrun + * @param payslips List<PayslipSummary> + **/ + public void setPayslips(List payslips) { this.payslips = payslips; } /** - * The total Wages for the Payrun - * - * @param wages Double - * @return PayRun - */ + * The total Wages for the Payrun + * @param wages Double + * @return PayRun + **/ public PayRun wages(Double wages) { this.wages = wages; return this; } - /** + /** * The total Wages for the Payrun - * * @return wages - */ + **/ @ApiModelProperty(example = "1060.5", value = "The total Wages for the Payrun") - /** + /** * The total Wages for the Payrun - * * @return wages Double - */ + **/ public Double getWages() { return wages; } - /** - * The total Wages for the Payrun - * - * @param wages Double - */ + /** + * The total Wages for the Payrun + * @param wages Double + **/ + public void setWages(Double wages) { this.wages = wages; } /** - * The total Deductions for the Payrun - * - * @param deductions Double - * @return PayRun - */ + * The total Deductions for the Payrun + * @param deductions Double + * @return PayRun + **/ public PayRun deductions(Double deductions) { this.deductions = deductions; return this; } - /** + /** * The total Deductions for the Payrun - * * @return deductions - */ + **/ @ApiModelProperty(example = "0.0", value = "The total Deductions for the Payrun") - /** + /** * The total Deductions for the Payrun - * * @return deductions Double - */ + **/ public Double getDeductions() { return deductions; } - /** - * The total Deductions for the Payrun - * - * @param deductions Double - */ + /** + * The total Deductions for the Payrun + * @param deductions Double + **/ + public void setDeductions(Double deductions) { this.deductions = deductions; } /** - * The total Tax for the Payrun - * - * @param tax Double - * @return PayRun - */ + * The total Tax for the Payrun + * @param tax Double + * @return PayRun + **/ public PayRun tax(Double tax) { this.tax = tax; return this; } - /** + /** * The total Tax for the Payrun - * * @return tax - */ + **/ @ApiModelProperty(example = "198.0", value = "The total Tax for the Payrun") - /** + /** * The total Tax for the Payrun - * * @return tax Double - */ + **/ public Double getTax() { return tax; } - /** - * The total Tax for the Payrun - * - * @param tax Double - */ + /** + * The total Tax for the Payrun + * @param tax Double + **/ + public void setTax(Double tax) { this.tax = tax; } /** - * The total Super for the Payrun - * - * @param _super Double - * @return PayRun - */ + * The total Super for the Payrun + * @param _super Double + * @return PayRun + **/ public PayRun _super(Double _super) { this._super = _super; return this; } - /** + /** * The total Super for the Payrun - * * @return _super - */ + **/ @ApiModelProperty(example = "75.6", value = "The total Super for the Payrun") - /** + /** * The total Super for the Payrun - * * @return _super Double - */ + **/ public Double getSuper() { return _super; } - /** - * The total Super for the Payrun - * - * @param _super Double - */ + /** + * The total Super for the Payrun + * @param _super Double + **/ + public void setSuper(Double _super) { this._super = _super; } /** - * The total Reimbursements for the Payrun - * - * @param reimbursement Double - * @return PayRun - */ + * The total Reimbursements for the Payrun + * @param reimbursement Double + * @return PayRun + **/ public PayRun reimbursement(Double reimbursement) { this.reimbursement = reimbursement; return this; } - /** + /** * The total Reimbursements for the Payrun - * * @return reimbursement - */ + **/ @ApiModelProperty(example = "0.0", value = "The total Reimbursements for the Payrun") - /** + /** * The total Reimbursements for the Payrun - * * @return reimbursement Double - */ + **/ public Double getReimbursement() { return reimbursement; } - /** - * The total Reimbursements for the Payrun - * - * @param reimbursement Double - */ + /** + * The total Reimbursements for the Payrun + * @param reimbursement Double + **/ + public void setReimbursement(Double reimbursement) { this.reimbursement = reimbursement; } /** - * The total NetPay for the Payrun - * - * @param netPay Double - * @return PayRun - */ + * The total NetPay for the Payrun + * @param netPay Double + * @return PayRun + **/ public PayRun netPay(Double netPay) { this.netPay = netPay; return this; } - /** + /** * The total NetPay for the Payrun - * * @return netPay - */ + **/ @ApiModelProperty(example = "862.5", value = "The total NetPay for the Payrun") - /** + /** * The total NetPay for the Payrun - * * @return netPay Double - */ + **/ public Double getNetPay() { return netPay; } - /** - * The total NetPay for the Payrun - * - * @param netPay Double - */ + /** + * The total NetPay for the Payrun + * @param netPay Double + **/ + public void setNetPay(Double netPay) { this.netPay = netPay; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return PayRun - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return PayRun + **/ public PayRun validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -717,10 +668,9 @@ public PayRun validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return PayRun - */ + **/ public PayRun addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -729,30 +679,29 @@ public PayRun addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -762,57 +711,38 @@ public boolean equals(java.lang.Object o) { return false; } PayRun payRun = (PayRun) o; - return Objects.equals(this.payrollCalendarID, payRun.payrollCalendarID) - && Objects.equals(this.payRunID, payRun.payRunID) - && Objects.equals(this.payRunPeriodStartDate, payRun.payRunPeriodStartDate) - && Objects.equals(this.payRunPeriodEndDate, payRun.payRunPeriodEndDate) - && Objects.equals(this.payRunStatus, payRun.payRunStatus) - && Objects.equals(this.paymentDate, payRun.paymentDate) - && Objects.equals(this.payslipMessage, payRun.payslipMessage) - && Objects.equals(this.updatedDateUTC, payRun.updatedDateUTC) - && Objects.equals(this.payslips, payRun.payslips) - && Objects.equals(this.wages, payRun.wages) - && Objects.equals(this.deductions, payRun.deductions) - && Objects.equals(this.tax, payRun.tax) - && Objects.equals(this._super, payRun._super) - && Objects.equals(this.reimbursement, payRun.reimbursement) - && Objects.equals(this.netPay, payRun.netPay) - && Objects.equals(this.validationErrors, payRun.validationErrors); + return Objects.equals(this.payrollCalendarID, payRun.payrollCalendarID) && + Objects.equals(this.payRunID, payRun.payRunID) && + Objects.equals(this.payRunPeriodStartDate, payRun.payRunPeriodStartDate) && + Objects.equals(this.payRunPeriodEndDate, payRun.payRunPeriodEndDate) && + Objects.equals(this.payRunStatus, payRun.payRunStatus) && + Objects.equals(this.paymentDate, payRun.paymentDate) && + Objects.equals(this.payslipMessage, payRun.payslipMessage) && + Objects.equals(this.updatedDateUTC, payRun.updatedDateUTC) && + Objects.equals(this.payslips, payRun.payslips) && + Objects.equals(this.wages, payRun.wages) && + Objects.equals(this.deductions, payRun.deductions) && + Objects.equals(this.tax, payRun.tax) && + Objects.equals(this._super, payRun._super) && + Objects.equals(this.reimbursement, payRun.reimbursement) && + Objects.equals(this.netPay, payRun.netPay) && + Objects.equals(this.validationErrors, payRun.validationErrors); } @Override public int hashCode() { - return Objects.hash( - payrollCalendarID, - payRunID, - payRunPeriodStartDate, - payRunPeriodEndDate, - payRunStatus, - paymentDate, - payslipMessage, - updatedDateUTC, - payslips, - wages, - deductions, - tax, - _super, - reimbursement, - netPay, - validationErrors); + return Objects.hash(payrollCalendarID, payRunID, payRunPeriodStartDate, payRunPeriodEndDate, payRunStatus, paymentDate, payslipMessage, updatedDateUTC, payslips, wages, deductions, tax, _super, reimbursement, netPay, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PayRun {\n"); sb.append(" payrollCalendarID: ").append(toIndentedString(payrollCalendarID)).append("\n"); sb.append(" payRunID: ").append(toIndentedString(payRunID)).append("\n"); - sb.append(" payRunPeriodStartDate: ") - .append(toIndentedString(payRunPeriodStartDate)) - .append("\n"); - sb.append(" payRunPeriodEndDate: ") - .append(toIndentedString(payRunPeriodEndDate)) - .append("\n"); + sb.append(" payRunPeriodStartDate: ").append(toIndentedString(payRunPeriodStartDate)).append("\n"); + sb.append(" payRunPeriodEndDate: ").append(toIndentedString(payRunPeriodEndDate)).append("\n"); sb.append(" payRunStatus: ").append(toIndentedString(payRunStatus)).append("\n"); sb.append(" paymentDate: ").append(toIndentedString(paymentDate)).append("\n"); sb.append(" payslipMessage: ").append(toIndentedString(payslipMessage)).append("\n"); @@ -830,7 +760,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -838,4 +769,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayRunStatus.java b/src/main/java/com/xero/models/payrollau/PayRunStatus.java index e31052d90..40e715af9 100644 --- a/src/main/java/com/xero/models/payrollau/PayRunStatus.java +++ b/src/main/java/com/xero/models/payrollau/PayRunStatus.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets PayRunStatus */ +/** + * Gets or Sets PayRunStatus + */ public enum PayRunStatus { - - /** DRAFT */ + + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** POSTED */ + + /** + * POSTED + */ POSTED("POSTED"); private String value; @@ -30,26 +45,24 @@ public enum PayRunStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static PayRunStatus fromValue(String value) { @@ -61,3 +74,4 @@ public static PayRunStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/PayRuns.java b/src/main/java/com/xero/models/payrollau/PayRuns.java index 8019813ed..69036e1ce 100644 --- a/src/main/java/com/xero/models/payrollau/PayRuns.java +++ b/src/main/java/com/xero/models/payrollau/PayRuns.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.PayRun; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRuns + */ -/** PayRuns */ public class PayRuns { StringUtil util = new StringUtil(); @JsonProperty("PayRuns") private List payRuns = new ArrayList(); /** - * payRuns - * - * @param payRuns List<PayRun> - * @return PayRuns - */ + * payRuns + * @param payRuns List<PayRun> + * @return PayRuns + **/ public PayRuns payRuns(List payRuns) { this.payRuns = payRuns; return this; @@ -37,10 +54,9 @@ public PayRuns payRuns(List payRuns) { /** * payRuns - * - * @param payRunsItem PayRun + * @param payRunsItem PayRun * @return PayRuns - */ + **/ public PayRuns addPayRunsItem(PayRun payRunsItem) { if (this.payRuns == null) { this.payRuns = new ArrayList(); @@ -49,30 +65,29 @@ public PayRuns addPayRunsItem(PayRun payRunsItem) { return this; } - /** + /** * Get payRuns - * * @return payRuns - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRuns - * * @return payRuns List - */ + **/ public List getPayRuns() { return payRuns; } - /** - * payRuns - * - * @param payRuns List<PayRun> - */ + /** + * payRuns + * @param payRuns List<PayRun> + **/ + public void setPayRuns(List payRuns) { this.payRuns = payRuns; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(payRuns); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayTemplate.java b/src/main/java/com/xero/models/payrollau/PayTemplate.java index 3b35b8c59..2ac661549 100644 --- a/src/main/java/com/xero/models/payrollau/PayTemplate.java +++ b/src/main/java/com/xero/models/payrollau/PayTemplate.java @@ -9,16 +9,38 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.DeductionLine; +import com.xero.models.payrollau.EarningsLine; +import com.xero.models.payrollau.LeaveLine; +import com.xero.models.payrollau.ReimbursementLine; +import com.xero.models.payrollau.SuperLine; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayTemplate + */ -/** PayTemplate */ public class PayTemplate { StringUtil util = new StringUtil(); @@ -37,11 +59,10 @@ public class PayTemplate { @JsonProperty("LeaveLines") private List leaveLines = new ArrayList(); /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - * @return PayTemplate - */ + * earningsLines + * @param earningsLines List<EarningsLine> + * @return PayTemplate + **/ public PayTemplate earningsLines(List earningsLines) { this.earningsLines = earningsLines; return this; @@ -49,10 +70,9 @@ public PayTemplate earningsLines(List earningsLines) { /** * earningsLines - * - * @param earningsLinesItem EarningsLine + * @param earningsLinesItem EarningsLine * @return PayTemplate - */ + **/ public PayTemplate addEarningsLinesItem(EarningsLine earningsLinesItem) { if (this.earningsLines == null) { this.earningsLines = new ArrayList(); @@ -61,36 +81,33 @@ public PayTemplate addEarningsLinesItem(EarningsLine earningsLinesItem) { return this; } - /** + /** * Get earningsLines - * * @return earningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsLines - * * @return earningsLines List - */ + **/ public List getEarningsLines() { return earningsLines; } - /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - */ + /** + * earningsLines + * @param earningsLines List<EarningsLine> + **/ + public void setEarningsLines(List earningsLines) { this.earningsLines = earningsLines; } /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - * @return PayTemplate - */ + * deductionLines + * @param deductionLines List<DeductionLine> + * @return PayTemplate + **/ public PayTemplate deductionLines(List deductionLines) { this.deductionLines = deductionLines; return this; @@ -98,10 +115,9 @@ public PayTemplate deductionLines(List deductionLines) { /** * deductionLines - * - * @param deductionLinesItem DeductionLine + * @param deductionLinesItem DeductionLine * @return PayTemplate - */ + **/ public PayTemplate addDeductionLinesItem(DeductionLine deductionLinesItem) { if (this.deductionLines == null) { this.deductionLines = new ArrayList(); @@ -110,36 +126,33 @@ public PayTemplate addDeductionLinesItem(DeductionLine deductionLinesItem) { return this; } - /** + /** * Get deductionLines - * * @return deductionLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionLines - * * @return deductionLines List - */ + **/ public List getDeductionLines() { return deductionLines; } - /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - */ + /** + * deductionLines + * @param deductionLines List<DeductionLine> + **/ + public void setDeductionLines(List deductionLines) { this.deductionLines = deductionLines; } /** - * superLines - * - * @param superLines List<SuperLine> - * @return PayTemplate - */ + * superLines + * @param superLines List<SuperLine> + * @return PayTemplate + **/ public PayTemplate superLines(List superLines) { this.superLines = superLines; return this; @@ -147,10 +160,9 @@ public PayTemplate superLines(List superLines) { /** * superLines - * - * @param superLinesItem SuperLine + * @param superLinesItem SuperLine * @return PayTemplate - */ + **/ public PayTemplate addSuperLinesItem(SuperLine superLinesItem) { if (this.superLines == null) { this.superLines = new ArrayList(); @@ -159,36 +171,33 @@ public PayTemplate addSuperLinesItem(SuperLine superLinesItem) { return this; } - /** + /** * Get superLines - * * @return superLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * superLines - * * @return superLines List - */ + **/ public List getSuperLines() { return superLines; } - /** - * superLines - * - * @param superLines List<SuperLine> - */ + /** + * superLines + * @param superLines List<SuperLine> + **/ + public void setSuperLines(List superLines) { this.superLines = superLines; } /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - * @return PayTemplate - */ + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + * @return PayTemplate + **/ public PayTemplate reimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; return this; @@ -196,10 +205,9 @@ public PayTemplate reimbursementLines(List reimbursementLines /** * reimbursementLines - * - * @param reimbursementLinesItem ReimbursementLine + * @param reimbursementLinesItem ReimbursementLine * @return PayTemplate - */ + **/ public PayTemplate addReimbursementLinesItem(ReimbursementLine reimbursementLinesItem) { if (this.reimbursementLines == null) { this.reimbursementLines = new ArrayList(); @@ -208,36 +216,33 @@ public PayTemplate addReimbursementLinesItem(ReimbursementLine reimbursementLine return this; } - /** + /** * Get reimbursementLines - * * @return reimbursementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementLines - * * @return reimbursementLines List - */ + **/ public List getReimbursementLines() { return reimbursementLines; } - /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - */ + /** + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + **/ + public void setReimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; } /** - * leaveLines - * - * @param leaveLines List<LeaveLine> - * @return PayTemplate - */ + * leaveLines + * @param leaveLines List<LeaveLine> + * @return PayTemplate + **/ public PayTemplate leaveLines(List leaveLines) { this.leaveLines = leaveLines; return this; @@ -245,10 +250,9 @@ public PayTemplate leaveLines(List leaveLines) { /** * leaveLines - * - * @param leaveLinesItem LeaveLine + * @param leaveLinesItem LeaveLine * @return PayTemplate - */ + **/ public PayTemplate addLeaveLinesItem(LeaveLine leaveLinesItem) { if (this.leaveLines == null) { this.leaveLines = new ArrayList(); @@ -257,30 +261,29 @@ public PayTemplate addLeaveLinesItem(LeaveLine leaveLinesItem) { return this; } - /** + /** * Get leaveLines - * * @return leaveLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveLines - * * @return leaveLines List - */ + **/ public List getLeaveLines() { return leaveLines; } - /** - * leaveLines - * - * @param leaveLines List<LeaveLine> - */ + /** + * leaveLines + * @param leaveLines List<LeaveLine> + **/ + public void setLeaveLines(List leaveLines) { this.leaveLines = leaveLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -290,11 +293,11 @@ public boolean equals(java.lang.Object o) { return false; } PayTemplate payTemplate = (PayTemplate) o; - return Objects.equals(this.earningsLines, payTemplate.earningsLines) - && Objects.equals(this.deductionLines, payTemplate.deductionLines) - && Objects.equals(this.superLines, payTemplate.superLines) - && Objects.equals(this.reimbursementLines, payTemplate.reimbursementLines) - && Objects.equals(this.leaveLines, payTemplate.leaveLines); + return Objects.equals(this.earningsLines, payTemplate.earningsLines) && + Objects.equals(this.deductionLines, payTemplate.deductionLines) && + Objects.equals(this.superLines, payTemplate.superLines) && + Objects.equals(this.reimbursementLines, payTemplate.reimbursementLines) && + Objects.equals(this.leaveLines, payTemplate.leaveLines); } @Override @@ -302,6 +305,7 @@ public int hashCode() { return Objects.hash(earningsLines, deductionLines, superLines, reimbursementLines, leaveLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -316,7 +320,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -324,4 +329,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PaymentFrequencyType.java b/src/main/java/com/xero/models/payrollau/PaymentFrequencyType.java index b9c4c6c01..9208dfe78 100644 --- a/src/main/java/com/xero/models/payrollau/PaymentFrequencyType.java +++ b/src/main/java/com/xero/models/payrollau/PaymentFrequencyType.java @@ -9,34 +9,59 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets PaymentFrequencyType */ +/** + * Gets or Sets PaymentFrequencyType + */ public enum PaymentFrequencyType { - - /** WEEKLY */ + + /** + * WEEKLY + */ WEEKLY("WEEKLY"), - - /** MONTHLY */ + + /** + * MONTHLY + */ MONTHLY("MONTHLY"), - - /** FORTNIGHTLY */ + + /** + * FORTNIGHTLY + */ FORTNIGHTLY("FORTNIGHTLY"), - - /** QUARTERLY */ + + /** + * QUARTERLY + */ QUARTERLY("QUARTERLY"), - - /** TWICEMONTHLY */ + + /** + * TWICEMONTHLY + */ TWICEMONTHLY("TWICEMONTHLY"), - - /** FOURWEEKLY */ + + /** + * FOURWEEKLY + */ FOURWEEKLY("FOURWEEKLY"), - - /** YEARLY */ + + /** + * YEARLY + */ YEARLY("YEARLY"); private String value; @@ -45,26 +70,24 @@ public enum PaymentFrequencyType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static PaymentFrequencyType fromValue(String value) { @@ -76,3 +99,4 @@ public static PaymentFrequencyType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/PayrollCalendar.java b/src/main/java/com/xero/models/payrollau/PayrollCalendar.java index bcf7662cc..d3f01c43a 100644 --- a/src/main/java/com/xero/models/payrollau/PayrollCalendar.java +++ b/src/main/java/com/xero/models/payrollau/PayrollCalendar.java @@ -9,22 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.CalendarType; +import com.xero.models.payrollau.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayrollCalendar + */ -/** PayrollCalendar */ public class PayrollCalendar { StringUtil util = new StringUtil(); @@ -52,347 +66,307 @@ public class PayrollCalendar { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * Name of the Payroll Calendar - * - * @param name String - * @return PayrollCalendar - */ + * Name of the Payroll Calendar + * @param name String + * @return PayrollCalendar + **/ public PayrollCalendar name(String name) { this.name = name; return this; } - /** + /** * Name of the Payroll Calendar - * * @return name - */ + **/ @ApiModelProperty(example = "Fortnightly Calendar", value = "Name of the Payroll Calendar") - /** + /** * Name of the Payroll Calendar - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the Payroll Calendar - * - * @param name String - */ + /** + * Name of the Payroll Calendar + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * calendarType - * - * @param calendarType CalendarType - * @return PayrollCalendar - */ + * calendarType + * @param calendarType CalendarType + * @return PayrollCalendar + **/ public PayrollCalendar calendarType(CalendarType calendarType) { this.calendarType = calendarType; return this; } - /** + /** * Get calendarType - * * @return calendarType - */ + **/ @ApiModelProperty(value = "") - /** + /** * calendarType - * * @return calendarType CalendarType - */ + **/ public CalendarType getCalendarType() { return calendarType; } - /** - * calendarType - * - * @param calendarType CalendarType - */ + /** + * calendarType + * @param calendarType CalendarType + **/ + public void setCalendarType(CalendarType calendarType) { this.calendarType = calendarType; } /** - * The start date of the upcoming pay period. The end date will be calculated based upon this - * date, and the calendar type selected (YYYY-MM-DD) - * - * @param startDate String - * @return PayrollCalendar - */ + * The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) + * @param startDate String + * @return PayrollCalendar + **/ public PayrollCalendar startDate(String startDate) { this.startDate = startDate; return this; } - /** - * The start date of the upcoming pay period. The end date will be calculated based upon this - * date, and the calendar type selected (YYYY-MM-DD) - * + /** + * The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) * @return startDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = - "The start date of the upcoming pay period. The end date will be calculated based upon" - + " this date, and the calendar type selected (YYYY-MM-DD)") - /** - * The start date of the upcoming pay period. The end date will be calculated based upon this - * date, and the calendar type selected (YYYY-MM-DD) - * + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD)") + /** + * The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) * @return startDate String - */ + **/ public String getStartDate() { return startDate; } - /** - * The start date of the upcoming pay period. The end date will be calculated based upon this - * date, and the calendar type selected (YYYY-MM-DD) - * + /** + * The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) * @return LocalDate - */ + **/ public LocalDate getStartDateAsDate() { if (this.startDate != null) { try { return util.convertStringToDate(this.startDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The start date of the upcoming pay period. The end date will be calculated based upon this - * date, and the calendar type selected (YYYY-MM-DD) - * - * @param startDate String - */ + /** + * The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) + * @param startDate String + **/ + public void setStartDate(String startDate) { this.startDate = startDate; } - /** - * The start date of the upcoming pay period. The end date will be calculated based upon this - * date, and the calendar type selected (YYYY-MM-DD) - * - * @param startDate LocalDateTime - */ + /** + * The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) + * @param startDate LocalDateTime + **/ public void setStartDate(LocalDate startDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.startDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) - * - * @param paymentDate String - * @return PayrollCalendar - */ + * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) + * @param paymentDate String + * @return PayrollCalendar + **/ public PayrollCalendar paymentDate(String paymentDate) { this.paymentDate = paymentDate; return this; } - /** + /** * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) - * * @return paymentDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD)") + /** * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) - * * @return paymentDate String - */ + **/ public String getPaymentDate() { return paymentDate; } - /** + /** * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getPaymentDateAsDate() { if (this.paymentDate != null) { try { return util.convertStringToDate(this.paymentDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) - * - * @param paymentDate String - */ + /** + * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) + * @param paymentDate String + **/ + public void setPaymentDate(String paymentDate) { this.paymentDate = paymentDate; } - /** - * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) - * - * @param paymentDate LocalDateTime - */ + /** + * The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) + * @param paymentDate LocalDateTime + **/ public void setPaymentDate(LocalDate paymentDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = paymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = paymentDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.paymentDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Xero identifier - * - * @param payrollCalendarID UUID - * @return PayrollCalendar - */ + * Xero identifier + * @param payrollCalendarID UUID + * @return PayrollCalendar + **/ public PayrollCalendar payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero identifier - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier") - /** + /** * Xero identifier - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero identifier - * - * @param payrollCalendarID UUID - */ + /** + * Xero identifier + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Reference Date (YYYY-MM-DD) - * - * @param referenceDate String - * @return PayrollCalendar - */ + * Reference Date (YYYY-MM-DD) + * @param referenceDate String + * @return PayrollCalendar + **/ public PayrollCalendar referenceDate(String referenceDate) { this.referenceDate = referenceDate; return this; } - /** + /** * Reference Date (YYYY-MM-DD) - * * @return referenceDate - */ + **/ @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "Reference Date (YYYY-MM-DD)") - /** + /** * Reference Date (YYYY-MM-DD) - * * @return referenceDate String - */ + **/ public String getReferenceDate() { return referenceDate; } - /** + /** * Reference Date (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getReferenceDateAsDate() { if (this.referenceDate != null) { try { return util.convertStringToDate(this.referenceDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Reference Date (YYYY-MM-DD) - * - * @param referenceDate String - */ + /** + * Reference Date (YYYY-MM-DD) + * @param referenceDate String + **/ + public void setReferenceDate(String referenceDate) { this.referenceDate = referenceDate; } - /** - * Reference Date (YYYY-MM-DD) - * - * @param referenceDate LocalDateTime - */ + /** + * Reference Date (YYYY-MM-DD) + * @param referenceDate LocalDateTime + **/ public void setReferenceDate(LocalDate referenceDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = referenceDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = referenceDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.referenceDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return PayrollCalendar - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return PayrollCalendar + **/ public PayrollCalendar validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -400,10 +374,9 @@ public PayrollCalendar validationErrors(List validationErrors) /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return PayrollCalendar - */ + **/ public PayrollCalendar addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -412,30 +385,29 @@ public PayrollCalendar addValidationErrorsItem(ValidationError validationErrorsI return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -445,29 +417,22 @@ public boolean equals(java.lang.Object o) { return false; } PayrollCalendar payrollCalendar = (PayrollCalendar) o; - return Objects.equals(this.name, payrollCalendar.name) - && Objects.equals(this.calendarType, payrollCalendar.calendarType) - && Objects.equals(this.startDate, payrollCalendar.startDate) - && Objects.equals(this.paymentDate, payrollCalendar.paymentDate) - && Objects.equals(this.payrollCalendarID, payrollCalendar.payrollCalendarID) - && Objects.equals(this.updatedDateUTC, payrollCalendar.updatedDateUTC) - && Objects.equals(this.referenceDate, payrollCalendar.referenceDate) - && Objects.equals(this.validationErrors, payrollCalendar.validationErrors); + return Objects.equals(this.name, payrollCalendar.name) && + Objects.equals(this.calendarType, payrollCalendar.calendarType) && + Objects.equals(this.startDate, payrollCalendar.startDate) && + Objects.equals(this.paymentDate, payrollCalendar.paymentDate) && + Objects.equals(this.payrollCalendarID, payrollCalendar.payrollCalendarID) && + Objects.equals(this.updatedDateUTC, payrollCalendar.updatedDateUTC) && + Objects.equals(this.referenceDate, payrollCalendar.referenceDate) && + Objects.equals(this.validationErrors, payrollCalendar.validationErrors); } @Override public int hashCode() { - return Objects.hash( - name, - calendarType, - startDate, - paymentDate, - payrollCalendarID, - updatedDateUTC, - referenceDate, - validationErrors); + return Objects.hash(name, calendarType, startDate, paymentDate, payrollCalendarID, updatedDateUTC, referenceDate, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -485,7 +450,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -493,4 +459,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayrollCalendars.java b/src/main/java/com/xero/models/payrollau/PayrollCalendars.java index 4f49f20b1..a184866d1 100644 --- a/src/main/java/com/xero/models/payrollau/PayrollCalendars.java +++ b/src/main/java/com/xero/models/payrollau/PayrollCalendars.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.PayrollCalendar; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayrollCalendars + */ -/** PayrollCalendars */ public class PayrollCalendars { StringUtil util = new StringUtil(); @JsonProperty("PayrollCalendars") private List payrollCalendars = new ArrayList(); /** - * payrollCalendars - * - * @param payrollCalendars List<PayrollCalendar> - * @return PayrollCalendars - */ + * payrollCalendars + * @param payrollCalendars List<PayrollCalendar> + * @return PayrollCalendars + **/ public PayrollCalendars payrollCalendars(List payrollCalendars) { this.payrollCalendars = payrollCalendars; return this; @@ -37,10 +54,9 @@ public PayrollCalendars payrollCalendars(List payrollCalendars) /** * payrollCalendars - * - * @param payrollCalendarsItem PayrollCalendar + * @param payrollCalendarsItem PayrollCalendar * @return PayrollCalendars - */ + **/ public PayrollCalendars addPayrollCalendarsItem(PayrollCalendar payrollCalendarsItem) { if (this.payrollCalendars == null) { this.payrollCalendars = new ArrayList(); @@ -49,30 +65,29 @@ public PayrollCalendars addPayrollCalendarsItem(PayrollCalendar payrollCalendars return this; } - /** + /** * Get payrollCalendars - * * @return payrollCalendars - */ + **/ @ApiModelProperty(value = "") - /** + /** * payrollCalendars - * * @return payrollCalendars List - */ + **/ public List getPayrollCalendars() { return payrollCalendars; } - /** - * payrollCalendars - * - * @param payrollCalendars List<PayrollCalendar> - */ + /** + * payrollCalendars + * @param payrollCalendars List<PayrollCalendar> + **/ + public void setPayrollCalendars(List payrollCalendars) { this.payrollCalendars = payrollCalendars; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(payrollCalendars); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/Payslip.java b/src/main/java/com/xero/models/payrollau/Payslip.java index b6f49f738..4f62be4e8 100644 --- a/src/main/java/com/xero/models/payrollau/Payslip.java +++ b/src/main/java/com/xero/models/payrollau/Payslip.java @@ -9,19 +9,41 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.DeductionLine; +import com.xero.models.payrollau.EarningsLine; +import com.xero.models.payrollau.LeaveAccrualLine; +import com.xero.models.payrollau.LeaveEarningsLine; +import com.xero.models.payrollau.ReimbursementLine; +import com.xero.models.payrollau.SuperannuationLine; +import com.xero.models.payrollau.TaxLine; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Payslip + */ -/** Payslip */ public class Payslip { StringUtil util = new StringUtil(); @@ -82,365 +104,330 @@ public class Payslip { @JsonProperty("UpdatedDateUTC") private String updatedDateUTC; /** - * The Xero identifier for an employee - * - * @param employeeID UUID - * @return Payslip - */ + * The Xero identifier for an employee + * @param employeeID UUID + * @return Payslip + **/ public Payslip employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for an employee - * * @return employeeID - */ - @ApiModelProperty( - example = "4729f087-8eec-49c1-8294-4d11a5a0a37c", - value = "The Xero identifier for an employee") - /** + **/ + @ApiModelProperty(example = "4729f087-8eec-49c1-8294-4d11a5a0a37c", value = "The Xero identifier for an employee") + /** * The Xero identifier for an employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for an employee - * - * @param employeeID UUID - */ + /** + * The Xero identifier for an employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * Xero identifier for the payslip - * - * @param payslipID UUID - * @return Payslip - */ + * Xero identifier for the payslip + * @param payslipID UUID + * @return Payslip + **/ public Payslip payslipID(UUID payslipID) { this.payslipID = payslipID; return this; } - /** + /** * Xero identifier for the payslip - * * @return payslipID - */ - @ApiModelProperty( - example = "f3c0874d-7cdd-459a-a95c-d90d51decc42", - value = "Xero identifier for the payslip") - /** + **/ + @ApiModelProperty(example = "f3c0874d-7cdd-459a-a95c-d90d51decc42", value = "Xero identifier for the payslip") + /** * Xero identifier for the payslip - * * @return payslipID UUID - */ + **/ public UUID getPayslipID() { return payslipID; } - /** - * Xero identifier for the payslip - * - * @param payslipID UUID - */ + /** + * Xero identifier for the payslip + * @param payslipID UUID + **/ + public void setPayslipID(UUID payslipID) { this.payslipID = payslipID; } /** - * First name of employee - * - * @param firstName String - * @return Payslip - */ + * First name of employee + * @param firstName String + * @return Payslip + **/ public Payslip firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of employee - * * @return firstName - */ + **/ @ApiModelProperty(example = "Karen", value = "First name of employee") - /** + /** * First name of employee - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of employee - * - * @param firstName String - */ + /** + * First name of employee + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of employee - * - * @param lastName String - * @return Payslip - */ + * Last name of employee + * @param lastName String + * @return Payslip + **/ public Payslip lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of employee - * * @return lastName - */ + **/ @ApiModelProperty(example = "Jones", value = "Last name of employee") - /** + /** * Last name of employee - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of employee - * - * @param lastName String - */ + /** + * Last name of employee + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * The Wages for the Payslip - * - * @param wages Double - * @return Payslip - */ + * The Wages for the Payslip + * @param wages Double + * @return Payslip + **/ public Payslip wages(Double wages) { this.wages = wages; return this; } - /** + /** * The Wages for the Payslip - * * @return wages - */ + **/ @ApiModelProperty(example = "1060.5", value = "The Wages for the Payslip") - /** + /** * The Wages for the Payslip - * * @return wages Double - */ + **/ public Double getWages() { return wages; } - /** - * The Wages for the Payslip - * - * @param wages Double - */ + /** + * The Wages for the Payslip + * @param wages Double + **/ + public void setWages(Double wages) { this.wages = wages; } /** - * The Deductions for the Payslip - * - * @param deductions Double - * @return Payslip - */ + * The Deductions for the Payslip + * @param deductions Double + * @return Payslip + **/ public Payslip deductions(Double deductions) { this.deductions = deductions; return this; } - /** + /** * The Deductions for the Payslip - * * @return deductions - */ + **/ @ApiModelProperty(example = "0.0", value = "The Deductions for the Payslip") - /** + /** * The Deductions for the Payslip - * * @return deductions Double - */ + **/ public Double getDeductions() { return deductions; } - /** - * The Deductions for the Payslip - * - * @param deductions Double - */ + /** + * The Deductions for the Payslip + * @param deductions Double + **/ + public void setDeductions(Double deductions) { this.deductions = deductions; } /** - * The Tax for the Payslip - * - * @param tax Double - * @return Payslip - */ + * The Tax for the Payslip + * @param tax Double + * @return Payslip + **/ public Payslip tax(Double tax) { this.tax = tax; return this; } - /** + /** * The Tax for the Payslip - * * @return tax - */ + **/ @ApiModelProperty(example = "198.0", value = "The Tax for the Payslip") - /** + /** * The Tax for the Payslip - * * @return tax Double - */ + **/ public Double getTax() { return tax; } - /** - * The Tax for the Payslip - * - * @param tax Double - */ + /** + * The Tax for the Payslip + * @param tax Double + **/ + public void setTax(Double tax) { this.tax = tax; } /** - * The Super for the Payslip - * - * @param _super Double - * @return Payslip - */ + * The Super for the Payslip + * @param _super Double + * @return Payslip + **/ public Payslip _super(Double _super) { this._super = _super; return this; } - /** + /** * The Super for the Payslip - * * @return _super - */ + **/ @ApiModelProperty(example = "75.6", value = "The Super for the Payslip") - /** + /** * The Super for the Payslip - * * @return _super Double - */ + **/ public Double getSuper() { return _super; } - /** - * The Super for the Payslip - * - * @param _super Double - */ + /** + * The Super for the Payslip + * @param _super Double + **/ + public void setSuper(Double _super) { this._super = _super; } /** - * The Reimbursements for the Payslip - * - * @param reimbursements Double - * @return Payslip - */ + * The Reimbursements for the Payslip + * @param reimbursements Double + * @return Payslip + **/ public Payslip reimbursements(Double reimbursements) { this.reimbursements = reimbursements; return this; } - /** + /** * The Reimbursements for the Payslip - * * @return reimbursements - */ + **/ @ApiModelProperty(example = "0.0", value = "The Reimbursements for the Payslip") - /** + /** * The Reimbursements for the Payslip - * * @return reimbursements Double - */ + **/ public Double getReimbursements() { return reimbursements; } - /** - * The Reimbursements for the Payslip - * - * @param reimbursements Double - */ + /** + * The Reimbursements for the Payslip + * @param reimbursements Double + **/ + public void setReimbursements(Double reimbursements) { this.reimbursements = reimbursements; } /** - * The NetPay for the Payslip - * - * @param netPay Double - * @return Payslip - */ + * The NetPay for the Payslip + * @param netPay Double + * @return Payslip + **/ public Payslip netPay(Double netPay) { this.netPay = netPay; return this; } - /** + /** * The NetPay for the Payslip - * * @return netPay - */ + **/ @ApiModelProperty(example = "862.5", value = "The NetPay for the Payslip") - /** + /** * The NetPay for the Payslip - * * @return netPay Double - */ + **/ public Double getNetPay() { return netPay; } - /** - * The NetPay for the Payslip - * - * @param netPay Double - */ + /** + * The NetPay for the Payslip + * @param netPay Double + **/ + public void setNetPay(Double netPay) { this.netPay = netPay; } /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - * @return Payslip - */ + * earningsLines + * @param earningsLines List<EarningsLine> + * @return Payslip + **/ public Payslip earningsLines(List earningsLines) { this.earningsLines = earningsLines; return this; @@ -448,10 +435,9 @@ public Payslip earningsLines(List earningsLines) { /** * earningsLines - * - * @param earningsLinesItem EarningsLine + * @param earningsLinesItem EarningsLine * @return Payslip - */ + **/ public Payslip addEarningsLinesItem(EarningsLine earningsLinesItem) { if (this.earningsLines == null) { this.earningsLines = new ArrayList(); @@ -460,36 +446,33 @@ public Payslip addEarningsLinesItem(EarningsLine earningsLinesItem) { return this; } - /** + /** * Get earningsLines - * * @return earningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsLines - * * @return earningsLines List - */ + **/ public List getEarningsLines() { return earningsLines; } - /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - */ + /** + * earningsLines + * @param earningsLines List<EarningsLine> + **/ + public void setEarningsLines(List earningsLines) { this.earningsLines = earningsLines; } /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - * @return Payslip - */ + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + * @return Payslip + **/ public Payslip leaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; return this; @@ -497,10 +480,9 @@ public Payslip leaveEarningsLines(List leaveEarningsLines) { /** * leaveEarningsLines - * - * @param leaveEarningsLinesItem LeaveEarningsLine + * @param leaveEarningsLinesItem LeaveEarningsLine * @return Payslip - */ + **/ public Payslip addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLinesItem) { if (this.leaveEarningsLines == null) { this.leaveEarningsLines = new ArrayList(); @@ -509,36 +491,33 @@ public Payslip addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLinesIte return this; } - /** + /** * Get leaveEarningsLines - * * @return leaveEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveEarningsLines - * * @return leaveEarningsLines List - */ + **/ public List getLeaveEarningsLines() { return leaveEarningsLines; } - /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - */ + /** + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + **/ + public void setLeaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; } /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<EarningsLine> - * @return Payslip - */ + * timesheetEarningsLines + * @param timesheetEarningsLines List<EarningsLine> + * @return Payslip + **/ public Payslip timesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; return this; @@ -546,10 +525,9 @@ public Payslip timesheetEarningsLines(List timesheetEarningsLines) /** * timesheetEarningsLines - * - * @param timesheetEarningsLinesItem EarningsLine + * @param timesheetEarningsLinesItem EarningsLine * @return Payslip - */ + **/ public Payslip addTimesheetEarningsLinesItem(EarningsLine timesheetEarningsLinesItem) { if (this.timesheetEarningsLines == null) { this.timesheetEarningsLines = new ArrayList(); @@ -558,36 +536,33 @@ public Payslip addTimesheetEarningsLinesItem(EarningsLine timesheetEarningsLines return this; } - /** + /** * Get timesheetEarningsLines - * * @return timesheetEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetEarningsLines - * * @return timesheetEarningsLines List - */ + **/ public List getTimesheetEarningsLines() { return timesheetEarningsLines; } - /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<EarningsLine> - */ + /** + * timesheetEarningsLines + * @param timesheetEarningsLines List<EarningsLine> + **/ + public void setTimesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; } /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - * @return Payslip - */ + * deductionLines + * @param deductionLines List<DeductionLine> + * @return Payslip + **/ public Payslip deductionLines(List deductionLines) { this.deductionLines = deductionLines; return this; @@ -595,10 +570,9 @@ public Payslip deductionLines(List deductionLines) { /** * deductionLines - * - * @param deductionLinesItem DeductionLine + * @param deductionLinesItem DeductionLine * @return Payslip - */ + **/ public Payslip addDeductionLinesItem(DeductionLine deductionLinesItem) { if (this.deductionLines == null) { this.deductionLines = new ArrayList(); @@ -607,36 +581,33 @@ public Payslip addDeductionLinesItem(DeductionLine deductionLinesItem) { return this; } - /** + /** * Get deductionLines - * * @return deductionLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionLines - * * @return deductionLines List - */ + **/ public List getDeductionLines() { return deductionLines; } - /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - */ + /** + * deductionLines + * @param deductionLines List<DeductionLine> + **/ + public void setDeductionLines(List deductionLines) { this.deductionLines = deductionLines; } /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - * @return Payslip - */ + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + * @return Payslip + **/ public Payslip leaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; return this; @@ -644,10 +615,9 @@ public Payslip leaveAccrualLines(List leaveAccrualLines) { /** * leaveAccrualLines - * - * @param leaveAccrualLinesItem LeaveAccrualLine + * @param leaveAccrualLinesItem LeaveAccrualLine * @return Payslip - */ + **/ public Payslip addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesItem) { if (this.leaveAccrualLines == null) { this.leaveAccrualLines = new ArrayList(); @@ -656,36 +626,33 @@ public Payslip addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesItem) return this; } - /** + /** * Get leaveAccrualLines - * * @return leaveAccrualLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveAccrualLines - * * @return leaveAccrualLines List - */ + **/ public List getLeaveAccrualLines() { return leaveAccrualLines; } - /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - */ + /** + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + **/ + public void setLeaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; } /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - * @return Payslip - */ + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + * @return Payslip + **/ public Payslip reimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; return this; @@ -693,10 +660,9 @@ public Payslip reimbursementLines(List reimbursementLines) { /** * reimbursementLines - * - * @param reimbursementLinesItem ReimbursementLine + * @param reimbursementLinesItem ReimbursementLine * @return Payslip - */ + **/ public Payslip addReimbursementLinesItem(ReimbursementLine reimbursementLinesItem) { if (this.reimbursementLines == null) { this.reimbursementLines = new ArrayList(); @@ -705,36 +671,33 @@ public Payslip addReimbursementLinesItem(ReimbursementLine reimbursementLinesIte return this; } - /** + /** * Get reimbursementLines - * * @return reimbursementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementLines - * * @return reimbursementLines List - */ + **/ public List getReimbursementLines() { return reimbursementLines; } - /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - */ + /** + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + **/ + public void setReimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; } /** - * superannuationLines - * - * @param superannuationLines List<SuperannuationLine> - * @return Payslip - */ + * superannuationLines + * @param superannuationLines List<SuperannuationLine> + * @return Payslip + **/ public Payslip superannuationLines(List superannuationLines) { this.superannuationLines = superannuationLines; return this; @@ -742,10 +705,9 @@ public Payslip superannuationLines(List superannuationLines) /** * superannuationLines - * - * @param superannuationLinesItem SuperannuationLine + * @param superannuationLinesItem SuperannuationLine * @return Payslip - */ + **/ public Payslip addSuperannuationLinesItem(SuperannuationLine superannuationLinesItem) { if (this.superannuationLines == null) { this.superannuationLines = new ArrayList(); @@ -754,36 +716,33 @@ public Payslip addSuperannuationLinesItem(SuperannuationLine superannuationLines return this; } - /** + /** * Get superannuationLines - * * @return superannuationLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * superannuationLines - * * @return superannuationLines List - */ + **/ public List getSuperannuationLines() { return superannuationLines; } - /** - * superannuationLines - * - * @param superannuationLines List<SuperannuationLine> - */ + /** + * superannuationLines + * @param superannuationLines List<SuperannuationLine> + **/ + public void setSuperannuationLines(List superannuationLines) { this.superannuationLines = superannuationLines; } /** - * taxLines - * - * @param taxLines List<TaxLine> - * @return Payslip - */ + * taxLines + * @param taxLines List<TaxLine> + * @return Payslip + **/ public Payslip taxLines(List taxLines) { this.taxLines = taxLines; return this; @@ -791,10 +750,9 @@ public Payslip taxLines(List taxLines) { /** * taxLines - * - * @param taxLinesItem TaxLine + * @param taxLinesItem TaxLine * @return Payslip - */ + **/ public Payslip addTaxLinesItem(TaxLine taxLinesItem) { if (this.taxLines == null) { this.taxLines = new ArrayList(); @@ -803,60 +761,56 @@ public Payslip addTaxLinesItem(TaxLine taxLinesItem) { return this; } - /** + /** * Get taxLines - * * @return taxLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxLines - * * @return taxLines List - */ + **/ public List getTaxLines() { return taxLines; } - /** - * taxLines - * - * @param taxLines List<TaxLine> - */ + /** + * taxLines + * @param taxLines List<TaxLine> + **/ + public void setTaxLines(List taxLines) { this.taxLines = taxLines; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -866,51 +820,33 @@ public boolean equals(java.lang.Object o) { return false; } Payslip payslip = (Payslip) o; - return Objects.equals(this.employeeID, payslip.employeeID) - && Objects.equals(this.payslipID, payslip.payslipID) - && Objects.equals(this.firstName, payslip.firstName) - && Objects.equals(this.lastName, payslip.lastName) - && Objects.equals(this.wages, payslip.wages) - && Objects.equals(this.deductions, payslip.deductions) - && Objects.equals(this.tax, payslip.tax) - && Objects.equals(this._super, payslip._super) - && Objects.equals(this.reimbursements, payslip.reimbursements) - && Objects.equals(this.netPay, payslip.netPay) - && Objects.equals(this.earningsLines, payslip.earningsLines) - && Objects.equals(this.leaveEarningsLines, payslip.leaveEarningsLines) - && Objects.equals(this.timesheetEarningsLines, payslip.timesheetEarningsLines) - && Objects.equals(this.deductionLines, payslip.deductionLines) - && Objects.equals(this.leaveAccrualLines, payslip.leaveAccrualLines) - && Objects.equals(this.reimbursementLines, payslip.reimbursementLines) - && Objects.equals(this.superannuationLines, payslip.superannuationLines) - && Objects.equals(this.taxLines, payslip.taxLines) - && Objects.equals(this.updatedDateUTC, payslip.updatedDateUTC); + return Objects.equals(this.employeeID, payslip.employeeID) && + Objects.equals(this.payslipID, payslip.payslipID) && + Objects.equals(this.firstName, payslip.firstName) && + Objects.equals(this.lastName, payslip.lastName) && + Objects.equals(this.wages, payslip.wages) && + Objects.equals(this.deductions, payslip.deductions) && + Objects.equals(this.tax, payslip.tax) && + Objects.equals(this._super, payslip._super) && + Objects.equals(this.reimbursements, payslip.reimbursements) && + Objects.equals(this.netPay, payslip.netPay) && + Objects.equals(this.earningsLines, payslip.earningsLines) && + Objects.equals(this.leaveEarningsLines, payslip.leaveEarningsLines) && + Objects.equals(this.timesheetEarningsLines, payslip.timesheetEarningsLines) && + Objects.equals(this.deductionLines, payslip.deductionLines) && + Objects.equals(this.leaveAccrualLines, payslip.leaveAccrualLines) && + Objects.equals(this.reimbursementLines, payslip.reimbursementLines) && + Objects.equals(this.superannuationLines, payslip.superannuationLines) && + Objects.equals(this.taxLines, payslip.taxLines) && + Objects.equals(this.updatedDateUTC, payslip.updatedDateUTC); } @Override public int hashCode() { - return Objects.hash( - employeeID, - payslipID, - firstName, - lastName, - wages, - deductions, - tax, - _super, - reimbursements, - netPay, - earningsLines, - leaveEarningsLines, - timesheetEarningsLines, - deductionLines, - leaveAccrualLines, - reimbursementLines, - superannuationLines, - taxLines, - updatedDateUTC); + return Objects.hash(employeeID, payslipID, firstName, lastName, wages, deductions, tax, _super, reimbursements, netPay, earningsLines, leaveEarningsLines, timesheetEarningsLines, deductionLines, leaveAccrualLines, reimbursementLines, superannuationLines, taxLines, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -927,15 +863,11 @@ public String toString() { sb.append(" netPay: ").append(toIndentedString(netPay)).append("\n"); sb.append(" earningsLines: ").append(toIndentedString(earningsLines)).append("\n"); sb.append(" leaveEarningsLines: ").append(toIndentedString(leaveEarningsLines)).append("\n"); - sb.append(" timesheetEarningsLines: ") - .append(toIndentedString(timesheetEarningsLines)) - .append("\n"); + sb.append(" timesheetEarningsLines: ").append(toIndentedString(timesheetEarningsLines)).append("\n"); sb.append(" deductionLines: ").append(toIndentedString(deductionLines)).append("\n"); sb.append(" leaveAccrualLines: ").append(toIndentedString(leaveAccrualLines)).append("\n"); sb.append(" reimbursementLines: ").append(toIndentedString(reimbursementLines)).append("\n"); - sb.append(" superannuationLines: ") - .append(toIndentedString(superannuationLines)) - .append("\n"); + sb.append(" superannuationLines: ").append(toIndentedString(superannuationLines)).append("\n"); sb.append(" taxLines: ").append(toIndentedString(taxLines)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append("}"); @@ -943,7 +875,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -951,4 +884,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayslipLines.java b/src/main/java/com/xero/models/payrollau/PayslipLines.java index 656124ed8..f459ed591 100644 --- a/src/main/java/com/xero/models/payrollau/PayslipLines.java +++ b/src/main/java/com/xero/models/payrollau/PayslipLines.java @@ -9,16 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.DeductionLine; +import com.xero.models.payrollau.EarningsLine; +import com.xero.models.payrollau.LeaveAccrualLine; +import com.xero.models.payrollau.LeaveEarningsLine; +import com.xero.models.payrollau.ReimbursementLine; +import com.xero.models.payrollau.SuperannuationLine; +import com.xero.models.payrollau.TaxLine; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayslipLines + */ -/** PayslipLines */ public class PayslipLines { StringUtil util = new StringUtil(); @@ -46,11 +70,10 @@ public class PayslipLines { @JsonProperty("TaxLines") private List taxLines = new ArrayList(); /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - * @return PayslipLines - */ + * earningsLines + * @param earningsLines List<EarningsLine> + * @return PayslipLines + **/ public PayslipLines earningsLines(List earningsLines) { this.earningsLines = earningsLines; return this; @@ -58,10 +81,9 @@ public PayslipLines earningsLines(List earningsLines) { /** * earningsLines - * - * @param earningsLinesItem EarningsLine + * @param earningsLinesItem EarningsLine * @return PayslipLines - */ + **/ public PayslipLines addEarningsLinesItem(EarningsLine earningsLinesItem) { if (this.earningsLines == null) { this.earningsLines = new ArrayList(); @@ -70,36 +92,33 @@ public PayslipLines addEarningsLinesItem(EarningsLine earningsLinesItem) { return this; } - /** + /** * Get earningsLines - * * @return earningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsLines - * * @return earningsLines List - */ + **/ public List getEarningsLines() { return earningsLines; } - /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - */ + /** + * earningsLines + * @param earningsLines List<EarningsLine> + **/ + public void setEarningsLines(List earningsLines) { this.earningsLines = earningsLines; } /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - * @return PayslipLines - */ + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + * @return PayslipLines + **/ public PayslipLines leaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; return this; @@ -107,10 +126,9 @@ public PayslipLines leaveEarningsLines(List leaveEarningsLine /** * leaveEarningsLines - * - * @param leaveEarningsLinesItem LeaveEarningsLine + * @param leaveEarningsLinesItem LeaveEarningsLine * @return PayslipLines - */ + **/ public PayslipLines addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLinesItem) { if (this.leaveEarningsLines == null) { this.leaveEarningsLines = new ArrayList(); @@ -119,36 +137,33 @@ public PayslipLines addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLin return this; } - /** + /** * Get leaveEarningsLines - * * @return leaveEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveEarningsLines - * * @return leaveEarningsLines List - */ + **/ public List getLeaveEarningsLines() { return leaveEarningsLines; } - /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - */ + /** + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + **/ + public void setLeaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; } /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<EarningsLine> - * @return PayslipLines - */ + * timesheetEarningsLines + * @param timesheetEarningsLines List<EarningsLine> + * @return PayslipLines + **/ public PayslipLines timesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; return this; @@ -156,10 +171,9 @@ public PayslipLines timesheetEarningsLines(List timesheetEarningsL /** * timesheetEarningsLines - * - * @param timesheetEarningsLinesItem EarningsLine + * @param timesheetEarningsLinesItem EarningsLine * @return PayslipLines - */ + **/ public PayslipLines addTimesheetEarningsLinesItem(EarningsLine timesheetEarningsLinesItem) { if (this.timesheetEarningsLines == null) { this.timesheetEarningsLines = new ArrayList(); @@ -168,36 +182,33 @@ public PayslipLines addTimesheetEarningsLinesItem(EarningsLine timesheetEarnings return this; } - /** + /** * Get timesheetEarningsLines - * * @return timesheetEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetEarningsLines - * * @return timesheetEarningsLines List - */ + **/ public List getTimesheetEarningsLines() { return timesheetEarningsLines; } - /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<EarningsLine> - */ + /** + * timesheetEarningsLines + * @param timesheetEarningsLines List<EarningsLine> + **/ + public void setTimesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; } /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - * @return PayslipLines - */ + * deductionLines + * @param deductionLines List<DeductionLine> + * @return PayslipLines + **/ public PayslipLines deductionLines(List deductionLines) { this.deductionLines = deductionLines; return this; @@ -205,10 +216,9 @@ public PayslipLines deductionLines(List deductionLines) { /** * deductionLines - * - * @param deductionLinesItem DeductionLine + * @param deductionLinesItem DeductionLine * @return PayslipLines - */ + **/ public PayslipLines addDeductionLinesItem(DeductionLine deductionLinesItem) { if (this.deductionLines == null) { this.deductionLines = new ArrayList(); @@ -217,36 +227,33 @@ public PayslipLines addDeductionLinesItem(DeductionLine deductionLinesItem) { return this; } - /** + /** * Get deductionLines - * * @return deductionLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionLines - * * @return deductionLines List - */ + **/ public List getDeductionLines() { return deductionLines; } - /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - */ + /** + * deductionLines + * @param deductionLines List<DeductionLine> + **/ + public void setDeductionLines(List deductionLines) { this.deductionLines = deductionLines; } /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - * @return PayslipLines - */ + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + * @return PayslipLines + **/ public PayslipLines leaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; return this; @@ -254,10 +261,9 @@ public PayslipLines leaveAccrualLines(List leaveAccrualLines) /** * leaveAccrualLines - * - * @param leaveAccrualLinesItem LeaveAccrualLine + * @param leaveAccrualLinesItem LeaveAccrualLine * @return PayslipLines - */ + **/ public PayslipLines addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesItem) { if (this.leaveAccrualLines == null) { this.leaveAccrualLines = new ArrayList(); @@ -266,36 +272,33 @@ public PayslipLines addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesI return this; } - /** + /** * Get leaveAccrualLines - * * @return leaveAccrualLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveAccrualLines - * * @return leaveAccrualLines List - */ + **/ public List getLeaveAccrualLines() { return leaveAccrualLines; } - /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - */ + /** + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + **/ + public void setLeaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; } /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - * @return PayslipLines - */ + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + * @return PayslipLines + **/ public PayslipLines reimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; return this; @@ -303,10 +306,9 @@ public PayslipLines reimbursementLines(List reimbursementLine /** * reimbursementLines - * - * @param reimbursementLinesItem ReimbursementLine + * @param reimbursementLinesItem ReimbursementLine * @return PayslipLines - */ + **/ public PayslipLines addReimbursementLinesItem(ReimbursementLine reimbursementLinesItem) { if (this.reimbursementLines == null) { this.reimbursementLines = new ArrayList(); @@ -315,36 +317,33 @@ public PayslipLines addReimbursementLinesItem(ReimbursementLine reimbursementLin return this; } - /** + /** * Get reimbursementLines - * * @return reimbursementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementLines - * * @return reimbursementLines List - */ + **/ public List getReimbursementLines() { return reimbursementLines; } - /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - */ + /** + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + **/ + public void setReimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; } /** - * superannuationLines - * - * @param superannuationLines List<SuperannuationLine> - * @return PayslipLines - */ + * superannuationLines + * @param superannuationLines List<SuperannuationLine> + * @return PayslipLines + **/ public PayslipLines superannuationLines(List superannuationLines) { this.superannuationLines = superannuationLines; return this; @@ -352,10 +351,9 @@ public PayslipLines superannuationLines(List superannuationL /** * superannuationLines - * - * @param superannuationLinesItem SuperannuationLine + * @param superannuationLinesItem SuperannuationLine * @return PayslipLines - */ + **/ public PayslipLines addSuperannuationLinesItem(SuperannuationLine superannuationLinesItem) { if (this.superannuationLines == null) { this.superannuationLines = new ArrayList(); @@ -364,36 +362,33 @@ public PayslipLines addSuperannuationLinesItem(SuperannuationLine superannuation return this; } - /** + /** * Get superannuationLines - * * @return superannuationLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * superannuationLines - * * @return superannuationLines List - */ + **/ public List getSuperannuationLines() { return superannuationLines; } - /** - * superannuationLines - * - * @param superannuationLines List<SuperannuationLine> - */ + /** + * superannuationLines + * @param superannuationLines List<SuperannuationLine> + **/ + public void setSuperannuationLines(List superannuationLines) { this.superannuationLines = superannuationLines; } /** - * taxLines - * - * @param taxLines List<TaxLine> - * @return PayslipLines - */ + * taxLines + * @param taxLines List<TaxLine> + * @return PayslipLines + **/ public PayslipLines taxLines(List taxLines) { this.taxLines = taxLines; return this; @@ -401,10 +396,9 @@ public PayslipLines taxLines(List taxLines) { /** * taxLines - * - * @param taxLinesItem TaxLine + * @param taxLinesItem TaxLine * @return PayslipLines - */ + **/ public PayslipLines addTaxLinesItem(TaxLine taxLinesItem) { if (this.taxLines == null) { this.taxLines = new ArrayList(); @@ -413,30 +407,29 @@ public PayslipLines addTaxLinesItem(TaxLine taxLinesItem) { return this; } - /** + /** * Get taxLines - * * @return taxLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxLines - * * @return taxLines List - */ + **/ public List getTaxLines() { return taxLines; } - /** - * taxLines - * - * @param taxLines List<TaxLine> - */ + /** + * taxLines + * @param taxLines List<TaxLine> + **/ + public void setTaxLines(List taxLines) { this.taxLines = taxLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -446,51 +439,41 @@ public boolean equals(java.lang.Object o) { return false; } PayslipLines payslipLines = (PayslipLines) o; - return Objects.equals(this.earningsLines, payslipLines.earningsLines) - && Objects.equals(this.leaveEarningsLines, payslipLines.leaveEarningsLines) - && Objects.equals(this.timesheetEarningsLines, payslipLines.timesheetEarningsLines) - && Objects.equals(this.deductionLines, payslipLines.deductionLines) - && Objects.equals(this.leaveAccrualLines, payslipLines.leaveAccrualLines) - && Objects.equals(this.reimbursementLines, payslipLines.reimbursementLines) - && Objects.equals(this.superannuationLines, payslipLines.superannuationLines) - && Objects.equals(this.taxLines, payslipLines.taxLines); + return Objects.equals(this.earningsLines, payslipLines.earningsLines) && + Objects.equals(this.leaveEarningsLines, payslipLines.leaveEarningsLines) && + Objects.equals(this.timesheetEarningsLines, payslipLines.timesheetEarningsLines) && + Objects.equals(this.deductionLines, payslipLines.deductionLines) && + Objects.equals(this.leaveAccrualLines, payslipLines.leaveAccrualLines) && + Objects.equals(this.reimbursementLines, payslipLines.reimbursementLines) && + Objects.equals(this.superannuationLines, payslipLines.superannuationLines) && + Objects.equals(this.taxLines, payslipLines.taxLines); } @Override public int hashCode() { - return Objects.hash( - earningsLines, - leaveEarningsLines, - timesheetEarningsLines, - deductionLines, - leaveAccrualLines, - reimbursementLines, - superannuationLines, - taxLines); + return Objects.hash(earningsLines, leaveEarningsLines, timesheetEarningsLines, deductionLines, leaveAccrualLines, reimbursementLines, superannuationLines, taxLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PayslipLines {\n"); sb.append(" earningsLines: ").append(toIndentedString(earningsLines)).append("\n"); sb.append(" leaveEarningsLines: ").append(toIndentedString(leaveEarningsLines)).append("\n"); - sb.append(" timesheetEarningsLines: ") - .append(toIndentedString(timesheetEarningsLines)) - .append("\n"); + sb.append(" timesheetEarningsLines: ").append(toIndentedString(timesheetEarningsLines)).append("\n"); sb.append(" deductionLines: ").append(toIndentedString(deductionLines)).append("\n"); sb.append(" leaveAccrualLines: ").append(toIndentedString(leaveAccrualLines)).append("\n"); sb.append(" reimbursementLines: ").append(toIndentedString(reimbursementLines)).append("\n"); - sb.append(" superannuationLines: ") - .append(toIndentedString(superannuationLines)) - .append("\n"); + sb.append(" superannuationLines: ").append(toIndentedString(superannuationLines)).append("\n"); sb.append(" taxLines: ").append(toIndentedString(taxLines)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -498,4 +481,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayslipObject.java b/src/main/java/com/xero/models/payrollau/PayslipObject.java index ef74729e3..3b7e2099a 100644 --- a/src/main/java/com/xero/models/payrollau/PayslipObject.java +++ b/src/main/java/com/xero/models/payrollau/PayslipObject.java @@ -9,54 +9,70 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.Payslip; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayslipObject + */ -/** PayslipObject */ public class PayslipObject { StringUtil util = new StringUtil(); @JsonProperty("Payslip") private Payslip payslip; /** - * payslip - * - * @param payslip Payslip - * @return PayslipObject - */ + * payslip + * @param payslip Payslip + * @return PayslipObject + **/ public PayslipObject payslip(Payslip payslip) { this.payslip = payslip; return this; } - /** + /** * Get payslip - * * @return payslip - */ + **/ @ApiModelProperty(value = "") - /** + /** * payslip - * * @return payslip Payslip - */ + **/ public Payslip getPayslip() { return payslip; } - /** - * payslip - * - * @param payslip Payslip - */ + /** + * payslip + * @param payslip Payslip + **/ + public void setPayslip(Payslip payslip) { this.payslip = payslip; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +90,7 @@ public int hashCode() { return Objects.hash(payslip); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +101,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +110,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/PayslipSummary.java b/src/main/java/com/xero/models/payrollau/PayslipSummary.java index cff5f5a57..28b6f56ab 100644 --- a/src/main/java/com/xero/models/payrollau/PayslipSummary.java +++ b/src/main/java/com/xero/models/payrollau/PayslipSummary.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayslipSummary + */ -/** PayslipSummary */ public class PayslipSummary { StringUtil util = new StringUtil(); @@ -59,424 +74,385 @@ public class PayslipSummary { @JsonProperty("UpdatedDateUTC") private String updatedDateUTC; /** - * The Xero identifier for an employee - * - * @param employeeID UUID - * @return PayslipSummary - */ + * The Xero identifier for an employee + * @param employeeID UUID + * @return PayslipSummary + **/ public PayslipSummary employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for an employee - * * @return employeeID - */ - @ApiModelProperty( - example = "4729f087-8eec-49c1-8294-4d11a5a0a37c", - value = "The Xero identifier for an employee") - /** + **/ + @ApiModelProperty(example = "4729f087-8eec-49c1-8294-4d11a5a0a37c", value = "The Xero identifier for an employee") + /** * The Xero identifier for an employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for an employee - * - * @param employeeID UUID - */ + /** + * The Xero identifier for an employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * Xero identifier for the payslip - * - * @param payslipID UUID - * @return PayslipSummary - */ + * Xero identifier for the payslip + * @param payslipID UUID + * @return PayslipSummary + **/ public PayslipSummary payslipID(UUID payslipID) { this.payslipID = payslipID; return this; } - /** + /** * Xero identifier for the payslip - * * @return payslipID - */ - @ApiModelProperty( - example = "f3c0874d-7cdd-459a-a95c-d90d51decc42", - value = "Xero identifier for the payslip") - /** + **/ + @ApiModelProperty(example = "f3c0874d-7cdd-459a-a95c-d90d51decc42", value = "Xero identifier for the payslip") + /** * Xero identifier for the payslip - * * @return payslipID UUID - */ + **/ public UUID getPayslipID() { return payslipID; } - /** - * Xero identifier for the payslip - * - * @param payslipID UUID - */ + /** + * Xero identifier for the payslip + * @param payslipID UUID + **/ + public void setPayslipID(UUID payslipID) { this.payslipID = payslipID; } /** - * First name of employee - * - * @param firstName String - * @return PayslipSummary - */ + * First name of employee + * @param firstName String + * @return PayslipSummary + **/ public PayslipSummary firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of employee - * * @return firstName - */ + **/ @ApiModelProperty(example = "Karen", value = "First name of employee") - /** + /** * First name of employee - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of employee - * - * @param firstName String - */ + /** + * First name of employee + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of employee - * - * @param lastName String - * @return PayslipSummary - */ + * Last name of employee + * @param lastName String + * @return PayslipSummary + **/ public PayslipSummary lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of employee - * * @return lastName - */ + **/ @ApiModelProperty(example = "Jones", value = "Last name of employee") - /** + /** * Last name of employee - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of employee - * - * @param lastName String - */ + /** + * Last name of employee + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Employee group name - * - * @param employeeGroup String - * @return PayslipSummary - */ + * Employee group name + * @param employeeGroup String + * @return PayslipSummary + **/ public PayslipSummary employeeGroup(String employeeGroup) { this.employeeGroup = employeeGroup; return this; } - /** + /** * Employee group name - * * @return employeeGroup - */ + **/ @ApiModelProperty(example = "Marketing", value = "Employee group name") - /** + /** * Employee group name - * * @return employeeGroup String - */ + **/ public String getEmployeeGroup() { return employeeGroup; } - /** - * Employee group name - * - * @param employeeGroup String - */ + /** + * Employee group name + * @param employeeGroup String + **/ + public void setEmployeeGroup(String employeeGroup) { this.employeeGroup = employeeGroup; } /** - * The Wages for the Payslip - * - * @param wages Double - * @return PayslipSummary - */ + * The Wages for the Payslip + * @param wages Double + * @return PayslipSummary + **/ public PayslipSummary wages(Double wages) { this.wages = wages; return this; } - /** + /** * The Wages for the Payslip - * * @return wages - */ + **/ @ApiModelProperty(example = "1060.5", value = "The Wages for the Payslip") - /** + /** * The Wages for the Payslip - * * @return wages Double - */ + **/ public Double getWages() { return wages; } - /** - * The Wages for the Payslip - * - * @param wages Double - */ + /** + * The Wages for the Payslip + * @param wages Double + **/ + public void setWages(Double wages) { this.wages = wages; } /** - * The Deductions for the Payslip - * - * @param deductions Double - * @return PayslipSummary - */ + * The Deductions for the Payslip + * @param deductions Double + * @return PayslipSummary + **/ public PayslipSummary deductions(Double deductions) { this.deductions = deductions; return this; } - /** + /** * The Deductions for the Payslip - * * @return deductions - */ + **/ @ApiModelProperty(example = "0.0", value = "The Deductions for the Payslip") - /** + /** * The Deductions for the Payslip - * * @return deductions Double - */ + **/ public Double getDeductions() { return deductions; } - /** - * The Deductions for the Payslip - * - * @param deductions Double - */ + /** + * The Deductions for the Payslip + * @param deductions Double + **/ + public void setDeductions(Double deductions) { this.deductions = deductions; } /** - * The Tax for the Payslip - * - * @param tax Double - * @return PayslipSummary - */ + * The Tax for the Payslip + * @param tax Double + * @return PayslipSummary + **/ public PayslipSummary tax(Double tax) { this.tax = tax; return this; } - /** + /** * The Tax for the Payslip - * * @return tax - */ + **/ @ApiModelProperty(example = "198.0", value = "The Tax for the Payslip") - /** + /** * The Tax for the Payslip - * * @return tax Double - */ + **/ public Double getTax() { return tax; } - /** - * The Tax for the Payslip - * - * @param tax Double - */ + /** + * The Tax for the Payslip + * @param tax Double + **/ + public void setTax(Double tax) { this.tax = tax; } /** - * The Super for the Payslip - * - * @param _super Double - * @return PayslipSummary - */ + * The Super for the Payslip + * @param _super Double + * @return PayslipSummary + **/ public PayslipSummary _super(Double _super) { this._super = _super; return this; } - /** + /** * The Super for the Payslip - * * @return _super - */ + **/ @ApiModelProperty(example = "75.6", value = "The Super for the Payslip") - /** + /** * The Super for the Payslip - * * @return _super Double - */ + **/ public Double getSuper() { return _super; } - /** - * The Super for the Payslip - * - * @param _super Double - */ + /** + * The Super for the Payslip + * @param _super Double + **/ + public void setSuper(Double _super) { this._super = _super; } /** - * The Reimbursements for the Payslip - * - * @param reimbursements Double - * @return PayslipSummary - */ + * The Reimbursements for the Payslip + * @param reimbursements Double + * @return PayslipSummary + **/ public PayslipSummary reimbursements(Double reimbursements) { this.reimbursements = reimbursements; return this; } - /** + /** * The Reimbursements for the Payslip - * * @return reimbursements - */ + **/ @ApiModelProperty(example = "0.0", value = "The Reimbursements for the Payslip") - /** + /** * The Reimbursements for the Payslip - * * @return reimbursements Double - */ + **/ public Double getReimbursements() { return reimbursements; } - /** - * The Reimbursements for the Payslip - * - * @param reimbursements Double - */ + /** + * The Reimbursements for the Payslip + * @param reimbursements Double + **/ + public void setReimbursements(Double reimbursements) { this.reimbursements = reimbursements; } /** - * The NetPay for the Payslip - * - * @param netPay Double - * @return PayslipSummary - */ + * The NetPay for the Payslip + * @param netPay Double + * @return PayslipSummary + **/ public PayslipSummary netPay(Double netPay) { this.netPay = netPay; return this; } - /** + /** * The NetPay for the Payslip - * * @return netPay - */ + **/ @ApiModelProperty(example = "862.5", value = "The NetPay for the Payslip") - /** + /** * The NetPay for the Payslip - * * @return netPay Double - */ + **/ public Double getNetPay() { return netPay; } - /** - * The NetPay for the Payslip - * - * @param netPay Double - */ + /** + * The NetPay for the Payslip + * @param netPay Double + **/ + public void setNetPay(Double netPay) { this.netPay = netPay; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -486,37 +462,26 @@ public boolean equals(java.lang.Object o) { return false; } PayslipSummary payslipSummary = (PayslipSummary) o; - return Objects.equals(this.employeeID, payslipSummary.employeeID) - && Objects.equals(this.payslipID, payslipSummary.payslipID) - && Objects.equals(this.firstName, payslipSummary.firstName) - && Objects.equals(this.lastName, payslipSummary.lastName) - && Objects.equals(this.employeeGroup, payslipSummary.employeeGroup) - && Objects.equals(this.wages, payslipSummary.wages) - && Objects.equals(this.deductions, payslipSummary.deductions) - && Objects.equals(this.tax, payslipSummary.tax) - && Objects.equals(this._super, payslipSummary._super) - && Objects.equals(this.reimbursements, payslipSummary.reimbursements) - && Objects.equals(this.netPay, payslipSummary.netPay) - && Objects.equals(this.updatedDateUTC, payslipSummary.updatedDateUTC); + return Objects.equals(this.employeeID, payslipSummary.employeeID) && + Objects.equals(this.payslipID, payslipSummary.payslipID) && + Objects.equals(this.firstName, payslipSummary.firstName) && + Objects.equals(this.lastName, payslipSummary.lastName) && + Objects.equals(this.employeeGroup, payslipSummary.employeeGroup) && + Objects.equals(this.wages, payslipSummary.wages) && + Objects.equals(this.deductions, payslipSummary.deductions) && + Objects.equals(this.tax, payslipSummary.tax) && + Objects.equals(this._super, payslipSummary._super) && + Objects.equals(this.reimbursements, payslipSummary.reimbursements) && + Objects.equals(this.netPay, payslipSummary.netPay) && + Objects.equals(this.updatedDateUTC, payslipSummary.updatedDateUTC); } @Override public int hashCode() { - return Objects.hash( - employeeID, - payslipID, - firstName, - lastName, - employeeGroup, - wages, - deductions, - tax, - _super, - reimbursements, - netPay, - updatedDateUTC); + return Objects.hash(employeeID, payslipID, firstName, lastName, employeeGroup, wages, deductions, tax, _super, reimbursements, netPay, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -538,7 +503,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -546,4 +512,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/Payslips.java b/src/main/java/com/xero/models/payrollau/Payslips.java index c5329bb57..97d13f7f0 100644 --- a/src/main/java/com/xero/models/payrollau/Payslips.java +++ b/src/main/java/com/xero/models/payrollau/Payslips.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.Payslip; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Payslips + */ -/** Payslips */ public class Payslips { StringUtil util = new StringUtil(); @JsonProperty("Payslips") private List payslips = new ArrayList(); /** - * payslips - * - * @param payslips List<Payslip> - * @return Payslips - */ + * payslips + * @param payslips List<Payslip> + * @return Payslips + **/ public Payslips payslips(List payslips) { this.payslips = payslips; return this; @@ -37,10 +54,9 @@ public Payslips payslips(List payslips) { /** * payslips - * - * @param payslipsItem Payslip + * @param payslipsItem Payslip * @return Payslips - */ + **/ public Payslips addPayslipsItem(Payslip payslipsItem) { if (this.payslips == null) { this.payslips = new ArrayList(); @@ -49,30 +65,29 @@ public Payslips addPayslipsItem(Payslip payslipsItem) { return this; } - /** + /** * Get payslips - * * @return payslips - */ + **/ @ApiModelProperty(value = "") - /** + /** * payslips - * * @return payslips List - */ + **/ public List getPayslips() { return payslips; } - /** - * payslips - * - * @param payslips List<Payslip> - */ + /** + * payslips + * @param payslips List<Payslip> + **/ + public void setPayslips(List payslips) { this.payslips = payslips; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(payslips); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/RateType.java b/src/main/java/com/xero/models/payrollau/RateType.java index 8abc1a645..87a4c6489 100644 --- a/src/main/java/com/xero/models/payrollau/RateType.java +++ b/src/main/java/com/xero/models/payrollau/RateType.java @@ -9,22 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets RateType */ +/** + * Gets or Sets RateType + */ public enum RateType { - - /** FIXEDAMOUNT */ + + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FIXEDAMOUNT"), - - /** MULTIPLE */ + + /** + * MULTIPLE + */ MULTIPLE("MULTIPLE"), - - /** RATEPERUNIT */ + + /** + * RATEPERUNIT + */ RATEPERUNIT("RATEPERUNIT"); private String value; @@ -33,26 +50,24 @@ public enum RateType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static RateType fromValue(String value) { @@ -64,3 +79,4 @@ public static RateType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/ReimbursementLine.java b/src/main/java/com/xero/models/payrollau/ReimbursementLine.java index b8d12c678..0714bc019 100644 --- a/src/main/java/com/xero/models/payrollau/ReimbursementLine.java +++ b/src/main/java/com/xero/models/payrollau/ReimbursementLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReimbursementLine + */ -/** ReimbursementLine */ public class ReimbursementLine { StringUtil util = new StringUtil(); @@ -33,157 +50,134 @@ public class ReimbursementLine { @JsonProperty("ExpenseAccount") private String expenseAccount; /** - * Xero reimbursement type identifier - * - * @param reimbursementTypeID UUID - * @return ReimbursementLine - */ + * Xero reimbursement type identifier + * @param reimbursementTypeID UUID + * @return ReimbursementLine + **/ public ReimbursementLine reimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; return this; } - /** + /** * Xero reimbursement type identifier - * * @return reimbursementTypeID - */ - @ApiModelProperty( - example = "bd246b96-c637-4767-81cf-851ba8fa93c2", - value = "Xero reimbursement type identifier") - /** + **/ + @ApiModelProperty(example = "bd246b96-c637-4767-81cf-851ba8fa93c2", value = "Xero reimbursement type identifier") + /** * Xero reimbursement type identifier - * * @return reimbursementTypeID UUID - */ + **/ public UUID getReimbursementTypeID() { return reimbursementTypeID; } - /** - * Xero reimbursement type identifier - * - * @param reimbursementTypeID UUID - */ + /** + * Xero reimbursement type identifier + * @param reimbursementTypeID UUID + **/ + public void setReimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; } /** - * Reimbursement type amount - * - * @param amount Double - * @return ReimbursementLine - */ + * Reimbursement type amount + * @param amount Double + * @return ReimbursementLine + **/ public ReimbursementLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Reimbursement type amount - * * @return amount - */ + **/ @ApiModelProperty(example = "10.0", value = "Reimbursement type amount") - /** + /** * Reimbursement type amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Reimbursement type amount - * - * @param amount Double - */ + /** + * Reimbursement type amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Reimbursement lines description (max length 50) - * - * @param description String - * @return ReimbursementLine - */ + * Reimbursement lines description (max length 50) + * @param description String + * @return ReimbursementLine + **/ public ReimbursementLine description(String description) { this.description = description; return this; } - /** + /** * Reimbursement lines description (max length 50) - * * @return description - */ - @ApiModelProperty( - example = "For the taxi", - value = "Reimbursement lines description (max length 50)") - /** + **/ + @ApiModelProperty(example = "For the taxi", value = "Reimbursement lines description (max length 50)") + /** * Reimbursement lines description (max length 50) - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Reimbursement lines description (max length 50) - * - * @param description String - */ + /** + * Reimbursement lines description (max length 50) + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Reimbursement expense account. For posted pay run you should be able to see expense account - * code. - * - * @param expenseAccount String - * @return ReimbursementLine - */ + * Reimbursement expense account. For posted pay run you should be able to see expense account code. + * @param expenseAccount String + * @return ReimbursementLine + **/ public ReimbursementLine expenseAccount(String expenseAccount) { this.expenseAccount = expenseAccount; return this; } - /** - * Reimbursement expense account. For posted pay run you should be able to see expense account - * code. - * + /** + * Reimbursement expense account. For posted pay run you should be able to see expense account code. * @return expenseAccount - */ - @ApiModelProperty( - example = "420", - value = - "Reimbursement expense account. For posted pay run you should be able to see expense" - + " account code.") - /** - * Reimbursement expense account. For posted pay run you should be able to see expense account - * code. - * + **/ + @ApiModelProperty(example = "420", value = "Reimbursement expense account. For posted pay run you should be able to see expense account code.") + /** + * Reimbursement expense account. For posted pay run you should be able to see expense account code. * @return expenseAccount String - */ + **/ public String getExpenseAccount() { return expenseAccount; } - /** - * Reimbursement expense account. For posted pay run you should be able to see expense account - * code. - * - * @param expenseAccount String - */ + /** + * Reimbursement expense account. For posted pay run you should be able to see expense account code. + * @param expenseAccount String + **/ + public void setExpenseAccount(String expenseAccount) { this.expenseAccount = expenseAccount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -193,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } ReimbursementLine reimbursementLine = (ReimbursementLine) o; - return Objects.equals(this.reimbursementTypeID, reimbursementLine.reimbursementTypeID) - && Objects.equals(this.amount, reimbursementLine.amount) - && Objects.equals(this.description, reimbursementLine.description) - && Objects.equals(this.expenseAccount, reimbursementLine.expenseAccount); + return Objects.equals(this.reimbursementTypeID, reimbursementLine.reimbursementTypeID) && + Objects.equals(this.amount, reimbursementLine.amount) && + Objects.equals(this.description, reimbursementLine.description) && + Objects.equals(this.expenseAccount, reimbursementLine.expenseAccount); } @Override @@ -204,13 +198,12 @@ public int hashCode() { return Objects.hash(reimbursementTypeID, amount, description, expenseAccount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReimbursementLine {\n"); - sb.append(" reimbursementTypeID: ") - .append(toIndentedString(reimbursementTypeID)) - .append("\n"); + sb.append(" reimbursementTypeID: ").append(toIndentedString(reimbursementTypeID)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" expenseAccount: ").append(toIndentedString(expenseAccount)).append("\n"); @@ -219,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -227,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/ReimbursementLines.java b/src/main/java/com/xero/models/payrollau/ReimbursementLines.java index d7c37310f..152f00aab 100644 --- a/src/main/java/com/xero/models/payrollau/ReimbursementLines.java +++ b/src/main/java/com/xero/models/payrollau/ReimbursementLines.java @@ -9,29 +9,45 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.ReimbursementLine; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -/** The reimbursement type lines */ +/** + * The reimbursement type lines + */ @ApiModel(description = "The reimbursement type lines") + public class ReimbursementLines { StringUtil util = new StringUtil(); @JsonProperty("ReimbursementLines") private List reimbursementLines = new ArrayList(); /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - * @return ReimbursementLines - */ + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + * @return ReimbursementLines + **/ public ReimbursementLines reimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; return this; @@ -39,10 +55,9 @@ public ReimbursementLines reimbursementLines(List reimburseme /** * reimbursementLines - * - * @param reimbursementLinesItem ReimbursementLine + * @param reimbursementLinesItem ReimbursementLine * @return ReimbursementLines - */ + **/ public ReimbursementLines addReimbursementLinesItem(ReimbursementLine reimbursementLinesItem) { if (this.reimbursementLines == null) { this.reimbursementLines = new ArrayList(); @@ -51,30 +66,29 @@ public ReimbursementLines addReimbursementLinesItem(ReimbursementLine reimbursem return this; } - /** + /** * Get reimbursementLines - * * @return reimbursementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementLines - * * @return reimbursementLines List - */ + **/ public List getReimbursementLines() { return reimbursementLines; } - /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - */ + /** + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + **/ + public void setReimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,6 +106,7 @@ public int hashCode() { return Objects.hash(reimbursementLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -102,7 +117,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -110,4 +126,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/ReimbursementType.java b/src/main/java/com/xero/models/payrollau/ReimbursementType.java index dbc373673..2667becbc 100644 --- a/src/main/java/com/xero/models/payrollau/ReimbursementType.java +++ b/src/main/java/com/xero/models/payrollau/ReimbursementType.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReimbursementType + */ -/** ReimbursementType */ public class ReimbursementType { StringUtil util = new StringUtil(); @@ -38,175 +53,161 @@ public class ReimbursementType { @JsonProperty("CurrentRecord") private Boolean currentRecord; /** - * Name of the earnings rate (max length = 100) - * - * @param name String - * @return ReimbursementType - */ + * Name of the earnings rate (max length = 100) + * @param name String + * @return ReimbursementType + **/ public ReimbursementType name(String name) { this.name = name; return this; } - /** + /** * Name of the earnings rate (max length = 100) - * * @return name - */ + **/ @ApiModelProperty(example = "PTO", value = "Name of the earnings rate (max length = 100)") - /** + /** * Name of the earnings rate (max length = 100) - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earnings rate (max length = 100) - * - * @param name String - */ + /** + * Name of the earnings rate (max length = 100) + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * See Accounts - * - * @param accountCode String - * @return ReimbursementType - */ + * See Accounts + * @param accountCode String + * @return ReimbursementType + **/ public ReimbursementType accountCode(String accountCode) { this.accountCode = accountCode; return this; } - /** + /** * See Accounts - * * @return accountCode - */ + **/ @ApiModelProperty(example = "720", value = "See Accounts") - /** + /** * See Accounts - * * @return accountCode String - */ + **/ public String getAccountCode() { return accountCode; } - /** - * See Accounts - * - * @param accountCode String - */ + /** + * See Accounts + * @param accountCode String + **/ + public void setAccountCode(String accountCode) { this.accountCode = accountCode; } /** - * Xero identifier - * - * @param reimbursementTypeID UUID - * @return ReimbursementType - */ + * Xero identifier + * @param reimbursementTypeID UUID + * @return ReimbursementType + **/ public ReimbursementType reimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; return this; } - /** + /** * Xero identifier - * * @return reimbursementTypeID - */ + **/ @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier") - /** + /** * Xero identifier - * * @return reimbursementTypeID UUID - */ + **/ public UUID getReimbursementTypeID() { return reimbursementTypeID; } - /** - * Xero identifier - * - * @param reimbursementTypeID UUID - */ + /** + * Xero identifier + * @param reimbursementTypeID UUID + **/ + public void setReimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Is the current record - * - * @param currentRecord Boolean - * @return ReimbursementType - */ + * Is the current record + * @param currentRecord Boolean + * @return ReimbursementType + **/ public ReimbursementType currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Is the current record - * * @return currentRecord - */ + **/ @ApiModelProperty(example = "true", value = "Is the current record") - /** + /** * Is the current record - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Is the current record - * - * @param currentRecord Boolean - */ + /** + * Is the current record + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -216,11 +217,11 @@ public boolean equals(java.lang.Object o) { return false; } ReimbursementType reimbursementType = (ReimbursementType) o; - return Objects.equals(this.name, reimbursementType.name) - && Objects.equals(this.accountCode, reimbursementType.accountCode) - && Objects.equals(this.reimbursementTypeID, reimbursementType.reimbursementTypeID) - && Objects.equals(this.updatedDateUTC, reimbursementType.updatedDateUTC) - && Objects.equals(this.currentRecord, reimbursementType.currentRecord); + return Objects.equals(this.name, reimbursementType.name) && + Objects.equals(this.accountCode, reimbursementType.accountCode) && + Objects.equals(this.reimbursementTypeID, reimbursementType.reimbursementTypeID) && + Objects.equals(this.updatedDateUTC, reimbursementType.updatedDateUTC) && + Objects.equals(this.currentRecord, reimbursementType.currentRecord); } @Override @@ -228,15 +229,14 @@ public int hashCode() { return Objects.hash(name, accountCode, reimbursementTypeID, updatedDateUTC, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReimbursementType {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" accountCode: ").append(toIndentedString(accountCode)).append("\n"); - sb.append(" reimbursementTypeID: ") - .append(toIndentedString(reimbursementTypeID)) - .append("\n"); + sb.append(" reimbursementTypeID: ").append(toIndentedString(reimbursementTypeID)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append("}"); @@ -244,7 +244,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -252,4 +253,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/ResidencyStatus.java b/src/main/java/com/xero/models/payrollau/ResidencyStatus.java index 12c988a8c..301cf6ec1 100644 --- a/src/main/java/com/xero/models/payrollau/ResidencyStatus.java +++ b/src/main/java/com/xero/models/payrollau/ResidencyStatus.java @@ -9,22 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets ResidencyStatus */ +/** + * Gets or Sets ResidencyStatus + */ public enum ResidencyStatus { - - /** AUSTRALIANRESIDENT */ + + /** + * AUSTRALIANRESIDENT + */ AUSTRALIANRESIDENT("AUSTRALIANRESIDENT"), - - /** FOREIGNRESIDENT */ + + /** + * FOREIGNRESIDENT + */ FOREIGNRESIDENT("FOREIGNRESIDENT"), - - /** WORKINGHOLIDAYMAKER */ + + /** + * WORKINGHOLIDAYMAKER + */ WORKINGHOLIDAYMAKER("WORKINGHOLIDAYMAKER"); private String value; @@ -33,26 +50,24 @@ public enum ResidencyStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static ResidencyStatus fromValue(String value) { @@ -64,3 +79,4 @@ public static ResidencyStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/SeniorMaritalStatus.java b/src/main/java/com/xero/models/payrollau/SeniorMaritalStatus.java index 217915069..976ff8c4e 100644 --- a/src/main/java/com/xero/models/payrollau/SeniorMaritalStatus.java +++ b/src/main/java/com/xero/models/payrollau/SeniorMaritalStatus.java @@ -9,22 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SeniorMaritalStatus */ +/** + * Gets or Sets SeniorMaritalStatus + */ public enum SeniorMaritalStatus { - - /** MEMBEROFCOUPLE */ + + /** + * MEMBEROFCOUPLE + */ MEMBEROFCOUPLE("MEMBEROFCOUPLE"), - - /** MEMBEROFILLNESSSEPARATEDCOUPLE */ + + /** + * MEMBEROFILLNESSSEPARATEDCOUPLE + */ MEMBEROFILLNESSSEPARATEDCOUPLE("MEMBEROFILLNESSSEPARATEDCOUPLE"), - - /** SINGLE */ + + /** + * SINGLE + */ SINGLE("SINGLE"); private String value; @@ -33,26 +50,24 @@ public enum SeniorMaritalStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static SeniorMaritalStatus fromValue(String value) { @@ -64,3 +79,4 @@ public static SeniorMaritalStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/Settings.java b/src/main/java/com/xero/models/payrollau/Settings.java index 09c4342ef..e8c913497 100644 --- a/src/main/java/com/xero/models/payrollau/Settings.java +++ b/src/main/java/com/xero/models/payrollau/Settings.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.Account; +import com.xero.models.payrollau.SettingsTrackingCategories; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Settings + */ -/** Settings */ public class Settings { StringUtil util = new StringUtil(); @@ -34,24 +53,20 @@ public class Settings { @JsonProperty("EmployeesAreSTP2") private Boolean employeesAreSTP2; /** - * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & - * WagesPayable. - * - * @param accounts List<Account> - * @return Settings - */ + * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. + * @param accounts List<Account> + * @return Settings + **/ public Settings accounts(List accounts) { this.accounts = accounts; return this; } /** - * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & - * WagesPayable. - * - * @param accountsItem Account + * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. + * @param accountsItem Account * @return Settings - */ + **/ public Settings addAccountsItem(Account accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -60,144 +75,125 @@ public Settings addAccountsItem(Account accountsItem) { return this; } - /** - * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & - * WagesPayable. - * + /** + * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. * @return accounts - */ - @ApiModelProperty( - value = - "Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability &" - + " WagesPayable.") - /** - * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & - * WagesPayable. - * + **/ + @ApiModelProperty(value = "Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable.") + /** + * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & - * WagesPayable. - * - * @param accounts List<Account> - */ + /** + * Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. + * @param accounts List<Account> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } /** - * trackingCategories - * - * @param trackingCategories SettingsTrackingCategories - * @return Settings - */ + * trackingCategories + * @param trackingCategories SettingsTrackingCategories + * @return Settings + **/ public Settings trackingCategories(SettingsTrackingCategories trackingCategories) { this.trackingCategories = trackingCategories; return this; } - /** + /** * Get trackingCategories - * * @return trackingCategories - */ + **/ @ApiModelProperty(value = "") - /** + /** * trackingCategories - * * @return trackingCategories SettingsTrackingCategories - */ + **/ public SettingsTrackingCategories getTrackingCategories() { return trackingCategories; } - /** - * trackingCategories - * - * @param trackingCategories SettingsTrackingCategories - */ + /** + * trackingCategories + * @param trackingCategories SettingsTrackingCategories + **/ + public void setTrackingCategories(SettingsTrackingCategories trackingCategories) { this.trackingCategories = trackingCategories; } /** - * Number of days in the Payroll year - * - * @param daysInPayrollYear Integer - * @return Settings - */ + * Number of days in the Payroll year + * @param daysInPayrollYear Integer + * @return Settings + **/ public Settings daysInPayrollYear(Integer daysInPayrollYear) { this.daysInPayrollYear = daysInPayrollYear; return this; } - /** + /** * Number of days in the Payroll year - * * @return daysInPayrollYear - */ + **/ @ApiModelProperty(example = "365", value = "Number of days in the Payroll year") - /** + /** * Number of days in the Payroll year - * * @return daysInPayrollYear Integer - */ + **/ public Integer getDaysInPayrollYear() { return daysInPayrollYear; } - /** - * Number of days in the Payroll year - * - * @param daysInPayrollYear Integer - */ + /** + * Number of days in the Payroll year + * @param daysInPayrollYear Integer + **/ + public void setDaysInPayrollYear(Integer daysInPayrollYear) { this.daysInPayrollYear = daysInPayrollYear; } /** - * Indicates if the organisation has been enabled for STP Phase 2 editing of employees. - * - * @param employeesAreSTP2 Boolean - * @return Settings - */ + * Indicates if the organisation has been enabled for STP Phase 2 editing of employees. + * @param employeesAreSTP2 Boolean + * @return Settings + **/ public Settings employeesAreSTP2(Boolean employeesAreSTP2) { this.employeesAreSTP2 = employeesAreSTP2; return this; } - /** + /** * Indicates if the organisation has been enabled for STP Phase 2 editing of employees. - * * @return employeesAreSTP2 - */ - @ApiModelProperty( - example = "true", - value = - "Indicates if the organisation has been enabled for STP Phase 2 editing of employees.") - /** + **/ + @ApiModelProperty(example = "true", value = "Indicates if the organisation has been enabled for STP Phase 2 editing of employees.") + /** * Indicates if the organisation has been enabled for STP Phase 2 editing of employees. - * * @return employeesAreSTP2 Boolean - */ + **/ public Boolean getEmployeesAreSTP2() { return employeesAreSTP2; } - /** - * Indicates if the organisation has been enabled for STP Phase 2 editing of employees. - * - * @param employeesAreSTP2 Boolean - */ + /** + * Indicates if the organisation has been enabled for STP Phase 2 editing of employees. + * @param employeesAreSTP2 Boolean + **/ + public void setEmployeesAreSTP2(Boolean employeesAreSTP2) { this.employeesAreSTP2 = employeesAreSTP2; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -207,10 +203,10 @@ public boolean equals(java.lang.Object o) { return false; } Settings settings = (Settings) o; - return Objects.equals(this.accounts, settings.accounts) - && Objects.equals(this.trackingCategories, settings.trackingCategories) - && Objects.equals(this.daysInPayrollYear, settings.daysInPayrollYear) - && Objects.equals(this.employeesAreSTP2, settings.employeesAreSTP2); + return Objects.equals(this.accounts, settings.accounts) && + Objects.equals(this.trackingCategories, settings.trackingCategories) && + Objects.equals(this.daysInPayrollYear, settings.daysInPayrollYear) && + Objects.equals(this.employeesAreSTP2, settings.employeesAreSTP2); } @Override @@ -218,6 +214,7 @@ public int hashCode() { return Objects.hash(accounts, trackingCategories, daysInPayrollYear, employeesAreSTP2); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -231,7 +228,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -239,4 +237,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SettingsObject.java b/src/main/java/com/xero/models/payrollau/SettingsObject.java index 714885e8e..262396339 100644 --- a/src/main/java/com/xero/models/payrollau/SettingsObject.java +++ b/src/main/java/com/xero/models/payrollau/SettingsObject.java @@ -9,54 +9,70 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.Settings; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SettingsObject + */ -/** SettingsObject */ public class SettingsObject { StringUtil util = new StringUtil(); @JsonProperty("Settings") private Settings settings; /** - * settings - * - * @param settings Settings - * @return SettingsObject - */ + * settings + * @param settings Settings + * @return SettingsObject + **/ public SettingsObject settings(Settings settings) { this.settings = settings; return this; } - /** + /** * Get settings - * * @return settings - */ + **/ @ApiModelProperty(value = "") - /** + /** * settings - * * @return settings Settings - */ + **/ public Settings getSettings() { return settings; } - /** - * settings - * - * @param settings Settings - */ + /** + * settings + * @param settings Settings + **/ + public void setSettings(Settings settings) { this.settings = settings; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +90,7 @@ public int hashCode() { return Objects.hash(settings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +101,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +110,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SettingsTrackingCategories.java b/src/main/java/com/xero/models/payrollau/SettingsTrackingCategories.java index ca7b612f5..ca6e83f81 100644 --- a/src/main/java/com/xero/models/payrollau/SettingsTrackingCategories.java +++ b/src/main/java/com/xero/models/payrollau/SettingsTrackingCategories.java @@ -9,16 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.SettingsTrackingCategoriesEmployeeGroups; +import com.xero.models.payrollau.SettingsTrackingCategoriesTimesheetCategories; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; -/** Tracking categories for Employees and Timesheets */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Tracking categories for Employees and Timesheets + */ @ApiModel(description = "Tracking categories for Employees and Timesheets") + public class SettingsTrackingCategories { StringUtil util = new StringUtil(); @@ -28,78 +46,70 @@ public class SettingsTrackingCategories { @JsonProperty("TimesheetCategories") private SettingsTrackingCategoriesTimesheetCategories timesheetCategories; /** - * employeeGroups - * - * @param employeeGroups SettingsTrackingCategoriesEmployeeGroups - * @return SettingsTrackingCategories - */ - public SettingsTrackingCategories employeeGroups( - SettingsTrackingCategoriesEmployeeGroups employeeGroups) { + * employeeGroups + * @param employeeGroups SettingsTrackingCategoriesEmployeeGroups + * @return SettingsTrackingCategories + **/ + public SettingsTrackingCategories employeeGroups(SettingsTrackingCategoriesEmployeeGroups employeeGroups) { this.employeeGroups = employeeGroups; return this; } - /** + /** * Get employeeGroups - * * @return employeeGroups - */ + **/ @ApiModelProperty(value = "") - /** + /** * employeeGroups - * * @return employeeGroups SettingsTrackingCategoriesEmployeeGroups - */ + **/ public SettingsTrackingCategoriesEmployeeGroups getEmployeeGroups() { return employeeGroups; } - /** - * employeeGroups - * - * @param employeeGroups SettingsTrackingCategoriesEmployeeGroups - */ + /** + * employeeGroups + * @param employeeGroups SettingsTrackingCategoriesEmployeeGroups + **/ + public void setEmployeeGroups(SettingsTrackingCategoriesEmployeeGroups employeeGroups) { this.employeeGroups = employeeGroups; } /** - * timesheetCategories - * - * @param timesheetCategories SettingsTrackingCategoriesTimesheetCategories - * @return SettingsTrackingCategories - */ - public SettingsTrackingCategories timesheetCategories( - SettingsTrackingCategoriesTimesheetCategories timesheetCategories) { + * timesheetCategories + * @param timesheetCategories SettingsTrackingCategoriesTimesheetCategories + * @return SettingsTrackingCategories + **/ + public SettingsTrackingCategories timesheetCategories(SettingsTrackingCategoriesTimesheetCategories timesheetCategories) { this.timesheetCategories = timesheetCategories; return this; } - /** + /** * Get timesheetCategories - * * @return timesheetCategories - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetCategories - * * @return timesheetCategories SettingsTrackingCategoriesTimesheetCategories - */ + **/ public SettingsTrackingCategoriesTimesheetCategories getTimesheetCategories() { return timesheetCategories; } - /** - * timesheetCategories - * - * @param timesheetCategories SettingsTrackingCategoriesTimesheetCategories - */ - public void setTimesheetCategories( - SettingsTrackingCategoriesTimesheetCategories timesheetCategories) { + /** + * timesheetCategories + * @param timesheetCategories SettingsTrackingCategoriesTimesheetCategories + **/ + + public void setTimesheetCategories(SettingsTrackingCategoriesTimesheetCategories timesheetCategories) { this.timesheetCategories = timesheetCategories; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -109,8 +119,8 @@ public boolean equals(java.lang.Object o) { return false; } SettingsTrackingCategories settingsTrackingCategories = (SettingsTrackingCategories) o; - return Objects.equals(this.employeeGroups, settingsTrackingCategories.employeeGroups) - && Objects.equals(this.timesheetCategories, settingsTrackingCategories.timesheetCategories); + return Objects.equals(this.employeeGroups, settingsTrackingCategories.employeeGroups) && + Objects.equals(this.timesheetCategories, settingsTrackingCategories.timesheetCategories); } @Override @@ -118,20 +128,20 @@ public int hashCode() { return Objects.hash(employeeGroups, timesheetCategories); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SettingsTrackingCategories {\n"); sb.append(" employeeGroups: ").append(toIndentedString(employeeGroups)).append("\n"); - sb.append(" timesheetCategories: ") - .append(toIndentedString(timesheetCategories)) - .append("\n"); + sb.append(" timesheetCategories: ").append(toIndentedString(timesheetCategories)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -139,4 +149,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesEmployeeGroups.java b/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesEmployeeGroups.java index 1e8b1ebb3..6d3031c90 100644 --- a/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesEmployeeGroups.java +++ b/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesEmployeeGroups.java @@ -9,17 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; -/** The tracking category used for employees */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The tracking category used for employees + */ @ApiModel(description = "The tracking category used for employees") + public class SettingsTrackingCategoriesEmployeeGroups { StringUtil util = new StringUtil(); @@ -29,78 +45,70 @@ public class SettingsTrackingCategoriesEmployeeGroups { @JsonProperty("TrackingCategoryName") private String trackingCategoryName; /** - * The identifier for the tracking category - * - * @param trackingCategoryID UUID - * @return SettingsTrackingCategoriesEmployeeGroups - */ + * The identifier for the tracking category + * @param trackingCategoryID UUID + * @return SettingsTrackingCategoriesEmployeeGroups + **/ public SettingsTrackingCategoriesEmployeeGroups trackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; return this; } - /** + /** * The identifier for the tracking category - * * @return trackingCategoryID - */ - @ApiModelProperty( - example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", - value = "The identifier for the tracking category") - /** + **/ + @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "The identifier for the tracking category") + /** * The identifier for the tracking category - * * @return trackingCategoryID UUID - */ + **/ public UUID getTrackingCategoryID() { return trackingCategoryID; } - /** - * The identifier for the tracking category - * - * @param trackingCategoryID UUID - */ + /** + * The identifier for the tracking category + * @param trackingCategoryID UUID + **/ + public void setTrackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; } /** - * Name of the tracking category - * - * @param trackingCategoryName String - * @return SettingsTrackingCategoriesEmployeeGroups - */ - public SettingsTrackingCategoriesEmployeeGroups trackingCategoryName( - String trackingCategoryName) { + * Name of the tracking category + * @param trackingCategoryName String + * @return SettingsTrackingCategoriesEmployeeGroups + **/ + public SettingsTrackingCategoriesEmployeeGroups trackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; return this; } - /** + /** * Name of the tracking category - * * @return trackingCategoryName - */ + **/ @ApiModelProperty(value = "Name of the tracking category") - /** + /** * Name of the tracking category - * * @return trackingCategoryName String - */ + **/ public String getTrackingCategoryName() { return trackingCategoryName; } - /** - * Name of the tracking category - * - * @param trackingCategoryName String - */ + /** + * Name of the tracking category + * @param trackingCategoryName String + **/ + public void setTrackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -109,13 +117,9 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SettingsTrackingCategoriesEmployeeGroups settingsTrackingCategoriesEmployeeGroups = - (SettingsTrackingCategoriesEmployeeGroups) o; - return Objects.equals( - this.trackingCategoryID, settingsTrackingCategoriesEmployeeGroups.trackingCategoryID) - && Objects.equals( - this.trackingCategoryName, - settingsTrackingCategoriesEmployeeGroups.trackingCategoryName); + SettingsTrackingCategoriesEmployeeGroups settingsTrackingCategoriesEmployeeGroups = (SettingsTrackingCategoriesEmployeeGroups) o; + return Objects.equals(this.trackingCategoryID, settingsTrackingCategoriesEmployeeGroups.trackingCategoryID) && + Objects.equals(this.trackingCategoryName, settingsTrackingCategoriesEmployeeGroups.trackingCategoryName); } @Override @@ -123,20 +127,20 @@ public int hashCode() { return Objects.hash(trackingCategoryID, trackingCategoryName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SettingsTrackingCategoriesEmployeeGroups {\n"); sb.append(" trackingCategoryID: ").append(toIndentedString(trackingCategoryID)).append("\n"); - sb.append(" trackingCategoryName: ") - .append(toIndentedString(trackingCategoryName)) - .append("\n"); + sb.append(" trackingCategoryName: ").append(toIndentedString(trackingCategoryName)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -144,4 +148,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesTimesheetCategories.java b/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesTimesheetCategories.java index 911ab8800..54b547b5c 100644 --- a/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesTimesheetCategories.java +++ b/src/main/java/com/xero/models/payrollau/SettingsTrackingCategoriesTimesheetCategories.java @@ -9,17 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; -/** The tracking category used for timesheets */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The tracking category used for timesheets + */ @ApiModel(description = "The tracking category used for timesheets") + public class SettingsTrackingCategoriesTimesheetCategories { StringUtil util = new StringUtil(); @@ -29,78 +45,70 @@ public class SettingsTrackingCategoriesTimesheetCategories { @JsonProperty("TrackingCategoryName") private String trackingCategoryName; /** - * The identifier for the tracking category - * - * @param trackingCategoryID UUID - * @return SettingsTrackingCategoriesTimesheetCategories - */ + * The identifier for the tracking category + * @param trackingCategoryID UUID + * @return SettingsTrackingCategoriesTimesheetCategories + **/ public SettingsTrackingCategoriesTimesheetCategories trackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; return this; } - /** + /** * The identifier for the tracking category - * * @return trackingCategoryID - */ - @ApiModelProperty( - example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", - value = "The identifier for the tracking category") - /** + **/ + @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "The identifier for the tracking category") + /** * The identifier for the tracking category - * * @return trackingCategoryID UUID - */ + **/ public UUID getTrackingCategoryID() { return trackingCategoryID; } - /** - * The identifier for the tracking category - * - * @param trackingCategoryID UUID - */ + /** + * The identifier for the tracking category + * @param trackingCategoryID UUID + **/ + public void setTrackingCategoryID(UUID trackingCategoryID) { this.trackingCategoryID = trackingCategoryID; } /** - * Name of the tracking category - * - * @param trackingCategoryName String - * @return SettingsTrackingCategoriesTimesheetCategories - */ - public SettingsTrackingCategoriesTimesheetCategories trackingCategoryName( - String trackingCategoryName) { + * Name of the tracking category + * @param trackingCategoryName String + * @return SettingsTrackingCategoriesTimesheetCategories + **/ + public SettingsTrackingCategoriesTimesheetCategories trackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; return this; } - /** + /** * Name of the tracking category - * * @return trackingCategoryName - */ + **/ @ApiModelProperty(value = "Name of the tracking category") - /** + /** * Name of the tracking category - * * @return trackingCategoryName String - */ + **/ public String getTrackingCategoryName() { return trackingCategoryName; } - /** - * Name of the tracking category - * - * @param trackingCategoryName String - */ + /** + * Name of the tracking category + * @param trackingCategoryName String + **/ + public void setTrackingCategoryName(String trackingCategoryName) { this.trackingCategoryName = trackingCategoryName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -109,14 +117,9 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SettingsTrackingCategoriesTimesheetCategories settingsTrackingCategoriesTimesheetCategories = - (SettingsTrackingCategoriesTimesheetCategories) o; - return Objects.equals( - this.trackingCategoryID, - settingsTrackingCategoriesTimesheetCategories.trackingCategoryID) - && Objects.equals( - this.trackingCategoryName, - settingsTrackingCategoriesTimesheetCategories.trackingCategoryName); + SettingsTrackingCategoriesTimesheetCategories settingsTrackingCategoriesTimesheetCategories = (SettingsTrackingCategoriesTimesheetCategories) o; + return Objects.equals(this.trackingCategoryID, settingsTrackingCategoriesTimesheetCategories.trackingCategoryID) && + Objects.equals(this.trackingCategoryName, settingsTrackingCategoriesTimesheetCategories.trackingCategoryName); } @Override @@ -124,20 +127,20 @@ public int hashCode() { return Objects.hash(trackingCategoryID, trackingCategoryName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SettingsTrackingCategoriesTimesheetCategories {\n"); sb.append(" trackingCategoryID: ").append(toIndentedString(trackingCategoryID)).append("\n"); - sb.append(" trackingCategoryName: ") - .append(toIndentedString(trackingCategoryName)) - .append("\n"); + sb.append(" trackingCategoryName: ").append(toIndentedString(trackingCategoryName)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -145,4 +148,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/State.java b/src/main/java/com/xero/models/payrollau/State.java index 279bb3a76..3851cc011 100644 --- a/src/main/java/com/xero/models/payrollau/State.java +++ b/src/main/java/com/xero/models/payrollau/State.java @@ -9,37 +9,65 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; - +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** State abbreviation for employee home address */ +/** + * State abbreviation for employee home address + */ public enum State { - - /** ACT */ + + /** + * ACT + */ ACT("ACT"), - - /** NSW */ + + /** + * NSW + */ NSW("NSW"), - - /** NT */ + + /** + * NT + */ NT("NT"), - - /** QLD */ + + /** + * QLD + */ QLD("QLD"), - - /** SA */ + + /** + * SA + */ SA("SA"), - - /** TAS */ + + /** + * TAS + */ TAS("TAS"), - - /** VIC */ + + /** + * VIC + */ VIC("VIC"), - - /** WA */ + + /** + * WA + */ WA("WA"); private String value; @@ -48,26 +76,24 @@ public enum State { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static State fromValue(String value) { @@ -79,3 +105,4 @@ public static State fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/SuperFund.java b/src/main/java/com/xero/models/payrollau/SuperFund.java index 73a1e3865..4a479fdde 100644 --- a/src/main/java/com/xero/models/payrollau/SuperFund.java +++ b/src/main/java/com/xero/models/payrollau/SuperFund.java @@ -9,19 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.SuperFundType; +import com.xero.models.payrollau.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperFund + */ -/** SuperFund */ public class SuperFund { StringUtil util = new StringUtil(); @@ -64,453 +81,389 @@ public class SuperFund { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * Xero identifier for a super fund - * - * @param superFundID UUID - * @return SuperFund - */ + * Xero identifier for a super fund + * @param superFundID UUID + * @return SuperFund + **/ public SuperFund superFundID(UUID superFundID) { this.superFundID = superFundID; return this; } - /** + /** * Xero identifier for a super fund - * * @return superFundID - */ - @ApiModelProperty( - example = "bfac31bd-ea62-4fc8-a5e7-7965d9504b15", - value = "Xero identifier for a super fund") - /** + **/ + @ApiModelProperty(example = "bfac31bd-ea62-4fc8-a5e7-7965d9504b15", value = "Xero identifier for a super fund") + /** * Xero identifier for a super fund - * * @return superFundID UUID - */ + **/ public UUID getSuperFundID() { return superFundID; } - /** - * Xero identifier for a super fund - * - * @param superFundID UUID - */ + /** + * Xero identifier for a super fund + * @param superFundID UUID + **/ + public void setSuperFundID(UUID superFundID) { this.superFundID = superFundID; } /** - * type - * - * @param type SuperFundType - * @return SuperFund - */ + * type + * @param type SuperFundType + * @return SuperFund + **/ public SuperFund type(SuperFundType type) { this.type = type; return this; } - /** + /** * Get type - * * @return type - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * type - * * @return type SuperFundType - */ + **/ public SuperFundType getType() { return type; } - /** - * type - * - * @param type SuperFundType - */ + /** + * type + * @param type SuperFundType + **/ + public void setType(SuperFundType type) { this.type = type; } /** - * Name of the super fund - * - * @param name String - * @return SuperFund - */ + * Name of the super fund + * @param name String + * @return SuperFund + **/ public SuperFund name(String name) { this.name = name; return this; } - /** + /** * Name of the super fund - * * @return name - */ - @ApiModelProperty( - example = - "MLC Navigator Retirement Plan - Superannuation Service (including Series 2) (MLC" - + " Superannuation Fund)", - value = "Name of the super fund") - /** + **/ + @ApiModelProperty(example = "MLC Navigator Retirement Plan - Superannuation Service (including Series 2) (MLC Superannuation Fund)", value = "Name of the super fund") + /** * Name of the super fund - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the super fund - * - * @param name String - */ + /** + * Name of the super fund + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * ABN of the self managed super fund - * - * @param ABN String - * @return SuperFund - */ + * ABN of the self managed super fund + * @param ABN String + * @return SuperFund + **/ public SuperFund ABN(String ABN) { this.ABN = ABN; return this; } - /** + /** * ABN of the self managed super fund - * * @return ABN - */ + **/ @ApiModelProperty(example = "40022701955", value = "ABN of the self managed super fund") - /** + /** * ABN of the self managed super fund - * * @return ABN String - */ + **/ public String getABN() { return ABN; } - /** - * ABN of the self managed super fund - * - * @param ABN String - */ + /** + * ABN of the self managed super fund + * @param ABN String + **/ + public void setABN(String ABN) { this.ABN = ABN; } /** - * BSB of the self managed super fund - * - * @param BSB String - * @return SuperFund - */ + * BSB of the self managed super fund + * @param BSB String + * @return SuperFund + **/ public SuperFund BSB(String BSB) { this.BSB = BSB; return this; } - /** + /** * BSB of the self managed super fund - * * @return BSB - */ + **/ @ApiModelProperty(example = "234324", value = "BSB of the self managed super fund") - /** + /** * BSB of the self managed super fund - * * @return BSB String - */ + **/ public String getBSB() { return BSB; } - /** - * BSB of the self managed super fund - * - * @param BSB String - */ + /** + * BSB of the self managed super fund + * @param BSB String + **/ + public void setBSB(String BSB) { this.BSB = BSB; } /** - * The account number for the self managed super fund. - * - * @param accountNumber String - * @return SuperFund - */ + * The account number for the self managed super fund. + * @param accountNumber String + * @return SuperFund + **/ public SuperFund accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** + /** * The account number for the self managed super fund. - * * @return accountNumber - */ - @ApiModelProperty( - example = "234234234", - value = "The account number for the self managed super fund.") - /** + **/ + @ApiModelProperty(example = "234234234", value = "The account number for the self managed super fund.") + /** * The account number for the self managed super fund. - * * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * The account number for the self managed super fund. - * - * @param accountNumber String - */ + /** + * The account number for the self managed super fund. + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * The account name for the self managed super fund. - * - * @param accountName String - * @return SuperFund - */ + * The account name for the self managed super fund. + * @param accountName String + * @return SuperFund + **/ public SuperFund accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * The account name for the self managed super fund. - * * @return accountName - */ - @ApiModelProperty( - example = "Money account", - value = "The account name for the self managed super fund.") - /** + **/ + @ApiModelProperty(example = "Money account", value = "The account name for the self managed super fund.") + /** * The account name for the self managed super fund. - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * The account name for the self managed super fund. - * - * @param accountName String - */ + /** + * The account name for the self managed super fund. + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * The electronic service address for the self managed super fund. - * - * @param electronicServiceAddress String - * @return SuperFund - */ + * The electronic service address for the self managed super fund. + * @param electronicServiceAddress String + * @return SuperFund + **/ public SuperFund electronicServiceAddress(String electronicServiceAddress) { this.electronicServiceAddress = electronicServiceAddress; return this; } - /** + /** * The electronic service address for the self managed super fund. - * * @return electronicServiceAddress - */ - @ApiModelProperty( - example = "12345678", - value = "The electronic service address for the self managed super fund.") - /** + **/ + @ApiModelProperty(example = "12345678", value = "The electronic service address for the self managed super fund.") + /** * The electronic service address for the self managed super fund. - * * @return electronicServiceAddress String - */ + **/ public String getElectronicServiceAddress() { return electronicServiceAddress; } - /** - * The electronic service address for the self managed super fund. - * - * @param electronicServiceAddress String - */ + /** + * The electronic service address for the self managed super fund. + * @param electronicServiceAddress String + **/ + public void setElectronicServiceAddress(String electronicServiceAddress) { this.electronicServiceAddress = electronicServiceAddress; } /** - * Some funds assign a unique number to each employer - * - * @param employerNumber String - * @return SuperFund - */ + * Some funds assign a unique number to each employer + * @param employerNumber String + * @return SuperFund + **/ public SuperFund employerNumber(String employerNumber) { this.employerNumber = employerNumber; return this; } - /** + /** * Some funds assign a unique number to each employer - * * @return employerNumber - */ - @ApiModelProperty( - example = "324324", - value = "Some funds assign a unique number to each employer") - /** + **/ + @ApiModelProperty(example = "324324", value = "Some funds assign a unique number to each employer") + /** * Some funds assign a unique number to each employer - * * @return employerNumber String - */ + **/ public String getEmployerNumber() { return employerNumber; } - /** - * Some funds assign a unique number to each employer - * - * @param employerNumber String - */ + /** + * Some funds assign a unique number to each employer + * @param employerNumber String + **/ + public void setEmployerNumber(String employerNumber) { this.employerNumber = employerNumber; } /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present - * for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used - * instead of SPIN. - * - * @param SPIN String - * @return SuperFund - */ + * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. + * @param SPIN String + * @return SuperFund + **/ public SuperFund SPIN(String SPIN) { this.SPIN = SPIN; return this; } - /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present - * for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used - * instead of SPIN. - * + /** + * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. * @return SPIN - */ - @ApiModelProperty( - example = "4545445454", - value = - "The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be" - + " present for legacy superfunds. New superfunds will not have a SPIN value. The" - + " USI field should be used instead of SPIN.") - /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present - * for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used - * instead of SPIN. - * + **/ + @ApiModelProperty(example = "4545445454", value = "The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN.") + /** + * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. * @return SPIN String - */ + **/ public String getSPIN() { return SPIN; } - /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present - * for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used - * instead of SPIN. - * - * @param SPIN String - */ + /** + * The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. + * @param SPIN String + **/ + public void setSPIN(String SPIN) { this.SPIN = SPIN; } /** - * The USI of the Regulated SuperFund - * - * @param USI String - * @return SuperFund - */ + * The USI of the Regulated SuperFund + * @param USI String + * @return SuperFund + **/ public SuperFund USI(String USI) { this.USI = USI; return this; } - /** + /** * The USI of the Regulated SuperFund - * * @return USI - */ + **/ @ApiModelProperty(example = "40022701955001", value = "The USI of the Regulated SuperFund") - /** + /** * The USI of the Regulated SuperFund - * * @return USI String - */ + **/ public String getUSI() { return USI; } - /** - * The USI of the Regulated SuperFund - * - * @param USI String - */ + /** + * The USI of the Regulated SuperFund + * @param USI String + **/ + public void setUSI(String USI) { this.USI = USI; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return SuperFund - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return SuperFund + **/ public SuperFund validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -518,10 +471,9 @@ public SuperFund validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return SuperFund - */ + **/ public SuperFund addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -530,30 +482,29 @@ public SuperFund addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -563,39 +514,27 @@ public boolean equals(java.lang.Object o) { return false; } SuperFund superFund = (SuperFund) o; - return Objects.equals(this.superFundID, superFund.superFundID) - && Objects.equals(this.type, superFund.type) - && Objects.equals(this.name, superFund.name) - && Objects.equals(this.ABN, superFund.ABN) - && Objects.equals(this.BSB, superFund.BSB) - && Objects.equals(this.accountNumber, superFund.accountNumber) - && Objects.equals(this.accountName, superFund.accountName) - && Objects.equals(this.electronicServiceAddress, superFund.electronicServiceAddress) - && Objects.equals(this.employerNumber, superFund.employerNumber) - && Objects.equals(this.SPIN, superFund.SPIN) - && Objects.equals(this.USI, superFund.USI) - && Objects.equals(this.updatedDateUTC, superFund.updatedDateUTC) - && Objects.equals(this.validationErrors, superFund.validationErrors); + return Objects.equals(this.superFundID, superFund.superFundID) && + Objects.equals(this.type, superFund.type) && + Objects.equals(this.name, superFund.name) && + Objects.equals(this.ABN, superFund.ABN) && + Objects.equals(this.BSB, superFund.BSB) && + Objects.equals(this.accountNumber, superFund.accountNumber) && + Objects.equals(this.accountName, superFund.accountName) && + Objects.equals(this.electronicServiceAddress, superFund.electronicServiceAddress) && + Objects.equals(this.employerNumber, superFund.employerNumber) && + Objects.equals(this.SPIN, superFund.SPIN) && + Objects.equals(this.USI, superFund.USI) && + Objects.equals(this.updatedDateUTC, superFund.updatedDateUTC) && + Objects.equals(this.validationErrors, superFund.validationErrors); } @Override public int hashCode() { - return Objects.hash( - superFundID, - type, - name, - ABN, - BSB, - accountNumber, - accountName, - electronicServiceAddress, - employerNumber, - SPIN, - USI, - updatedDateUTC, - validationErrors); + return Objects.hash(superFundID, type, name, ABN, BSB, accountNumber, accountName, electronicServiceAddress, employerNumber, SPIN, USI, updatedDateUTC, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -607,9 +546,7 @@ public String toString() { sb.append(" BSB: ").append(toIndentedString(BSB)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); - sb.append(" electronicServiceAddress: ") - .append(toIndentedString(electronicServiceAddress)) - .append("\n"); + sb.append(" electronicServiceAddress: ").append(toIndentedString(electronicServiceAddress)).append("\n"); sb.append(" employerNumber: ").append(toIndentedString(employerNumber)).append("\n"); sb.append(" SPIN: ").append(toIndentedString(SPIN)).append("\n"); sb.append(" USI: ").append(toIndentedString(USI)).append("\n"); @@ -620,7 +557,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -628,4 +566,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SuperFundProduct.java b/src/main/java/com/xero/models/payrollau/SuperFundProduct.java index 28555731c..9dc68833c 100644 --- a/src/main/java/com/xero/models/payrollau/SuperFundProduct.java +++ b/src/main/java/com/xero/models/payrollau/SuperFundProduct.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperFundProduct + */ -/** SuperFundProduct */ public class SuperFundProduct { StringUtil util = new StringUtil(); @@ -32,157 +49,134 @@ public class SuperFundProduct { @JsonProperty("ProductName") private String productName; /** - * The ABN of the Regulated SuperFund - * - * @param ABN String - * @return SuperFundProduct - */ + * The ABN of the Regulated SuperFund + * @param ABN String + * @return SuperFundProduct + **/ public SuperFundProduct ABN(String ABN) { this.ABN = ABN; return this; } - /** + /** * The ABN of the Regulated SuperFund - * * @return ABN - */ + **/ @ApiModelProperty(example = "839182848805", value = "The ABN of the Regulated SuperFund") - /** + /** * The ABN of the Regulated SuperFund - * * @return ABN String - */ + **/ public String getABN() { return ABN; } - /** - * The ABN of the Regulated SuperFund - * - * @param ABN String - */ + /** + * The ABN of the Regulated SuperFund + * @param ABN String + **/ + public void setABN(String ABN) { this.ABN = ABN; } /** - * The USI of the Regulated SuperFund - * - * @param USI String - * @return SuperFundProduct - */ + * The USI of the Regulated SuperFund + * @param USI String + * @return SuperFundProduct + **/ public SuperFundProduct USI(String USI) { this.USI = USI; return this; } - /** + /** * The USI of the Regulated SuperFund - * * @return USI - */ + **/ @ApiModelProperty(example = "839182848805001", value = "The USI of the Regulated SuperFund") - /** + /** * The USI of the Regulated SuperFund - * * @return USI String - */ + **/ public String getUSI() { return USI; } - /** - * The USI of the Regulated SuperFund - * - * @param USI String - */ + /** + * The USI of the Regulated SuperFund + * @param USI String + **/ + public void setUSI(String USI) { this.USI = USI; } /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not - * have a SPIN value. The USI field should be used instead of SPIN - * - * @param SPIN String - * @return SuperFundProduct - */ + * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN + * @param SPIN String + * @return SuperFundProduct + **/ public SuperFundProduct SPIN(String SPIN) { this.SPIN = SPIN; return this; } - /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not - * have a SPIN value. The USI field should be used instead of SPIN - * + /** + * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN * @return SPIN - */ - @ApiModelProperty( - example = "NML0117AU", - value = - "The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds" - + " will not have a SPIN value. The USI field should be used instead of SPIN") - /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not - * have a SPIN value. The USI field should be used instead of SPIN - * + **/ + @ApiModelProperty(example = "NML0117AU", value = "The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN") + /** + * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN * @return SPIN String - */ + **/ public String getSPIN() { return SPIN; } - /** - * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not - * have a SPIN value. The USI field should be used instead of SPIN - * - * @param SPIN String - */ + /** + * The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN + * @param SPIN String + **/ + public void setSPIN(String SPIN) { this.SPIN = SPIN; } /** - * The name of the Regulated SuperFund - * - * @param productName String - * @return SuperFundProduct - */ + * The name of the Regulated SuperFund + * @param productName String + * @return SuperFundProduct + **/ public SuperFundProduct productName(String productName) { this.productName = productName; return this; } - /** + /** * The name of the Regulated SuperFund - * * @return productName - */ - @ApiModelProperty( - example = - "MLC Navigator Retirement Plan - Superannuation Service (including Series 2) (MLC" - + " Superannuation Fund)", - value = "The name of the Regulated SuperFund") - /** + **/ + @ApiModelProperty(example = "MLC Navigator Retirement Plan - Superannuation Service (including Series 2) (MLC Superannuation Fund)", value = "The name of the Regulated SuperFund") + /** * The name of the Regulated SuperFund - * * @return productName String - */ + **/ public String getProductName() { return productName; } - /** - * The name of the Regulated SuperFund - * - * @param productName String - */ + /** + * The name of the Regulated SuperFund + * @param productName String + **/ + public void setProductName(String productName) { this.productName = productName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } SuperFundProduct superFundProduct = (SuperFundProduct) o; - return Objects.equals(this.ABN, superFundProduct.ABN) - && Objects.equals(this.USI, superFundProduct.USI) - && Objects.equals(this.SPIN, superFundProduct.SPIN) - && Objects.equals(this.productName, superFundProduct.productName); + return Objects.equals(this.ABN, superFundProduct.ABN) && + Objects.equals(this.USI, superFundProduct.USI) && + Objects.equals(this.SPIN, superFundProduct.SPIN) && + Objects.equals(this.productName, superFundProduct.productName); } @Override @@ -203,6 +197,7 @@ public int hashCode() { return Objects.hash(ABN, USI, SPIN, productName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -216,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -224,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SuperFundProducts.java b/src/main/java/com/xero/models/payrollau/SuperFundProducts.java index 6f0ee4191..38796a812 100644 --- a/src/main/java/com/xero/models/payrollau/SuperFundProducts.java +++ b/src/main/java/com/xero/models/payrollau/SuperFundProducts.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.SuperFundProduct; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperFundProducts + */ -/** SuperFundProducts */ public class SuperFundProducts { StringUtil util = new StringUtil(); @JsonProperty("SuperFundProducts") private List superFundProducts = new ArrayList(); /** - * superFundProducts - * - * @param superFundProducts List<SuperFundProduct> - * @return SuperFundProducts - */ + * superFundProducts + * @param superFundProducts List<SuperFundProduct> + * @return SuperFundProducts + **/ public SuperFundProducts superFundProducts(List superFundProducts) { this.superFundProducts = superFundProducts; return this; @@ -37,10 +54,9 @@ public SuperFundProducts superFundProducts(List superFundProdu /** * superFundProducts - * - * @param superFundProductsItem SuperFundProduct + * @param superFundProductsItem SuperFundProduct * @return SuperFundProducts - */ + **/ public SuperFundProducts addSuperFundProductsItem(SuperFundProduct superFundProductsItem) { if (this.superFundProducts == null) { this.superFundProducts = new ArrayList(); @@ -49,30 +65,29 @@ public SuperFundProducts addSuperFundProductsItem(SuperFundProduct superFundProd return this; } - /** + /** * Get superFundProducts - * * @return superFundProducts - */ + **/ @ApiModelProperty(value = "") - /** + /** * superFundProducts - * * @return superFundProducts List - */ + **/ public List getSuperFundProducts() { return superFundProducts; } - /** - * superFundProducts - * - * @param superFundProducts List<SuperFundProduct> - */ + /** + * superFundProducts + * @param superFundProducts List<SuperFundProduct> + **/ + public void setSuperFundProducts(List superFundProducts) { this.superFundProducts = superFundProducts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(superFundProducts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SuperFundType.java b/src/main/java/com/xero/models/payrollau/SuperFundType.java index 29ce8884c..f86802b33 100644 --- a/src/main/java/com/xero/models/payrollau/SuperFundType.java +++ b/src/main/java/com/xero/models/payrollau/SuperFundType.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SuperFundType */ +/** + * Gets or Sets SuperFundType + */ public enum SuperFundType { - - /** REGULATED */ + + /** + * REGULATED + */ REGULATED("REGULATED"), - - /** SMSF */ + + /** + * SMSF + */ SMSF("SMSF"); private String value; @@ -30,26 +45,24 @@ public enum SuperFundType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static SuperFundType fromValue(String value) { @@ -61,3 +74,4 @@ public static SuperFundType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/SuperFunds.java b/src/main/java/com/xero/models/payrollau/SuperFunds.java index f7ef6a4c5..03b8393f1 100644 --- a/src/main/java/com/xero/models/payrollau/SuperFunds.java +++ b/src/main/java/com/xero/models/payrollau/SuperFunds.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.SuperFund; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperFunds + */ -/** SuperFunds */ public class SuperFunds { StringUtil util = new StringUtil(); @JsonProperty("SuperFunds") private List superFunds = new ArrayList(); /** - * superFunds - * - * @param superFunds List<SuperFund> - * @return SuperFunds - */ + * superFunds + * @param superFunds List<SuperFund> + * @return SuperFunds + **/ public SuperFunds superFunds(List superFunds) { this.superFunds = superFunds; return this; @@ -37,10 +54,9 @@ public SuperFunds superFunds(List superFunds) { /** * superFunds - * - * @param superFundsItem SuperFund + * @param superFundsItem SuperFund * @return SuperFunds - */ + **/ public SuperFunds addSuperFundsItem(SuperFund superFundsItem) { if (this.superFunds == null) { this.superFunds = new ArrayList(); @@ -49,30 +65,29 @@ public SuperFunds addSuperFundsItem(SuperFund superFundsItem) { return this; } - /** + /** * Get superFunds - * * @return superFunds - */ + **/ @ApiModelProperty(value = "") - /** + /** * superFunds - * * @return superFunds List - */ + **/ public List getSuperFunds() { return superFunds; } - /** - * superFunds - * - * @param superFunds List<SuperFund> - */ + /** + * superFunds + * @param superFunds List<SuperFund> + **/ + public void setSuperFunds(List superFunds) { this.superFunds = superFunds; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(superFunds); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SuperLine.java b/src/main/java/com/xero/models/payrollau/SuperLine.java index 2196e08ce..64b02a99c 100644 --- a/src/main/java/com/xero/models/payrollau/SuperLine.java +++ b/src/main/java/com/xero/models/payrollau/SuperLine.java @@ -9,15 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.SuperannuationCalculationType; +import com.xero.models.payrollau.SuperannuationContributionType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperLine + */ -/** SuperLine */ public class SuperLine { StringUtil util = new StringUtil(); @@ -45,287 +64,262 @@ public class SuperLine { @JsonProperty("Amount") private Double amount; /** - * Xero super membership ID - * - * @param superMembershipID UUID - * @return SuperLine - */ + * Xero super membership ID + * @param superMembershipID UUID + * @return SuperLine + **/ public SuperLine superMembershipID(UUID superMembershipID) { this.superMembershipID = superMembershipID; return this; } - /** + /** * Xero super membership ID - * * @return superMembershipID - */ - @ApiModelProperty( - example = "4333d5cd-53a5-4c31-98e5-a8b4e5676b0b", - value = "Xero super membership ID") - /** + **/ + @ApiModelProperty(example = "4333d5cd-53a5-4c31-98e5-a8b4e5676b0b", value = "Xero super membership ID") + /** * Xero super membership ID - * * @return superMembershipID UUID - */ + **/ public UUID getSuperMembershipID() { return superMembershipID; } - /** - * Xero super membership ID - * - * @param superMembershipID UUID - */ + /** + * Xero super membership ID + * @param superMembershipID UUID + **/ + public void setSuperMembershipID(UUID superMembershipID) { this.superMembershipID = superMembershipID; } /** - * contributionType - * - * @param contributionType SuperannuationContributionType - * @return SuperLine - */ + * contributionType + * @param contributionType SuperannuationContributionType + * @return SuperLine + **/ public SuperLine contributionType(SuperannuationContributionType contributionType) { this.contributionType = contributionType; return this; } - /** + /** * Get contributionType - * * @return contributionType - */ + **/ @ApiModelProperty(value = "") - /** + /** * contributionType - * * @return contributionType SuperannuationContributionType - */ + **/ public SuperannuationContributionType getContributionType() { return contributionType; } - /** - * contributionType - * - * @param contributionType SuperannuationContributionType - */ + /** + * contributionType + * @param contributionType SuperannuationContributionType + **/ + public void setContributionType(SuperannuationContributionType contributionType) { this.contributionType = contributionType; } /** - * calculationType - * - * @param calculationType SuperannuationCalculationType - * @return SuperLine - */ + * calculationType + * @param calculationType SuperannuationCalculationType + * @return SuperLine + **/ public SuperLine calculationType(SuperannuationCalculationType calculationType) { this.calculationType = calculationType; return this; } - /** + /** * Get calculationType - * * @return calculationType - */ + **/ @ApiModelProperty(value = "") - /** + /** * calculationType - * * @return calculationType SuperannuationCalculationType - */ + **/ public SuperannuationCalculationType getCalculationType() { return calculationType; } - /** - * calculationType - * - * @param calculationType SuperannuationCalculationType - */ + /** + * calculationType + * @param calculationType SuperannuationCalculationType + **/ + public void setCalculationType(SuperannuationCalculationType calculationType) { this.calculationType = calculationType; } /** - * amount of minimum earnings - * - * @param minimumMonthlyEarnings Double - * @return SuperLine - */ + * amount of minimum earnings + * @param minimumMonthlyEarnings Double + * @return SuperLine + **/ public SuperLine minimumMonthlyEarnings(Double minimumMonthlyEarnings) { this.minimumMonthlyEarnings = minimumMonthlyEarnings; return this; } - /** + /** * amount of minimum earnings - * * @return minimumMonthlyEarnings - */ + **/ @ApiModelProperty(example = "450.0", value = "amount of minimum earnings") - /** + /** * amount of minimum earnings - * * @return minimumMonthlyEarnings Double - */ + **/ public Double getMinimumMonthlyEarnings() { return minimumMonthlyEarnings; } - /** - * amount of minimum earnings - * - * @param minimumMonthlyEarnings Double - */ + /** + * amount of minimum earnings + * @param minimumMonthlyEarnings Double + **/ + public void setMinimumMonthlyEarnings(Double minimumMonthlyEarnings) { this.minimumMonthlyEarnings = minimumMonthlyEarnings; } /** - * expense account code - * - * @param expenseAccountCode String - * @return SuperLine - */ + * expense account code + * @param expenseAccountCode String + * @return SuperLine + **/ public SuperLine expenseAccountCode(String expenseAccountCode) { this.expenseAccountCode = expenseAccountCode; return this; } - /** + /** * expense account code - * * @return expenseAccountCode - */ + **/ @ApiModelProperty(example = "478", value = "expense account code") - /** + /** * expense account code - * * @return expenseAccountCode String - */ + **/ public String getExpenseAccountCode() { return expenseAccountCode; } - /** - * expense account code - * - * @param expenseAccountCode String - */ + /** + * expense account code + * @param expenseAccountCode String + **/ + public void setExpenseAccountCode(String expenseAccountCode) { this.expenseAccountCode = expenseAccountCode; } /** - * liabilty account code - * - * @param liabilityAccountCode String - * @return SuperLine - */ + * liabilty account code + * @param liabilityAccountCode String + * @return SuperLine + **/ public SuperLine liabilityAccountCode(String liabilityAccountCode) { this.liabilityAccountCode = liabilityAccountCode; return this; } - /** + /** * liabilty account code - * * @return liabilityAccountCode - */ + **/ @ApiModelProperty(example = "826", value = "liabilty account code") - /** + /** * liabilty account code - * * @return liabilityAccountCode String - */ + **/ public String getLiabilityAccountCode() { return liabilityAccountCode; } - /** - * liabilty account code - * - * @param liabilityAccountCode String - */ + /** + * liabilty account code + * @param liabilityAccountCode String + **/ + public void setLiabilityAccountCode(String liabilityAccountCode) { this.liabilityAccountCode = liabilityAccountCode; } /** - * percentage for super line - * - * @param percentage Double - * @return SuperLine - */ + * percentage for super line + * @param percentage Double + * @return SuperLine + **/ public SuperLine percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * percentage for super line - * * @return percentage - */ + **/ @ApiModelProperty(example = "9.0", value = "percentage for super line") - /** + /** * percentage for super line - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * percentage for super line - * - * @param percentage Double - */ + /** + * percentage for super line + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } /** - * Super membership amount - * - * @param amount Double - * @return SuperLine - */ + * Super membership amount + * @param amount Double + * @return SuperLine + **/ public SuperLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Super membership amount - * * @return amount - */ + **/ @ApiModelProperty(example = "10.0", value = "Super membership amount") - /** + /** * Super membership amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Super membership amount - * - * @param amount Double - */ + /** + * Super membership amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -335,29 +329,22 @@ public boolean equals(java.lang.Object o) { return false; } SuperLine superLine = (SuperLine) o; - return Objects.equals(this.superMembershipID, superLine.superMembershipID) - && Objects.equals(this.contributionType, superLine.contributionType) - && Objects.equals(this.calculationType, superLine.calculationType) - && Objects.equals(this.minimumMonthlyEarnings, superLine.minimumMonthlyEarnings) - && Objects.equals(this.expenseAccountCode, superLine.expenseAccountCode) - && Objects.equals(this.liabilityAccountCode, superLine.liabilityAccountCode) - && Objects.equals(this.percentage, superLine.percentage) - && Objects.equals(this.amount, superLine.amount); + return Objects.equals(this.superMembershipID, superLine.superMembershipID) && + Objects.equals(this.contributionType, superLine.contributionType) && + Objects.equals(this.calculationType, superLine.calculationType) && + Objects.equals(this.minimumMonthlyEarnings, superLine.minimumMonthlyEarnings) && + Objects.equals(this.expenseAccountCode, superLine.expenseAccountCode) && + Objects.equals(this.liabilityAccountCode, superLine.liabilityAccountCode) && + Objects.equals(this.percentage, superLine.percentage) && + Objects.equals(this.amount, superLine.amount); } @Override public int hashCode() { - return Objects.hash( - superMembershipID, - contributionType, - calculationType, - minimumMonthlyEarnings, - expenseAccountCode, - liabilityAccountCode, - percentage, - amount); + return Objects.hash(superMembershipID, contributionType, calculationType, minimumMonthlyEarnings, expenseAccountCode, liabilityAccountCode, percentage, amount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -365,13 +352,9 @@ public String toString() { sb.append(" superMembershipID: ").append(toIndentedString(superMembershipID)).append("\n"); sb.append(" contributionType: ").append(toIndentedString(contributionType)).append("\n"); sb.append(" calculationType: ").append(toIndentedString(calculationType)).append("\n"); - sb.append(" minimumMonthlyEarnings: ") - .append(toIndentedString(minimumMonthlyEarnings)) - .append("\n"); + sb.append(" minimumMonthlyEarnings: ").append(toIndentedString(minimumMonthlyEarnings)).append("\n"); sb.append(" expenseAccountCode: ").append(toIndentedString(expenseAccountCode)).append("\n"); - sb.append(" liabilityAccountCode: ") - .append(toIndentedString(liabilityAccountCode)) - .append("\n"); + sb.append(" liabilityAccountCode: ").append(toIndentedString(liabilityAccountCode)).append("\n"); sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append("}"); @@ -379,7 +362,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -387,4 +371,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SuperMembership.java b/src/main/java/com/xero/models/payrollau/SuperMembership.java index d73ca6abf..2a605144d 100644 --- a/src/main/java/com/xero/models/payrollau/SuperMembership.java +++ b/src/main/java/com/xero/models/payrollau/SuperMembership.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperMembership + */ -/** SuperMembership */ public class SuperMembership { StringUtil util = new StringUtil(); @@ -30,118 +47,102 @@ public class SuperMembership { @JsonProperty("EmployeeNumber") private String employeeNumber; /** - * Xero unique identifier for Super membership - * - * @param superMembershipID UUID - * @return SuperMembership - */ + * Xero unique identifier for Super membership + * @param superMembershipID UUID + * @return SuperMembership + **/ public SuperMembership superMembershipID(UUID superMembershipID) { this.superMembershipID = superMembershipID; return this; } - /** + /** * Xero unique identifier for Super membership - * * @return superMembershipID - */ - @ApiModelProperty( - example = "4333d5cd-53a5-4c31-98e5-a8b4e5676b0b", - value = "Xero unique identifier for Super membership") - /** + **/ + @ApiModelProperty(example = "4333d5cd-53a5-4c31-98e5-a8b4e5676b0b", value = "Xero unique identifier for Super membership") + /** * Xero unique identifier for Super membership - * * @return superMembershipID UUID - */ + **/ public UUID getSuperMembershipID() { return superMembershipID; } - /** - * Xero unique identifier for Super membership - * - * @param superMembershipID UUID - */ + /** + * Xero unique identifier for Super membership + * @param superMembershipID UUID + **/ + public void setSuperMembershipID(UUID superMembershipID) { this.superMembershipID = superMembershipID; } /** - * Xero identifier for super fund - * - * @param superFundID UUID - * @return SuperMembership - */ + * Xero identifier for super fund + * @param superFundID UUID + * @return SuperMembership + **/ public SuperMembership superFundID(UUID superFundID) { this.superFundID = superFundID; return this; } - /** + /** * Xero identifier for super fund - * * @return superFundID - */ - @ApiModelProperty( - example = "2187a42b-639a-45cb-9eed-cd4ae488306a", - required = true, - value = "Xero identifier for super fund") - /** + **/ + @ApiModelProperty(example = "2187a42b-639a-45cb-9eed-cd4ae488306a", required = true, value = "Xero identifier for super fund") + /** * Xero identifier for super fund - * * @return superFundID UUID - */ + **/ public UUID getSuperFundID() { return superFundID; } - /** - * Xero identifier for super fund - * - * @param superFundID UUID - */ + /** + * Xero identifier for super fund + * @param superFundID UUID + **/ + public void setSuperFundID(UUID superFundID) { this.superFundID = superFundID; } /** - * The membership number assigned to the employee by the super fund. - * - * @param employeeNumber String - * @return SuperMembership - */ + * The membership number assigned to the employee by the super fund. + * @param employeeNumber String + * @return SuperMembership + **/ public SuperMembership employeeNumber(String employeeNumber) { this.employeeNumber = employeeNumber; return this; } - /** + /** * The membership number assigned to the employee by the super fund. - * * @return employeeNumber - */ - @ApiModelProperty( - example = "1234", - required = true, - value = "The membership number assigned to the employee by the super fund.") - /** + **/ + @ApiModelProperty(example = "1234", required = true, value = "The membership number assigned to the employee by the super fund.") + /** * The membership number assigned to the employee by the super fund. - * * @return employeeNumber String - */ + **/ public String getEmployeeNumber() { return employeeNumber; } - /** - * The membership number assigned to the employee by the super fund. - * - * @param employeeNumber String - */ + /** + * The membership number assigned to the employee by the super fund. + * @param employeeNumber String + **/ + public void setEmployeeNumber(String employeeNumber) { this.employeeNumber = employeeNumber; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -151,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } SuperMembership superMembership = (SuperMembership) o; - return Objects.equals(this.superMembershipID, superMembership.superMembershipID) - && Objects.equals(this.superFundID, superMembership.superFundID) - && Objects.equals(this.employeeNumber, superMembership.employeeNumber); + return Objects.equals(this.superMembershipID, superMembership.superMembershipID) && + Objects.equals(this.superFundID, superMembership.superFundID) && + Objects.equals(this.employeeNumber, superMembership.employeeNumber); } @Override @@ -161,6 +162,7 @@ public int hashCode() { return Objects.hash(superMembershipID, superFundID, employeeNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -173,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -181,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/SuperannuationCalculationType.java b/src/main/java/com/xero/models/payrollau/SuperannuationCalculationType.java index 0cdb52696..c291b388d 100644 --- a/src/main/java/com/xero/models/payrollau/SuperannuationCalculationType.java +++ b/src/main/java/com/xero/models/payrollau/SuperannuationCalculationType.java @@ -9,22 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SuperannuationCalculationType */ +/** + * Gets or Sets SuperannuationCalculationType + */ public enum SuperannuationCalculationType { - - /** FIXEDAMOUNT */ + + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FIXEDAMOUNT"), - - /** PERCENTAGEOFEARNINGS */ + + /** + * PERCENTAGEOFEARNINGS + */ PERCENTAGEOFEARNINGS("PERCENTAGEOFEARNINGS"), - - /** STATUTORY */ + + /** + * STATUTORY + */ STATUTORY("STATUTORY"); private String value; @@ -33,26 +50,24 @@ public enum SuperannuationCalculationType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static SuperannuationCalculationType fromValue(String value) { @@ -64,3 +79,4 @@ public static SuperannuationCalculationType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/SuperannuationContributionType.java b/src/main/java/com/xero/models/payrollau/SuperannuationContributionType.java index 0d67a7e9e..531911511 100644 --- a/src/main/java/com/xero/models/payrollau/SuperannuationContributionType.java +++ b/src/main/java/com/xero/models/payrollau/SuperannuationContributionType.java @@ -9,25 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SuperannuationContributionType */ +/** + * Gets or Sets SuperannuationContributionType + */ public enum SuperannuationContributionType { - - /** SGC */ + + /** + * SGC + */ SGC("SGC"), - - /** SALARYSACRIFICE */ + + /** + * SALARYSACRIFICE + */ SALARYSACRIFICE("SALARYSACRIFICE"), - - /** EMPLOYERADDITIONAL */ + + /** + * EMPLOYERADDITIONAL + */ EMPLOYERADDITIONAL("EMPLOYERADDITIONAL"), - - /** EMPLOYEE */ + + /** + * EMPLOYEE + */ EMPLOYEE("EMPLOYEE"); private String value; @@ -36,26 +55,24 @@ public enum SuperannuationContributionType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static SuperannuationContributionType fromValue(String value) { @@ -67,3 +84,4 @@ public static SuperannuationContributionType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/SuperannuationLine.java b/src/main/java/com/xero/models/payrollau/SuperannuationLine.java index 4d7944e0c..3152cf2dc 100644 --- a/src/main/java/com/xero/models/payrollau/SuperannuationLine.java +++ b/src/main/java/com/xero/models/payrollau/SuperannuationLine.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.SuperannuationCalculationType; +import com.xero.models.payrollau.SuperannuationContributionType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; import org.threeten.bp.Instant; import org.threeten.bp.LocalDate; -import org.threeten.bp.ZoneId; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperannuationLine + */ -/** SuperannuationLine */ public class SuperannuationLine { StringUtil util = new StringUtil(); @@ -52,353 +67,320 @@ public class SuperannuationLine { @JsonProperty("Amount") private Double amount; /** - * Xero identifier for payroll super fund membership ID. - * - * @param superMembershipID UUID - * @return SuperannuationLine - */ + * Xero identifier for payroll super fund membership ID. + * @param superMembershipID UUID + * @return SuperannuationLine + **/ public SuperannuationLine superMembershipID(UUID superMembershipID) { this.superMembershipID = superMembershipID; return this; } - /** + /** * Xero identifier for payroll super fund membership ID. - * * @return superMembershipID - */ - @ApiModelProperty( - example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", - value = "Xero identifier for payroll super fund membership ID.") - /** + **/ + @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier for payroll super fund membership ID.") + /** * Xero identifier for payroll super fund membership ID. - * * @return superMembershipID UUID - */ + **/ public UUID getSuperMembershipID() { return superMembershipID; } - /** - * Xero identifier for payroll super fund membership ID. - * - * @param superMembershipID UUID - */ + /** + * Xero identifier for payroll super fund membership ID. + * @param superMembershipID UUID + **/ + public void setSuperMembershipID(UUID superMembershipID) { this.superMembershipID = superMembershipID; } /** - * contributionType - * - * @param contributionType SuperannuationContributionType - * @return SuperannuationLine - */ + * contributionType + * @param contributionType SuperannuationContributionType + * @return SuperannuationLine + **/ public SuperannuationLine contributionType(SuperannuationContributionType contributionType) { this.contributionType = contributionType; return this; } - /** + /** * Get contributionType - * * @return contributionType - */ + **/ @ApiModelProperty(value = "") - /** + /** * contributionType - * * @return contributionType SuperannuationContributionType - */ + **/ public SuperannuationContributionType getContributionType() { return contributionType; } - /** - * contributionType - * - * @param contributionType SuperannuationContributionType - */ + /** + * contributionType + * @param contributionType SuperannuationContributionType + **/ + public void setContributionType(SuperannuationContributionType contributionType) { this.contributionType = contributionType; } /** - * calculationType - * - * @param calculationType SuperannuationCalculationType - * @return SuperannuationLine - */ + * calculationType + * @param calculationType SuperannuationCalculationType + * @return SuperannuationLine + **/ public SuperannuationLine calculationType(SuperannuationCalculationType calculationType) { this.calculationType = calculationType; return this; } - /** + /** * Get calculationType - * * @return calculationType - */ + **/ @ApiModelProperty(value = "") - /** + /** * calculationType - * * @return calculationType SuperannuationCalculationType - */ + **/ public SuperannuationCalculationType getCalculationType() { return calculationType; } - /** - * calculationType - * - * @param calculationType SuperannuationCalculationType - */ + /** + * calculationType + * @param calculationType SuperannuationCalculationType + **/ + public void setCalculationType(SuperannuationCalculationType calculationType) { this.calculationType = calculationType; } /** - * Superannuation minimum monthly earnings. - * - * @param minimumMonthlyEarnings Double - * @return SuperannuationLine - */ + * Superannuation minimum monthly earnings. + * @param minimumMonthlyEarnings Double + * @return SuperannuationLine + **/ public SuperannuationLine minimumMonthlyEarnings(Double minimumMonthlyEarnings) { this.minimumMonthlyEarnings = minimumMonthlyEarnings; return this; } - /** + /** * Superannuation minimum monthly earnings. - * * @return minimumMonthlyEarnings - */ + **/ @ApiModelProperty(example = "100.5", value = "Superannuation minimum monthly earnings.") - /** + /** * Superannuation minimum monthly earnings. - * * @return minimumMonthlyEarnings Double - */ + **/ public Double getMinimumMonthlyEarnings() { return minimumMonthlyEarnings; } - /** - * Superannuation minimum monthly earnings. - * - * @param minimumMonthlyEarnings Double - */ + /** + * Superannuation minimum monthly earnings. + * @param minimumMonthlyEarnings Double + **/ + public void setMinimumMonthlyEarnings(Double minimumMonthlyEarnings) { this.minimumMonthlyEarnings = minimumMonthlyEarnings; } /** - * Superannuation expense account code. - * - * @param expenseAccountCode String - * @return SuperannuationLine - */ + * Superannuation expense account code. + * @param expenseAccountCode String + * @return SuperannuationLine + **/ public SuperannuationLine expenseAccountCode(String expenseAccountCode) { this.expenseAccountCode = expenseAccountCode; return this; } - /** + /** * Superannuation expense account code. - * * @return expenseAccountCode - */ + **/ @ApiModelProperty(example = "450", value = "Superannuation expense account code.") - /** + /** * Superannuation expense account code. - * * @return expenseAccountCode String - */ + **/ public String getExpenseAccountCode() { return expenseAccountCode; } - /** - * Superannuation expense account code. - * - * @param expenseAccountCode String - */ + /** + * Superannuation expense account code. + * @param expenseAccountCode String + **/ + public void setExpenseAccountCode(String expenseAccountCode) { this.expenseAccountCode = expenseAccountCode; } /** - * Superannuation liability account code - * - * @param liabilityAccountCode String - * @return SuperannuationLine - */ + * Superannuation liability account code + * @param liabilityAccountCode String + * @return SuperannuationLine + **/ public SuperannuationLine liabilityAccountCode(String liabilityAccountCode) { this.liabilityAccountCode = liabilityAccountCode; return this; } - /** + /** * Superannuation liability account code - * * @return liabilityAccountCode - */ + **/ @ApiModelProperty(example = "650", value = "Superannuation liability account code") - /** + /** * Superannuation liability account code - * * @return liabilityAccountCode String - */ + **/ public String getLiabilityAccountCode() { return liabilityAccountCode; } - /** - * Superannuation liability account code - * - * @param liabilityAccountCode String - */ + /** + * Superannuation liability account code + * @param liabilityAccountCode String + **/ + public void setLiabilityAccountCode(String liabilityAccountCode) { this.liabilityAccountCode = liabilityAccountCode; } /** - * Superannuation payment date for the current period (YYYY-MM-DD) - * - * @param paymentDateForThisPeriod String - * @return SuperannuationLine - */ + * Superannuation payment date for the current period (YYYY-MM-DD) + * @param paymentDateForThisPeriod String + * @return SuperannuationLine + **/ public SuperannuationLine paymentDateForThisPeriod(String paymentDateForThisPeriod) { this.paymentDateForThisPeriod = paymentDateForThisPeriod; return this; } - /** + /** * Superannuation payment date for the current period (YYYY-MM-DD) - * * @return paymentDateForThisPeriod - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - value = "Superannuation payment date for the current period (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", value = "Superannuation payment date for the current period (YYYY-MM-DD)") + /** * Superannuation payment date for the current period (YYYY-MM-DD) - * * @return paymentDateForThisPeriod String - */ + **/ public String getPaymentDateForThisPeriod() { return paymentDateForThisPeriod; } - /** + /** * Superannuation payment date for the current period (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getPaymentDateForThisPeriodAsDate() { if (this.paymentDateForThisPeriod != null) { try { return util.convertStringToDate(this.paymentDateForThisPeriod); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Superannuation payment date for the current period (YYYY-MM-DD) - * - * @param paymentDateForThisPeriod String - */ + /** + * Superannuation payment date for the current period (YYYY-MM-DD) + * @param paymentDateForThisPeriod String + **/ + public void setPaymentDateForThisPeriod(String paymentDateForThisPeriod) { this.paymentDateForThisPeriod = paymentDateForThisPeriod; } - /** - * Superannuation payment date for the current period (YYYY-MM-DD) - * - * @param paymentDateForThisPeriod LocalDateTime - */ + /** + * Superannuation payment date for the current period (YYYY-MM-DD) + * @param paymentDateForThisPeriod LocalDateTime + **/ public void setPaymentDateForThisPeriod(LocalDate paymentDateForThisPeriod) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = - paymentDateForThisPeriod.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = paymentDateForThisPeriod.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.paymentDateForThisPeriod = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Superannuation percentage - * - * @param percentage Double - * @return SuperannuationLine - */ + * Superannuation percentage + * @param percentage Double + * @return SuperannuationLine + **/ public SuperannuationLine percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Superannuation percentage - * * @return percentage - */ + **/ @ApiModelProperty(example = "4.0", value = "Superannuation percentage") - /** + /** * Superannuation percentage - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Superannuation percentage - * - * @param percentage Double - */ + /** + * Superannuation percentage + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } /** - * Superannuation amount - * - * @param amount Double - * @return SuperannuationLine - */ + * Superannuation amount + * @param amount Double + * @return SuperannuationLine + **/ public SuperannuationLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Superannuation amount - * * @return amount - */ + **/ @ApiModelProperty(example = "10.5", value = "Superannuation amount") - /** + /** * Superannuation amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Superannuation amount - * - * @param amount Double - */ + /** + * Superannuation amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -408,32 +390,23 @@ public boolean equals(java.lang.Object o) { return false; } SuperannuationLine superannuationLine = (SuperannuationLine) o; - return Objects.equals(this.superMembershipID, superannuationLine.superMembershipID) - && Objects.equals(this.contributionType, superannuationLine.contributionType) - && Objects.equals(this.calculationType, superannuationLine.calculationType) - && Objects.equals(this.minimumMonthlyEarnings, superannuationLine.minimumMonthlyEarnings) - && Objects.equals(this.expenseAccountCode, superannuationLine.expenseAccountCode) - && Objects.equals(this.liabilityAccountCode, superannuationLine.liabilityAccountCode) - && Objects.equals( - this.paymentDateForThisPeriod, superannuationLine.paymentDateForThisPeriod) - && Objects.equals(this.percentage, superannuationLine.percentage) - && Objects.equals(this.amount, superannuationLine.amount); + return Objects.equals(this.superMembershipID, superannuationLine.superMembershipID) && + Objects.equals(this.contributionType, superannuationLine.contributionType) && + Objects.equals(this.calculationType, superannuationLine.calculationType) && + Objects.equals(this.minimumMonthlyEarnings, superannuationLine.minimumMonthlyEarnings) && + Objects.equals(this.expenseAccountCode, superannuationLine.expenseAccountCode) && + Objects.equals(this.liabilityAccountCode, superannuationLine.liabilityAccountCode) && + Objects.equals(this.paymentDateForThisPeriod, superannuationLine.paymentDateForThisPeriod) && + Objects.equals(this.percentage, superannuationLine.percentage) && + Objects.equals(this.amount, superannuationLine.amount); } @Override public int hashCode() { - return Objects.hash( - superMembershipID, - contributionType, - calculationType, - minimumMonthlyEarnings, - expenseAccountCode, - liabilityAccountCode, - paymentDateForThisPeriod, - percentage, - amount); + return Objects.hash(superMembershipID, contributionType, calculationType, minimumMonthlyEarnings, expenseAccountCode, liabilityAccountCode, paymentDateForThisPeriod, percentage, amount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -441,16 +414,10 @@ public String toString() { sb.append(" superMembershipID: ").append(toIndentedString(superMembershipID)).append("\n"); sb.append(" contributionType: ").append(toIndentedString(contributionType)).append("\n"); sb.append(" calculationType: ").append(toIndentedString(calculationType)).append("\n"); - sb.append(" minimumMonthlyEarnings: ") - .append(toIndentedString(minimumMonthlyEarnings)) - .append("\n"); + sb.append(" minimumMonthlyEarnings: ").append(toIndentedString(minimumMonthlyEarnings)).append("\n"); sb.append(" expenseAccountCode: ").append(toIndentedString(expenseAccountCode)).append("\n"); - sb.append(" liabilityAccountCode: ") - .append(toIndentedString(liabilityAccountCode)) - .append("\n"); - sb.append(" paymentDateForThisPeriod: ") - .append(toIndentedString(paymentDateForThisPeriod)) - .append("\n"); + sb.append(" liabilityAccountCode: ").append(toIndentedString(liabilityAccountCode)).append("\n"); + sb.append(" paymentDateForThisPeriod: ").append(toIndentedString(paymentDateForThisPeriod)).append("\n"); sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append("}"); @@ -458,7 +425,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -466,4 +434,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/TFNExemptionType.java b/src/main/java/com/xero/models/payrollau/TFNExemptionType.java index 6da9d2472..a3b1cde45 100644 --- a/src/main/java/com/xero/models/payrollau/TFNExemptionType.java +++ b/src/main/java/com/xero/models/payrollau/TFNExemptionType.java @@ -9,25 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets TFNExemptionType */ +/** + * Gets or Sets TFNExemptionType + */ public enum TFNExemptionType { - - /** NOTQUOTED */ + + /** + * NOTQUOTED + */ NOTQUOTED("NOTQUOTED"), - - /** PENDING */ + + /** + * PENDING + */ PENDING("PENDING"), - - /** PENSIONER */ + + /** + * PENSIONER + */ PENSIONER("PENSIONER"), - - /** UNDER18 */ + + /** + * UNDER18 + */ UNDER18("UNDER18"); private String value; @@ -36,26 +55,24 @@ public enum TFNExemptionType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static TFNExemptionType fromValue(String value) { @@ -67,3 +84,4 @@ public static TFNExemptionType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/TaxDeclaration.java b/src/main/java/com/xero/models/payrollau/TaxDeclaration.java index 28f729008..d23b96fa8 100644 --- a/src/main/java/com/xero/models/payrollau/TaxDeclaration.java +++ b/src/main/java/com/xero/models/payrollau/TaxDeclaration.java @@ -9,18 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.EmploymentBasis; +import com.xero.models.payrollau.ResidencyStatus; +import com.xero.models.payrollau.SeniorMaritalStatus; +import com.xero.models.payrollau.TFNExemptionType; +import com.xero.models.payrollau.TaxScaleType; +import com.xero.models.payrollau.WorkCondition; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.math.BigDecimal; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxDeclaration + */ -/** TaxDeclaration */ public class TaxDeclaration { StringUtil util = new StringUtil(); @@ -87,785 +108,673 @@ public class TaxDeclaration { @JsonProperty("UpdatedDateUTC") private String updatedDateUTC; /** - * Address line 1 for employee home address - * - * @param employeeID UUID - * @return TaxDeclaration - */ + * Address line 1 for employee home address + * @param employeeID UUID + * @return TaxDeclaration + **/ public TaxDeclaration employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * Address line 1 for employee home address - * * @return employeeID - */ + **/ @ApiModelProperty(value = "Address line 1 for employee home address") - /** + /** * Address line 1 for employee home address - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * Address line 1 for employee home address - * - * @param employeeID UUID - */ + /** + * Address line 1 for employee home address + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * employmentBasis - * - * @param employmentBasis EmploymentBasis - * @return TaxDeclaration - */ + * employmentBasis + * @param employmentBasis EmploymentBasis + * @return TaxDeclaration + **/ public TaxDeclaration employmentBasis(EmploymentBasis employmentBasis) { this.employmentBasis = employmentBasis; return this; } - /** + /** * Get employmentBasis - * * @return employmentBasis - */ + **/ @ApiModelProperty(value = "") - /** + /** * employmentBasis - * * @return employmentBasis EmploymentBasis - */ + **/ public EmploymentBasis getEmploymentBasis() { return employmentBasis; } - /** - * employmentBasis - * - * @param employmentBasis EmploymentBasis - */ + /** + * employmentBasis + * @param employmentBasis EmploymentBasis + **/ + public void setEmploymentBasis(EmploymentBasis employmentBasis) { this.employmentBasis = employmentBasis; } /** - * tfNExemptionType - * - * @param tfNExemptionType TFNExemptionType - * @return TaxDeclaration - */ + * tfNExemptionType + * @param tfNExemptionType TFNExemptionType + * @return TaxDeclaration + **/ public TaxDeclaration tfNExemptionType(TFNExemptionType tfNExemptionType) { this.tfNExemptionType = tfNExemptionType; return this; } - /** + /** * Get tfNExemptionType - * * @return tfNExemptionType - */ + **/ @ApiModelProperty(value = "") - /** + /** * tfNExemptionType - * * @return tfNExemptionType TFNExemptionType - */ + **/ public TFNExemptionType getTfNExemptionType() { return tfNExemptionType; } - /** - * tfNExemptionType - * - * @param tfNExemptionType TFNExemptionType - */ + /** + * tfNExemptionType + * @param tfNExemptionType TFNExemptionType + **/ + public void setTfNExemptionType(TFNExemptionType tfNExemptionType) { this.tfNExemptionType = tfNExemptionType; } /** - * The tax file number e.g 123123123. - * - * @param taxFileNumber String - * @return TaxDeclaration - */ + * The tax file number e.g 123123123. + * @param taxFileNumber String + * @return TaxDeclaration + **/ public TaxDeclaration taxFileNumber(String taxFileNumber) { this.taxFileNumber = taxFileNumber; return this; } - /** + /** * The tax file number e.g 123123123. - * * @return taxFileNumber - */ + **/ @ApiModelProperty(example = "123123123", value = "The tax file number e.g 123123123.") - /** + /** * The tax file number e.g 123123123. - * * @return taxFileNumber String - */ + **/ public String getTaxFileNumber() { return taxFileNumber; } - /** - * The tax file number e.g 123123123. - * - * @param taxFileNumber String - */ + /** + * The tax file number e.g 123123123. + * @param taxFileNumber String + **/ + public void setTaxFileNumber(String taxFileNumber) { this.taxFileNumber = taxFileNumber; } /** - * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to - * unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. - * - * @param ABN String - * @return TaxDeclaration - */ + * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. + * @param ABN String + * @return TaxDeclaration + **/ public TaxDeclaration ABN(String ABN) { this.ABN = ABN; return this; } - /** - * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to - * unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. - * + /** + * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. * @return ABN - */ - @ApiModelProperty( - example = "21006819692", - value = - "11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to unset" - + " a previously set value. Only applicable, and mandatory if income type is" - + " NONEMPLOYEE.") - /** - * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to - * unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. - * + **/ + @ApiModelProperty(example = "21006819692", value = "11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE.") + /** + * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. * @return ABN String - */ + **/ public String getABN() { return ABN; } - /** - * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to - * unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. - * - * @param ABN String - */ + /** + * 11-digit Australian Business Number e.g 21006819692 or an empty string (\"\") to unset a previously set value. Only applicable, and mandatory if income type is NONEMPLOYEE. + * @param ABN String + **/ + public void setABN(String ABN) { this.ABN = ABN; } /** - * If the employee is Australian resident for tax purposes. e.g true or false - * - * @param australianResidentForTaxPurposes Boolean - * @return TaxDeclaration - */ + * If the employee is Australian resident for tax purposes. e.g true or false + * @param australianResidentForTaxPurposes Boolean + * @return TaxDeclaration + **/ public TaxDeclaration australianResidentForTaxPurposes(Boolean australianResidentForTaxPurposes) { this.australianResidentForTaxPurposes = australianResidentForTaxPurposes; return this; } - /** + /** * If the employee is Australian resident for tax purposes. e.g true or false - * * @return australianResidentForTaxPurposes - */ - @ApiModelProperty( - example = "true", - value = "If the employee is Australian resident for tax purposes. e.g true or false") - /** + **/ + @ApiModelProperty(example = "true", value = "If the employee is Australian resident for tax purposes. e.g true or false") + /** * If the employee is Australian resident for tax purposes. e.g true or false - * * @return australianResidentForTaxPurposes Boolean - */ + **/ public Boolean getAustralianResidentForTaxPurposes() { return australianResidentForTaxPurposes; } - /** - * If the employee is Australian resident for tax purposes. e.g true or false - * - * @param australianResidentForTaxPurposes Boolean - */ + /** + * If the employee is Australian resident for tax purposes. e.g true or false + * @param australianResidentForTaxPurposes Boolean + **/ + public void setAustralianResidentForTaxPurposes(Boolean australianResidentForTaxPurposes) { this.australianResidentForTaxPurposes = australianResidentForTaxPurposes; } /** - * residencyStatus - * - * @param residencyStatus ResidencyStatus - * @return TaxDeclaration - */ + * residencyStatus + * @param residencyStatus ResidencyStatus + * @return TaxDeclaration + **/ public TaxDeclaration residencyStatus(ResidencyStatus residencyStatus) { this.residencyStatus = residencyStatus; return this; } - /** + /** * Get residencyStatus - * * @return residencyStatus - */ + **/ @ApiModelProperty(value = "") - /** + /** * residencyStatus - * * @return residencyStatus ResidencyStatus - */ + **/ public ResidencyStatus getResidencyStatus() { return residencyStatus; } - /** - * residencyStatus - * - * @param residencyStatus ResidencyStatus - */ + /** + * residencyStatus + * @param residencyStatus ResidencyStatus + **/ + public void setResidencyStatus(ResidencyStatus residencyStatus) { this.residencyStatus = residencyStatus; } /** - * taxScaleType - * - * @param taxScaleType TaxScaleType - * @return TaxDeclaration - */ + * taxScaleType + * @param taxScaleType TaxScaleType + * @return TaxDeclaration + **/ public TaxDeclaration taxScaleType(TaxScaleType taxScaleType) { this.taxScaleType = taxScaleType; return this; } - /** + /** * Get taxScaleType - * * @return taxScaleType - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxScaleType - * * @return taxScaleType TaxScaleType - */ + **/ public TaxScaleType getTaxScaleType() { return taxScaleType; } - /** - * taxScaleType - * - * @param taxScaleType TaxScaleType - */ + /** + * taxScaleType + * @param taxScaleType TaxScaleType + **/ + public void setTaxScaleType(TaxScaleType taxScaleType) { this.taxScaleType = taxScaleType; } /** - * workCondition - * - * @param workCondition WorkCondition - * @return TaxDeclaration - */ + * workCondition + * @param workCondition WorkCondition + * @return TaxDeclaration + **/ public TaxDeclaration workCondition(WorkCondition workCondition) { this.workCondition = workCondition; return this; } - /** + /** * Get workCondition - * * @return workCondition - */ + **/ @ApiModelProperty(value = "") - /** + /** * workCondition - * * @return workCondition WorkCondition - */ + **/ public WorkCondition getWorkCondition() { return workCondition; } - /** - * workCondition - * - * @param workCondition WorkCondition - */ + /** + * workCondition + * @param workCondition WorkCondition + **/ + public void setWorkCondition(WorkCondition workCondition) { this.workCondition = workCondition; } /** - * seniorMaritalStatus - * - * @param seniorMaritalStatus SeniorMaritalStatus - * @return TaxDeclaration - */ + * seniorMaritalStatus + * @param seniorMaritalStatus SeniorMaritalStatus + * @return TaxDeclaration + **/ public TaxDeclaration seniorMaritalStatus(SeniorMaritalStatus seniorMaritalStatus) { this.seniorMaritalStatus = seniorMaritalStatus; return this; } - /** + /** * Get seniorMaritalStatus - * * @return seniorMaritalStatus - */ + **/ @ApiModelProperty(value = "") - /** + /** * seniorMaritalStatus - * * @return seniorMaritalStatus SeniorMaritalStatus - */ + **/ public SeniorMaritalStatus getSeniorMaritalStatus() { return seniorMaritalStatus; } - /** - * seniorMaritalStatus - * - * @param seniorMaritalStatus SeniorMaritalStatus - */ + /** + * seniorMaritalStatus + * @param seniorMaritalStatus SeniorMaritalStatus + **/ + public void setSeniorMaritalStatus(SeniorMaritalStatus seniorMaritalStatus) { this.seniorMaritalStatus = seniorMaritalStatus; } /** - * If tax free threshold claimed. e.g true or false - * - * @param taxFreeThresholdClaimed Boolean - * @return TaxDeclaration - */ + * If tax free threshold claimed. e.g true or false + * @param taxFreeThresholdClaimed Boolean + * @return TaxDeclaration + **/ public TaxDeclaration taxFreeThresholdClaimed(Boolean taxFreeThresholdClaimed) { this.taxFreeThresholdClaimed = taxFreeThresholdClaimed; return this; } - /** + /** * If tax free threshold claimed. e.g true or false - * * @return taxFreeThresholdClaimed - */ + **/ @ApiModelProperty(example = "false", value = "If tax free threshold claimed. e.g true or false") - /** + /** * If tax free threshold claimed. e.g true or false - * * @return taxFreeThresholdClaimed Boolean - */ + **/ public Boolean getTaxFreeThresholdClaimed() { return taxFreeThresholdClaimed; } - /** - * If tax free threshold claimed. e.g true or false - * - * @param taxFreeThresholdClaimed Boolean - */ + /** + * If tax free threshold claimed. e.g true or false + * @param taxFreeThresholdClaimed Boolean + **/ + public void setTaxFreeThresholdClaimed(Boolean taxFreeThresholdClaimed) { this.taxFreeThresholdClaimed = taxFreeThresholdClaimed; } /** - * If has tax offset estimated then the tax offset estimated amount. e.g 100 - * - * @param taxOffsetEstimatedAmount BigDecimal - * @return TaxDeclaration - */ + * If has tax offset estimated then the tax offset estimated amount. e.g 100 + * @param taxOffsetEstimatedAmount BigDecimal + * @return TaxDeclaration + **/ public TaxDeclaration taxOffsetEstimatedAmount(BigDecimal taxOffsetEstimatedAmount) { this.taxOffsetEstimatedAmount = taxOffsetEstimatedAmount; return this; } - /** + /** * If has tax offset estimated then the tax offset estimated amount. e.g 100 - * * @return taxOffsetEstimatedAmount - */ - @ApiModelProperty( - example = "100", - value = "If has tax offset estimated then the tax offset estimated amount. e.g 100") - /** + **/ + @ApiModelProperty(example = "100", value = "If has tax offset estimated then the tax offset estimated amount. e.g 100") + /** * If has tax offset estimated then the tax offset estimated amount. e.g 100 - * * @return taxOffsetEstimatedAmount BigDecimal - */ + **/ public BigDecimal getTaxOffsetEstimatedAmount() { return taxOffsetEstimatedAmount; } - /** - * If has tax offset estimated then the tax offset estimated amount. e.g 100 - * - * @param taxOffsetEstimatedAmount BigDecimal - */ + /** + * If has tax offset estimated then the tax offset estimated amount. e.g 100 + * @param taxOffsetEstimatedAmount BigDecimal + **/ + public void setTaxOffsetEstimatedAmount(BigDecimal taxOffsetEstimatedAmount) { this.taxOffsetEstimatedAmount = taxOffsetEstimatedAmount; } /** - * If employee has HECS or HELP debt. e.g true or false - * - * @param hasHELPDebt Boolean - * @return TaxDeclaration - */ + * If employee has HECS or HELP debt. e.g true or false + * @param hasHELPDebt Boolean + * @return TaxDeclaration + **/ public TaxDeclaration hasHELPDebt(Boolean hasHELPDebt) { this.hasHELPDebt = hasHELPDebt; return this; } - /** + /** * If employee has HECS or HELP debt. e.g true or false - * * @return hasHELPDebt - */ - @ApiModelProperty( - example = "false", - value = "If employee has HECS or HELP debt. e.g true or false") - /** + **/ + @ApiModelProperty(example = "false", value = "If employee has HECS or HELP debt. e.g true or false") + /** * If employee has HECS or HELP debt. e.g true or false - * * @return hasHELPDebt Boolean - */ + **/ public Boolean getHasHELPDebt() { return hasHELPDebt; } - /** - * If employee has HECS or HELP debt. e.g true or false - * - * @param hasHELPDebt Boolean - */ + /** + * If employee has HECS or HELP debt. e.g true or false + * @param hasHELPDebt Boolean + **/ + public void setHasHELPDebt(Boolean hasHELPDebt) { this.hasHELPDebt = hasHELPDebt; } /** - * If employee has financial supplement debt. e.g true or false - * - * @param hasSFSSDebt Boolean - * @return TaxDeclaration - */ + * If employee has financial supplement debt. e.g true or false + * @param hasSFSSDebt Boolean + * @return TaxDeclaration + **/ public TaxDeclaration hasSFSSDebt(Boolean hasSFSSDebt) { this.hasSFSSDebt = hasSFSSDebt; return this; } - /** + /** * If employee has financial supplement debt. e.g true or false - * * @return hasSFSSDebt - */ - @ApiModelProperty( - example = "false", - value = "If employee has financial supplement debt. e.g true or false") - /** + **/ + @ApiModelProperty(example = "false", value = "If employee has financial supplement debt. e.g true or false") + /** * If employee has financial supplement debt. e.g true or false - * * @return hasSFSSDebt Boolean - */ + **/ public Boolean getHasSFSSDebt() { return hasSFSSDebt; } - /** - * If employee has financial supplement debt. e.g true or false - * - * @param hasSFSSDebt Boolean - */ + /** + * If employee has financial supplement debt. e.g true or false + * @param hasSFSSDebt Boolean + **/ + public void setHasSFSSDebt(Boolean hasSFSSDebt) { this.hasSFSSDebt = hasSFSSDebt; } /** - * If employee has trade support loan. e.g true or false - * - * @param hasTradeSupportLoanDebt Boolean - * @return TaxDeclaration - */ + * If employee has trade support loan. e.g true or false + * @param hasTradeSupportLoanDebt Boolean + * @return TaxDeclaration + **/ public TaxDeclaration hasTradeSupportLoanDebt(Boolean hasTradeSupportLoanDebt) { this.hasTradeSupportLoanDebt = hasTradeSupportLoanDebt; return this; } - /** + /** * If employee has trade support loan. e.g true or false - * * @return hasTradeSupportLoanDebt - */ - @ApiModelProperty( - example = "false", - value = "If employee has trade support loan. e.g true or false") - /** + **/ + @ApiModelProperty(example = "false", value = "If employee has trade support loan. e.g true or false") + /** * If employee has trade support loan. e.g true or false - * * @return hasTradeSupportLoanDebt Boolean - */ + **/ public Boolean getHasTradeSupportLoanDebt() { return hasTradeSupportLoanDebt; } - /** - * If employee has trade support loan. e.g true or false - * - * @param hasTradeSupportLoanDebt Boolean - */ + /** + * If employee has trade support loan. e.g true or false + * @param hasTradeSupportLoanDebt Boolean + **/ + public void setHasTradeSupportLoanDebt(Boolean hasTradeSupportLoanDebt) { this.hasTradeSupportLoanDebt = hasTradeSupportLoanDebt; } /** - * If the employee has requested that additional tax be withheld each pay run. e.g 50 - * - * @param upwardVariationTaxWithholdingAmount BigDecimal - * @return TaxDeclaration - */ - public TaxDeclaration upwardVariationTaxWithholdingAmount( - BigDecimal upwardVariationTaxWithholdingAmount) { + * If the employee has requested that additional tax be withheld each pay run. e.g 50 + * @param upwardVariationTaxWithholdingAmount BigDecimal + * @return TaxDeclaration + **/ + public TaxDeclaration upwardVariationTaxWithholdingAmount(BigDecimal upwardVariationTaxWithholdingAmount) { this.upwardVariationTaxWithholdingAmount = upwardVariationTaxWithholdingAmount; return this; } - /** + /** * If the employee has requested that additional tax be withheld each pay run. e.g 50 - * * @return upwardVariationTaxWithholdingAmount - */ - @ApiModelProperty( - example = "50", - value = "If the employee has requested that additional tax be withheld each pay run. e.g 50") - /** + **/ + @ApiModelProperty(example = "50", value = "If the employee has requested that additional tax be withheld each pay run. e.g 50") + /** * If the employee has requested that additional tax be withheld each pay run. e.g 50 - * * @return upwardVariationTaxWithholdingAmount BigDecimal - */ + **/ public BigDecimal getUpwardVariationTaxWithholdingAmount() { return upwardVariationTaxWithholdingAmount; } - /** - * If the employee has requested that additional tax be withheld each pay run. e.g 50 - * - * @param upwardVariationTaxWithholdingAmount BigDecimal - */ - public void setUpwardVariationTaxWithholdingAmount( - BigDecimal upwardVariationTaxWithholdingAmount) { + /** + * If the employee has requested that additional tax be withheld each pay run. e.g 50 + * @param upwardVariationTaxWithholdingAmount BigDecimal + **/ + + public void setUpwardVariationTaxWithholdingAmount(BigDecimal upwardVariationTaxWithholdingAmount) { this.upwardVariationTaxWithholdingAmount = upwardVariationTaxWithholdingAmount; } /** - * If the employee is eligible to receive an additional percentage on top of ordinary earnings - * when they take leave (typically 17.5%). e.g true or false - * - * @param eligibleToReceiveLeaveLoading Boolean - * @return TaxDeclaration - */ + * If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false + * @param eligibleToReceiveLeaveLoading Boolean + * @return TaxDeclaration + **/ public TaxDeclaration eligibleToReceiveLeaveLoading(Boolean eligibleToReceiveLeaveLoading) { this.eligibleToReceiveLeaveLoading = eligibleToReceiveLeaveLoading; return this; } - /** - * If the employee is eligible to receive an additional percentage on top of ordinary earnings - * when they take leave (typically 17.5%). e.g true or false - * + /** + * If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false * @return eligibleToReceiveLeaveLoading - */ - @ApiModelProperty( - example = "false", - value = - "If the employee is eligible to receive an additional percentage on top of ordinary" - + " earnings when they take leave (typically 17.5%). e.g true or false") - /** - * If the employee is eligible to receive an additional percentage on top of ordinary earnings - * when they take leave (typically 17.5%). e.g true or false - * + **/ + @ApiModelProperty(example = "false", value = "If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false") + /** + * If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false * @return eligibleToReceiveLeaveLoading Boolean - */ + **/ public Boolean getEligibleToReceiveLeaveLoading() { return eligibleToReceiveLeaveLoading; } - /** - * If the employee is eligible to receive an additional percentage on top of ordinary earnings - * when they take leave (typically 17.5%). e.g true or false - * - * @param eligibleToReceiveLeaveLoading Boolean - */ + /** + * If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false + * @param eligibleToReceiveLeaveLoading Boolean + **/ + public void setEligibleToReceiveLeaveLoading(Boolean eligibleToReceiveLeaveLoading) { this.eligibleToReceiveLeaveLoading = eligibleToReceiveLeaveLoading; } /** - * If the employee has approved withholding variation. e.g (0 - 100) - * - * @param approvedWithholdingVariationPercentage BigDecimal - * @return TaxDeclaration - */ - public TaxDeclaration approvedWithholdingVariationPercentage( - BigDecimal approvedWithholdingVariationPercentage) { + * If the employee has approved withholding variation. e.g (0 - 100) + * @param approvedWithholdingVariationPercentage BigDecimal + * @return TaxDeclaration + **/ + public TaxDeclaration approvedWithholdingVariationPercentage(BigDecimal approvedWithholdingVariationPercentage) { this.approvedWithholdingVariationPercentage = approvedWithholdingVariationPercentage; return this; } - /** + /** * If the employee has approved withholding variation. e.g (0 - 100) - * * @return approvedWithholdingVariationPercentage - */ - @ApiModelProperty( - example = "75", - value = "If the employee has approved withholding variation. e.g (0 - 100)") - /** + **/ + @ApiModelProperty(example = "75", value = "If the employee has approved withholding variation. e.g (0 - 100)") + /** * If the employee has approved withholding variation. e.g (0 - 100) - * * @return approvedWithholdingVariationPercentage BigDecimal - */ + **/ public BigDecimal getApprovedWithholdingVariationPercentage() { return approvedWithholdingVariationPercentage; } - /** - * If the employee has approved withholding variation. e.g (0 - 100) - * - * @param approvedWithholdingVariationPercentage BigDecimal - */ - public void setApprovedWithholdingVariationPercentage( - BigDecimal approvedWithholdingVariationPercentage) { + /** + * If the employee has approved withholding variation. e.g (0 - 100) + * @param approvedWithholdingVariationPercentage BigDecimal + **/ + + public void setApprovedWithholdingVariationPercentage(BigDecimal approvedWithholdingVariationPercentage) { this.approvedWithholdingVariationPercentage = approvedWithholdingVariationPercentage; } /** - * If the employee is eligible for student startup loan rules - * - * @param hasStudentStartupLoan Boolean - * @return TaxDeclaration - */ + * If the employee is eligible for student startup loan rules + * @param hasStudentStartupLoan Boolean + * @return TaxDeclaration + **/ public TaxDeclaration hasStudentStartupLoan(Boolean hasStudentStartupLoan) { this.hasStudentStartupLoan = hasStudentStartupLoan; return this; } - /** + /** * If the employee is eligible for student startup loan rules - * * @return hasStudentStartupLoan - */ - @ApiModelProperty( - example = "true", - value = "If the employee is eligible for student startup loan rules") - /** + **/ + @ApiModelProperty(example = "true", value = "If the employee is eligible for student startup loan rules") + /** * If the employee is eligible for student startup loan rules - * * @return hasStudentStartupLoan Boolean - */ + **/ public Boolean getHasStudentStartupLoan() { return hasStudentStartupLoan; } - /** - * If the employee is eligible for student startup loan rules - * - * @param hasStudentStartupLoan Boolean - */ + /** + * If the employee is eligible for student startup loan rules + * @param hasStudentStartupLoan Boolean + **/ + public void setHasStudentStartupLoan(Boolean hasStudentStartupLoan) { this.hasStudentStartupLoan = hasStudentStartupLoan; } /** - * If the employee has any of the following loans or debts: Higher Education Loan Program - * (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or - * Trade Support Loan (TSL) - * - * @param hasLoanOrStudentDebt Boolean - * @return TaxDeclaration - */ + * If the employee has any of the following loans or debts: Higher Education Loan Program (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or Trade Support Loan (TSL) + * @param hasLoanOrStudentDebt Boolean + * @return TaxDeclaration + **/ public TaxDeclaration hasLoanOrStudentDebt(Boolean hasLoanOrStudentDebt) { this.hasLoanOrStudentDebt = hasLoanOrStudentDebt; return this; } - /** - * If the employee has any of the following loans or debts: Higher Education Loan Program - * (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or - * Trade Support Loan (TSL) - * + /** + * If the employee has any of the following loans or debts: Higher Education Loan Program (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or Trade Support Loan (TSL) * @return hasLoanOrStudentDebt - */ - @ApiModelProperty( - example = "true", - value = - "If the employee has any of the following loans or debts: Higher Education Loan Program" - + " (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up" - + " Loan (SSL), or Trade Support Loan (TSL)") - /** - * If the employee has any of the following loans or debts: Higher Education Loan Program - * (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or - * Trade Support Loan (TSL) - * + **/ + @ApiModelProperty(example = "true", value = "If the employee has any of the following loans or debts: Higher Education Loan Program (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or Trade Support Loan (TSL)") + /** + * If the employee has any of the following loans or debts: Higher Education Loan Program (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or Trade Support Loan (TSL) * @return hasLoanOrStudentDebt Boolean - */ + **/ public Boolean getHasLoanOrStudentDebt() { return hasLoanOrStudentDebt; } - /** - * If the employee has any of the following loans or debts: Higher Education Loan Program - * (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or - * Trade Support Loan (TSL) - * - * @param hasLoanOrStudentDebt Boolean - */ + /** + * If the employee has any of the following loans or debts: Higher Education Loan Program (HELP/HECS), VET Student Loan (VSL), Financial Supplement (FS), Student Start-up Loan (SSL), or Trade Support Loan (TSL) + * @param hasLoanOrStudentDebt Boolean + **/ + public void setHasLoanOrStudentDebt(Boolean hasLoanOrStudentDebt) { this.hasLoanOrStudentDebt = hasLoanOrStudentDebt; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -875,61 +784,35 @@ public boolean equals(java.lang.Object o) { return false; } TaxDeclaration taxDeclaration = (TaxDeclaration) o; - return Objects.equals(this.employeeID, taxDeclaration.employeeID) - && Objects.equals(this.employmentBasis, taxDeclaration.employmentBasis) - && Objects.equals(this.tfNExemptionType, taxDeclaration.tfNExemptionType) - && Objects.equals(this.taxFileNumber, taxDeclaration.taxFileNumber) - && Objects.equals(this.ABN, taxDeclaration.ABN) - && Objects.equals( - this.australianResidentForTaxPurposes, taxDeclaration.australianResidentForTaxPurposes) - && Objects.equals(this.residencyStatus, taxDeclaration.residencyStatus) - && Objects.equals(this.taxScaleType, taxDeclaration.taxScaleType) - && Objects.equals(this.workCondition, taxDeclaration.workCondition) - && Objects.equals(this.seniorMaritalStatus, taxDeclaration.seniorMaritalStatus) - && Objects.equals(this.taxFreeThresholdClaimed, taxDeclaration.taxFreeThresholdClaimed) - && Objects.equals(this.taxOffsetEstimatedAmount, taxDeclaration.taxOffsetEstimatedAmount) - && Objects.equals(this.hasHELPDebt, taxDeclaration.hasHELPDebt) - && Objects.equals(this.hasSFSSDebt, taxDeclaration.hasSFSSDebt) - && Objects.equals(this.hasTradeSupportLoanDebt, taxDeclaration.hasTradeSupportLoanDebt) - && Objects.equals( - this.upwardVariationTaxWithholdingAmount, - taxDeclaration.upwardVariationTaxWithholdingAmount) - && Objects.equals( - this.eligibleToReceiveLeaveLoading, taxDeclaration.eligibleToReceiveLeaveLoading) - && Objects.equals( - this.approvedWithholdingVariationPercentage, - taxDeclaration.approvedWithholdingVariationPercentage) - && Objects.equals(this.hasStudentStartupLoan, taxDeclaration.hasStudentStartupLoan) - && Objects.equals(this.hasLoanOrStudentDebt, taxDeclaration.hasLoanOrStudentDebt) - && Objects.equals(this.updatedDateUTC, taxDeclaration.updatedDateUTC); + return Objects.equals(this.employeeID, taxDeclaration.employeeID) && + Objects.equals(this.employmentBasis, taxDeclaration.employmentBasis) && + Objects.equals(this.tfNExemptionType, taxDeclaration.tfNExemptionType) && + Objects.equals(this.taxFileNumber, taxDeclaration.taxFileNumber) && + Objects.equals(this.ABN, taxDeclaration.ABN) && + Objects.equals(this.australianResidentForTaxPurposes, taxDeclaration.australianResidentForTaxPurposes) && + Objects.equals(this.residencyStatus, taxDeclaration.residencyStatus) && + Objects.equals(this.taxScaleType, taxDeclaration.taxScaleType) && + Objects.equals(this.workCondition, taxDeclaration.workCondition) && + Objects.equals(this.seniorMaritalStatus, taxDeclaration.seniorMaritalStatus) && + Objects.equals(this.taxFreeThresholdClaimed, taxDeclaration.taxFreeThresholdClaimed) && + Objects.equals(this.taxOffsetEstimatedAmount, taxDeclaration.taxOffsetEstimatedAmount) && + Objects.equals(this.hasHELPDebt, taxDeclaration.hasHELPDebt) && + Objects.equals(this.hasSFSSDebt, taxDeclaration.hasSFSSDebt) && + Objects.equals(this.hasTradeSupportLoanDebt, taxDeclaration.hasTradeSupportLoanDebt) && + Objects.equals(this.upwardVariationTaxWithholdingAmount, taxDeclaration.upwardVariationTaxWithholdingAmount) && + Objects.equals(this.eligibleToReceiveLeaveLoading, taxDeclaration.eligibleToReceiveLeaveLoading) && + Objects.equals(this.approvedWithholdingVariationPercentage, taxDeclaration.approvedWithholdingVariationPercentage) && + Objects.equals(this.hasStudentStartupLoan, taxDeclaration.hasStudentStartupLoan) && + Objects.equals(this.hasLoanOrStudentDebt, taxDeclaration.hasLoanOrStudentDebt) && + Objects.equals(this.updatedDateUTC, taxDeclaration.updatedDateUTC); } @Override public int hashCode() { - return Objects.hash( - employeeID, - employmentBasis, - tfNExemptionType, - taxFileNumber, - ABN, - australianResidentForTaxPurposes, - residencyStatus, - taxScaleType, - workCondition, - seniorMaritalStatus, - taxFreeThresholdClaimed, - taxOffsetEstimatedAmount, - hasHELPDebt, - hasSFSSDebt, - hasTradeSupportLoanDebt, - upwardVariationTaxWithholdingAmount, - eligibleToReceiveLeaveLoading, - approvedWithholdingVariationPercentage, - hasStudentStartupLoan, - hasLoanOrStudentDebt, - updatedDateUTC); + return Objects.hash(employeeID, employmentBasis, tfNExemptionType, taxFileNumber, ABN, australianResidentForTaxPurposes, residencyStatus, taxScaleType, workCondition, seniorMaritalStatus, taxFreeThresholdClaimed, taxOffsetEstimatedAmount, hasHELPDebt, hasSFSSDebt, hasTradeSupportLoanDebt, upwardVariationTaxWithholdingAmount, eligibleToReceiveLeaveLoading, approvedWithholdingVariationPercentage, hasStudentStartupLoan, hasLoanOrStudentDebt, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -939,48 +822,29 @@ public String toString() { sb.append(" tfNExemptionType: ").append(toIndentedString(tfNExemptionType)).append("\n"); sb.append(" taxFileNumber: ").append(toIndentedString(taxFileNumber)).append("\n"); sb.append(" ABN: ").append(toIndentedString(ABN)).append("\n"); - sb.append(" australianResidentForTaxPurposes: ") - .append(toIndentedString(australianResidentForTaxPurposes)) - .append("\n"); + sb.append(" australianResidentForTaxPurposes: ").append(toIndentedString(australianResidentForTaxPurposes)).append("\n"); sb.append(" residencyStatus: ").append(toIndentedString(residencyStatus)).append("\n"); sb.append(" taxScaleType: ").append(toIndentedString(taxScaleType)).append("\n"); sb.append(" workCondition: ").append(toIndentedString(workCondition)).append("\n"); - sb.append(" seniorMaritalStatus: ") - .append(toIndentedString(seniorMaritalStatus)) - .append("\n"); - sb.append(" taxFreeThresholdClaimed: ") - .append(toIndentedString(taxFreeThresholdClaimed)) - .append("\n"); - sb.append(" taxOffsetEstimatedAmount: ") - .append(toIndentedString(taxOffsetEstimatedAmount)) - .append("\n"); + sb.append(" seniorMaritalStatus: ").append(toIndentedString(seniorMaritalStatus)).append("\n"); + sb.append(" taxFreeThresholdClaimed: ").append(toIndentedString(taxFreeThresholdClaimed)).append("\n"); + sb.append(" taxOffsetEstimatedAmount: ").append(toIndentedString(taxOffsetEstimatedAmount)).append("\n"); sb.append(" hasHELPDebt: ").append(toIndentedString(hasHELPDebt)).append("\n"); sb.append(" hasSFSSDebt: ").append(toIndentedString(hasSFSSDebt)).append("\n"); - sb.append(" hasTradeSupportLoanDebt: ") - .append(toIndentedString(hasTradeSupportLoanDebt)) - .append("\n"); - sb.append(" upwardVariationTaxWithholdingAmount: ") - .append(toIndentedString(upwardVariationTaxWithholdingAmount)) - .append("\n"); - sb.append(" eligibleToReceiveLeaveLoading: ") - .append(toIndentedString(eligibleToReceiveLeaveLoading)) - .append("\n"); - sb.append(" approvedWithholdingVariationPercentage: ") - .append(toIndentedString(approvedWithholdingVariationPercentage)) - .append("\n"); - sb.append(" hasStudentStartupLoan: ") - .append(toIndentedString(hasStudentStartupLoan)) - .append("\n"); - sb.append(" hasLoanOrStudentDebt: ") - .append(toIndentedString(hasLoanOrStudentDebt)) - .append("\n"); + sb.append(" hasTradeSupportLoanDebt: ").append(toIndentedString(hasTradeSupportLoanDebt)).append("\n"); + sb.append(" upwardVariationTaxWithholdingAmount: ").append(toIndentedString(upwardVariationTaxWithholdingAmount)).append("\n"); + sb.append(" eligibleToReceiveLeaveLoading: ").append(toIndentedString(eligibleToReceiveLeaveLoading)).append("\n"); + sb.append(" approvedWithholdingVariationPercentage: ").append(toIndentedString(approvedWithholdingVariationPercentage)).append("\n"); + sb.append(" hasStudentStartupLoan: ").append(toIndentedString(hasStudentStartupLoan)).append("\n"); + sb.append(" hasLoanOrStudentDebt: ").append(toIndentedString(hasLoanOrStudentDebt)).append("\n"); sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -988,4 +852,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/TaxLine.java b/src/main/java/com/xero/models/payrollau/TaxLine.java index 7f35bc796..2f3edfa43 100644 --- a/src/main/java/com/xero/models/payrollau/TaxLine.java +++ b/src/main/java/com/xero/models/payrollau/TaxLine.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.ManualTaxType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxLine + */ -/** TaxLine */ public class TaxLine { StringUtil util = new StringUtil(); @@ -39,225 +57,198 @@ public class TaxLine { @JsonProperty("LiabilityAccount") private String liabilityAccount; /** - * Xero identifier for payslip tax line ID. - * - * @param payslipTaxLineID UUID - * @return TaxLine - */ + * Xero identifier for payslip tax line ID. + * @param payslipTaxLineID UUID + * @return TaxLine + **/ public TaxLine payslipTaxLineID(UUID payslipTaxLineID) { this.payslipTaxLineID = payslipTaxLineID; return this; } - /** + /** * Xero identifier for payslip tax line ID. - * * @return payslipTaxLineID - */ - @ApiModelProperty( - example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", - value = "Xero identifier for payslip tax line ID.") - /** + **/ + @ApiModelProperty(example = "e0eb6747-7c17-4075-b804-989f8d4e5d39", value = "Xero identifier for payslip tax line ID.") + /** * Xero identifier for payslip tax line ID. - * * @return payslipTaxLineID UUID - */ + **/ public UUID getPayslipTaxLineID() { return payslipTaxLineID; } - /** - * Xero identifier for payslip tax line ID. - * - * @param payslipTaxLineID UUID - */ + /** + * Xero identifier for payslip tax line ID. + * @param payslipTaxLineID UUID + **/ + public void setPayslipTaxLineID(UUID payslipTaxLineID) { this.payslipTaxLineID = payslipTaxLineID; } /** - * The tax line amount - * - * @param amount Double - * @return TaxLine - */ + * The tax line amount + * @param amount Double + * @return TaxLine + **/ public TaxLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The tax line amount - * * @return amount - */ + **/ @ApiModelProperty(example = "50.0", value = "The tax line amount") - /** + /** * The tax line amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The tax line amount - * - * @param amount Double - */ + /** + * The tax line amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Name of the tax type. - * - * @param taxTypeName String - * @return TaxLine - */ + * Name of the tax type. + * @param taxTypeName String + * @return TaxLine + **/ public TaxLine taxTypeName(String taxTypeName) { this.taxTypeName = taxTypeName; return this; } - /** + /** * Name of the tax type. - * * @return taxTypeName - */ + **/ @ApiModelProperty(example = "Manual Adjustment", value = "Name of the tax type.") - /** + /** * Name of the tax type. - * * @return taxTypeName String - */ + **/ public String getTaxTypeName() { return taxTypeName; } - /** - * Name of the tax type. - * - * @param taxTypeName String - */ + /** + * Name of the tax type. + * @param taxTypeName String + **/ + public void setTaxTypeName(String taxTypeName) { this.taxTypeName = taxTypeName; } /** - * Description of the tax line. - * - * @param description String - * @return TaxLine - */ + * Description of the tax line. + * @param description String + * @return TaxLine + **/ public TaxLine description(String description) { this.description = description; return this; } - /** + /** * Description of the tax line. - * * @return description - */ + **/ @ApiModelProperty(value = "Description of the tax line.") - /** + /** * Description of the tax line. - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Description of the tax line. - * - * @param description String - */ + /** + * Description of the tax line. + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * manualTaxType - * - * @param manualTaxType ManualTaxType - * @return TaxLine - */ + * manualTaxType + * @param manualTaxType ManualTaxType + * @return TaxLine + **/ public TaxLine manualTaxType(ManualTaxType manualTaxType) { this.manualTaxType = manualTaxType; return this; } - /** + /** * Get manualTaxType - * * @return manualTaxType - */ + **/ @ApiModelProperty(value = "") - /** + /** * manualTaxType - * * @return manualTaxType ManualTaxType - */ + **/ public ManualTaxType getManualTaxType() { return manualTaxType; } - /** - * manualTaxType - * - * @param manualTaxType ManualTaxType - */ + /** + * manualTaxType + * @param manualTaxType ManualTaxType + **/ + public void setManualTaxType(ManualTaxType manualTaxType) { this.manualTaxType = manualTaxType; } /** - * The tax line liability account code. For posted pay run you should be able to see liability - * account code - * - * @param liabilityAccount String - * @return TaxLine - */ + * The tax line liability account code. For posted pay run you should be able to see liability account code + * @param liabilityAccount String + * @return TaxLine + **/ public TaxLine liabilityAccount(String liabilityAccount) { this.liabilityAccount = liabilityAccount; return this; } - /** - * The tax line liability account code. For posted pay run you should be able to see liability - * account code - * + /** + * The tax line liability account code. For posted pay run you should be able to see liability account code * @return liabilityAccount - */ - @ApiModelProperty( - example = "620", - value = - "The tax line liability account code. For posted pay run you should be able to see" - + " liability account code") - /** - * The tax line liability account code. For posted pay run you should be able to see liability - * account code - * + **/ + @ApiModelProperty(example = "620", value = "The tax line liability account code. For posted pay run you should be able to see liability account code") + /** + * The tax line liability account code. For posted pay run you should be able to see liability account code * @return liabilityAccount String - */ + **/ public String getLiabilityAccount() { return liabilityAccount; } - /** - * The tax line liability account code. For posted pay run you should be able to see liability - * account code - * - * @param liabilityAccount String - */ + /** + * The tax line liability account code. For posted pay run you should be able to see liability account code + * @param liabilityAccount String + **/ + public void setLiabilityAccount(String liabilityAccount) { this.liabilityAccount = liabilityAccount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -267,20 +258,20 @@ public boolean equals(java.lang.Object o) { return false; } TaxLine taxLine = (TaxLine) o; - return Objects.equals(this.payslipTaxLineID, taxLine.payslipTaxLineID) - && Objects.equals(this.amount, taxLine.amount) - && Objects.equals(this.taxTypeName, taxLine.taxTypeName) - && Objects.equals(this.description, taxLine.description) - && Objects.equals(this.manualTaxType, taxLine.manualTaxType) - && Objects.equals(this.liabilityAccount, taxLine.liabilityAccount); + return Objects.equals(this.payslipTaxLineID, taxLine.payslipTaxLineID) && + Objects.equals(this.amount, taxLine.amount) && + Objects.equals(this.taxTypeName, taxLine.taxTypeName) && + Objects.equals(this.description, taxLine.description) && + Objects.equals(this.manualTaxType, taxLine.manualTaxType) && + Objects.equals(this.liabilityAccount, taxLine.liabilityAccount); } @Override public int hashCode() { - return Objects.hash( - payslipTaxLineID, amount, taxTypeName, description, manualTaxType, liabilityAccount); + return Objects.hash(payslipTaxLineID, amount, taxTypeName, description, manualTaxType, liabilityAccount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -296,7 +287,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -304,4 +296,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/TaxScaleType.java b/src/main/java/com/xero/models/payrollau/TaxScaleType.java index b481c5774..eb8098b1e 100644 --- a/src/main/java/com/xero/models/payrollau/TaxScaleType.java +++ b/src/main/java/com/xero/models/payrollau/TaxScaleType.java @@ -9,31 +9,54 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets TaxScaleType */ +/** + * Gets or Sets TaxScaleType + */ public enum TaxScaleType { - - /** REGULAR */ + + /** + * REGULAR + */ REGULAR("REGULAR"), - - /** ACTORSARTISTSENTERTAINERS */ + + /** + * ACTORSARTISTSENTERTAINERS + */ ACTORSARTISTSENTERTAINERS("ACTORSARTISTSENTERTAINERS"), - - /** HORTICULTURISTORSHEARER */ + + /** + * HORTICULTURISTORSHEARER + */ HORTICULTURISTORSHEARER("HORTICULTURISTORSHEARER"), - - /** SENIORORPENSIONER */ + + /** + * SENIORORPENSIONER + */ SENIORORPENSIONER("SENIORORPENSIONER"), - - /** WORKINGHOLIDAYMAKER */ + + /** + * WORKINGHOLIDAYMAKER + */ WORKINGHOLIDAYMAKER("WORKINGHOLIDAYMAKER"), - - /** FOREIGN */ + + /** + * FOREIGN + */ FOREIGN("FOREIGN"); private String value; @@ -42,26 +65,24 @@ public enum TaxScaleType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static TaxScaleType fromValue(String value) { @@ -73,3 +94,4 @@ public static TaxScaleType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/Timesheet.java b/src/main/java/com/xero/models/payrollau/Timesheet.java index c1c3355e0..f7a587e25 100644 --- a/src/main/java/com/xero/models/payrollau/Timesheet.java +++ b/src/main/java/com/xero/models/payrollau/Timesheet.java @@ -9,22 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.TimesheetLine; +import com.xero.models.payrollau.TimesheetStatus; +import com.xero.models.payrollau.ValidationError; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Timesheet + */ -/** Timesheet */ public class Timesheet { StringUtil util = new StringUtil(); @@ -55,288 +70,254 @@ public class Timesheet { @JsonProperty("ValidationErrors") private List validationErrors = new ArrayList(); /** - * The Xero identifier for an employee - * - * @param employeeID UUID - * @return Timesheet - */ + * The Xero identifier for an employee + * @param employeeID UUID + * @return Timesheet + **/ public Timesheet employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for an employee - * * @return employeeID - */ - @ApiModelProperty( - example = "72a0d0c2-0cf8-4f0b-ade1-33231f47b41b", - required = true, - value = "The Xero identifier for an employee") - /** + **/ + @ApiModelProperty(example = "72a0d0c2-0cf8-4f0b-ade1-33231f47b41b", required = true, value = "The Xero identifier for an employee") + /** * The Xero identifier for an employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for an employee - * - * @param employeeID UUID - */ + /** + * The Xero identifier for an employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * Period start date (YYYY-MM-DD) - * - * @param startDate String - * @return Timesheet - */ + * Period start date (YYYY-MM-DD) + * @param startDate String + * @return Timesheet + **/ public Timesheet startDate(String startDate) { this.startDate = startDate; return this; } - /** + /** * Period start date (YYYY-MM-DD) - * * @return startDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - required = true, - value = "Period start date (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", required = true, value = "Period start date (YYYY-MM-DD)") + /** * Period start date (YYYY-MM-DD) - * * @return startDate String - */ + **/ public String getStartDate() { return startDate; } - /** + /** * Period start date (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getStartDateAsDate() { if (this.startDate != null) { try { return util.convertStringToDate(this.startDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Period start date (YYYY-MM-DD) - * - * @param startDate String - */ + /** + * Period start date (YYYY-MM-DD) + * @param startDate String + **/ + public void setStartDate(String startDate) { this.startDate = startDate; } - /** - * Period start date (YYYY-MM-DD) - * - * @param startDate LocalDateTime - */ + /** + * Period start date (YYYY-MM-DD) + * @param startDate LocalDateTime + **/ public void setStartDate(LocalDate startDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = startDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.startDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * Period end date (YYYY-MM-DD) - * - * @param endDate String - * @return Timesheet - */ + * Period end date (YYYY-MM-DD) + * @param endDate String + * @return Timesheet + **/ public Timesheet endDate(String endDate) { this.endDate = endDate; return this; } - /** + /** * Period end date (YYYY-MM-DD) - * * @return endDate - */ - @ApiModelProperty( - example = "/Date(322560000000+0000)/", - required = true, - value = "Period end date (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "/Date(322560000000+0000)/", required = true, value = "Period end date (YYYY-MM-DD)") + /** * Period end date (YYYY-MM-DD) - * * @return endDate String - */ + **/ public String getEndDate() { return endDate; } - /** + /** * Period end date (YYYY-MM-DD) - * * @return LocalDate - */ + **/ public LocalDate getEndDateAsDate() { if (this.endDate != null) { try { return util.convertStringToDate(this.endDate); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } - /** - * Period end date (YYYY-MM-DD) - * - * @param endDate String - */ + /** + * Period end date (YYYY-MM-DD) + * @param endDate String + **/ + public void setEndDate(String endDate) { this.endDate = endDate; } - /** - * Period end date (YYYY-MM-DD) - * - * @param endDate LocalDateTime - */ + /** + * Period end date (YYYY-MM-DD) + * @param endDate LocalDateTime + **/ public void setEndDate(LocalDate endDate) { - // CONVERT LocalDate args into MS DateFromat String - Instant instant = endDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); + //CONVERT LocalDate args into MS DateFromat String + Instant instant = endDate.atStartOfDay(ZoneId.of("UTC").normalized()).toInstant(); long timeInMillis = instant.toEpochMilli(); this.endDate = "/Date(" + Long.toString(timeInMillis) + "+0000)/"; } /** - * status - * - * @param status TimesheetStatus - * @return Timesheet - */ + * status + * @param status TimesheetStatus + * @return Timesheet + **/ public Timesheet status(TimesheetStatus status) { this.status = status; return this; } - /** + /** * Get status - * * @return status - */ + **/ @ApiModelProperty(value = "") - /** + /** * status - * * @return status TimesheetStatus - */ + **/ public TimesheetStatus getStatus() { return status; } - /** - * status - * - * @param status TimesheetStatus - */ + /** + * status + * @param status TimesheetStatus + **/ + public void setStatus(TimesheetStatus status) { this.status = status; } /** - * Timesheet total hours - * - * @param hours Double - * @return Timesheet - */ + * Timesheet total hours + * @param hours Double + * @return Timesheet + **/ public Timesheet hours(Double hours) { this.hours = hours; return this; } - /** + /** * Timesheet total hours - * * @return hours - */ + **/ @ApiModelProperty(example = "31.0", value = "Timesheet total hours") - /** + /** * Timesheet total hours - * * @return hours Double - */ + **/ public Double getHours() { return hours; } - /** - * Timesheet total hours - * - * @param hours Double - */ + /** + * Timesheet total hours + * @param hours Double + **/ + public void setHours(Double hours) { this.hours = hours; } /** - * The Xero identifier for a Payroll Timesheet - * - * @param timesheetID UUID - * @return Timesheet - */ + * The Xero identifier for a Payroll Timesheet + * @param timesheetID UUID + * @return Timesheet + **/ public Timesheet timesheetID(UUID timesheetID) { this.timesheetID = timesheetID; return this; } - /** + /** * The Xero identifier for a Payroll Timesheet - * * @return timesheetID - */ - @ApiModelProperty( - example = "049765fc-4506-48fb-bf88-3578dec0ec47", - value = "The Xero identifier for a Payroll Timesheet") - /** + **/ + @ApiModelProperty(example = "049765fc-4506-48fb-bf88-3578dec0ec47", value = "The Xero identifier for a Payroll Timesheet") + /** * The Xero identifier for a Payroll Timesheet - * * @return timesheetID UUID - */ + **/ public UUID getTimesheetID() { return timesheetID; } - /** - * The Xero identifier for a Payroll Timesheet - * - * @param timesheetID UUID - */ + /** + * The Xero identifier for a Payroll Timesheet + * @param timesheetID UUID + **/ + public void setTimesheetID(UUID timesheetID) { this.timesheetID = timesheetID; } /** - * timesheetLines - * - * @param timesheetLines List<TimesheetLine> - * @return Timesheet - */ + * timesheetLines + * @param timesheetLines List<TimesheetLine> + * @return Timesheet + **/ public Timesheet timesheetLines(List timesheetLines) { this.timesheetLines = timesheetLines; return this; @@ -344,10 +325,9 @@ public Timesheet timesheetLines(List timesheetLines) { /** * timesheetLines - * - * @param timesheetLinesItem TimesheetLine + * @param timesheetLinesItem TimesheetLine * @return Timesheet - */ + **/ public Timesheet addTimesheetLinesItem(TimesheetLine timesheetLinesItem) { if (this.timesheetLines == null) { this.timesheetLines = new ArrayList(); @@ -356,66 +336,60 @@ public Timesheet addTimesheetLinesItem(TimesheetLine timesheetLinesItem) { return this; } - /** + /** * Get timesheetLines - * * @return timesheetLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetLines - * * @return timesheetLines List - */ + **/ public List getTimesheetLines() { return timesheetLines; } - /** - * timesheetLines - * - * @param timesheetLines List<TimesheetLine> - */ + /** + * timesheetLines + * @param timesheetLines List<TimesheetLine> + **/ + public void setTimesheetLines(List timesheetLines) { this.timesheetLines = timesheetLines; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - * @return Timesheet - */ + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + * @return Timesheet + **/ public Timesheet validationErrors(List validationErrors) { this.validationErrors = validationErrors; return this; @@ -423,10 +397,9 @@ public Timesheet validationErrors(List validationErrors) { /** * Displays array of validation error messages from the API - * - * @param validationErrorsItem ValidationError + * @param validationErrorsItem ValidationError * @return Timesheet - */ + **/ public Timesheet addValidationErrorsItem(ValidationError validationErrorsItem) { if (this.validationErrors == null) { this.validationErrors = new ArrayList(); @@ -435,30 +408,29 @@ public Timesheet addValidationErrorsItem(ValidationError validationErrorsItem) { return this; } - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors - */ + **/ @ApiModelProperty(value = "Displays array of validation error messages from the API") - /** + /** * Displays array of validation error messages from the API - * * @return validationErrors List - */ + **/ public List getValidationErrors() { return validationErrors; } - /** - * Displays array of validation error messages from the API - * - * @param validationErrors List<ValidationError> - */ + /** + * Displays array of validation error messages from the API + * @param validationErrors List<ValidationError> + **/ + public void setValidationErrors(List validationErrors) { this.validationErrors = validationErrors; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -468,31 +440,23 @@ public boolean equals(java.lang.Object o) { return false; } Timesheet timesheet = (Timesheet) o; - return Objects.equals(this.employeeID, timesheet.employeeID) - && Objects.equals(this.startDate, timesheet.startDate) - && Objects.equals(this.endDate, timesheet.endDate) - && Objects.equals(this.status, timesheet.status) - && Objects.equals(this.hours, timesheet.hours) - && Objects.equals(this.timesheetID, timesheet.timesheetID) - && Objects.equals(this.timesheetLines, timesheet.timesheetLines) - && Objects.equals(this.updatedDateUTC, timesheet.updatedDateUTC) - && Objects.equals(this.validationErrors, timesheet.validationErrors); + return Objects.equals(this.employeeID, timesheet.employeeID) && + Objects.equals(this.startDate, timesheet.startDate) && + Objects.equals(this.endDate, timesheet.endDate) && + Objects.equals(this.status, timesheet.status) && + Objects.equals(this.hours, timesheet.hours) && + Objects.equals(this.timesheetID, timesheet.timesheetID) && + Objects.equals(this.timesheetLines, timesheet.timesheetLines) && + Objects.equals(this.updatedDateUTC, timesheet.updatedDateUTC) && + Objects.equals(this.validationErrors, timesheet.validationErrors); } @Override public int hashCode() { - return Objects.hash( - employeeID, - startDate, - endDate, - status, - hours, - timesheetID, - timesheetLines, - updatedDateUTC, - validationErrors); + return Objects.hash(employeeID, startDate, endDate, status, hours, timesheetID, timesheetLines, updatedDateUTC, validationErrors); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -511,7 +475,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -519,4 +484,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/TimesheetLine.java b/src/main/java/com/xero/models/payrollau/TimesheetLine.java index c8b16be55..e110ef32c 100644 --- a/src/main/java/com/xero/models/payrollau/TimesheetLine.java +++ b/src/main/java/com/xero/models/payrollau/TimesheetLine.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetLine + */ -/** TimesheetLine */ public class TimesheetLine { StringUtil util = new StringUtil(); @@ -37,91 +52,74 @@ public class TimesheetLine { @JsonProperty("UpdatedDateUTC") private String updatedDateUTC; /** - * The Xero identifier for an Earnings Rate - * - * @param earningsRateID UUID - * @return TimesheetLine - */ + * The Xero identifier for an Earnings Rate + * @param earningsRateID UUID + * @return TimesheetLine + **/ public TimesheetLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * The Xero identifier for an Earnings Rate - * * @return earningsRateID - */ - @ApiModelProperty( - example = "966c5c77-2ef0-4320-b6a9-6c27b080ecc5", - value = "The Xero identifier for an Earnings Rate") - /** + **/ + @ApiModelProperty(example = "966c5c77-2ef0-4320-b6a9-6c27b080ecc5", value = "The Xero identifier for an Earnings Rate") + /** * The Xero identifier for an Earnings Rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * The Xero identifier for an Earnings Rate - * - * @param earningsRateID UUID - */ + /** + * The Xero identifier for an Earnings Rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the - * TrackingCategory selected as TimesheetCategories under Payroll Settings. - * - * @param trackingItemID UUID - * @return TimesheetLine - */ + * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. + * @param trackingItemID UUID + * @return TimesheetLine + **/ public TimesheetLine trackingItemID(UUID trackingItemID) { this.trackingItemID = trackingItemID; return this; } - /** - * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the - * TrackingCategory selected as TimesheetCategories under Payroll Settings. - * + /** + * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. * @return trackingItemID - */ - @ApiModelProperty( - example = "ae777a87-5ef3-4fa0-a4f0-d10e1f13073a", - value = - "The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the" - + " TrackingCategory selected as TimesheetCategories under Payroll Settings.") - /** - * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the - * TrackingCategory selected as TimesheetCategories under Payroll Settings. - * + **/ + @ApiModelProperty(example = "ae777a87-5ef3-4fa0-a4f0-d10e1f13073a", value = "The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings.") + /** + * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. * @return trackingItemID UUID - */ + **/ public UUID getTrackingItemID() { return trackingItemID; } - /** - * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the - * TrackingCategory selected as TimesheetCategories under Payroll Settings. - * - * @param trackingItemID UUID - */ + /** + * The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. + * @param trackingItemID UUID + **/ + public void setTrackingItemID(UUID trackingItemID) { this.trackingItemID = trackingItemID; } /** - * The number of units on a timesheet line - * - * @param numberOfUnits List<> - * @return TimesheetLine - */ + * The number of units on a timesheet line + * @param numberOfUnits List<> + * @return TimesheetLine + **/ public TimesheetLine numberOfUnits(List numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; @@ -129,10 +127,9 @@ public TimesheetLine numberOfUnits(List numberOfUnits) { /** * The number of units on a timesheet line - * - * @param numberOfUnitsItem Double + * @param numberOfUnitsItem Double * @return TimesheetLine - */ + **/ public TimesheetLine addNumberOfUnitsItem(Double numberOfUnitsItem) { if (this.numberOfUnits == null) { this.numberOfUnits = new ArrayList(); @@ -141,60 +138,56 @@ public TimesheetLine addNumberOfUnitsItem(Double numberOfUnitsItem) { return this; } - /** + /** * The number of units on a timesheet line - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "The number of units on a timesheet line") - /** + /** * The number of units on a timesheet line - * * @return numberOfUnits List - */ + **/ public List getNumberOfUnits() { return numberOfUnits; } - /** - * The number of units on a timesheet line - * - * @param numberOfUnits List<> - */ + /** + * The number of units on a timesheet line + * @param numberOfUnits List<> + **/ + public void setNumberOfUnits(List numberOfUnits) { this.numberOfUnits = numberOfUnits; } - /** + /** * Last modified timestamp - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") - /** + /** * Last modified timestamp - * * @return updatedDateUTC String - */ + **/ public String getUpdatedDateUTC() { return updatedDateUTC; } - /** + /** * Last modified timestamp - * * @return OffsetDateTime - */ + **/ public OffsetDateTime getUpdatedDateUTCAsDate() { if (this.updatedDateUTC != null) { try { return util.convertStringToOffsetDateTime(this.updatedDateUTC); } catch (IOException e) { e.printStackTrace(); - } + } } - return null; + return null; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -204,10 +197,10 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetLine timesheetLine = (TimesheetLine) o; - return Objects.equals(this.earningsRateID, timesheetLine.earningsRateID) - && Objects.equals(this.trackingItemID, timesheetLine.trackingItemID) - && Objects.equals(this.numberOfUnits, timesheetLine.numberOfUnits) - && Objects.equals(this.updatedDateUTC, timesheetLine.updatedDateUTC); + return Objects.equals(this.earningsRateID, timesheetLine.earningsRateID) && + Objects.equals(this.trackingItemID, timesheetLine.trackingItemID) && + Objects.equals(this.numberOfUnits, timesheetLine.numberOfUnits) && + Objects.equals(this.updatedDateUTC, timesheetLine.updatedDateUTC); } @Override @@ -215,6 +208,7 @@ public int hashCode() { return Objects.hash(earningsRateID, trackingItemID, numberOfUnits, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -228,7 +222,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -236,4 +231,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/TimesheetObject.java b/src/main/java/com/xero/models/payrollau/TimesheetObject.java index e531a4736..93100b7b6 100644 --- a/src/main/java/com/xero/models/payrollau/TimesheetObject.java +++ b/src/main/java/com/xero/models/payrollau/TimesheetObject.java @@ -9,54 +9,70 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.Timesheet; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetObject + */ -/** TimesheetObject */ public class TimesheetObject { StringUtil util = new StringUtil(); @JsonProperty("Timesheet") private Timesheet timesheet; /** - * timesheet - * - * @param timesheet Timesheet - * @return TimesheetObject - */ + * timesheet + * @param timesheet Timesheet + * @return TimesheetObject + **/ public TimesheetObject timesheet(Timesheet timesheet) { this.timesheet = timesheet; return this; } - /** + /** * Get timesheet - * * @return timesheet - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheet - * * @return timesheet Timesheet - */ + **/ public Timesheet getTimesheet() { return timesheet; } - /** - * timesheet - * - * @param timesheet Timesheet - */ + /** + * timesheet + * @param timesheet Timesheet + **/ + public void setTimesheet(Timesheet timesheet) { this.timesheet = timesheet; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +90,7 @@ public int hashCode() { return Objects.hash(timesheet); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +101,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +110,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/TimesheetStatus.java b/src/main/java/com/xero/models/payrollau/TimesheetStatus.java index 565a93647..1c6d4bb6a 100644 --- a/src/main/java/com/xero/models/payrollau/TimesheetStatus.java +++ b/src/main/java/com/xero/models/payrollau/TimesheetStatus.java @@ -9,28 +9,49 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets TimesheetStatus */ +/** + * Gets or Sets TimesheetStatus + */ public enum TimesheetStatus { - - /** DRAFT */ + + /** + * DRAFT + */ DRAFT("DRAFT"), - - /** PROCESSED */ + + /** + * PROCESSED + */ PROCESSED("PROCESSED"), - - /** APPROVED */ + + /** + * APPROVED + */ APPROVED("APPROVED"), - - /** REJECTED */ + + /** + * REJECTED + */ REJECTED("REJECTED"), - - /** REQUESTED */ + + /** + * REQUESTED + */ REQUESTED("REQUESTED"); private String value; @@ -39,26 +60,24 @@ public enum TimesheetStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static TimesheetStatus fromValue(String value) { @@ -70,3 +89,4 @@ public static TimesheetStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollau/Timesheets.java b/src/main/java/com/xero/models/payrollau/Timesheets.java index 4ec27e73d..d0d19a56f 100644 --- a/src/main/java/com/xero/models/payrollau/Timesheets.java +++ b/src/main/java/com/xero/models/payrollau/Timesheets.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollau.Timesheet; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Timesheets + */ -/** Timesheets */ public class Timesheets { StringUtil util = new StringUtil(); @JsonProperty("Timesheets") private List timesheets = new ArrayList(); /** - * timesheets - * - * @param timesheets List<Timesheet> - * @return Timesheets - */ + * timesheets + * @param timesheets List<Timesheet> + * @return Timesheets + **/ public Timesheets timesheets(List timesheets) { this.timesheets = timesheets; return this; @@ -37,10 +54,9 @@ public Timesheets timesheets(List timesheets) { /** * timesheets - * - * @param timesheetsItem Timesheet + * @param timesheetsItem Timesheet * @return Timesheets - */ + **/ public Timesheets addTimesheetsItem(Timesheet timesheetsItem) { if (this.timesheets == null) { this.timesheets = new ArrayList(); @@ -49,30 +65,29 @@ public Timesheets addTimesheetsItem(Timesheet timesheetsItem) { return this; } - /** + /** * Get timesheets - * * @return timesheets - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheets - * * @return timesheets List - */ + **/ public List getTimesheets() { return timesheets; } - /** - * timesheets - * - * @param timesheets List<Timesheet> - */ + /** + * timesheets + * @param timesheets List<Timesheet> + **/ + public void setTimesheets(List timesheets) { this.timesheets = timesheets; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(timesheets); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/ValidationError.java b/src/main/java/com/xero/models/payrollau/ValidationError.java index 4b0ea8baf..db7e09cb6 100644 --- a/src/main/java/com/xero/models/payrollau/ValidationError.java +++ b/src/main/java/com/xero/models/payrollau/ValidationError.java @@ -9,54 +9,69 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ValidationError + */ -/** ValidationError */ public class ValidationError { StringUtil util = new StringUtil(); @JsonProperty("Message") private String message; /** - * Validation error message - * - * @param message String - * @return ValidationError - */ + * Validation error message + * @param message String + * @return ValidationError + **/ public ValidationError message(String message) { this.message = message; return this; } - /** + /** * Validation error message - * * @return message - */ + **/ @ApiModelProperty(value = "Validation error message") - /** + /** * Validation error message - * * @return message String - */ + **/ public String getMessage() { return message; } - /** - * Validation error message - * - * @param message String - */ + /** + * Validation error message + * @param message String + **/ + public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +89,7 @@ public int hashCode() { return Objects.hash(message); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +100,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +109,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollau/WorkCondition.java b/src/main/java/com/xero/models/payrollau/WorkCondition.java index bf1c481ea..6943a0a97 100644 --- a/src/main/java/com/xero/models/payrollau/WorkCondition.java +++ b/src/main/java/com/xero/models/payrollau/WorkCondition.java @@ -9,22 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrollau; +package com.xero.models.payrollau; +import java.util.Objects; +import java.util.Arrays; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets WorkCondition */ +/** + * Gets or Sets WorkCondition + */ public enum WorkCondition { - - /** PROMOTIONAL */ + + /** + * PROMOTIONAL + */ PROMOTIONAL("PROMOTIONAL"), - - /** THREELESSPERFORMANCESPERWEEK */ + + /** + * THREELESSPERFORMANCESPERWEEK + */ THREELESSPERFORMANCESPERWEEK("THREELESSPERFORMANCESPERWEEK"), - - /** NONE */ + + /** + * NONE + */ NONE("NONE"); private String value; @@ -33,26 +50,24 @@ public enum WorkCondition { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static WorkCondition fromValue(String value) { @@ -64,3 +79,4 @@ public static WorkCondition fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollnz/Account.java b/src/main/java/com/xero/models/payrollnz/Account.java index 6f630eedd..ba1e9644c 100644 --- a/src/main/java/com/xero/models/payrollnz/Account.java +++ b/src/main/java/com/xero/models/payrollnz/Account.java @@ -9,34 +9,59 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Account + */ -/** Account */ public class Account { StringUtil util = new StringUtil(); @JsonProperty("accountID") private UUID accountID; - /** The assigned AccountType */ + /** + * The assigned AccountType + */ public enum TypeEnum { - /** PAYELIABILITY */ + /** + * PAYELIABILITY + */ PAYELIABILITY("PAYELIABILITY"), - - /** WAGESPAYABLE */ + + /** + * WAGESPAYABLE + */ WAGESPAYABLE("WAGESPAYABLE"), - - /** WAGESEXPENSE */ + + /** + * WAGESEXPENSE + */ WAGESEXPENSE("WAGESEXPENSE"), - - /** BANK */ + + /** + * BANK + */ BANK("BANK"); private String value; @@ -45,31 +70,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -81,6 +100,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("type") private TypeEnum type; @@ -90,145 +110,134 @@ public static TypeEnum fromValue(String value) { @JsonProperty("name") private String name; /** - * The Xero identifier for Settings. - * - * @param accountID UUID - * @return Account - */ + * The Xero identifier for Settings. + * @param accountID UUID + * @return Account + **/ public Account accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * The Xero identifier for Settings. - * * @return accountID - */ + **/ @ApiModelProperty(value = "The Xero identifier for Settings.") - /** + /** * The Xero identifier for Settings. - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * The Xero identifier for Settings. - * - * @param accountID UUID - */ + /** + * The Xero identifier for Settings. + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * The assigned AccountType - * - * @param type TypeEnum - * @return Account - */ + * The assigned AccountType + * @param type TypeEnum + * @return Account + **/ public Account type(TypeEnum type) { this.type = type; return this; } - /** + /** * The assigned AccountType - * * @return type - */ + **/ @ApiModelProperty(value = "The assigned AccountType") - /** + /** * The assigned AccountType - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * The assigned AccountType - * - * @param type TypeEnum - */ + /** + * The assigned AccountType + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * A unique 3 digit number for each Account - * - * @param code String - * @return Account - */ + * A unique 3 digit number for each Account + * @param code String + * @return Account + **/ public Account code(String code) { this.code = code; return this; } - /** + /** * A unique 3 digit number for each Account - * * @return code - */ + **/ @ApiModelProperty(value = "A unique 3 digit number for each Account") - /** + /** * A unique 3 digit number for each Account - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * A unique 3 digit number for each Account - * - * @param code String - */ + /** + * A unique 3 digit number for each Account + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Name of the Account. - * - * @param name String - * @return Account - */ + * Name of the Account. + * @param name String + * @return Account + **/ public Account name(String name) { this.name = name; return this; } - /** + /** * Name of the Account. - * * @return name - */ + **/ @ApiModelProperty(value = "Name of the Account.") - /** + /** * Name of the Account. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the Account. - * - * @param name String - */ + /** + * Name of the Account. + * @param name String + **/ + public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -238,10 +247,10 @@ public boolean equals(java.lang.Object o) { return false; } Account account = (Account) o; - return Objects.equals(this.accountID, account.accountID) - && Objects.equals(this.type, account.type) - && Objects.equals(this.code, account.code) - && Objects.equals(this.name, account.name); + return Objects.equals(this.accountID, account.accountID) && + Objects.equals(this.type, account.type) && + Objects.equals(this.code, account.code) && + Objects.equals(this.name, account.name); } @Override @@ -249,6 +258,7 @@ public int hashCode() { return Objects.hash(accountID, type, code, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,7 +272,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -270,4 +281,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Accounts.java b/src/main/java/com/xero/models/payrollnz/Accounts.java index ed78b33f7..56a490fd1 100644 --- a/src/main/java/com/xero/models/payrollnz/Accounts.java +++ b/src/main/java/com/xero/models/payrollnz/Accounts.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Account; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Accounts + */ -/** Accounts */ public class Accounts { StringUtil util = new StringUtil(); @JsonProperty("accounts") private List accounts = new ArrayList(); /** - * accounts - * - * @param accounts List<Account> - * @return Accounts - */ + * accounts + * @param accounts List<Account> + * @return Accounts + **/ public Accounts accounts(List accounts) { this.accounts = accounts; return this; @@ -37,10 +54,9 @@ public Accounts accounts(List accounts) { /** * accounts - * - * @param accountsItem Account + * @param accountsItem Account * @return Accounts - */ + **/ public Accounts addAccountsItem(Account accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -49,30 +65,29 @@ public Accounts addAccountsItem(Account accountsItem) { return this; } - /** + /** * Get accounts - * * @return accounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * accounts - * * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * accounts - * - * @param accounts List<Account> - */ + /** + * accounts + * @param accounts List<Account> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(accounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Address.java b/src/main/java/com/xero/models/payrollnz/Address.java index 92140af77..50eb93017 100644 --- a/src/main/java/com/xero/models/payrollnz/Address.java +++ b/src/main/java/com/xero/models/payrollnz/Address.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Address + */ -/** Address */ public class Address { StringUtil util = new StringUtil(); @@ -38,221 +55,198 @@ public class Address { @JsonProperty("countryName") private String countryName; /** - * Address line 1 for employee home address - * - * @param addressLine1 String - * @return Address - */ + * Address line 1 for employee home address + * @param addressLine1 String + * @return Address + **/ public Address addressLine1(String addressLine1) { this.addressLine1 = addressLine1; return this; } - /** + /** * Address line 1 for employee home address - * * @return addressLine1 - */ - @ApiModelProperty( - example = "19 Taranaki Street", - required = true, - value = "Address line 1 for employee home address") - /** + **/ + @ApiModelProperty(example = "19 Taranaki Street", required = true, value = "Address line 1 for employee home address") + /** * Address line 1 for employee home address - * * @return addressLine1 String - */ + **/ public String getAddressLine1() { return addressLine1; } - /** - * Address line 1 for employee home address - * - * @param addressLine1 String - */ + /** + * Address line 1 for employee home address + * @param addressLine1 String + **/ + public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } /** - * Address line 2 for employee home address - * - * @param addressLine2 String - * @return Address - */ + * Address line 2 for employee home address + * @param addressLine2 String + * @return Address + **/ public Address addressLine2(String addressLine2) { this.addressLine2 = addressLine2; return this; } - /** + /** * Address line 2 for employee home address - * * @return addressLine2 - */ + **/ @ApiModelProperty(example = "Apt 4", value = "Address line 2 for employee home address") - /** + /** * Address line 2 for employee home address - * * @return addressLine2 String - */ + **/ public String getAddressLine2() { return addressLine2; } - /** - * Address line 2 for employee home address - * - * @param addressLine2 String - */ + /** + * Address line 2 for employee home address + * @param addressLine2 String + **/ + public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } /** - * Suburb for employee home address - * - * @param city String - * @return Address - */ + * Suburb for employee home address + * @param city String + * @return Address + **/ public Address city(String city) { this.city = city; return this; } - /** + /** * Suburb for employee home address - * * @return city - */ - @ApiModelProperty( - example = "Wellington", - required = true, - value = "Suburb for employee home address") - /** + **/ + @ApiModelProperty(example = "Wellington", required = true, value = "Suburb for employee home address") + /** * Suburb for employee home address - * * @return city String - */ + **/ public String getCity() { return city; } - /** - * Suburb for employee home address - * - * @param city String - */ + /** + * Suburb for employee home address + * @param city String + **/ + public void setCity(String city) { this.city = city; } /** - * Suburb for employee home address - * - * @param suburb String - * @return Address - */ + * Suburb for employee home address + * @param suburb String + * @return Address + **/ public Address suburb(String suburb) { this.suburb = suburb; return this; } - /** + /** * Suburb for employee home address - * * @return suburb - */ + **/ @ApiModelProperty(example = "Te Aro", value = "Suburb for employee home address") - /** + /** * Suburb for employee home address - * * @return suburb String - */ + **/ public String getSuburb() { return suburb; } - /** - * Suburb for employee home address - * - * @param suburb String - */ + /** + * Suburb for employee home address + * @param suburb String + **/ + public void setSuburb(String suburb) { this.suburb = suburb; } /** - * PostCode for employee home address - * - * @param postCode String - * @return Address - */ + * PostCode for employee home address + * @param postCode String + * @return Address + **/ public Address postCode(String postCode) { this.postCode = postCode; return this; } - /** + /** * PostCode for employee home address - * * @return postCode - */ + **/ @ApiModelProperty(example = "6011", required = true, value = "PostCode for employee home address") - /** + /** * PostCode for employee home address - * * @return postCode String - */ + **/ public String getPostCode() { return postCode; } - /** - * PostCode for employee home address - * - * @param postCode String - */ + /** + * PostCode for employee home address + * @param postCode String + **/ + public void setPostCode(String postCode) { this.postCode = postCode; } /** - * Country of HomeAddress - * - * @param countryName String - * @return Address - */ + * Country of HomeAddress + * @param countryName String + * @return Address + **/ public Address countryName(String countryName) { this.countryName = countryName; return this; } - /** + /** * Country of HomeAddress - * * @return countryName - */ + **/ @ApiModelProperty(example = "NEW ZEALAND", value = "Country of HomeAddress") - /** + /** * Country of HomeAddress - * * @return countryName String - */ + **/ public String getCountryName() { return countryName; } - /** - * Country of HomeAddress - * - * @param countryName String - */ + /** + * Country of HomeAddress + * @param countryName String + **/ + public void setCountryName(String countryName) { this.countryName = countryName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,12 +256,12 @@ public boolean equals(java.lang.Object o) { return false; } Address address = (Address) o; - return Objects.equals(this.addressLine1, address.addressLine1) - && Objects.equals(this.addressLine2, address.addressLine2) - && Objects.equals(this.city, address.city) - && Objects.equals(this.suburb, address.suburb) - && Objects.equals(this.postCode, address.postCode) - && Objects.equals(this.countryName, address.countryName); + return Objects.equals(this.addressLine1, address.addressLine1) && + Objects.equals(this.addressLine2, address.addressLine2) && + Objects.equals(this.city, address.city) && + Objects.equals(this.suburb, address.suburb) && + Objects.equals(this.postCode, address.postCode) && + Objects.equals(this.countryName, address.countryName); } @Override @@ -275,6 +269,7 @@ public int hashCode() { return Objects.hash(addressLine1, addressLine2, city, suburb, postCode, countryName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -290,7 +285,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -298,4 +294,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/BankAccount.java b/src/main/java/com/xero/models/payrollnz/BankAccount.java index c6efbd8a6..adb796a6b 100644 --- a/src/main/java/com/xero/models/payrollnz/BankAccount.java +++ b/src/main/java/com/xero/models/payrollnz/BankAccount.java @@ -9,16 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankAccount + */ -/** BankAccount */ public class BankAccount { StringUtil util = new StringUtil(); @@ -42,12 +57,18 @@ public class BankAccount { @JsonProperty("reference") private String reference; - /** Calculation type for the transaction can be 'Fixed Amount' or 'Balance' */ + /** + * Calculation type for the transaction can be 'Fixed Amount' or 'Balance' + */ public enum CalculationTypeEnum { - /** FIXEDAMOUNT */ + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FixedAmount"), - - /** BALANCE */ + + /** + * BALANCE + */ BALANCE("Balance"); private String value; @@ -56,31 +77,25 @@ public enum CalculationTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CalculationTypeEnum fromValue(String value) { for (CalculationTypeEnum b : CalculationTypeEnum.values()) { @@ -92,290 +107,266 @@ public static CalculationTypeEnum fromValue(String value) { } } + @JsonProperty("calculationType") private CalculationTypeEnum calculationType; /** - * Bank account name (max length = 32) - * - * @param accountName String - * @return BankAccount - */ + * Bank account name (max length = 32) + * @param accountName String + * @return BankAccount + **/ public BankAccount accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * Bank account name (max length = 32) - * * @return accountName - */ + **/ @ApiModelProperty(required = true, value = "Bank account name (max length = 32)") - /** + /** * Bank account name (max length = 32) - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * Bank account name (max length = 32) - * - * @param accountName String - */ + /** + * Bank account name (max length = 32) + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * Bank account number (digits only; max length = 8) - * - * @param accountNumber String - * @return BankAccount - */ + * Bank account number (digits only; max length = 8) + * @param accountNumber String + * @return BankAccount + **/ public BankAccount accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** + /** * Bank account number (digits only; max length = 8) - * * @return accountNumber - */ + **/ @ApiModelProperty(required = true, value = "Bank account number (digits only; max length = 8)") - /** + /** * Bank account number (digits only; max length = 8) - * * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * Bank account number (digits only; max length = 8) - * - * @param accountNumber String - */ + /** + * Bank account number (digits only; max length = 8) + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * Bank account sort code (6 digits) - * - * @param sortCode String - * @return BankAccount - */ + * Bank account sort code (6 digits) + * @param sortCode String + * @return BankAccount + **/ public BankAccount sortCode(String sortCode) { this.sortCode = sortCode; return this; } - /** + /** * Bank account sort code (6 digits) - * * @return sortCode - */ + **/ @ApiModelProperty(required = true, value = "Bank account sort code (6 digits)") - /** + /** * Bank account sort code (6 digits) - * * @return sortCode String - */ + **/ public String getSortCode() { return sortCode; } - /** - * Bank account sort code (6 digits) - * - * @param sortCode String - */ + /** + * Bank account sort code (6 digits) + * @param sortCode String + **/ + public void setSortCode(String sortCode) { this.sortCode = sortCode; } /** - * Particulars that appear on the statement. - * - * @param particulars String - * @return BankAccount - */ + * Particulars that appear on the statement. + * @param particulars String + * @return BankAccount + **/ public BankAccount particulars(String particulars) { this.particulars = particulars; return this; } - /** + /** * Particulars that appear on the statement. - * * @return particulars - */ + **/ @ApiModelProperty(value = "Particulars that appear on the statement.") - /** + /** * Particulars that appear on the statement. - * * @return particulars String - */ + **/ public String getParticulars() { return particulars; } - /** - * Particulars that appear on the statement. - * - * @param particulars String - */ + /** + * Particulars that appear on the statement. + * @param particulars String + **/ + public void setParticulars(String particulars) { this.particulars = particulars; } /** - * Code of a transaction that appear on the statement. - * - * @param code String - * @return BankAccount - */ + * Code of a transaction that appear on the statement. + * @param code String + * @return BankAccount + **/ public BankAccount code(String code) { this.code = code; return this; } - /** + /** * Code of a transaction that appear on the statement. - * * @return code - */ + **/ @ApiModelProperty(value = "Code of a transaction that appear on the statement.") - /** + /** * Code of a transaction that appear on the statement. - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * Code of a transaction that appear on the statement. - * - * @param code String - */ + /** + * Code of a transaction that appear on the statement. + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Dollar amount of a transaction. - * - * @param dollarAmount Double - * @return BankAccount - */ + * Dollar amount of a transaction. + * @param dollarAmount Double + * @return BankAccount + **/ public BankAccount dollarAmount(Double dollarAmount) { this.dollarAmount = dollarAmount; return this; } - /** + /** * Dollar amount of a transaction. - * * @return dollarAmount - */ + **/ @ApiModelProperty(value = "Dollar amount of a transaction.") - /** + /** * Dollar amount of a transaction. - * * @return dollarAmount Double - */ + **/ public Double getDollarAmount() { return dollarAmount; } - /** - * Dollar amount of a transaction. - * - * @param dollarAmount Double - */ + /** + * Dollar amount of a transaction. + * @param dollarAmount Double + **/ + public void setDollarAmount(Double dollarAmount) { this.dollarAmount = dollarAmount; } /** - * Statement Text/reference for a transaction that appear on the statement. - * - * @param reference String - * @return BankAccount - */ + * Statement Text/reference for a transaction that appear on the statement. + * @param reference String + * @return BankAccount + **/ public BankAccount reference(String reference) { this.reference = reference; return this; } - /** + /** * Statement Text/reference for a transaction that appear on the statement. - * * @return reference - */ - @ApiModelProperty( - value = "Statement Text/reference for a transaction that appear on the statement.") - /** + **/ + @ApiModelProperty(value = "Statement Text/reference for a transaction that appear on the statement.") + /** * Statement Text/reference for a transaction that appear on the statement. - * * @return reference String - */ + **/ public String getReference() { return reference; } - /** - * Statement Text/reference for a transaction that appear on the statement. - * - * @param reference String - */ + /** + * Statement Text/reference for a transaction that appear on the statement. + * @param reference String + **/ + public void setReference(String reference) { this.reference = reference; } /** - * Calculation type for the transaction can be 'Fixed Amount' or 'Balance' - * - * @param calculationType CalculationTypeEnum - * @return BankAccount - */ + * Calculation type for the transaction can be 'Fixed Amount' or 'Balance' + * @param calculationType CalculationTypeEnum + * @return BankAccount + **/ public BankAccount calculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; return this; } - /** + /** * Calculation type for the transaction can be 'Fixed Amount' or 'Balance' - * * @return calculationType - */ - @ApiModelProperty( - value = "Calculation type for the transaction can be 'Fixed Amount' or 'Balance'") - /** + **/ + @ApiModelProperty(value = "Calculation type for the transaction can be 'Fixed Amount' or 'Balance'") + /** * Calculation type for the transaction can be 'Fixed Amount' or 'Balance' - * * @return calculationType CalculationTypeEnum - */ + **/ public CalculationTypeEnum getCalculationType() { return calculationType; } - /** - * Calculation type for the transaction can be 'Fixed Amount' or 'Balance' - * - * @param calculationType CalculationTypeEnum - */ + /** + * Calculation type for the transaction can be 'Fixed Amount' or 'Balance' + * @param calculationType CalculationTypeEnum + **/ + public void setCalculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -385,29 +376,22 @@ public boolean equals(java.lang.Object o) { return false; } BankAccount bankAccount = (BankAccount) o; - return Objects.equals(this.accountName, bankAccount.accountName) - && Objects.equals(this.accountNumber, bankAccount.accountNumber) - && Objects.equals(this.sortCode, bankAccount.sortCode) - && Objects.equals(this.particulars, bankAccount.particulars) - && Objects.equals(this.code, bankAccount.code) - && Objects.equals(this.dollarAmount, bankAccount.dollarAmount) - && Objects.equals(this.reference, bankAccount.reference) - && Objects.equals(this.calculationType, bankAccount.calculationType); + return Objects.equals(this.accountName, bankAccount.accountName) && + Objects.equals(this.accountNumber, bankAccount.accountNumber) && + Objects.equals(this.sortCode, bankAccount.sortCode) && + Objects.equals(this.particulars, bankAccount.particulars) && + Objects.equals(this.code, bankAccount.code) && + Objects.equals(this.dollarAmount, bankAccount.dollarAmount) && + Objects.equals(this.reference, bankAccount.reference) && + Objects.equals(this.calculationType, bankAccount.calculationType); } @Override public int hashCode() { - return Objects.hash( - accountName, - accountNumber, - sortCode, - particulars, - code, - dollarAmount, - reference, - calculationType); + return Objects.hash(accountName, accountNumber, sortCode, particulars, code, dollarAmount, reference, calculationType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -425,7 +409,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -433,4 +418,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Benefit.java b/src/main/java/com/xero/models/payrollnz/Benefit.java index 14d328125..271f8f0a6 100644 --- a/src/main/java/com/xero/models/payrollnz/Benefit.java +++ b/src/main/java/com/xero/models/payrollnz/Benefit.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Benefit + */ -/** Benefit */ public class Benefit { StringUtil util = new StringUtil(); @@ -28,15 +43,23 @@ public class Benefit { @JsonProperty("name") private String name; - /** Superannuations Category type */ + /** + * Superannuations Category type + */ public enum CategoryEnum { - /** KIWISAVER */ + /** + * KIWISAVER + */ KIWISAVER("KiwiSaver"), - - /** COMPLYINGFUND */ + + /** + * COMPLYINGFUND + */ COMPLYINGFUND("ComplyingFund"), - - /** OTHER */ + + /** + * OTHER + */ OTHER("Other"); private String value; @@ -45,31 +68,25 @@ public enum CategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CategoryEnum fromValue(String value) { for (CategoryEnum b : CategoryEnum.values()) { @@ -81,6 +98,7 @@ public static CategoryEnum fromValue(String value) { } } + @JsonProperty("category") private CategoryEnum category; @@ -89,12 +107,18 @@ public static CategoryEnum fromValue(String value) { @JsonProperty("expenseAccountId") private UUID expenseAccountId; - /** Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings */ + /** + * Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings + */ public enum CalculationTypeNZEnum { - /** FIXEDAMOUNT */ + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FixedAmount"), - - /** PERCENTAGEOFTAXABLEEARNINGS */ + + /** + * PERCENTAGEOFTAXABLEEARNINGS + */ PERCENTAGEOFTAXABLEEARNINGS("PercentageOfTaxableEarnings"); private String value; @@ -103,31 +127,25 @@ public enum CalculationTypeNZEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CalculationTypeNZEnum fromValue(String value) { for (CalculationTypeNZEnum b : CalculationTypeNZEnum.values()) { @@ -139,6 +157,7 @@ public static CalculationTypeNZEnum fromValue(String value) { } } + @JsonProperty("calculationTypeNZ") private CalculationTypeNZEnum calculationTypeNZ; @@ -154,358 +173,326 @@ public static CalculationTypeNZEnum fromValue(String value) { @JsonProperty("currentRecord") private Boolean currentRecord; /** - * The Xero identifier for superannuation - * - * @param id UUID - * @return Benefit - */ + * The Xero identifier for superannuation + * @param id UUID + * @return Benefit + **/ public Benefit id(UUID id) { this.id = id; return this; } - /** + /** * The Xero identifier for superannuation - * * @return id - */ + **/ @ApiModelProperty(value = "The Xero identifier for superannuation") - /** + /** * The Xero identifier for superannuation - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The Xero identifier for superannuation - * - * @param id UUID - */ + /** + * The Xero identifier for superannuation + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Name of the superannuations - * - * @param name String - * @return Benefit - */ + * Name of the superannuations + * @param name String + * @return Benefit + **/ public Benefit name(String name) { this.name = name; return this; } - /** + /** * Name of the superannuations - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the superannuations") - /** + /** * Name of the superannuations - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the superannuations - * - * @param name String - */ + /** + * Name of the superannuations + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Superannuations Category type - * - * @param category CategoryEnum - * @return Benefit - */ + * Superannuations Category type + * @param category CategoryEnum + * @return Benefit + **/ public Benefit category(CategoryEnum category) { this.category = category; return this; } - /** + /** * Superannuations Category type - * * @return category - */ + **/ @ApiModelProperty(required = true, value = "Superannuations Category type") - /** + /** * Superannuations Category type - * * @return category CategoryEnum - */ + **/ public CategoryEnum getCategory() { return category; } - /** - * Superannuations Category type - * - * @param category CategoryEnum - */ + /** + * Superannuations Category type + * @param category CategoryEnum + **/ + public void setCategory(CategoryEnum category) { this.category = category; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return Benefit - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return Benefit + **/ public Benefit liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(required = true, value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Xero identifier for Expense Account - * - * @param expenseAccountId UUID - * @return Benefit - */ + * Xero identifier for Expense Account + * @param expenseAccountId UUID + * @return Benefit + **/ public Benefit expenseAccountId(UUID expenseAccountId) { this.expenseAccountId = expenseAccountId; return this; } - /** + /** * Xero identifier for Expense Account - * * @return expenseAccountId - */ + **/ @ApiModelProperty(required = true, value = "Xero identifier for Expense Account") - /** + /** * Xero identifier for Expense Account - * * @return expenseAccountId UUID - */ + **/ public UUID getExpenseAccountId() { return expenseAccountId; } - /** - * Xero identifier for Expense Account - * - * @param expenseAccountId UUID - */ + /** + * Xero identifier for Expense Account + * @param expenseAccountId UUID + **/ + public void setExpenseAccountId(UUID expenseAccountId) { this.expenseAccountId = expenseAccountId; } /** - * Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings - * - * @param calculationTypeNZ CalculationTypeNZEnum - * @return Benefit - */ + * Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings + * @param calculationTypeNZ CalculationTypeNZEnum + * @return Benefit + **/ public Benefit calculationTypeNZ(CalculationTypeNZEnum calculationTypeNZ) { this.calculationTypeNZ = calculationTypeNZ; return this; } - /** + /** * Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings - * * @return calculationTypeNZ - */ - @ApiModelProperty( - value = - "Calculation Type of the superannuation either FixedAmount or" - + " PercentageOfTaxableEarnings") - /** + **/ + @ApiModelProperty(value = "Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings") + /** * Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings - * * @return calculationTypeNZ CalculationTypeNZEnum - */ + **/ public CalculationTypeNZEnum getCalculationTypeNZ() { return calculationTypeNZ; } - /** - * Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings - * - * @param calculationTypeNZ CalculationTypeNZEnum - */ + /** + * Calculation Type of the superannuation either FixedAmount or PercentageOfTaxableEarnings + * @param calculationTypeNZ CalculationTypeNZEnum + **/ + public void setCalculationTypeNZ(CalculationTypeNZEnum calculationTypeNZ) { this.calculationTypeNZ = calculationTypeNZ; } /** - * Standard amount of the superannuation - * - * @param standardAmount Double - * @return Benefit - */ + * Standard amount of the superannuation + * @param standardAmount Double + * @return Benefit + **/ public Benefit standardAmount(Double standardAmount) { this.standardAmount = standardAmount; return this; } - /** + /** * Standard amount of the superannuation - * * @return standardAmount - */ + **/ @ApiModelProperty(value = "Standard amount of the superannuation") - /** + /** * Standard amount of the superannuation - * * @return standardAmount Double - */ + **/ public Double getStandardAmount() { return standardAmount; } - /** - * Standard amount of the superannuation - * - * @param standardAmount Double - */ + /** + * Standard amount of the superannuation + * @param standardAmount Double + **/ + public void setStandardAmount(Double standardAmount) { this.standardAmount = standardAmount; } /** - * Percentage of Taxable Earnings of the superannuation - * - * @param percentage Double - * @return Benefit - */ + * Percentage of Taxable Earnings of the superannuation + * @param percentage Double + * @return Benefit + **/ public Benefit percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Percentage of Taxable Earnings of the superannuation - * * @return percentage - */ + **/ @ApiModelProperty(value = "Percentage of Taxable Earnings of the superannuation") - /** + /** * Percentage of Taxable Earnings of the superannuation - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Percentage of Taxable Earnings of the superannuation - * - * @param percentage Double - */ + /** + * Percentage of Taxable Earnings of the superannuation + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } /** - * Company Maximum amount of the superannuation - * - * @param companyMax Double - * @return Benefit - */ + * Company Maximum amount of the superannuation + * @param companyMax Double + * @return Benefit + **/ public Benefit companyMax(Double companyMax) { this.companyMax = companyMax; return this; } - /** + /** * Company Maximum amount of the superannuation - * * @return companyMax - */ + **/ @ApiModelProperty(value = "Company Maximum amount of the superannuation") - /** + /** * Company Maximum amount of the superannuation - * * @return companyMax Double - */ + **/ public Double getCompanyMax() { return companyMax; } - /** - * Company Maximum amount of the superannuation - * - * @param companyMax Double - */ + /** + * Company Maximum amount of the superannuation + * @param companyMax Double + **/ + public void setCompanyMax(Double companyMax) { this.companyMax = companyMax; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return Benefit - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return Benefit + **/ public Benefit currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -515,33 +502,24 @@ public boolean equals(java.lang.Object o) { return false; } Benefit benefit = (Benefit) o; - return Objects.equals(this.id, benefit.id) - && Objects.equals(this.name, benefit.name) - && Objects.equals(this.category, benefit.category) - && Objects.equals(this.liabilityAccountId, benefit.liabilityAccountId) - && Objects.equals(this.expenseAccountId, benefit.expenseAccountId) - && Objects.equals(this.calculationTypeNZ, benefit.calculationTypeNZ) - && Objects.equals(this.standardAmount, benefit.standardAmount) - && Objects.equals(this.percentage, benefit.percentage) - && Objects.equals(this.companyMax, benefit.companyMax) - && Objects.equals(this.currentRecord, benefit.currentRecord); + return Objects.equals(this.id, benefit.id) && + Objects.equals(this.name, benefit.name) && + Objects.equals(this.category, benefit.category) && + Objects.equals(this.liabilityAccountId, benefit.liabilityAccountId) && + Objects.equals(this.expenseAccountId, benefit.expenseAccountId) && + Objects.equals(this.calculationTypeNZ, benefit.calculationTypeNZ) && + Objects.equals(this.standardAmount, benefit.standardAmount) && + Objects.equals(this.percentage, benefit.percentage) && + Objects.equals(this.companyMax, benefit.companyMax) && + Objects.equals(this.currentRecord, benefit.currentRecord); } @Override public int hashCode() { - return Objects.hash( - id, - name, - category, - liabilityAccountId, - expenseAccountId, - calculationTypeNZ, - standardAmount, - percentage, - companyMax, - currentRecord); + return Objects.hash(id, name, category, liabilityAccountId, expenseAccountId, calculationTypeNZ, standardAmount, percentage, companyMax, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -561,7 +539,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -569,4 +548,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/CalendarType.java b/src/main/java/com/xero/models/payrollnz/CalendarType.java index 716acbb31..9d1857004 100644 --- a/src/main/java/com/xero/models/payrollnz/CalendarType.java +++ b/src/main/java/com/xero/models/payrollnz/CalendarType.java @@ -9,34 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; - +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Calendar type of the pay run */ +/** + * Calendar type of the pay run + */ public enum CalendarType { - - /** WEEKLY */ + + /** + * WEEKLY + */ WEEKLY("Weekly"), - - /** FORTNIGHTLY */ + + /** + * FORTNIGHTLY + */ FORTNIGHTLY("Fortnightly"), - - /** FOURWEEKLY */ + + /** + * FOURWEEKLY + */ FOURWEEKLY("FourWeekly"), - - /** MONTHLY */ + + /** + * MONTHLY + */ MONTHLY("Monthly"), - - /** ANNUAL */ + + /** + * ANNUAL + */ ANNUAL("Annual"), - - /** QUARTERLY */ + + /** + * QUARTERLY + */ QUARTERLY("Quarterly"), - - /** TWICEMONTHLY */ + + /** + * TWICEMONTHLY + */ TWICEMONTHLY("TwiceMonthly"); private String value; @@ -45,26 +71,24 @@ public enum CalendarType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CalendarType fromValue(String value) { @@ -76,3 +100,4 @@ public static CalendarType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollnz/Deduction.java b/src/main/java/com/xero/models/payrollnz/Deduction.java index 50a8b0b23..bcd4f3093 100644 --- a/src/main/java/com/xero/models/payrollnz/Deduction.java +++ b/src/main/java/com/xero/models/payrollnz/Deduction.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Deduction + */ -/** Deduction */ public class Deduction { StringUtil util = new StringUtil(); @@ -28,18 +43,28 @@ public class Deduction { @JsonProperty("deductionName") private String deductionName; - /** Deduction Category type */ + /** + * Deduction Category type + */ public enum DeductionCategoryEnum { - /** PAYROLLGIVING */ + /** + * PAYROLLGIVING + */ PAYROLLGIVING("PayrollGiving"), - - /** KIWISAVERVOLUNTARYCONTRIBUTIONS */ + + /** + * KIWISAVERVOLUNTARYCONTRIBUTIONS + */ KIWISAVERVOLUNTARYCONTRIBUTIONS("KiwiSaverVoluntaryContributions"), - - /** SUPERANNUATION */ + + /** + * SUPERANNUATION + */ SUPERANNUATION("Superannuation"), - - /** NZOTHER */ + + /** + * NZOTHER + */ NZOTHER("NzOther"); private String value; @@ -48,31 +73,25 @@ public enum DeductionCategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static DeductionCategoryEnum fromValue(String value) { for (DeductionCategoryEnum b : DeductionCategoryEnum.values()) { @@ -84,6 +103,7 @@ public static DeductionCategoryEnum fromValue(String value) { } } + @JsonProperty("deductionCategory") private DeductionCategoryEnum deductionCategory; @@ -96,215 +116,198 @@ public static DeductionCategoryEnum fromValue(String value) { @JsonProperty("standardAmount") private Double standardAmount; /** - * The Xero identifier for Deduction - * - * @param deductionId UUID - * @return Deduction - */ + * The Xero identifier for Deduction + * @param deductionId UUID + * @return Deduction + **/ public Deduction deductionId(UUID deductionId) { this.deductionId = deductionId; return this; } - /** + /** * The Xero identifier for Deduction - * * @return deductionId - */ + **/ @ApiModelProperty(value = "The Xero identifier for Deduction") - /** + /** * The Xero identifier for Deduction - * * @return deductionId UUID - */ + **/ public UUID getDeductionId() { return deductionId; } - /** - * The Xero identifier for Deduction - * - * @param deductionId UUID - */ + /** + * The Xero identifier for Deduction + * @param deductionId UUID + **/ + public void setDeductionId(UUID deductionId) { this.deductionId = deductionId; } /** - * Name of the deduction - * - * @param deductionName String - * @return Deduction - */ + * Name of the deduction + * @param deductionName String + * @return Deduction + **/ public Deduction deductionName(String deductionName) { this.deductionName = deductionName; return this; } - /** + /** * Name of the deduction - * * @return deductionName - */ + **/ @ApiModelProperty(required = true, value = "Name of the deduction") - /** + /** * Name of the deduction - * * @return deductionName String - */ + **/ public String getDeductionName() { return deductionName; } - /** - * Name of the deduction - * - * @param deductionName String - */ + /** + * Name of the deduction + * @param deductionName String + **/ + public void setDeductionName(String deductionName) { this.deductionName = deductionName; } /** - * Deduction Category type - * - * @param deductionCategory DeductionCategoryEnum - * @return Deduction - */ + * Deduction Category type + * @param deductionCategory DeductionCategoryEnum + * @return Deduction + **/ public Deduction deductionCategory(DeductionCategoryEnum deductionCategory) { this.deductionCategory = deductionCategory; return this; } - /** + /** * Deduction Category type - * * @return deductionCategory - */ + **/ @ApiModelProperty(required = true, value = "Deduction Category type") - /** + /** * Deduction Category type - * * @return deductionCategory DeductionCategoryEnum - */ + **/ public DeductionCategoryEnum getDeductionCategory() { return deductionCategory; } - /** - * Deduction Category type - * - * @param deductionCategory DeductionCategoryEnum - */ + /** + * Deduction Category type + * @param deductionCategory DeductionCategoryEnum + **/ + public void setDeductionCategory(DeductionCategoryEnum deductionCategory) { this.deductionCategory = deductionCategory; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return Deduction - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return Deduction + **/ public Deduction liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(required = true, value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return Deduction - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return Deduction + **/ public Deduction currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * Standard amount of the deduction. - * - * @param standardAmount Double - * @return Deduction - */ + * Standard amount of the deduction. + * @param standardAmount Double + * @return Deduction + **/ public Deduction standardAmount(Double standardAmount) { this.standardAmount = standardAmount; return this; } - /** + /** * Standard amount of the deduction. - * * @return standardAmount - */ + **/ @ApiModelProperty(value = "Standard amount of the deduction.") - /** + /** * Standard amount of the deduction. - * * @return standardAmount Double - */ + **/ public Double getStandardAmount() { return standardAmount; } - /** - * Standard amount of the deduction. - * - * @param standardAmount Double - */ + /** + * Standard amount of the deduction. + * @param standardAmount Double + **/ + public void setStandardAmount(Double standardAmount) { this.standardAmount = standardAmount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -314,25 +317,20 @@ public boolean equals(java.lang.Object o) { return false; } Deduction deduction = (Deduction) o; - return Objects.equals(this.deductionId, deduction.deductionId) - && Objects.equals(this.deductionName, deduction.deductionName) - && Objects.equals(this.deductionCategory, deduction.deductionCategory) - && Objects.equals(this.liabilityAccountId, deduction.liabilityAccountId) - && Objects.equals(this.currentRecord, deduction.currentRecord) - && Objects.equals(this.standardAmount, deduction.standardAmount); + return Objects.equals(this.deductionId, deduction.deductionId) && + Objects.equals(this.deductionName, deduction.deductionName) && + Objects.equals(this.deductionCategory, deduction.deductionCategory) && + Objects.equals(this.liabilityAccountId, deduction.liabilityAccountId) && + Objects.equals(this.currentRecord, deduction.currentRecord) && + Objects.equals(this.standardAmount, deduction.standardAmount); } @Override public int hashCode() { - return Objects.hash( - deductionId, - deductionName, - deductionCategory, - liabilityAccountId, - currentRecord, - standardAmount); + return Objects.hash(deductionId, deductionName, deductionCategory, liabilityAccountId, currentRecord, standardAmount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -348,7 +346,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -356,4 +355,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/DeductionLine.java b/src/main/java/com/xero/models/payrollnz/DeductionLine.java index 2ae6c5355..13dbf1bc0 100644 --- a/src/main/java/com/xero/models/payrollnz/DeductionLine.java +++ b/src/main/java/com/xero/models/payrollnz/DeductionLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * DeductionLine + */ -/** DeductionLine */ public class DeductionLine { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class DeductionLine { @JsonProperty("percentage") private Double percentage; /** - * Xero identifier for payroll deduction - * - * @param deductionTypeID UUID - * @return DeductionLine - */ + * Xero identifier for payroll deduction + * @param deductionTypeID UUID + * @return DeductionLine + **/ public DeductionLine deductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; return this; } - /** + /** * Xero identifier for payroll deduction - * * @return deductionTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll deduction") - /** + /** * Xero identifier for payroll deduction - * * @return deductionTypeID UUID - */ + **/ public UUID getDeductionTypeID() { return deductionTypeID; } - /** - * Xero identifier for payroll deduction - * - * @param deductionTypeID UUID - */ + /** + * Xero identifier for payroll deduction + * @param deductionTypeID UUID + **/ + public void setDeductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; } /** - * name of earnings rate for display in UI - * - * @param displayName String - * @return DeductionLine - */ + * name of earnings rate for display in UI + * @param displayName String + * @return DeductionLine + **/ public DeductionLine displayName(String displayName) { this.displayName = displayName; return this; } - /** + /** * name of earnings rate for display in UI - * * @return displayName - */ + **/ @ApiModelProperty(value = "name of earnings rate for display in UI") - /** + /** * name of earnings rate for display in UI - * * @return displayName String - */ + **/ public String getDisplayName() { return displayName; } - /** - * name of earnings rate for display in UI - * - * @param displayName String - */ + /** + * name of earnings rate for display in UI + * @param displayName String + **/ + public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * The amount of the deduction line - * - * @param amount Double - * @return DeductionLine - */ + * The amount of the deduction line + * @param amount Double + * @return DeductionLine + **/ public DeductionLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the deduction line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the deduction line") - /** + /** * The amount of the deduction line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the deduction line - * - * @param amount Double - */ + /** + * The amount of the deduction line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the deduction is subject to tax - * - * @param subjectToTax Boolean - * @return DeductionLine - */ + * Identifies if the deduction is subject to tax + * @param subjectToTax Boolean + * @return DeductionLine + **/ public DeductionLine subjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; return this; } - /** + /** * Identifies if the deduction is subject to tax - * * @return subjectToTax - */ + **/ @ApiModelProperty(value = "Identifies if the deduction is subject to tax") - /** + /** * Identifies if the deduction is subject to tax - * * @return subjectToTax Boolean - */ + **/ public Boolean getSubjectToTax() { return subjectToTax; } - /** - * Identifies if the deduction is subject to tax - * - * @param subjectToTax Boolean - */ + /** + * Identifies if the deduction is subject to tax + * @param subjectToTax Boolean + **/ + public void setSubjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; } /** - * Deduction rate percentage - * - * @param percentage Double - * @return DeductionLine - */ + * Deduction rate percentage + * @param percentage Double + * @return DeductionLine + **/ public DeductionLine percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Deduction rate percentage - * * @return percentage - */ + **/ @ApiModelProperty(value = "Deduction rate percentage") - /** + /** * Deduction rate percentage - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Deduction rate percentage - * - * @param percentage Double - */ + /** + * Deduction rate percentage + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } DeductionLine deductionLine = (DeductionLine) o; - return Objects.equals(this.deductionTypeID, deductionLine.deductionTypeID) - && Objects.equals(this.displayName, deductionLine.displayName) - && Objects.equals(this.amount, deductionLine.amount) - && Objects.equals(this.subjectToTax, deductionLine.subjectToTax) - && Objects.equals(this.percentage, deductionLine.percentage); + return Objects.equals(this.deductionTypeID, deductionLine.deductionTypeID) && + Objects.equals(this.displayName, deductionLine.displayName) && + Objects.equals(this.amount, deductionLine.amount) && + Objects.equals(this.subjectToTax, deductionLine.subjectToTax) && + Objects.equals(this.percentage, deductionLine.percentage); } @Override @@ -231,6 +234,7 @@ public int hashCode() { return Objects.hash(deductionTypeID, displayName, amount, subjectToTax, percentage); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/DeductionObject.java b/src/main/java/com/xero/models/payrollnz/DeductionObject.java index 0e182187b..a0bc09b56 100644 --- a/src/main/java/com/xero/models/payrollnz/DeductionObject.java +++ b/src/main/java/com/xero/models/payrollnz/DeductionObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Deduction; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * DeductionObject + */ -/** DeductionObject */ public class DeductionObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class DeductionObject { @JsonProperty("deduction") private Deduction deduction; /** - * pagination - * - * @param pagination Pagination - * @return DeductionObject - */ + * pagination + * @param pagination Pagination + * @return DeductionObject + **/ public DeductionObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return DeductionObject - */ + * problem + * @param problem Problem + * @return DeductionObject + **/ public DeductionObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * deduction - * - * @param deduction Deduction - * @return DeductionObject - */ + * deduction + * @param deduction Deduction + * @return DeductionObject + **/ public DeductionObject deduction(Deduction deduction) { this.deduction = deduction; return this; } - /** + /** * Get deduction - * * @return deduction - */ + **/ @ApiModelProperty(value = "") - /** + /** * deduction - * * @return deduction Deduction - */ + **/ public Deduction getDeduction() { return deduction; } - /** - * deduction - * - * @param deduction Deduction - */ + /** + * deduction + * @param deduction Deduction + **/ + public void setDeduction(Deduction deduction) { this.deduction = deduction; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } DeductionObject deductionObject = (DeductionObject) o; - return Objects.equals(this.pagination, deductionObject.pagination) - && Objects.equals(this.problem, deductionObject.problem) - && Objects.equals(this.deduction, deductionObject.deduction); + return Objects.equals(this.pagination, deductionObject.pagination) && + Objects.equals(this.problem, deductionObject.problem) && + Objects.equals(this.deduction, deductionObject.deduction); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, deduction); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Deductions.java b/src/main/java/com/xero/models/payrollnz/Deductions.java index f497e577b..aa9a15ff5 100644 --- a/src/main/java/com/xero/models/payrollnz/Deductions.java +++ b/src/main/java/com/xero/models/payrollnz/Deductions.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Deduction; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Deductions + */ -/** Deductions */ public class Deductions { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Deductions { @JsonProperty("deductions") private List deductions = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Deductions - */ + * pagination + * @param pagination Pagination + * @return Deductions + **/ public Deductions pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Deductions - */ + * problem + * @param problem Problem + * @return Deductions + **/ public Deductions problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * deductions - * - * @param deductions List<Deduction> - * @return Deductions - */ + * deductions + * @param deductions List<Deduction> + * @return Deductions + **/ public Deductions deductions(List deductions) { this.deductions = deductions; return this; @@ -113,10 +126,9 @@ public Deductions deductions(List deductions) { /** * deductions - * - * @param deductionsItem Deduction + * @param deductionsItem Deduction * @return Deductions - */ + **/ public Deductions addDeductionsItem(Deduction deductionsItem) { if (this.deductions == null) { this.deductions = new ArrayList(); @@ -125,30 +137,29 @@ public Deductions addDeductionsItem(Deduction deductionsItem) { return this; } - /** + /** * Get deductions - * * @return deductions - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductions - * * @return deductions List - */ + **/ public List getDeductions() { return deductions; } - /** - * deductions - * - * @param deductions List<Deduction> - */ + /** + * deductions + * @param deductions List<Deduction> + **/ + public void setDeductions(List deductions) { this.deductions = deductions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Deductions deductions = (Deductions) o; - return Objects.equals(this.pagination, deductions.pagination) - && Objects.equals(this.problem, deductions.problem) - && Objects.equals(this.deductions, deductions.deductions); + return Objects.equals(this.pagination, deductions.pagination) && + Objects.equals(this.problem, deductions.problem) && + Objects.equals(this.deductions, deductions.deductions); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, deductions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsLine.java b/src/main/java/com/xero/models/payrollnz/EarningsLine.java index 932e6d557..9d8350a41 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsLine.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsLine + */ -/** EarningsLine */ public class EarningsLine { StringUtil util = new StringUtil(); @@ -51,358 +68,326 @@ public class EarningsLine { @JsonProperty("isSystemGenerated") private Boolean isSystemGenerated; /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - * @return EarningsLine - */ + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + * @return EarningsLine + **/ public EarningsLine earningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; return this; } - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll earnings line") - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID UUID - */ + **/ public UUID getEarningsLineID() { return earningsLineID; } - /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - */ + /** + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + **/ + public void setEarningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; } /** - * Xero identifier for payroll earnings rate - * - * @param earningsRateID UUID - * @return EarningsLine - */ + * Xero identifier for payroll earnings rate + * @param earningsRateID UUID + * @return EarningsLine + **/ public EarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier for payroll earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll earnings rate") - /** + /** * Xero identifier for payroll earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier for payroll earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero identifier for payroll earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * name of earnings rate for display in UI - * - * @param displayName String - * @return EarningsLine - */ + * name of earnings rate for display in UI + * @param displayName String + * @return EarningsLine + **/ public EarningsLine displayName(String displayName) { this.displayName = displayName; return this; } - /** + /** * name of earnings rate for display in UI - * * @return displayName - */ + **/ @ApiModelProperty(value = "name of earnings rate for display in UI") - /** + /** * name of earnings rate for display in UI - * * @return displayName String - */ + **/ public String getDisplayName() { return displayName; } - /** - * name of earnings rate for display in UI - * - * @param displayName String - */ + /** + * name of earnings rate for display in UI + * @param displayName String + **/ + public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * Rate per unit for earnings line - * - * @param ratePerUnit Double - * @return EarningsLine - */ + * Rate per unit for earnings line + * @param ratePerUnit Double + * @return EarningsLine + **/ public EarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit for earnings line - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "Rate per unit for earnings line") - /** + /** * Rate per unit for earnings line - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit for earnings line - * - * @param ratePerUnit Double - */ + /** + * Rate per unit for earnings line + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Earnings number of units - * - * @param numberOfUnits Double - * @return EarningsLine - */ + * Earnings number of units + * @param numberOfUnits Double + * @return EarningsLine + **/ public EarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Earnings number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Earnings number of units") - /** + /** * Earnings number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Earnings number of units - * - * @param numberOfUnits Double - */ + /** + * Earnings number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - * @return EarningsLine - */ + * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + * @return EarningsLine + **/ public EarningsLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount - */ - @ApiModelProperty( - value = "Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") - /** + **/ + @ApiModelProperty(value = "Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") + /** * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - */ + /** + * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The amount of the earnings line. - * - * @param amount Double - * @return EarningsLine - */ + * The amount of the earnings line. + * @param amount Double + * @return EarningsLine + **/ public EarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the earnings line. - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the earnings line.") - /** + /** * The amount of the earnings line. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the earnings line. - * - * @param amount Double - */ + /** + * The amount of the earnings line. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the earnings is taken from the timesheet. False for earnings line - * - * @param isLinkedToTimesheet Boolean - * @return EarningsLine - */ + * Identifies if the earnings is taken from the timesheet. False for earnings line + * @param isLinkedToTimesheet Boolean + * @return EarningsLine + **/ public EarningsLine isLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; return this; } - /** + /** * Identifies if the earnings is taken from the timesheet. False for earnings line - * * @return isLinkedToTimesheet - */ - @ApiModelProperty( - value = "Identifies if the earnings is taken from the timesheet. False for earnings line") - /** + **/ + @ApiModelProperty(value = "Identifies if the earnings is taken from the timesheet. False for earnings line") + /** * Identifies if the earnings is taken from the timesheet. False for earnings line - * * @return isLinkedToTimesheet Boolean - */ + **/ public Boolean getIsLinkedToTimesheet() { return isLinkedToTimesheet; } - /** - * Identifies if the earnings is taken from the timesheet. False for earnings line - * - * @param isLinkedToTimesheet Boolean - */ + /** + * Identifies if the earnings is taken from the timesheet. False for earnings line + * @param isLinkedToTimesheet Boolean + **/ + public void setIsLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; } /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - * @return EarningsLine - */ + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + * @return EarningsLine + **/ public EarningsLine isAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; return this; } - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate - */ + **/ @ApiModelProperty(value = "Identifies if the earnings is using an average daily pay rate") - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate Boolean - */ + **/ public Boolean getIsAverageDailyPayRate() { return isAverageDailyPayRate; } - /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - */ + /** + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + **/ + public void setIsAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; } /** - * Flag to identify whether the earnings line is system generated or not. - * - * @param isSystemGenerated Boolean - * @return EarningsLine - */ + * Flag to identify whether the earnings line is system generated or not. + * @param isSystemGenerated Boolean + * @return EarningsLine + **/ public EarningsLine isSystemGenerated(Boolean isSystemGenerated) { this.isSystemGenerated = isSystemGenerated; return this; } - /** + /** * Flag to identify whether the earnings line is system generated or not. - * * @return isSystemGenerated - */ - @ApiModelProperty( - value = "Flag to identify whether the earnings line is system generated or not.") - /** + **/ + @ApiModelProperty(value = "Flag to identify whether the earnings line is system generated or not.") + /** * Flag to identify whether the earnings line is system generated or not. - * * @return isSystemGenerated Boolean - */ + **/ public Boolean getIsSystemGenerated() { return isSystemGenerated; } - /** - * Flag to identify whether the earnings line is system generated or not. - * - * @param isSystemGenerated Boolean - */ + /** + * Flag to identify whether the earnings line is system generated or not. + * @param isSystemGenerated Boolean + **/ + public void setIsSystemGenerated(Boolean isSystemGenerated) { this.isSystemGenerated = isSystemGenerated; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -412,33 +397,24 @@ public boolean equals(java.lang.Object o) { return false; } EarningsLine earningsLine = (EarningsLine) o; - return Objects.equals(this.earningsLineID, earningsLine.earningsLineID) - && Objects.equals(this.earningsRateID, earningsLine.earningsRateID) - && Objects.equals(this.displayName, earningsLine.displayName) - && Objects.equals(this.ratePerUnit, earningsLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, earningsLine.numberOfUnits) - && Objects.equals(this.fixedAmount, earningsLine.fixedAmount) - && Objects.equals(this.amount, earningsLine.amount) - && Objects.equals(this.isLinkedToTimesheet, earningsLine.isLinkedToTimesheet) - && Objects.equals(this.isAverageDailyPayRate, earningsLine.isAverageDailyPayRate) - && Objects.equals(this.isSystemGenerated, earningsLine.isSystemGenerated); + return Objects.equals(this.earningsLineID, earningsLine.earningsLineID) && + Objects.equals(this.earningsRateID, earningsLine.earningsRateID) && + Objects.equals(this.displayName, earningsLine.displayName) && + Objects.equals(this.ratePerUnit, earningsLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, earningsLine.numberOfUnits) && + Objects.equals(this.fixedAmount, earningsLine.fixedAmount) && + Objects.equals(this.amount, earningsLine.amount) && + Objects.equals(this.isLinkedToTimesheet, earningsLine.isLinkedToTimesheet) && + Objects.equals(this.isAverageDailyPayRate, earningsLine.isAverageDailyPayRate) && + Objects.equals(this.isSystemGenerated, earningsLine.isSystemGenerated); } @Override public int hashCode() { - return Objects.hash( - earningsLineID, - earningsRateID, - displayName, - ratePerUnit, - numberOfUnits, - fixedAmount, - amount, - isLinkedToTimesheet, - isAverageDailyPayRate, - isSystemGenerated); + return Objects.hash(earningsLineID, earningsRateID, displayName, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet, isAverageDailyPayRate, isSystemGenerated); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -450,19 +426,16 @@ public String toString() { sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" isLinkedToTimesheet: ") - .append(toIndentedString(isLinkedToTimesheet)) - .append("\n"); - sb.append(" isAverageDailyPayRate: ") - .append(toIndentedString(isAverageDailyPayRate)) - .append("\n"); + sb.append(" isLinkedToTimesheet: ").append(toIndentedString(isLinkedToTimesheet)).append("\n"); + sb.append(" isAverageDailyPayRate: ").append(toIndentedString(isAverageDailyPayRate)).append("\n"); sb.append(" isSystemGenerated: ").append(toIndentedString(isSystemGenerated)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -470,4 +443,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsOrder.java b/src/main/java/com/xero/models/payrollnz/EarningsOrder.java index a65026d55..c462b3203 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsOrder.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsOrder.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.StatutoryDeductionCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsOrder + */ -/** EarningsOrder */ public class EarningsOrder { StringUtil util = new StringUtil(); @@ -36,181 +54,166 @@ public class EarningsOrder { @JsonProperty("currentRecord") private Boolean currentRecord = true; /** - * Xero unique identifier for an earning rate - * - * @param id UUID - * @return EarningsOrder - */ + * Xero unique identifier for an earning rate + * @param id UUID + * @return EarningsOrder + **/ public EarningsOrder id(UUID id) { this.id = id; return this; } - /** + /** * Xero unique identifier for an earning rate - * * @return id - */ + **/ @ApiModelProperty(value = "Xero unique identifier for an earning rate") - /** + /** * Xero unique identifier for an earning rate - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * Xero unique identifier for an earning rate - * - * @param id UUID - */ + /** + * Xero unique identifier for an earning rate + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Name of the earning order - * - * @param name String - * @return EarningsOrder - */ + * Name of the earning order + * @param name String + * @return EarningsOrder + **/ public EarningsOrder name(String name) { this.name = name; return this; } - /** + /** * Name of the earning order - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the earning order") - /** + /** * Name of the earning order - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earning order - * - * @param name String - */ + /** + * Name of the earning order + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - * @return EarningsOrder - */ - public EarningsOrder statutoryDeductionCategory( - StatutoryDeductionCategory statutoryDeductionCategory) { + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + * @return EarningsOrder + **/ + public EarningsOrder statutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; return this; } - /** + /** * Get statutoryDeductionCategory - * * @return statutoryDeductionCategory - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductionCategory - * * @return statutoryDeductionCategory StatutoryDeductionCategory - */ + **/ public StatutoryDeductionCategory getStatutoryDeductionCategory() { return statutoryDeductionCategory; } - /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - */ + /** + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + **/ + public void setStatutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return EarningsOrder - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return EarningsOrder + **/ public EarningsOrder liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return EarningsOrder - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return EarningsOrder + **/ public EarningsOrder currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,11 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } EarningsOrder earningsOrder = (EarningsOrder) o; - return Objects.equals(this.id, earningsOrder.id) - && Objects.equals(this.name, earningsOrder.name) - && Objects.equals(this.statutoryDeductionCategory, earningsOrder.statutoryDeductionCategory) - && Objects.equals(this.liabilityAccountId, earningsOrder.liabilityAccountId) - && Objects.equals(this.currentRecord, earningsOrder.currentRecord); + return Objects.equals(this.id, earningsOrder.id) && + Objects.equals(this.name, earningsOrder.name) && + Objects.equals(this.statutoryDeductionCategory, earningsOrder.statutoryDeductionCategory) && + Objects.equals(this.liabilityAccountId, earningsOrder.liabilityAccountId) && + Objects.equals(this.currentRecord, earningsOrder.currentRecord); } @Override @@ -232,15 +235,14 @@ public int hashCode() { return Objects.hash(id, name, statutoryDeductionCategory, liabilityAccountId, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EarningsOrder {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" statutoryDeductionCategory: ") - .append(toIndentedString(statutoryDeductionCategory)) - .append("\n"); + sb.append(" statutoryDeductionCategory: ").append(toIndentedString(statutoryDeductionCategory)).append("\n"); sb.append(" liabilityAccountId: ").append(toIndentedString(liabilityAccountId)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append("}"); @@ -248,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -256,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsOrderObject.java b/src/main/java/com/xero/models/payrollnz/EarningsOrderObject.java index d1be9332f..b8cbbe811 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsOrderObject.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsOrderObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EarningsOrder; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsOrderObject + */ -/** EarningsOrderObject */ public class EarningsOrderObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EarningsOrderObject { @JsonProperty("statutoryDeduction") private EarningsOrder statutoryDeduction; /** - * pagination - * - * @param pagination Pagination - * @return EarningsOrderObject - */ + * pagination + * @param pagination Pagination + * @return EarningsOrderObject + **/ public EarningsOrderObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsOrderObject - */ + * problem + * @param problem Problem + * @return EarningsOrderObject + **/ public EarningsOrderObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryDeduction - * - * @param statutoryDeduction EarningsOrder - * @return EarningsOrderObject - */ + * statutoryDeduction + * @param statutoryDeduction EarningsOrder + * @return EarningsOrderObject + **/ public EarningsOrderObject statutoryDeduction(EarningsOrder statutoryDeduction) { this.statutoryDeduction = statutoryDeduction; return this; } - /** + /** * Get statutoryDeduction - * * @return statutoryDeduction - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeduction - * * @return statutoryDeduction EarningsOrder - */ + **/ public EarningsOrder getStatutoryDeduction() { return statutoryDeduction; } - /** - * statutoryDeduction - * - * @param statutoryDeduction EarningsOrder - */ + /** + * statutoryDeduction + * @param statutoryDeduction EarningsOrder + **/ + public void setStatutoryDeduction(EarningsOrder statutoryDeduction) { this.statutoryDeduction = statutoryDeduction; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsOrderObject earningsOrderObject = (EarningsOrderObject) o; - return Objects.equals(this.pagination, earningsOrderObject.pagination) - && Objects.equals(this.problem, earningsOrderObject.problem) - && Objects.equals(this.statutoryDeduction, earningsOrderObject.statutoryDeduction); + return Objects.equals(this.pagination, earningsOrderObject.pagination) && + Objects.equals(this.problem, earningsOrderObject.problem) && + Objects.equals(this.statutoryDeduction, earningsOrderObject.statutoryDeduction); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryDeduction); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsOrders.java b/src/main/java/com/xero/models/payrollnz/EarningsOrders.java index 6509ae90f..1515534cd 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsOrders.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsOrders.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EarningsOrder; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsOrders + */ -/** EarningsOrders */ public class EarningsOrders { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EarningsOrders { @JsonProperty("statutoryDeductions") private List statutoryDeductions = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EarningsOrders - */ + * pagination + * @param pagination Pagination + * @return EarningsOrders + **/ public EarningsOrders pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsOrders - */ + * problem + * @param problem Problem + * @return EarningsOrders + **/ public EarningsOrders problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryDeductions - * - * @param statutoryDeductions List<EarningsOrder> - * @return EarningsOrders - */ + * statutoryDeductions + * @param statutoryDeductions List<EarningsOrder> + * @return EarningsOrders + **/ public EarningsOrders statutoryDeductions(List statutoryDeductions) { this.statutoryDeductions = statutoryDeductions; return this; @@ -113,10 +126,9 @@ public EarningsOrders statutoryDeductions(List statutoryDeduction /** * statutoryDeductions - * - * @param statutoryDeductionsItem EarningsOrder + * @param statutoryDeductionsItem EarningsOrder * @return EarningsOrders - */ + **/ public EarningsOrders addStatutoryDeductionsItem(EarningsOrder statutoryDeductionsItem) { if (this.statutoryDeductions == null) { this.statutoryDeductions = new ArrayList(); @@ -125,30 +137,29 @@ public EarningsOrders addStatutoryDeductionsItem(EarningsOrder statutoryDeductio return this; } - /** + /** * Get statutoryDeductions - * * @return statutoryDeductions - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductions - * * @return statutoryDeductions List - */ + **/ public List getStatutoryDeductions() { return statutoryDeductions; } - /** - * statutoryDeductions - * - * @param statutoryDeductions List<EarningsOrder> - */ + /** + * statutoryDeductions + * @param statutoryDeductions List<EarningsOrder> + **/ + public void setStatutoryDeductions(List statutoryDeductions) { this.statutoryDeductions = statutoryDeductions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsOrders earningsOrders = (EarningsOrders) o; - return Objects.equals(this.pagination, earningsOrders.pagination) - && Objects.equals(this.problem, earningsOrders.problem) - && Objects.equals(this.statutoryDeductions, earningsOrders.statutoryDeductions); + return Objects.equals(this.pagination, earningsOrders.pagination) && + Objects.equals(this.problem, earningsOrders.problem) && + Objects.equals(this.statutoryDeductions, earningsOrders.statutoryDeductions); } @Override @@ -168,21 +179,21 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryDeductions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EarningsOrders {\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append(" problem: ").append(toIndentedString(problem)).append("\n"); - sb.append(" statutoryDeductions: ") - .append(toIndentedString(statutoryDeductions)) - .append("\n"); + sb.append(" statutoryDeductions: ").append(toIndentedString(statutoryDeductions)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -190,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsRate.java b/src/main/java/com/xero/models/payrollnz/EarningsRate.java index efbcc70b6..c792a00ec 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsRate.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsRate.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsRate + */ -/** EarningsRate */ public class EarningsRate { StringUtil util = new StringUtil(); @@ -28,51 +43,83 @@ public class EarningsRate { @JsonProperty("name") private String name; - /** Indicates how an employee will be paid when taking this type of earning */ + /** + * Indicates how an employee will be paid when taking this type of earning + */ public enum EarningsTypeEnum { - /** ALLOWANCE */ + /** + * ALLOWANCE + */ ALLOWANCE("Allowance"), - - /** BACKPAY */ + + /** + * BACKPAY + */ BACKPAY("Backpay"), - - /** BONUS */ + + /** + * BONUS + */ BONUS("Bonus"), - - /** COMMISSION */ + + /** + * COMMISSION + */ COMMISSION("Commission"), - - /** DISCRETIONARYPAYMENTS */ + + /** + * DISCRETIONARYPAYMENTS + */ DISCRETIONARYPAYMENTS("DiscretionaryPayments"), - - /** HOLIDAYPAY */ + + /** + * HOLIDAYPAY + */ HOLIDAYPAY("HolidayPay"), - - /** LUMPSUM */ + + /** + * LUMPSUM + */ LUMPSUM("LumpSum"), - - /** OTHEREARNINGS */ + + /** + * OTHEREARNINGS + */ OTHEREARNINGS("OtherEarnings"), - - /** OTHERGROSSEARNINGS */ + + /** + * OTHERGROSSEARNINGS + */ OTHERGROSSEARNINGS("OtherGrossEarnings"), - - /** OVERTIMEEARNINGS */ + + /** + * OVERTIMEEARNINGS + */ OVERTIMEEARNINGS("OvertimeEarnings"), - - /** REGULAREARNINGS */ + + /** + * REGULAREARNINGS + */ REGULAREARNINGS("RegularEarnings"), - - /** SALARYSACRIFICEFORKIWISAVER */ + + /** + * SALARYSACRIFICEFORKIWISAVER + */ SALARYSACRIFICEFORKIWISAVER("SalarySacrificeForKiwiSaver"), - - /** TIPS_DIRECT_ */ + + /** + * TIPS_DIRECT_ + */ TIPS_DIRECT_("Tips(Direct)"), - - /** TIPS_NON_DIRECT_ */ + + /** + * TIPS_NON_DIRECT_ + */ TIPS_NON_DIRECT_("Tips(Non-Direct)"), - - /** WITHHOLDINGINCOME */ + + /** + * WITHHOLDINGINCOME + */ WITHHOLDINGINCOME("WithholdingIncome"); private String value; @@ -81,31 +128,25 @@ public enum EarningsTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static EarningsTypeEnum fromValue(String value) { for (EarningsTypeEnum b : EarningsTypeEnum.values()) { @@ -117,17 +158,26 @@ public static EarningsTypeEnum fromValue(String value) { } } + @JsonProperty("earningsType") private EarningsTypeEnum earningsType; - /** Indicates the type of the earning rate */ + /** + * Indicates the type of the earning rate + */ public enum RateTypeEnum { - /** RATEPERUNIT */ + /** + * RATEPERUNIT + */ RATEPERUNIT("RatePerUnit"), - - /** MULTIPLEOFORDINARYEARNINGSRATE */ + + /** + * MULTIPLEOFORDINARYEARNINGSRATE + */ MULTIPLEOFORDINARYEARNINGSRATE("MultipleOfOrdinaryEarningsRate"), - - /** FIXEDAMOUNT */ + + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FixedAmount"); private String value; @@ -136,31 +186,25 @@ public enum RateTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static RateTypeEnum fromValue(String value) { for (RateTypeEnum b : RateTypeEnum.values()) { @@ -172,6 +216,7 @@ public static RateTypeEnum fromValue(String value) { } } + @JsonProperty("rateType") private RateTypeEnum rateType; @@ -193,370 +238,326 @@ public static RateTypeEnum fromValue(String value) { @JsonProperty("fixedAmount") private Double fixedAmount; /** - * Xero unique identifier for an earning rate - * - * @param earningsRateID UUID - * @return EarningsRate - */ + * Xero unique identifier for an earning rate + * @param earningsRateID UUID + * @return EarningsRate + **/ public EarningsRate earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero unique identifier for an earning rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for an earning rate") - /** + /** * Xero unique identifier for an earning rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero unique identifier for an earning rate - * - * @param earningsRateID UUID - */ + /** + * Xero unique identifier for an earning rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * Name of the earning rate - * - * @param name String - * @return EarningsRate - */ + * Name of the earning rate + * @param name String + * @return EarningsRate + **/ public EarningsRate name(String name) { this.name = name; return this; } - /** + /** * Name of the earning rate - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the earning rate") - /** + /** * Name of the earning rate - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earning rate - * - * @param name String - */ + /** + * Name of the earning rate + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Indicates how an employee will be paid when taking this type of earning - * - * @param earningsType EarningsTypeEnum - * @return EarningsRate - */ + * Indicates how an employee will be paid when taking this type of earning + * @param earningsType EarningsTypeEnum + * @return EarningsRate + **/ public EarningsRate earningsType(EarningsTypeEnum earningsType) { this.earningsType = earningsType; return this; } - /** + /** * Indicates how an employee will be paid when taking this type of earning - * * @return earningsType - */ - @ApiModelProperty( - required = true, - value = "Indicates how an employee will be paid when taking this type of earning") - /** + **/ + @ApiModelProperty(required = true, value = "Indicates how an employee will be paid when taking this type of earning") + /** * Indicates how an employee will be paid when taking this type of earning - * * @return earningsType EarningsTypeEnum - */ + **/ public EarningsTypeEnum getEarningsType() { return earningsType; } - /** - * Indicates how an employee will be paid when taking this type of earning - * - * @param earningsType EarningsTypeEnum - */ + /** + * Indicates how an employee will be paid when taking this type of earning + * @param earningsType EarningsTypeEnum + **/ + public void setEarningsType(EarningsTypeEnum earningsType) { this.earningsType = earningsType; } /** - * Indicates the type of the earning rate - * - * @param rateType RateTypeEnum - * @return EarningsRate - */ + * Indicates the type of the earning rate + * @param rateType RateTypeEnum + * @return EarningsRate + **/ public EarningsRate rateType(RateTypeEnum rateType) { this.rateType = rateType; return this; } - /** + /** * Indicates the type of the earning rate - * * @return rateType - */ + **/ @ApiModelProperty(required = true, value = "Indicates the type of the earning rate") - /** + /** * Indicates the type of the earning rate - * * @return rateType RateTypeEnum - */ + **/ public RateTypeEnum getRateType() { return rateType; } - /** - * Indicates the type of the earning rate - * - * @param rateType RateTypeEnum - */ + /** + * Indicates the type of the earning rate + * @param rateType RateTypeEnum + **/ + public void setRateType(RateTypeEnum rateType) { this.rateType = rateType; } /** - * The type of units used to record earnings - * - * @param typeOfUnits String - * @return EarningsRate - */ + * The type of units used to record earnings + * @param typeOfUnits String + * @return EarningsRate + **/ public EarningsRate typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * The type of units used to record earnings - * * @return typeOfUnits - */ + **/ @ApiModelProperty(required = true, value = "The type of units used to record earnings") - /** + /** * The type of units used to record earnings - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of units used to record earnings - * - * @param typeOfUnits String - */ + /** + * The type of units used to record earnings + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } /** - * Indicates whether an earning type is active - * - * @param currentRecord Boolean - * @return EarningsRate - */ + * Indicates whether an earning type is active + * @param currentRecord Boolean + * @return EarningsRate + **/ public EarningsRate currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Indicates whether an earning type is active - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Indicates whether an earning type is active") - /** + /** * Indicates whether an earning type is active - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Indicates whether an earning type is active - * - * @param currentRecord Boolean - */ + /** + * Indicates whether an earning type is active + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * The account that will be used for the earnings rate - * - * @param expenseAccountID UUID - * @return EarningsRate - */ + * The account that will be used for the earnings rate + * @param expenseAccountID UUID + * @return EarningsRate + **/ public EarningsRate expenseAccountID(UUID expenseAccountID) { this.expenseAccountID = expenseAccountID; return this; } - /** + /** * The account that will be used for the earnings rate - * * @return expenseAccountID - */ + **/ @ApiModelProperty(required = true, value = "The account that will be used for the earnings rate") - /** + /** * The account that will be used for the earnings rate - * * @return expenseAccountID UUID - */ + **/ public UUID getExpenseAccountID() { return expenseAccountID; } - /** - * The account that will be used for the earnings rate - * - * @param expenseAccountID UUID - */ + /** + * The account that will be used for the earnings rate + * @param expenseAccountID UUID + **/ + public void setExpenseAccountID(UUID expenseAccountID) { this.expenseAccountID = expenseAccountID; } /** - * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * - * @param ratePerUnit Double - * @return EarningsRate - */ + * Default rate per unit (optional). Only applicable if RateType is RatePerUnit + * @param ratePerUnit Double + * @return EarningsRate + **/ public EarningsRate ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * * @return ratePerUnit - */ - @ApiModelProperty( - value = "Default rate per unit (optional). Only applicable if RateType is RatePerUnit") - /** + **/ + @ApiModelProperty(value = "Default rate per unit (optional). Only applicable if RateType is RatePerUnit") + /** * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * - * @param ratePerUnit Double - */ + /** + * Default rate per unit (optional). Only applicable if RateType is RatePerUnit + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * - * @param multipleOfOrdinaryEarningsRate Double - * @return EarningsRate - */ + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + * @param multipleOfOrdinaryEarningsRate Double + * @return EarningsRate + **/ public EarningsRate multipleOfOrdinaryEarningsRate(Double multipleOfOrdinaryEarningsRate) { this.multipleOfOrdinaryEarningsRate = multipleOfOrdinaryEarningsRate; return this; } - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate * @return multipleOfOrdinaryEarningsRate - */ - @ApiModelProperty( - value = - "This is the multiplier used to calculate the rate per unit, based on the employee’s" - + " ordinary earnings rate. For example, for time and a half enter 1.5. Only" - + " applicable if RateType is MultipleOfOrdinaryEarningsRate") - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * + **/ + @ApiModelProperty(value = "This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate") + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate * @return multipleOfOrdinaryEarningsRate Double - */ + **/ public Double getMultipleOfOrdinaryEarningsRate() { return multipleOfOrdinaryEarningsRate; } - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * - * @param multipleOfOrdinaryEarningsRate Double - */ + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + * @param multipleOfOrdinaryEarningsRate Double + **/ + public void setMultipleOfOrdinaryEarningsRate(Double multipleOfOrdinaryEarningsRate) { this.multipleOfOrdinaryEarningsRate = multipleOfOrdinaryEarningsRate; } /** - * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * - * @param fixedAmount Double - * @return EarningsRate - */ + * Optional Fixed Rate Amount. Applicable for FixedAmount Rate + * @param fixedAmount Double + * @return EarningsRate + **/ public EarningsRate fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * * @return fixedAmount - */ + **/ @ApiModelProperty(value = "Optional Fixed Rate Amount. Applicable for FixedAmount Rate") - /** + /** * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * - * @param fixedAmount Double - */ + /** + * Optional Fixed Rate Amount. Applicable for FixedAmount Rate + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -566,34 +567,24 @@ public boolean equals(java.lang.Object o) { return false; } EarningsRate earningsRate = (EarningsRate) o; - return Objects.equals(this.earningsRateID, earningsRate.earningsRateID) - && Objects.equals(this.name, earningsRate.name) - && Objects.equals(this.earningsType, earningsRate.earningsType) - && Objects.equals(this.rateType, earningsRate.rateType) - && Objects.equals(this.typeOfUnits, earningsRate.typeOfUnits) - && Objects.equals(this.currentRecord, earningsRate.currentRecord) - && Objects.equals(this.expenseAccountID, earningsRate.expenseAccountID) - && Objects.equals(this.ratePerUnit, earningsRate.ratePerUnit) - && Objects.equals( - this.multipleOfOrdinaryEarningsRate, earningsRate.multipleOfOrdinaryEarningsRate) - && Objects.equals(this.fixedAmount, earningsRate.fixedAmount); + return Objects.equals(this.earningsRateID, earningsRate.earningsRateID) && + Objects.equals(this.name, earningsRate.name) && + Objects.equals(this.earningsType, earningsRate.earningsType) && + Objects.equals(this.rateType, earningsRate.rateType) && + Objects.equals(this.typeOfUnits, earningsRate.typeOfUnits) && + Objects.equals(this.currentRecord, earningsRate.currentRecord) && + Objects.equals(this.expenseAccountID, earningsRate.expenseAccountID) && + Objects.equals(this.ratePerUnit, earningsRate.ratePerUnit) && + Objects.equals(this.multipleOfOrdinaryEarningsRate, earningsRate.multipleOfOrdinaryEarningsRate) && + Objects.equals(this.fixedAmount, earningsRate.fixedAmount); } @Override public int hashCode() { - return Objects.hash( - earningsRateID, - name, - earningsType, - rateType, - typeOfUnits, - currentRecord, - expenseAccountID, - ratePerUnit, - multipleOfOrdinaryEarningsRate, - fixedAmount); + return Objects.hash(earningsRateID, name, earningsType, rateType, typeOfUnits, currentRecord, expenseAccountID, ratePerUnit, multipleOfOrdinaryEarningsRate, fixedAmount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -606,16 +597,15 @@ public String toString() { sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append(" expenseAccountID: ").append(toIndentedString(expenseAccountID)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); - sb.append(" multipleOfOrdinaryEarningsRate: ") - .append(toIndentedString(multipleOfOrdinaryEarningsRate)) - .append("\n"); + sb.append(" multipleOfOrdinaryEarningsRate: ").append(toIndentedString(multipleOfOrdinaryEarningsRate)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -623,4 +613,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsRateObject.java b/src/main/java/com/xero/models/payrollnz/EarningsRateObject.java index fcb8ffeac..c7e59f03b 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsRateObject.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsRateObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EarningsRate; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsRateObject + */ -/** EarningsRateObject */ public class EarningsRateObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EarningsRateObject { @JsonProperty("earningsRate") private EarningsRate earningsRate; /** - * pagination - * - * @param pagination Pagination - * @return EarningsRateObject - */ + * pagination + * @param pagination Pagination + * @return EarningsRateObject + **/ public EarningsRateObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsRateObject - */ + * problem + * @param problem Problem + * @return EarningsRateObject + **/ public EarningsRateObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningsRate - * - * @param earningsRate EarningsRate - * @return EarningsRateObject - */ + * earningsRate + * @param earningsRate EarningsRate + * @return EarningsRateObject + **/ public EarningsRateObject earningsRate(EarningsRate earningsRate) { this.earningsRate = earningsRate; return this; } - /** + /** * Get earningsRate - * * @return earningsRate - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsRate - * * @return earningsRate EarningsRate - */ + **/ public EarningsRate getEarningsRate() { return earningsRate; } - /** - * earningsRate - * - * @param earningsRate EarningsRate - */ + /** + * earningsRate + * @param earningsRate EarningsRate + **/ + public void setEarningsRate(EarningsRate earningsRate) { this.earningsRate = earningsRate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsRateObject earningsRateObject = (EarningsRateObject) o; - return Objects.equals(this.pagination, earningsRateObject.pagination) - && Objects.equals(this.problem, earningsRateObject.problem) - && Objects.equals(this.earningsRate, earningsRateObject.earningsRate); + return Objects.equals(this.pagination, earningsRateObject.pagination) && + Objects.equals(this.problem, earningsRateObject.problem) && + Objects.equals(this.earningsRate, earningsRateObject.earningsRate); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningsRate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsRates.java b/src/main/java/com/xero/models/payrollnz/EarningsRates.java index ff2dd62a4..9ceeee643 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsRates.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsRates.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EarningsRate; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsRates + */ -/** EarningsRates */ public class EarningsRates { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EarningsRates { @JsonProperty("earningsRates") private List earningsRates = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EarningsRates - */ + * pagination + * @param pagination Pagination + * @return EarningsRates + **/ public EarningsRates pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsRates - */ + * problem + * @param problem Problem + * @return EarningsRates + **/ public EarningsRates problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningsRates - * - * @param earningsRates List<EarningsRate> - * @return EarningsRates - */ + * earningsRates + * @param earningsRates List<EarningsRate> + * @return EarningsRates + **/ public EarningsRates earningsRates(List earningsRates) { this.earningsRates = earningsRates; return this; @@ -113,10 +126,9 @@ public EarningsRates earningsRates(List earningsRates) { /** * earningsRates - * - * @param earningsRatesItem EarningsRate + * @param earningsRatesItem EarningsRate * @return EarningsRates - */ + **/ public EarningsRates addEarningsRatesItem(EarningsRate earningsRatesItem) { if (this.earningsRates == null) { this.earningsRates = new ArrayList(); @@ -125,30 +137,29 @@ public EarningsRates addEarningsRatesItem(EarningsRate earningsRatesItem) { return this; } - /** + /** * Get earningsRates - * * @return earningsRates - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsRates - * * @return earningsRates List - */ + **/ public List getEarningsRates() { return earningsRates; } - /** - * earningsRates - * - * @param earningsRates List<EarningsRate> - */ + /** + * earningsRates + * @param earningsRates List<EarningsRate> + **/ + public void setEarningsRates(List earningsRates) { this.earningsRates = earningsRates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsRates earningsRates = (EarningsRates) o; - return Objects.equals(this.pagination, earningsRates.pagination) - && Objects.equals(this.problem, earningsRates.problem) - && Objects.equals(this.earningsRates, earningsRates.earningsRates); + return Objects.equals(this.pagination, earningsRates.pagination) && + Objects.equals(this.problem, earningsRates.problem) && + Objects.equals(this.earningsRates, earningsRates.earningsRates); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningsRates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsTemplate.java b/src/main/java/com/xero/models/payrollnz/EarningsTemplate.java index d364392e5..86deea5ef 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsTemplate.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsTemplate.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsTemplate + */ -/** EarningsTemplate */ public class EarningsTemplate { StringUtil util = new StringUtil(); @@ -39,215 +56,198 @@ public class EarningsTemplate { @JsonProperty("name") private String name; /** - * The Xero identifier for the earnings template - * - * @param payTemplateEarningID UUID - * @return EarningsTemplate - */ + * The Xero identifier for the earnings template + * @param payTemplateEarningID UUID + * @return EarningsTemplate + **/ public EarningsTemplate payTemplateEarningID(UUID payTemplateEarningID) { this.payTemplateEarningID = payTemplateEarningID; return this; } - /** + /** * The Xero identifier for the earnings template - * * @return payTemplateEarningID - */ + **/ @ApiModelProperty(value = "The Xero identifier for the earnings template") - /** + /** * The Xero identifier for the earnings template - * * @return payTemplateEarningID UUID - */ + **/ public UUID getPayTemplateEarningID() { return payTemplateEarningID; } - /** - * The Xero identifier for the earnings template - * - * @param payTemplateEarningID UUID - */ + /** + * The Xero identifier for the earnings template + * @param payTemplateEarningID UUID + **/ + public void setPayTemplateEarningID(UUID payTemplateEarningID) { this.payTemplateEarningID = payTemplateEarningID; } /** - * The rate per unit - * - * @param ratePerUnit Double - * @return EarningsTemplate - */ + * The rate per unit + * @param ratePerUnit Double + * @return EarningsTemplate + **/ public EarningsTemplate ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * The rate per unit - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "The rate per unit") - /** + /** * The rate per unit - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * The rate per unit - * - * @param ratePerUnit Double - */ + /** + * The rate per unit + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * The rate per unit - * - * @param numberOfUnits Double - * @return EarningsTemplate - */ + * The rate per unit + * @param numberOfUnits Double + * @return EarningsTemplate + **/ public EarningsTemplate numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The rate per unit - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "The rate per unit") - /** + /** * The rate per unit - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The rate per unit - * - * @param numberOfUnits Double - */ + /** + * The rate per unit + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * The fixed amount per period - * - * @param fixedAmount Double - * @return EarningsTemplate - */ + * The fixed amount per period + * @param fixedAmount Double + * @return EarningsTemplate + **/ public EarningsTemplate fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * The fixed amount per period - * * @return fixedAmount - */ + **/ @ApiModelProperty(value = "The fixed amount per period") - /** + /** * The fixed amount per period - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * The fixed amount per period - * - * @param fixedAmount Double - */ + /** + * The fixed amount per period + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The corresponding earnings rate identifier - * - * @param earningsRateID UUID - * @return EarningsTemplate - */ + * The corresponding earnings rate identifier + * @param earningsRateID UUID + * @return EarningsTemplate + **/ public EarningsTemplate earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * The corresponding earnings rate identifier - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "The corresponding earnings rate identifier") - /** + /** * The corresponding earnings rate identifier - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * The corresponding earnings rate identifier - * - * @param earningsRateID UUID - */ + /** + * The corresponding earnings rate identifier + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * The read-only name of the Earning Template. - * - * @param name String - * @return EarningsTemplate - */ + * The read-only name of the Earning Template. + * @param name String + * @return EarningsTemplate + **/ public EarningsTemplate name(String name) { this.name = name; return this; } - /** + /** * The read-only name of the Earning Template. - * * @return name - */ + **/ @ApiModelProperty(value = "The read-only name of the Earning Template.") - /** + /** * The read-only name of the Earning Template. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The read-only name of the Earning Template. - * - * @param name String - */ + /** + * The read-only name of the Earning Template. + * @param name String + **/ + public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -257,27 +257,25 @@ public boolean equals(java.lang.Object o) { return false; } EarningsTemplate earningsTemplate = (EarningsTemplate) o; - return Objects.equals(this.payTemplateEarningID, earningsTemplate.payTemplateEarningID) - && Objects.equals(this.ratePerUnit, earningsTemplate.ratePerUnit) - && Objects.equals(this.numberOfUnits, earningsTemplate.numberOfUnits) - && Objects.equals(this.fixedAmount, earningsTemplate.fixedAmount) - && Objects.equals(this.earningsRateID, earningsTemplate.earningsRateID) - && Objects.equals(this.name, earningsTemplate.name); + return Objects.equals(this.payTemplateEarningID, earningsTemplate.payTemplateEarningID) && + Objects.equals(this.ratePerUnit, earningsTemplate.ratePerUnit) && + Objects.equals(this.numberOfUnits, earningsTemplate.numberOfUnits) && + Objects.equals(this.fixedAmount, earningsTemplate.fixedAmount) && + Objects.equals(this.earningsRateID, earningsTemplate.earningsRateID) && + Objects.equals(this.name, earningsTemplate.name); } @Override public int hashCode() { - return Objects.hash( - payTemplateEarningID, ratePerUnit, numberOfUnits, fixedAmount, earningsRateID, name); + return Objects.hash(payTemplateEarningID, ratePerUnit, numberOfUnits, fixedAmount, earningsRateID, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EarningsTemplate {\n"); - sb.append(" payTemplateEarningID: ") - .append(toIndentedString(payTemplateEarningID)) - .append("\n"); + sb.append(" payTemplateEarningID: ").append(toIndentedString(payTemplateEarningID)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); @@ -288,7 +286,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -296,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EarningsTemplateObject.java b/src/main/java/com/xero/models/payrollnz/EarningsTemplateObject.java index 19b8c7f18..940919a74 100644 --- a/src/main/java/com/xero/models/payrollnz/EarningsTemplateObject.java +++ b/src/main/java/com/xero/models/payrollnz/EarningsTemplateObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EarningsTemplate; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsTemplateObject + */ -/** EarningsTemplateObject */ public class EarningsTemplateObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EarningsTemplateObject { @JsonProperty("earningTemplate") private EarningsTemplate earningTemplate; /** - * pagination - * - * @param pagination Pagination - * @return EarningsTemplateObject - */ + * pagination + * @param pagination Pagination + * @return EarningsTemplateObject + **/ public EarningsTemplateObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsTemplateObject - */ + * problem + * @param problem Problem + * @return EarningsTemplateObject + **/ public EarningsTemplateObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningTemplate - * - * @param earningTemplate EarningsTemplate - * @return EarningsTemplateObject - */ + * earningTemplate + * @param earningTemplate EarningsTemplate + * @return EarningsTemplateObject + **/ public EarningsTemplateObject earningTemplate(EarningsTemplate earningTemplate) { this.earningTemplate = earningTemplate; return this; } - /** + /** * Get earningTemplate - * * @return earningTemplate - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningTemplate - * * @return earningTemplate EarningsTemplate - */ + **/ public EarningsTemplate getEarningTemplate() { return earningTemplate; } - /** - * earningTemplate - * - * @param earningTemplate EarningsTemplate - */ + /** + * earningTemplate + * @param earningTemplate EarningsTemplate + **/ + public void setEarningTemplate(EarningsTemplate earningTemplate) { this.earningTemplate = earningTemplate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsTemplateObject earningsTemplateObject = (EarningsTemplateObject) o; - return Objects.equals(this.pagination, earningsTemplateObject.pagination) - && Objects.equals(this.problem, earningsTemplateObject.problem) - && Objects.equals(this.earningTemplate, earningsTemplateObject.earningTemplate); + return Objects.equals(this.pagination, earningsTemplateObject.pagination) && + Objects.equals(this.problem, earningsTemplateObject.problem) && + Objects.equals(this.earningTemplate, earningsTemplateObject.earningTemplate); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningTemplate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Employee.java b/src/main/java/com/xero/models/payrollnz/Employee.java index 50d4c3cc3..2ff3d471d 100644 --- a/src/main/java/com/xero/models/payrollnz/Employee.java +++ b/src/main/java/com/xero/models/payrollnz/Employee.java @@ -9,19 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollnz.Address; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employee + */ -/** Employee */ public class Employee { StringUtil util = new StringUtil(); @@ -45,12 +61,18 @@ public class Employee { @JsonProperty("email") private String email; - /** The employee’s gender */ + /** + * The employee’s gender + */ public enum GenderEnum { - /** M */ + /** + * M + */ M("M"), - - /** F */ + + /** + * F + */ F("F"); private String value; @@ -59,31 +81,25 @@ public enum GenderEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static GenderEnum fromValue(String value) { for (GenderEnum b : GenderEnum.values()) { @@ -95,6 +111,7 @@ public static GenderEnum fromValue(String value) { } } + @JsonProperty("gender") private GenderEnum gender; @@ -125,610 +142,550 @@ public static GenderEnum fromValue(String value) { @JsonProperty("fixedTermEndDate") private LocalDate fixedTermEndDate; /** - * Xero unique identifier for the employee - * - * @param employeeID UUID - * @return Employee - */ + * Xero unique identifier for the employee + * @param employeeID UUID + * @return Employee + **/ public Employee employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * Xero unique identifier for the employee - * * @return employeeID - */ - @ApiModelProperty( - example = "d90457c4-f1be-4f2e-b4e3-f766390a7e30", - value = "Xero unique identifier for the employee") - /** + **/ + @ApiModelProperty(example = "d90457c4-f1be-4f2e-b4e3-f766390a7e30", value = "Xero unique identifier for the employee") + /** * Xero unique identifier for the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * Xero unique identifier for the employee - * - * @param employeeID UUID - */ + /** + * Xero unique identifier for the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * Title of the employee - * - * @param title String - * @return Employee - */ + * Title of the employee + * @param title String + * @return Employee + **/ public Employee title(String title) { this.title = title; return this; } - /** + /** * Title of the employee - * * @return title - */ + **/ @ApiModelProperty(example = "Mrs", value = "Title of the employee") - /** + /** * Title of the employee - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Title of the employee - * - * @param title String - */ + /** + * Title of the employee + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * First name of employee - * - * @param firstName String - * @return Employee - */ + * First name of employee + * @param firstName String + * @return Employee + **/ public Employee firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of employee - * * @return firstName - */ + **/ @ApiModelProperty(example = "Karen", value = "First name of employee") - /** + /** * First name of employee - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of employee - * - * @param firstName String - */ + /** + * First name of employee + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of employee - * - * @param lastName String - * @return Employee - */ + * Last name of employee + * @param lastName String + * @return Employee + **/ public Employee lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of employee - * * @return lastName - */ + **/ @ApiModelProperty(example = "Jones", value = "Last name of employee") - /** + /** * Last name of employee - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of employee - * - * @param lastName String - */ + /** + * Last name of employee + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Date of birth of the employee (YYYY-MM-DD) - * - * @param dateOfBirth LocalDate - * @return Employee - */ + * Date of birth of the employee (YYYY-MM-DD) + * @param dateOfBirth LocalDate + * @return Employee + **/ public Employee dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; return this; } - /** + /** * Date of birth of the employee (YYYY-MM-DD) - * * @return dateOfBirth - */ - @ApiModelProperty( - example = "Wed Jan 02 00:00:00 UTC 2019", - value = "Date of birth of the employee (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "Wed Jan 02 00:00:00 UTC 2019", value = "Date of birth of the employee (YYYY-MM-DD)") + /** * Date of birth of the employee (YYYY-MM-DD) - * * @return dateOfBirth LocalDate - */ + **/ public LocalDate getDateOfBirth() { return dateOfBirth; } - /** - * Date of birth of the employee (YYYY-MM-DD) - * - * @param dateOfBirth LocalDate - */ + /** + * Date of birth of the employee (YYYY-MM-DD) + * @param dateOfBirth LocalDate + **/ + public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } /** - * address - * - * @param address Address - * @return Employee - */ + * address + * @param address Address + * @return Employee + **/ public Employee address(Address address) { this.address = address; return this; } - /** + /** * Get address - * * @return address - */ + **/ @ApiModelProperty(value = "") - /** + /** * address - * * @return address Address - */ + **/ public Address getAddress() { return address; } - /** - * address - * - * @param address Address - */ + /** + * address + * @param address Address + **/ + public void setAddress(Address address) { this.address = address; } /** - * The email address for the employee - * - * @param email String - * @return Employee - */ + * The email address for the employee + * @param email String + * @return Employee + **/ public Employee email(String email) { this.email = email; return this; } - /** + /** * The email address for the employee - * * @return email - */ + **/ @ApiModelProperty(example = "developer@me.com", value = "The email address for the employee") - /** + /** * The email address for the employee - * * @return email String - */ + **/ public String getEmail() { return email; } - /** - * The email address for the employee - * - * @param email String - */ + /** + * The email address for the employee + * @param email String + **/ + public void setEmail(String email) { this.email = email; } /** - * The employee’s gender - * - * @param gender GenderEnum - * @return Employee - */ + * The employee’s gender + * @param gender GenderEnum + * @return Employee + **/ public Employee gender(GenderEnum gender) { this.gender = gender; return this; } - /** + /** * The employee’s gender - * * @return gender - */ + **/ @ApiModelProperty(example = "F", value = "The employee’s gender") - /** + /** * The employee’s gender - * * @return gender GenderEnum - */ + **/ public GenderEnum getGender() { return gender; } - /** - * The employee’s gender - * - * @param gender GenderEnum - */ + /** + * The employee’s gender + * @param gender GenderEnum + **/ + public void setGender(GenderEnum gender) { this.gender = gender; } /** - * Employee phone number - * - * @param phoneNumber String - * @return Employee - */ + * Employee phone number + * @param phoneNumber String + * @return Employee + **/ public Employee phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; return this; } - /** + /** * Employee phone number - * * @return phoneNumber - */ + **/ @ApiModelProperty(example = "415-555-1212", value = "Employee phone number") - /** + /** * Employee phone number - * * @return phoneNumber String - */ + **/ public String getPhoneNumber() { return phoneNumber; } - /** - * Employee phone number - * - * @param phoneNumber String - */ + /** + * Employee phone number + * @param phoneNumber String + **/ + public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } /** - * Employment start date of the employee at the time it was requested - * - * @param startDate LocalDate - * @return Employee - */ + * Employment start date of the employee at the time it was requested + * @param startDate LocalDate + * @return Employee + **/ public Employee startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Employment start date of the employee at the time it was requested - * * @return startDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = "Employment start date of the employee at the time it was requested") - /** + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "Employment start date of the employee at the time it was requested") + /** * Employment start date of the employee at the time it was requested - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Employment start date of the employee at the time it was requested - * - * @param startDate LocalDate - */ + /** + * Employment start date of the employee at the time it was requested + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * Employment end date of the employee at the time it was requested - * - * @param endDate LocalDate - * @return Employee - */ + * Employment end date of the employee at the time it was requested + * @param endDate LocalDate + * @return Employee + **/ public Employee endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * Employment end date of the employee at the time it was requested - * * @return endDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = "Employment end date of the employee at the time it was requested") - /** + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "Employment end date of the employee at the time it was requested") + /** * Employment end date of the employee at the time it was requested - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * Employment end date of the employee at the time it was requested - * - * @param endDate LocalDate - */ + /** + * Employment end date of the employee at the time it was requested + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - * @return Employee - */ + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + * @return Employee + **/ public Employee payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar of the employee") - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * UTC timestamp of last update to the employee - * - * @param updatedDateUTC LocalDateTime - * @return Employee - */ + * UTC timestamp of last update to the employee + * @param updatedDateUTC LocalDateTime + * @return Employee + **/ public Employee updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of last update to the employee - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of last update to the employee") - /** + /** * UTC timestamp of last update to the employee - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of last update to the employee - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of last update to the employee + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } /** - * UTC timestamp when the employee was created in Xero - * - * @param createdDateUTC LocalDateTime - * @return Employee - */ + * UTC timestamp when the employee was created in Xero + * @param createdDateUTC LocalDateTime + * @return Employee + **/ public Employee createdDateUTC(LocalDateTime createdDateUTC) { this.createdDateUTC = createdDateUTC; return this; } - /** + /** * UTC timestamp when the employee was created in Xero - * * @return createdDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp when the employee was created in Xero") - /** + /** * UTC timestamp when the employee was created in Xero - * * @return createdDateUTC LocalDateTime - */ + **/ public LocalDateTime getCreatedDateUTC() { return createdDateUTC; } - /** - * UTC timestamp when the employee was created in Xero - * - * @param createdDateUTC LocalDateTime - */ + /** + * UTC timestamp when the employee was created in Xero + * @param createdDateUTC LocalDateTime + **/ + public void setCreatedDateUTC(LocalDateTime createdDateUTC) { this.createdDateUTC = createdDateUTC; } /** - * Employee's job title - * - * @param jobTitle String - * @return Employee - */ + * Employee's job title + * @param jobTitle String + * @return Employee + **/ public Employee jobTitle(String jobTitle) { this.jobTitle = jobTitle; return this; } - /** + /** * Employee's job title - * * @return jobTitle - */ + **/ @ApiModelProperty(example = "General Manager", value = "Employee's job title") - /** + /** * Employee's job title - * * @return jobTitle String - */ + **/ public String getJobTitle() { return jobTitle; } - /** - * Employee's job title - * - * @param jobTitle String - */ + /** + * Employee's job title + * @param jobTitle String + **/ + public void setJobTitle(String jobTitle) { this.jobTitle = jobTitle; } /** - * Engagement type of the employee - * - * @param engagementType String - * @return Employee - */ + * Engagement type of the employee + * @param engagementType String + * @return Employee + **/ public Employee engagementType(String engagementType) { this.engagementType = engagementType; return this; } - /** + /** * Engagement type of the employee - * * @return engagementType - */ + **/ @ApiModelProperty(example = "Permanent", value = "Engagement type of the employee") - /** + /** * Engagement type of the employee - * * @return engagementType String - */ + **/ public String getEngagementType() { return engagementType; } - /** - * Engagement type of the employee - * - * @param engagementType String - */ + /** + * Engagement type of the employee + * @param engagementType String + **/ + public void setEngagementType(String engagementType) { this.engagementType = engagementType; } /** - * End date for an employee with a fixed-term engagement type - * - * @param fixedTermEndDate LocalDate - * @return Employee - */ + * End date for an employee with a fixed-term engagement type + * @param fixedTermEndDate LocalDate + * @return Employee + **/ public Employee fixedTermEndDate(LocalDate fixedTermEndDate) { this.fixedTermEndDate = fixedTermEndDate; return this; } - /** + /** * End date for an employee with a fixed-term engagement type - * * @return fixedTermEndDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = "End date for an employee with a fixed-term engagement type") - /** + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "End date for an employee with a fixed-term engagement type") + /** * End date for an employee with a fixed-term engagement type - * * @return fixedTermEndDate LocalDate - */ + **/ public LocalDate getFixedTermEndDate() { return fixedTermEndDate; } - /** - * End date for an employee with a fixed-term engagement type - * - * @param fixedTermEndDate LocalDate - */ + /** + * End date for an employee with a fixed-term engagement type + * @param fixedTermEndDate LocalDate + **/ + public void setFixedTermEndDate(LocalDate fixedTermEndDate) { this.fixedTermEndDate = fixedTermEndDate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -738,47 +695,31 @@ public boolean equals(java.lang.Object o) { return false; } Employee employee = (Employee) o; - return Objects.equals(this.employeeID, employee.employeeID) - && Objects.equals(this.title, employee.title) - && Objects.equals(this.firstName, employee.firstName) - && Objects.equals(this.lastName, employee.lastName) - && Objects.equals(this.dateOfBirth, employee.dateOfBirth) - && Objects.equals(this.address, employee.address) - && Objects.equals(this.email, employee.email) - && Objects.equals(this.gender, employee.gender) - && Objects.equals(this.phoneNumber, employee.phoneNumber) - && Objects.equals(this.startDate, employee.startDate) - && Objects.equals(this.endDate, employee.endDate) - && Objects.equals(this.payrollCalendarID, employee.payrollCalendarID) - && Objects.equals(this.updatedDateUTC, employee.updatedDateUTC) - && Objects.equals(this.createdDateUTC, employee.createdDateUTC) - && Objects.equals(this.jobTitle, employee.jobTitle) - && Objects.equals(this.engagementType, employee.engagementType) - && Objects.equals(this.fixedTermEndDate, employee.fixedTermEndDate); + return Objects.equals(this.employeeID, employee.employeeID) && + Objects.equals(this.title, employee.title) && + Objects.equals(this.firstName, employee.firstName) && + Objects.equals(this.lastName, employee.lastName) && + Objects.equals(this.dateOfBirth, employee.dateOfBirth) && + Objects.equals(this.address, employee.address) && + Objects.equals(this.email, employee.email) && + Objects.equals(this.gender, employee.gender) && + Objects.equals(this.phoneNumber, employee.phoneNumber) && + Objects.equals(this.startDate, employee.startDate) && + Objects.equals(this.endDate, employee.endDate) && + Objects.equals(this.payrollCalendarID, employee.payrollCalendarID) && + Objects.equals(this.updatedDateUTC, employee.updatedDateUTC) && + Objects.equals(this.createdDateUTC, employee.createdDateUTC) && + Objects.equals(this.jobTitle, employee.jobTitle) && + Objects.equals(this.engagementType, employee.engagementType) && + Objects.equals(this.fixedTermEndDate, employee.fixedTermEndDate); } @Override public int hashCode() { - return Objects.hash( - employeeID, - title, - firstName, - lastName, - dateOfBirth, - address, - email, - gender, - phoneNumber, - startDate, - endDate, - payrollCalendarID, - updatedDateUTC, - createdDateUTC, - jobTitle, - engagementType, - fixedTermEndDate); + return Objects.hash(employeeID, title, firstName, lastName, dateOfBirth, address, email, gender, phoneNumber, startDate, endDate, payrollCalendarID, updatedDateUTC, createdDateUTC, jobTitle, engagementType, fixedTermEndDate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -805,7 +746,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -813,4 +755,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeEarningsTemplates.java b/src/main/java/com/xero/models/payrollnz/EmployeeEarningsTemplates.java index dd4f67ef2..ba7d1b224 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeEarningsTemplates.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeEarningsTemplates.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EarningsTemplate; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeEarningsTemplates + */ -/** EmployeeEarningsTemplates */ public class EmployeeEarningsTemplates { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeeEarningsTemplates { @JsonProperty("earningTemplates") private List earningTemplates = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeEarningsTemplates - */ + * pagination + * @param pagination Pagination + * @return EmployeeEarningsTemplates + **/ public EmployeeEarningsTemplates pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeEarningsTemplates - */ + * problem + * @param problem Problem + * @return EmployeeEarningsTemplates + **/ public EmployeeEarningsTemplates problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - * @return EmployeeEarningsTemplates - */ + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + * @return EmployeeEarningsTemplates + **/ public EmployeeEarningsTemplates earningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; return this; @@ -113,10 +126,9 @@ public EmployeeEarningsTemplates earningTemplates(List earning /** * earningTemplates - * - * @param earningTemplatesItem EarningsTemplate + * @param earningTemplatesItem EarningsTemplate * @return EmployeeEarningsTemplates - */ + **/ public EmployeeEarningsTemplates addEarningTemplatesItem(EarningsTemplate earningTemplatesItem) { if (this.earningTemplates == null) { this.earningTemplates = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeeEarningsTemplates addEarningTemplatesItem(EarningsTemplate earnin return this; } - /** + /** * Get earningTemplates - * * @return earningTemplates - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningTemplates - * * @return earningTemplates List - */ + **/ public List getEarningTemplates() { return earningTemplates; } - /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - */ + /** + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + **/ + public void setEarningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeEarningsTemplates employeeEarningsTemplates = (EmployeeEarningsTemplates) o; - return Objects.equals(this.pagination, employeeEarningsTemplates.pagination) - && Objects.equals(this.problem, employeeEarningsTemplates.problem) - && Objects.equals(this.earningTemplates, employeeEarningsTemplates.earningTemplates); + return Objects.equals(this.pagination, employeeEarningsTemplates.pagination) && + Objects.equals(this.problem, employeeEarningsTemplates.problem) && + Objects.equals(this.earningTemplates, employeeEarningsTemplates.earningTemplates); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningTemplates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeave.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeave.java index 3e257138d..8c574af36 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeave.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeave.java @@ -9,19 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.LeavePeriod; +import io.swagger.annotations.ApiModel; 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; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeave + */ -/** EmployeeLeave */ public class EmployeeLeave { StringUtil util = new StringUtil(); @@ -46,201 +64,180 @@ public class EmployeeLeave { @JsonProperty("updatedDateUTC") private LocalDateTime updatedDateUTC; /** - * The Xero identifier for LeaveType - * - * @param leaveID UUID - * @return EmployeeLeave - */ + * The Xero identifier for LeaveType + * @param leaveID UUID + * @return EmployeeLeave + **/ public EmployeeLeave leaveID(UUID leaveID) { this.leaveID = leaveID; return this; } - /** + /** * The Xero identifier for LeaveType - * * @return leaveID - */ + **/ @ApiModelProperty(value = "The Xero identifier for LeaveType") - /** + /** * The Xero identifier for LeaveType - * * @return leaveID UUID - */ + **/ public UUID getLeaveID() { return leaveID; } - /** - * The Xero identifier for LeaveType - * - * @param leaveID UUID - */ + /** + * The Xero identifier for LeaveType + * @param leaveID UUID + **/ + public void setLeaveID(UUID leaveID) { this.leaveID = leaveID; } /** - * The Xero identifier for LeaveType - * - * @param leaveTypeID UUID - * @return EmployeeLeave - */ + * The Xero identifier for LeaveType + * @param leaveTypeID UUID + * @return EmployeeLeave + **/ public EmployeeLeave leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * The Xero identifier for LeaveType - * * @return leaveTypeID - */ + **/ @ApiModelProperty(required = true, value = "The Xero identifier for LeaveType") - /** + /** * The Xero identifier for LeaveType - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The Xero identifier for LeaveType - * - * @param leaveTypeID UUID - */ + /** + * The Xero identifier for LeaveType + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The description of the leave (max length = 50) - * - * @param description String - * @return EmployeeLeave - */ + * The description of the leave (max length = 50) + * @param description String + * @return EmployeeLeave + **/ public EmployeeLeave description(String description) { this.description = description; return this; } - /** - * The description of the leave (max length = 50) - * + /** + * The description of the leave (max length = 50) * @return description - */ + **/ @ApiModelProperty(required = true, value = "The description of the leave (max length = 50)") - /** - * The description of the leave (max length = 50) - * + /** + * The description of the leave (max length = 50) * @return description String - */ + **/ public String getDescription() { return description; } - /** - * The description of the leave (max length = 50) - * - * @param description String - */ + /** + * The description of the leave (max length = 50) + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Start date of the leave (YYYY-MM-DD) - * - * @param startDate LocalDate - * @return EmployeeLeave - */ + * Start date of the leave (YYYY-MM-DD) + * @param startDate LocalDate + * @return EmployeeLeave + **/ public EmployeeLeave startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the leave (YYYY-MM-DD) - * * @return startDate - */ + **/ @ApiModelProperty(required = true, value = "Start date of the leave (YYYY-MM-DD)") - /** + /** * Start date of the leave (YYYY-MM-DD) - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the leave (YYYY-MM-DD) - * - * @param startDate LocalDate - */ + /** + * Start date of the leave (YYYY-MM-DD) + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * End date of the leave (YYYY-MM-DD) - * - * @param endDate LocalDate - * @return EmployeeLeave - */ + * End date of the leave (YYYY-MM-DD) + * @param endDate LocalDate + * @return EmployeeLeave + **/ public EmployeeLeave endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * End date of the leave (YYYY-MM-DD) - * * @return endDate - */ + **/ @ApiModelProperty(required = true, value = "End date of the leave (YYYY-MM-DD)") - /** + /** * End date of the leave (YYYY-MM-DD) - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * End date of the leave (YYYY-MM-DD) - * - * @param endDate LocalDate - */ + /** + * End date of the leave (YYYY-MM-DD) + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * - * @param periods List<LeavePeriod> - * @return EmployeeLeave - */ + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + * @param periods List<LeavePeriod> + * @return EmployeeLeave + **/ public EmployeeLeave periods(List periods) { this.periods = periods; return this; } /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * - * @param periodsItem LeavePeriod + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + * @param periodsItem LeavePeriod * @return EmployeeLeave - */ + **/ public EmployeeLeave addPeriodsItem(LeavePeriod periodsItem) { if (this.periods == null) { this.periods = new ArrayList(); @@ -249,76 +246,61 @@ public EmployeeLeave addPeriodsItem(LeavePeriod periodsItem) { return this; } - /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * + /** + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. * @return periods - */ - @ApiModelProperty( - value = - "The leave period information. The StartDate, EndDate and NumberOfUnits needs to be" - + " specified when you do not want to calculate NumberOfUnits automatically. Using" - + " incorrect period StartDate and EndDate will result in automatic computation of" - + " the NumberOfUnits.") - /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * + **/ + @ApiModelProperty(value = "The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits.") + /** + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. * @return periods List - */ + **/ public List getPeriods() { return periods; } - /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * - * @param periods List<LeavePeriod> - */ + /** + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + * @param periods List<LeavePeriod> + **/ + public void setPeriods(List periods) { this.periods = periods; } /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - * @return EmployeeLeave - */ + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + * @return EmployeeLeave + **/ public EmployeeLeave updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of last update to the leave type note") - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -328,21 +310,21 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeave employeeLeave = (EmployeeLeave) o; - return Objects.equals(this.leaveID, employeeLeave.leaveID) - && Objects.equals(this.leaveTypeID, employeeLeave.leaveTypeID) - && Objects.equals(this.description, employeeLeave.description) - && Objects.equals(this.startDate, employeeLeave.startDate) - && Objects.equals(this.endDate, employeeLeave.endDate) - && Objects.equals(this.periods, employeeLeave.periods) - && Objects.equals(this.updatedDateUTC, employeeLeave.updatedDateUTC); + return Objects.equals(this.leaveID, employeeLeave.leaveID) && + Objects.equals(this.leaveTypeID, employeeLeave.leaveTypeID) && + Objects.equals(this.description, employeeLeave.description) && + Objects.equals(this.startDate, employeeLeave.startDate) && + Objects.equals(this.endDate, employeeLeave.endDate) && + Objects.equals(this.periods, employeeLeave.periods) && + Objects.equals(this.updatedDateUTC, employeeLeave.updatedDateUTC); } @Override public int hashCode() { - return Objects.hash( - leaveID, leaveTypeID, description, startDate, endDate, periods, updatedDateUTC); + return Objects.hash(leaveID, leaveTypeID, description, startDate, endDate, periods, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -359,7 +341,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -367,4 +350,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalance.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalance.java index c08096743..3f4a95ea7 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalance.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalance.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveBalance + */ -/** EmployeeLeaveBalance */ public class EmployeeLeaveBalance { StringUtil util = new StringUtil(); @@ -33,145 +50,134 @@ public class EmployeeLeaveBalance { @JsonProperty("typeOfUnits") private String typeOfUnits; /** - * Name of the leave type. - * - * @param name String - * @return EmployeeLeaveBalance - */ + * Name of the leave type. + * @param name String + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance name(String name) { this.name = name; return this; } - /** + /** * Name of the leave type. - * * @return name - */ + **/ @ApiModelProperty(example = "Holiday", value = "Name of the leave type.") - /** + /** * Name of the leave type. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the leave type. - * - * @param name String - */ + /** + * Name of the leave type. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - * @return EmployeeLeaveBalance - */ + * The Xero identifier for leave type + * @param leaveTypeID UUID + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(value = "The Xero identifier for leave type") - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - */ + /** + * The Xero identifier for leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The employees current balance for the corresponding leave type. - * - * @param balance Double - * @return EmployeeLeaveBalance - */ + * The employees current balance for the corresponding leave type. + * @param balance Double + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance balance(Double balance) { this.balance = balance; return this; } - /** + /** * The employees current balance for the corresponding leave type. - * * @return balance - */ + **/ @ApiModelProperty(value = "The employees current balance for the corresponding leave type.") - /** + /** * The employees current balance for the corresponding leave type. - * * @return balance Double - */ + **/ public Double getBalance() { return balance; } - /** - * The employees current balance for the corresponding leave type. - * - * @param balance Double - */ + /** + * The employees current balance for the corresponding leave type. + * @param balance Double + **/ + public void setBalance(Double balance) { this.balance = balance; } /** - * The type of the units of the leave. - * - * @param typeOfUnits String - * @return EmployeeLeaveBalance - */ + * The type of the units of the leave. + * @param typeOfUnits String + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * The type of the units of the leave. - * * @return typeOfUnits - */ + **/ @ApiModelProperty(example = "hours", value = "The type of the units of the leave.") - /** + /** * The type of the units of the leave. - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of the units of the leave. - * - * @param typeOfUnits String - */ + /** + * The type of the units of the leave. + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveBalance employeeLeaveBalance = (EmployeeLeaveBalance) o; - return Objects.equals(this.name, employeeLeaveBalance.name) - && Objects.equals(this.leaveTypeID, employeeLeaveBalance.leaveTypeID) - && Objects.equals(this.balance, employeeLeaveBalance.balance) - && Objects.equals(this.typeOfUnits, employeeLeaveBalance.typeOfUnits); + return Objects.equals(this.name, employeeLeaveBalance.name) && + Objects.equals(this.leaveTypeID, employeeLeaveBalance.leaveTypeID) && + Objects.equals(this.balance, employeeLeaveBalance.balance) && + Objects.equals(this.typeOfUnits, employeeLeaveBalance.typeOfUnits); } @Override @@ -192,6 +198,7 @@ public int hashCode() { return Objects.hash(name, leaveTypeID, balance, typeOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalances.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalances.java index a089bd8a6..de53d635b 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalances.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveBalances.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeLeaveBalance; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveBalances + */ -/** EmployeeLeaveBalances */ public class EmployeeLeaveBalances { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeeLeaveBalances { @JsonProperty("leaveBalances") private List leaveBalances = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveBalances - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveBalances + **/ public EmployeeLeaveBalances pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveBalances - */ + * problem + * @param problem Problem + * @return EmployeeLeaveBalances + **/ public EmployeeLeaveBalances problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveBalances - * - * @param leaveBalances List<EmployeeLeaveBalance> - * @return EmployeeLeaveBalances - */ + * leaveBalances + * @param leaveBalances List<EmployeeLeaveBalance> + * @return EmployeeLeaveBalances + **/ public EmployeeLeaveBalances leaveBalances(List leaveBalances) { this.leaveBalances = leaveBalances; return this; @@ -113,10 +126,9 @@ public EmployeeLeaveBalances leaveBalances(List leaveBalan /** * leaveBalances - * - * @param leaveBalancesItem EmployeeLeaveBalance + * @param leaveBalancesItem EmployeeLeaveBalance * @return EmployeeLeaveBalances - */ + **/ public EmployeeLeaveBalances addLeaveBalancesItem(EmployeeLeaveBalance leaveBalancesItem) { if (this.leaveBalances == null) { this.leaveBalances = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeeLeaveBalances addLeaveBalancesItem(EmployeeLeaveBalance leaveBala return this; } - /** + /** * Get leaveBalances - * * @return leaveBalances - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveBalances - * * @return leaveBalances List - */ + **/ public List getLeaveBalances() { return leaveBalances; } - /** - * leaveBalances - * - * @param leaveBalances List<EmployeeLeaveBalance> - */ + /** + * leaveBalances + * @param leaveBalances List<EmployeeLeaveBalance> + **/ + public void setLeaveBalances(List leaveBalances) { this.leaveBalances = leaveBalances; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveBalances employeeLeaveBalances = (EmployeeLeaveBalances) o; - return Objects.equals(this.pagination, employeeLeaveBalances.pagination) - && Objects.equals(this.problem, employeeLeaveBalances.problem) - && Objects.equals(this.leaveBalances, employeeLeaveBalances.leaveBalances); + return Objects.equals(this.pagination, employeeLeaveBalances.pagination) && + Objects.equals(this.problem, employeeLeaveBalances.problem) && + Objects.equals(this.leaveBalances, employeeLeaveBalances.leaveBalances); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveBalances); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveObject.java index 16a2cca8d..5a70e0f0c 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeLeave; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveObject + */ -/** EmployeeLeaveObject */ public class EmployeeLeaveObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeLeaveObject { @JsonProperty("leave") private EmployeeLeave leave; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveObject + **/ public EmployeeLeaveObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveObject - */ + * problem + * @param problem Problem + * @return EmployeeLeaveObject + **/ public EmployeeLeaveObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leave - * - * @param leave EmployeeLeave - * @return EmployeeLeaveObject - */ + * leave + * @param leave EmployeeLeave + * @return EmployeeLeaveObject + **/ public EmployeeLeaveObject leave(EmployeeLeave leave) { this.leave = leave; return this; } - /** + /** * Get leave - * * @return leave - */ + **/ @ApiModelProperty(value = "") - /** + /** * leave - * * @return leave EmployeeLeave - */ + **/ public EmployeeLeave getLeave() { return leave; } - /** - * leave - * - * @param leave EmployeeLeave - */ + /** + * leave + * @param leave EmployeeLeave + **/ + public void setLeave(EmployeeLeave leave) { this.leave = leave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveObject employeeLeaveObject = (EmployeeLeaveObject) o; - return Objects.equals(this.pagination, employeeLeaveObject.pagination) - && Objects.equals(this.problem, employeeLeaveObject.problem) - && Objects.equals(this.leave, employeeLeaveObject.leave); + return Objects.equals(this.pagination, employeeLeaveObject.pagination) && + Objects.equals(this.problem, employeeLeaveObject.problem) && + Objects.equals(this.leave, employeeLeaveObject.leave); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetup.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetup.java index 8b01f013b..706dc5f03 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetup.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetup.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveSetup + */ -/** EmployeeLeaveSetup */ public class EmployeeLeaveSetup { StringUtil util = new StringUtil(); @@ -57,490 +74,390 @@ public class EmployeeLeaveSetup { @JsonProperty("AnnualLeaveAnniversaryDate") private LocalDate annualLeaveAnniversaryDate; /** - * Identifier if holiday pay will be included in each payslip - * - * @param includeHolidayPay Boolean - * @return EmployeeLeaveSetup - */ + * Identifier if holiday pay will be included in each payslip + * @param includeHolidayPay Boolean + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup includeHolidayPay(Boolean includeHolidayPay) { this.includeHolidayPay = includeHolidayPay; return this; } - /** + /** * Identifier if holiday pay will be included in each payslip - * * @return includeHolidayPay - */ - @ApiModelProperty( - example = "false", - value = "Identifier if holiday pay will be included in each payslip") - /** + **/ + @ApiModelProperty(example = "false", value = "Identifier if holiday pay will be included in each payslip") + /** * Identifier if holiday pay will be included in each payslip - * * @return includeHolidayPay Boolean - */ + **/ public Boolean getIncludeHolidayPay() { return includeHolidayPay; } - /** - * Identifier if holiday pay will be included in each payslip - * - * @param includeHolidayPay Boolean - */ + /** + * Identifier if holiday pay will be included in each payslip + * @param includeHolidayPay Boolean + **/ + public void setIncludeHolidayPay(Boolean includeHolidayPay) { this.includeHolidayPay = includeHolidayPay; } /** - * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last - * work anniversary. - * - * @param holidayPayOpeningBalance Double - * @return EmployeeLeaveSetup - */ + * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last work anniversary. + * @param holidayPayOpeningBalance Double + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup holidayPayOpeningBalance(Double holidayPayOpeningBalance) { this.holidayPayOpeningBalance = holidayPayOpeningBalance; return this; } - /** - * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last - * work anniversary. - * + /** + * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last work anniversary. * @return holidayPayOpeningBalance - */ - @ApiModelProperty( - example = "10.5", - value = - "Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their" - + " last work anniversary.") - /** - * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last - * work anniversary. - * + **/ + @ApiModelProperty(example = "10.5", value = "Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last work anniversary.") + /** + * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last work anniversary. * @return holidayPayOpeningBalance Double - */ + **/ public Double getHolidayPayOpeningBalance() { return holidayPayOpeningBalance; } - /** - * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last - * work anniversary. - * - * @param holidayPayOpeningBalance Double - */ + /** + * Initial holiday pay balance. A percentage — usually 8% — of gross earnings since their last work anniversary. + * @param holidayPayOpeningBalance Double + **/ + public void setHolidayPayOpeningBalance(Double holidayPayOpeningBalance) { this.holidayPayOpeningBalance = holidayPayOpeningBalance; } /** - * Initial annual leave balance. The balance at their last anniversary, less any leave taken since - * then and excluding accrued annual leave. - * - * @param annualLeaveOpeningBalance Double - * @return EmployeeLeaveSetup - */ + * Initial annual leave balance. The balance at their last anniversary, less any leave taken since then and excluding accrued annual leave. + * @param annualLeaveOpeningBalance Double + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup annualLeaveOpeningBalance(Double annualLeaveOpeningBalance) { this.annualLeaveOpeningBalance = annualLeaveOpeningBalance; return this; } - /** - * Initial annual leave balance. The balance at their last anniversary, less any leave taken since - * then and excluding accrued annual leave. - * + /** + * Initial annual leave balance. The balance at their last anniversary, less any leave taken since then and excluding accrued annual leave. * @return annualLeaveOpeningBalance - */ - @ApiModelProperty( - example = "25.89", - value = - "Initial annual leave balance. The balance at their last anniversary, less any leave" - + " taken since then and excluding accrued annual leave.") - /** - * Initial annual leave balance. The balance at their last anniversary, less any leave taken since - * then and excluding accrued annual leave. - * + **/ + @ApiModelProperty(example = "25.89", value = "Initial annual leave balance. The balance at their last anniversary, less any leave taken since then and excluding accrued annual leave.") + /** + * Initial annual leave balance. The balance at their last anniversary, less any leave taken since then and excluding accrued annual leave. * @return annualLeaveOpeningBalance Double - */ + **/ public Double getAnnualLeaveOpeningBalance() { return annualLeaveOpeningBalance; } - /** - * Initial annual leave balance. The balance at their last anniversary, less any leave taken since - * then and excluding accrued annual leave. - * - * @param annualLeaveOpeningBalance Double - */ + /** + * Initial annual leave balance. The balance at their last anniversary, less any leave taken since then and excluding accrued annual leave. + * @param annualLeaveOpeningBalance Double + **/ + public void setAnnualLeaveOpeningBalance(Double annualLeaveOpeningBalance) { this.annualLeaveOpeningBalance = annualLeaveOpeningBalance; } /** - * The dollar value of annual leave opening balance if negative. - * - * @param negativeAnnualLeaveBalancePaidAmount Double - * @return EmployeeLeaveSetup - */ - public EmployeeLeaveSetup negativeAnnualLeaveBalancePaidAmount( - Double negativeAnnualLeaveBalancePaidAmount) { + * The dollar value of annual leave opening balance if negative. + * @param negativeAnnualLeaveBalancePaidAmount Double + * @return EmployeeLeaveSetup + **/ + public EmployeeLeaveSetup negativeAnnualLeaveBalancePaidAmount(Double negativeAnnualLeaveBalancePaidAmount) { this.negativeAnnualLeaveBalancePaidAmount = negativeAnnualLeaveBalancePaidAmount; return this; } - /** + /** * The dollar value of annual leave opening balance if negative. - * * @return negativeAnnualLeaveBalancePaidAmount - */ - @ApiModelProperty( - example = "10.0", - value = "The dollar value of annual leave opening balance if negative.") - /** + **/ + @ApiModelProperty(example = "10.0", value = "The dollar value of annual leave opening balance if negative.") + /** * The dollar value of annual leave opening balance if negative. - * * @return negativeAnnualLeaveBalancePaidAmount Double - */ + **/ public Double getNegativeAnnualLeaveBalancePaidAmount() { return negativeAnnualLeaveBalancePaidAmount; } - /** - * The dollar value of annual leave opening balance if negative. - * - * @param negativeAnnualLeaveBalancePaidAmount Double - */ + /** + * The dollar value of annual leave opening balance if negative. + * @param negativeAnnualLeaveBalancePaidAmount Double + **/ + public void setNegativeAnnualLeaveBalancePaidAmount(Double negativeAnnualLeaveBalancePaidAmount) { this.negativeAnnualLeaveBalancePaidAmount = negativeAnnualLeaveBalancePaidAmount; } /** - * Deprecated use SickLeaveToAccrueAnnually - * - * @param sickLeaveHoursToAccrueAnnually Double - * @return EmployeeLeaveSetup - */ + * Deprecated use SickLeaveToAccrueAnnually + * @param sickLeaveHoursToAccrueAnnually Double + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup sickLeaveHoursToAccrueAnnually(Double sickLeaveHoursToAccrueAnnually) { this.sickLeaveHoursToAccrueAnnually = sickLeaveHoursToAccrueAnnually; return this; } - /** + /** * Deprecated use SickLeaveToAccrueAnnually - * * @return sickLeaveHoursToAccrueAnnually - */ + **/ @ApiModelProperty(example = "100.5", value = "Deprecated use SickLeaveToAccrueAnnually") - /** + /** * Deprecated use SickLeaveToAccrueAnnually - * * @return sickLeaveHoursToAccrueAnnually Double - */ + **/ public Double getSickLeaveHoursToAccrueAnnually() { return sickLeaveHoursToAccrueAnnually; } - /** - * Deprecated use SickLeaveToAccrueAnnually - * - * @param sickLeaveHoursToAccrueAnnually Double - */ + /** + * Deprecated use SickLeaveToAccrueAnnually + * @param sickLeaveHoursToAccrueAnnually Double + **/ + public void setSickLeaveHoursToAccrueAnnually(Double sickLeaveHoursToAccrueAnnually) { this.sickLeaveHoursToAccrueAnnually = sickLeaveHoursToAccrueAnnually; } /** - * Deprecated use SickLeaveMaximumToAccrue - * - * @param sickLeaveMaximumHoursToAccrue Double - * @return EmployeeLeaveSetup - */ + * Deprecated use SickLeaveMaximumToAccrue + * @param sickLeaveMaximumHoursToAccrue Double + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup sickLeaveMaximumHoursToAccrue(Double sickLeaveMaximumHoursToAccrue) { this.sickLeaveMaximumHoursToAccrue = sickLeaveMaximumHoursToAccrue; return this; } - /** + /** * Deprecated use SickLeaveMaximumToAccrue - * * @return sickLeaveMaximumHoursToAccrue - */ + **/ @ApiModelProperty(example = "200.5", value = "Deprecated use SickLeaveMaximumToAccrue") - /** + /** * Deprecated use SickLeaveMaximumToAccrue - * * @return sickLeaveMaximumHoursToAccrue Double - */ + **/ public Double getSickLeaveMaximumHoursToAccrue() { return sickLeaveMaximumHoursToAccrue; } - /** - * Deprecated use SickLeaveMaximumToAccrue - * - * @param sickLeaveMaximumHoursToAccrue Double - */ + /** + * Deprecated use SickLeaveMaximumToAccrue + * @param sickLeaveMaximumHoursToAccrue Double + **/ + public void setSickLeaveMaximumHoursToAccrue(Double sickLeaveMaximumHoursToAccrue) { this.sickLeaveMaximumHoursToAccrue = sickLeaveMaximumHoursToAccrue; } /** - * Number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * - * @param sickLeaveToAccrueAnnually Double - * @return EmployeeLeaveSetup - */ + * Number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type + * @param sickLeaveToAccrueAnnually Double + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup sickLeaveToAccrueAnnually(Double sickLeaveToAccrueAnnually) { this.sickLeaveToAccrueAnnually = sickLeaveToAccrueAnnually; return this; } - /** - * Number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * + /** + * Number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type * @return sickLeaveToAccrueAnnually - */ - @ApiModelProperty( - example = "100.5", - value = - "Number of units accrued annually for sick leave. The type of units is determined by the" - + " property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type") - /** - * Number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * + **/ + @ApiModelProperty(example = "100.5", value = "Number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type") + /** + * Number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type * @return sickLeaveToAccrueAnnually Double - */ + **/ public Double getSickLeaveToAccrueAnnually() { return sickLeaveToAccrueAnnually; } - /** - * Number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * - * @param sickLeaveToAccrueAnnually Double - */ + /** + * Number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type + * @param sickLeaveToAccrueAnnually Double + **/ + public void setSickLeaveToAccrueAnnually(Double sickLeaveToAccrueAnnually) { this.sickLeaveToAccrueAnnually = sickLeaveToAccrueAnnually; } /** - * Maximum number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * - * @param sickLeaveMaximumToAccrue Double - * @return EmployeeLeaveSetup - */ + * Maximum number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type + * @param sickLeaveMaximumToAccrue Double + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup sickLeaveMaximumToAccrue(Double sickLeaveMaximumToAccrue) { this.sickLeaveMaximumToAccrue = sickLeaveMaximumToAccrue; return this; } - /** - * Maximum number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * + /** + * Maximum number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type * @return sickLeaveMaximumToAccrue - */ - @ApiModelProperty( - example = "200.5", - value = - "Maximum number of units accrued annually for sick leave. The type of units is" - + " determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave" - + " type") - /** - * Maximum number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * + **/ + @ApiModelProperty(example = "200.5", value = "Maximum number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type") + /** + * Maximum number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type * @return sickLeaveMaximumToAccrue Double - */ + **/ public Double getSickLeaveMaximumToAccrue() { return sickLeaveMaximumToAccrue; } - /** - * Maximum number of units accrued annually for sick leave. The type of units is determined by the - * property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type - * - * @param sickLeaveMaximumToAccrue Double - */ + /** + * Maximum number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type + * @param sickLeaveMaximumToAccrue Double + **/ + public void setSickLeaveMaximumToAccrue(Double sickLeaveMaximumToAccrue) { this.sickLeaveMaximumToAccrue = sickLeaveMaximumToAccrue; } /** - * Initial sick leave balance. This will be positive unless they've taken sick leave in - * advance - * - * @param sickLeaveOpeningBalance Double - * @return EmployeeLeaveSetup - */ + * Initial sick leave balance. This will be positive unless they've taken sick leave in advance + * @param sickLeaveOpeningBalance Double + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup sickLeaveOpeningBalance(Double sickLeaveOpeningBalance) { this.sickLeaveOpeningBalance = sickLeaveOpeningBalance; return this; } - /** - * Initial sick leave balance. This will be positive unless they've taken sick leave in - * advance - * + /** + * Initial sick leave balance. This will be positive unless they've taken sick leave in advance * @return sickLeaveOpeningBalance - */ - @ApiModelProperty( - example = "10.5", - value = - "Initial sick leave balance. This will be positive unless they've taken sick leave in" - + " advance") - /** - * Initial sick leave balance. This will be positive unless they've taken sick leave in - * advance - * + **/ + @ApiModelProperty(example = "10.5", value = "Initial sick leave balance. This will be positive unless they've taken sick leave in advance") + /** + * Initial sick leave balance. This will be positive unless they've taken sick leave in advance * @return sickLeaveOpeningBalance Double - */ + **/ public Double getSickLeaveOpeningBalance() { return sickLeaveOpeningBalance; } - /** - * Initial sick leave balance. This will be positive unless they've taken sick leave in - * advance - * - * @param sickLeaveOpeningBalance Double - */ + /** + * Initial sick leave balance. This will be positive unless they've taken sick leave in advance + * @param sickLeaveOpeningBalance Double + **/ + public void setSickLeaveOpeningBalance(Double sickLeaveOpeningBalance) { this.sickLeaveOpeningBalance = sickLeaveOpeningBalance; } /** - * Set Schedule of Accrual Type for Sick Leave - * - * @param sickLeaveScheduleOfAccrual String - * @return EmployeeLeaveSetup - */ + * Set Schedule of Accrual Type for Sick Leave + * @param sickLeaveScheduleOfAccrual String + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup sickLeaveScheduleOfAccrual(String sickLeaveScheduleOfAccrual) { this.sickLeaveScheduleOfAccrual = sickLeaveScheduleOfAccrual; return this; } - /** + /** * Set Schedule of Accrual Type for Sick Leave - * * @return sickLeaveScheduleOfAccrual - */ - @ApiModelProperty( - example = "OnAnniversaryDate", - value = "Set Schedule of Accrual Type for Sick Leave") - /** + **/ + @ApiModelProperty(example = "OnAnniversaryDate", value = "Set Schedule of Accrual Type for Sick Leave") + /** * Set Schedule of Accrual Type for Sick Leave - * * @return sickLeaveScheduleOfAccrual String - */ + **/ public String getSickLeaveScheduleOfAccrual() { return sickLeaveScheduleOfAccrual; } - /** - * Set Schedule of Accrual Type for Sick Leave - * - * @param sickLeaveScheduleOfAccrual String - */ + /** + * Set Schedule of Accrual Type for Sick Leave + * @param sickLeaveScheduleOfAccrual String + **/ + public void setSickLeaveScheduleOfAccrual(String sickLeaveScheduleOfAccrual) { this.sickLeaveScheduleOfAccrual = sickLeaveScheduleOfAccrual; } /** - * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when - * entitled to Sick Leave. When null the Employee's start date is used as the anniversary date - * - * @param sickLeaveAnniversaryDate LocalDate - * @return EmployeeLeaveSetup - */ + * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave. When null the Employee's start date is used as the anniversary date + * @param sickLeaveAnniversaryDate LocalDate + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup sickLeaveAnniversaryDate(LocalDate sickLeaveAnniversaryDate) { this.sickLeaveAnniversaryDate = sickLeaveAnniversaryDate; return this; } - /** - * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when - * entitled to Sick Leave. When null the Employee's start date is used as the anniversary date - * + /** + * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave. When null the Employee's start date is used as the anniversary date * @return sickLeaveAnniversaryDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = - "If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when" - + " entitled to Sick Leave. When null the Employee's start date is used as the" - + " anniversary date") - /** - * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when - * entitled to Sick Leave. When null the Employee's start date is used as the anniversary date - * + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave. When null the Employee's start date is used as the anniversary date") + /** + * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave. When null the Employee's start date is used as the anniversary date * @return sickLeaveAnniversaryDate LocalDate - */ + **/ public LocalDate getSickLeaveAnniversaryDate() { return sickLeaveAnniversaryDate; } - /** - * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when - * entitled to Sick Leave. When null the Employee's start date is used as the anniversary date - * - * @param sickLeaveAnniversaryDate LocalDate - */ + /** + * If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave. When null the Employee's start date is used as the anniversary date + * @param sickLeaveAnniversaryDate LocalDate + **/ + public void setSickLeaveAnniversaryDate(LocalDate sickLeaveAnniversaryDate) { this.sickLeaveAnniversaryDate = sickLeaveAnniversaryDate; } /** - * The first date the employee will accrue Annual Leave. When null the Employee's start date - * is used as the anniversary date - * - * @param annualLeaveAnniversaryDate LocalDate - * @return EmployeeLeaveSetup - */ + * The first date the employee will accrue Annual Leave. When null the Employee's start date is used as the anniversary date + * @param annualLeaveAnniversaryDate LocalDate + * @return EmployeeLeaveSetup + **/ public EmployeeLeaveSetup annualLeaveAnniversaryDate(LocalDate annualLeaveAnniversaryDate) { this.annualLeaveAnniversaryDate = annualLeaveAnniversaryDate; return this; } - /** - * The first date the employee will accrue Annual Leave. When null the Employee's start date - * is used as the anniversary date - * + /** + * The first date the employee will accrue Annual Leave. When null the Employee's start date is used as the anniversary date * @return annualLeaveAnniversaryDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = - "The first date the employee will accrue Annual Leave. When null the Employee's start" - + " date is used as the anniversary date") - /** - * The first date the employee will accrue Annual Leave. When null the Employee's start date - * is used as the anniversary date - * + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "The first date the employee will accrue Annual Leave. When null the Employee's start date is used as the anniversary date") + /** + * The first date the employee will accrue Annual Leave. When null the Employee's start date is used as the anniversary date * @return annualLeaveAnniversaryDate LocalDate - */ + **/ public LocalDate getAnnualLeaveAnniversaryDate() { return annualLeaveAnniversaryDate; } - /** - * The first date the employee will accrue Annual Leave. When null the Employee's start date - * is used as the anniversary date - * - * @param annualLeaveAnniversaryDate LocalDate - */ + /** + * The first date the employee will accrue Annual Leave. When null the Employee's start date is used as the anniversary date + * @param annualLeaveAnniversaryDate LocalDate + **/ + public void setAnnualLeaveAnniversaryDate(LocalDate annualLeaveAnniversaryDate) { this.annualLeaveAnniversaryDate = annualLeaveAnniversaryDate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -550,92 +467,49 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveSetup employeeLeaveSetup = (EmployeeLeaveSetup) o; - return Objects.equals(this.includeHolidayPay, employeeLeaveSetup.includeHolidayPay) - && Objects.equals( - this.holidayPayOpeningBalance, employeeLeaveSetup.holidayPayOpeningBalance) - && Objects.equals( - this.annualLeaveOpeningBalance, employeeLeaveSetup.annualLeaveOpeningBalance) - && Objects.equals( - this.negativeAnnualLeaveBalancePaidAmount, - employeeLeaveSetup.negativeAnnualLeaveBalancePaidAmount) - && Objects.equals( - this.sickLeaveHoursToAccrueAnnually, employeeLeaveSetup.sickLeaveHoursToAccrueAnnually) - && Objects.equals( - this.sickLeaveMaximumHoursToAccrue, employeeLeaveSetup.sickLeaveMaximumHoursToAccrue) - && Objects.equals( - this.sickLeaveToAccrueAnnually, employeeLeaveSetup.sickLeaveToAccrueAnnually) - && Objects.equals( - this.sickLeaveMaximumToAccrue, employeeLeaveSetup.sickLeaveMaximumToAccrue) - && Objects.equals(this.sickLeaveOpeningBalance, employeeLeaveSetup.sickLeaveOpeningBalance) - && Objects.equals( - this.sickLeaveScheduleOfAccrual, employeeLeaveSetup.sickLeaveScheduleOfAccrual) - && Objects.equals( - this.sickLeaveAnniversaryDate, employeeLeaveSetup.sickLeaveAnniversaryDate) - && Objects.equals( - this.annualLeaveAnniversaryDate, employeeLeaveSetup.annualLeaveAnniversaryDate); + return Objects.equals(this.includeHolidayPay, employeeLeaveSetup.includeHolidayPay) && + Objects.equals(this.holidayPayOpeningBalance, employeeLeaveSetup.holidayPayOpeningBalance) && + Objects.equals(this.annualLeaveOpeningBalance, employeeLeaveSetup.annualLeaveOpeningBalance) && + Objects.equals(this.negativeAnnualLeaveBalancePaidAmount, employeeLeaveSetup.negativeAnnualLeaveBalancePaidAmount) && + Objects.equals(this.sickLeaveHoursToAccrueAnnually, employeeLeaveSetup.sickLeaveHoursToAccrueAnnually) && + Objects.equals(this.sickLeaveMaximumHoursToAccrue, employeeLeaveSetup.sickLeaveMaximumHoursToAccrue) && + Objects.equals(this.sickLeaveToAccrueAnnually, employeeLeaveSetup.sickLeaveToAccrueAnnually) && + Objects.equals(this.sickLeaveMaximumToAccrue, employeeLeaveSetup.sickLeaveMaximumToAccrue) && + Objects.equals(this.sickLeaveOpeningBalance, employeeLeaveSetup.sickLeaveOpeningBalance) && + Objects.equals(this.sickLeaveScheduleOfAccrual, employeeLeaveSetup.sickLeaveScheduleOfAccrual) && + Objects.equals(this.sickLeaveAnniversaryDate, employeeLeaveSetup.sickLeaveAnniversaryDate) && + Objects.equals(this.annualLeaveAnniversaryDate, employeeLeaveSetup.annualLeaveAnniversaryDate); } @Override public int hashCode() { - return Objects.hash( - includeHolidayPay, - holidayPayOpeningBalance, - annualLeaveOpeningBalance, - negativeAnnualLeaveBalancePaidAmount, - sickLeaveHoursToAccrueAnnually, - sickLeaveMaximumHoursToAccrue, - sickLeaveToAccrueAnnually, - sickLeaveMaximumToAccrue, - sickLeaveOpeningBalance, - sickLeaveScheduleOfAccrual, - sickLeaveAnniversaryDate, - annualLeaveAnniversaryDate); + return Objects.hash(includeHolidayPay, holidayPayOpeningBalance, annualLeaveOpeningBalance, negativeAnnualLeaveBalancePaidAmount, sickLeaveHoursToAccrueAnnually, sickLeaveMaximumHoursToAccrue, sickLeaveToAccrueAnnually, sickLeaveMaximumToAccrue, sickLeaveOpeningBalance, sickLeaveScheduleOfAccrual, sickLeaveAnniversaryDate, annualLeaveAnniversaryDate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeLeaveSetup {\n"); sb.append(" includeHolidayPay: ").append(toIndentedString(includeHolidayPay)).append("\n"); - sb.append(" holidayPayOpeningBalance: ") - .append(toIndentedString(holidayPayOpeningBalance)) - .append("\n"); - sb.append(" annualLeaveOpeningBalance: ") - .append(toIndentedString(annualLeaveOpeningBalance)) - .append("\n"); - sb.append(" negativeAnnualLeaveBalancePaidAmount: ") - .append(toIndentedString(negativeAnnualLeaveBalancePaidAmount)) - .append("\n"); - sb.append(" sickLeaveHoursToAccrueAnnually: ") - .append(toIndentedString(sickLeaveHoursToAccrueAnnually)) - .append("\n"); - sb.append(" sickLeaveMaximumHoursToAccrue: ") - .append(toIndentedString(sickLeaveMaximumHoursToAccrue)) - .append("\n"); - sb.append(" sickLeaveToAccrueAnnually: ") - .append(toIndentedString(sickLeaveToAccrueAnnually)) - .append("\n"); - sb.append(" sickLeaveMaximumToAccrue: ") - .append(toIndentedString(sickLeaveMaximumToAccrue)) - .append("\n"); - sb.append(" sickLeaveOpeningBalance: ") - .append(toIndentedString(sickLeaveOpeningBalance)) - .append("\n"); - sb.append(" sickLeaveScheduleOfAccrual: ") - .append(toIndentedString(sickLeaveScheduleOfAccrual)) - .append("\n"); - sb.append(" sickLeaveAnniversaryDate: ") - .append(toIndentedString(sickLeaveAnniversaryDate)) - .append("\n"); - sb.append(" annualLeaveAnniversaryDate: ") - .append(toIndentedString(annualLeaveAnniversaryDate)) - .append("\n"); + sb.append(" holidayPayOpeningBalance: ").append(toIndentedString(holidayPayOpeningBalance)).append("\n"); + sb.append(" annualLeaveOpeningBalance: ").append(toIndentedString(annualLeaveOpeningBalance)).append("\n"); + sb.append(" negativeAnnualLeaveBalancePaidAmount: ").append(toIndentedString(negativeAnnualLeaveBalancePaidAmount)).append("\n"); + sb.append(" sickLeaveHoursToAccrueAnnually: ").append(toIndentedString(sickLeaveHoursToAccrueAnnually)).append("\n"); + sb.append(" sickLeaveMaximumHoursToAccrue: ").append(toIndentedString(sickLeaveMaximumHoursToAccrue)).append("\n"); + sb.append(" sickLeaveToAccrueAnnually: ").append(toIndentedString(sickLeaveToAccrueAnnually)).append("\n"); + sb.append(" sickLeaveMaximumToAccrue: ").append(toIndentedString(sickLeaveMaximumToAccrue)).append("\n"); + sb.append(" sickLeaveOpeningBalance: ").append(toIndentedString(sickLeaveOpeningBalance)).append("\n"); + sb.append(" sickLeaveScheduleOfAccrual: ").append(toIndentedString(sickLeaveScheduleOfAccrual)).append("\n"); + sb.append(" sickLeaveAnniversaryDate: ").append(toIndentedString(sickLeaveAnniversaryDate)).append("\n"); + sb.append(" annualLeaveAnniversaryDate: ").append(toIndentedString(annualLeaveAnniversaryDate)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -643,4 +517,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetupObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetupObject.java index 18e3630a3..2bba2def1 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetupObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveSetupObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeLeaveSetup; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveSetupObject + */ -/** EmployeeLeaveSetupObject */ public class EmployeeLeaveSetupObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeLeaveSetupObject { @JsonProperty("leaveSetup") private EmployeeLeaveSetup leaveSetup; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveSetupObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveSetupObject + **/ public EmployeeLeaveSetupObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveSetupObject - */ + * problem + * @param problem Problem + * @return EmployeeLeaveSetupObject + **/ public EmployeeLeaveSetupObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveSetup - * - * @param leaveSetup EmployeeLeaveSetup - * @return EmployeeLeaveSetupObject - */ + * leaveSetup + * @param leaveSetup EmployeeLeaveSetup + * @return EmployeeLeaveSetupObject + **/ public EmployeeLeaveSetupObject leaveSetup(EmployeeLeaveSetup leaveSetup) { this.leaveSetup = leaveSetup; return this; } - /** + /** * Get leaveSetup - * * @return leaveSetup - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveSetup - * * @return leaveSetup EmployeeLeaveSetup - */ + **/ public EmployeeLeaveSetup getLeaveSetup() { return leaveSetup; } - /** - * leaveSetup - * - * @param leaveSetup EmployeeLeaveSetup - */ + /** + * leaveSetup + * @param leaveSetup EmployeeLeaveSetup + **/ + public void setLeaveSetup(EmployeeLeaveSetup leaveSetup) { this.leaveSetup = leaveSetup; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveSetupObject employeeLeaveSetupObject = (EmployeeLeaveSetupObject) o; - return Objects.equals(this.pagination, employeeLeaveSetupObject.pagination) - && Objects.equals(this.problem, employeeLeaveSetupObject.problem) - && Objects.equals(this.leaveSetup, employeeLeaveSetupObject.leaveSetup); + return Objects.equals(this.pagination, employeeLeaveSetupObject.pagination) && + Objects.equals(this.problem, employeeLeaveSetupObject.problem) && + Objects.equals(this.leaveSetup, employeeLeaveSetupObject.leaveSetup); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveSetup); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveType.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveType.java index ea43c1be5..ab6202013 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveType.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveType.java @@ -9,35 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveType + */ -/** EmployeeLeaveType */ public class EmployeeLeaveType { StringUtil util = new StringUtil(); @JsonProperty("leaveTypeID") private UUID leaveTypeID; - /** The schedule of accrual */ + /** + * The schedule of accrual + */ public enum ScheduleOfAccrualEnum { - /** ANNUALLYAFTER6MONTHS */ + /** + * ANNUALLYAFTER6MONTHS + */ ANNUALLYAFTER6MONTHS("AnnuallyAfter6Months"), - - /** ONANNIVERSARYDATE */ + + /** + * ONANNIVERSARYDATE + */ ONANNIVERSARYDATE("OnAnniversaryDate"), - - /** PERCENTAGEOFGROSSEARNINGS */ + + /** + * PERCENTAGEOFGROSSEARNINGS + */ PERCENTAGEOFGROSSEARNINGS("PercentageOfGrossEarnings"), - - /** NOACCRUALS */ + + /** + * NOACCRUALS + */ NOACCRUALS("NoAccruals"); private String value; @@ -46,31 +71,25 @@ public enum ScheduleOfAccrualEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static ScheduleOfAccrualEnum fromValue(String value) { for (ScheduleOfAccrualEnum b : ScheduleOfAccrualEnum.values()) { @@ -82,6 +101,7 @@ public static ScheduleOfAccrualEnum fromValue(String value) { } } + @JsonProperty("scheduleOfAccrual") private ScheduleOfAccrualEnum scheduleOfAccrual; @@ -121,529 +141,454 @@ public static ScheduleOfAccrualEnum fromValue(String value) { @JsonProperty("scheduleOfAccrualDate") private LocalDate scheduleOfAccrualDate; /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - * @return EmployeeLeaveType - */ + * The Xero identifier for leave type + * @param leaveTypeID UUID + * @return EmployeeLeaveType + **/ public EmployeeLeaveType leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(value = "The Xero identifier for leave type") - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - */ + /** + * The Xero identifier for leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The schedule of accrual - * - * @param scheduleOfAccrual ScheduleOfAccrualEnum - * @return EmployeeLeaveType - */ + * The schedule of accrual + * @param scheduleOfAccrual ScheduleOfAccrualEnum + * @return EmployeeLeaveType + **/ public EmployeeLeaveType scheduleOfAccrual(ScheduleOfAccrualEnum scheduleOfAccrual) { this.scheduleOfAccrual = scheduleOfAccrual; return this; } - /** + /** * The schedule of accrual - * * @return scheduleOfAccrual - */ + **/ @ApiModelProperty(value = "The schedule of accrual") - /** + /** * The schedule of accrual - * * @return scheduleOfAccrual ScheduleOfAccrualEnum - */ + **/ public ScheduleOfAccrualEnum getScheduleOfAccrual() { return scheduleOfAccrual; } - /** - * The schedule of accrual - * - * @param scheduleOfAccrual ScheduleOfAccrualEnum - */ + /** + * The schedule of accrual + * @param scheduleOfAccrual ScheduleOfAccrualEnum + **/ + public void setScheduleOfAccrual(ScheduleOfAccrualEnum scheduleOfAccrual) { this.scheduleOfAccrual = scheduleOfAccrual; } /** - * Deprecated use UnitsAccruedAnnually - * - * @param hoursAccruedAnnually Double - * @return EmployeeLeaveType - */ + * Deprecated use UnitsAccruedAnnually + * @param hoursAccruedAnnually Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType hoursAccruedAnnually(Double hoursAccruedAnnually) { this.hoursAccruedAnnually = hoursAccruedAnnually; return this; } - /** + /** * Deprecated use UnitsAccruedAnnually - * * @return hoursAccruedAnnually - */ + **/ @ApiModelProperty(value = "Deprecated use UnitsAccruedAnnually") - /** + /** * Deprecated use UnitsAccruedAnnually - * * @return hoursAccruedAnnually Double - */ + **/ public Double getHoursAccruedAnnually() { return hoursAccruedAnnually; } - /** - * Deprecated use UnitsAccruedAnnually - * - * @param hoursAccruedAnnually Double - */ + /** + * Deprecated use UnitsAccruedAnnually + * @param hoursAccruedAnnually Double + **/ + public void setHoursAccruedAnnually(Double hoursAccruedAnnually) { this.hoursAccruedAnnually = hoursAccruedAnnually; } /** - * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen - * is \"NoAccruals\" - * - * @param unitsAccruedAnnually Double - * @return EmployeeLeaveType - */ + * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen is \"NoAccruals\" + * @param unitsAccruedAnnually Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType unitsAccruedAnnually(Double unitsAccruedAnnually) { this.unitsAccruedAnnually = unitsAccruedAnnually; return this; } - /** - * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen - * is \"NoAccruals\" - * + /** + * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen is \"NoAccruals\" * @return unitsAccruedAnnually - */ - @ApiModelProperty( - value = - "The number of units accrued for the leave annually. This is 0 when the" - + " ScheduleOfAccrual chosen is \"NoAccruals\"") - /** - * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen - * is \"NoAccruals\" - * + **/ + @ApiModelProperty(value = "The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen is \"NoAccruals\"") + /** + * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen is \"NoAccruals\" * @return unitsAccruedAnnually Double - */ + **/ public Double getUnitsAccruedAnnually() { return unitsAccruedAnnually; } - /** - * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen - * is \"NoAccruals\" - * - * @param unitsAccruedAnnually Double - */ + /** + * The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen is \"NoAccruals\" + * @param unitsAccruedAnnually Double + **/ + public void setUnitsAccruedAnnually(Double unitsAccruedAnnually) { this.unitsAccruedAnnually = unitsAccruedAnnually; } /** - * The type of units accrued for the leave annually - * - * @param typeOfUnitsToAccrue String - * @return EmployeeLeaveType - */ + * The type of units accrued for the leave annually + * @param typeOfUnitsToAccrue String + * @return EmployeeLeaveType + **/ public EmployeeLeaveType typeOfUnitsToAccrue(String typeOfUnitsToAccrue) { this.typeOfUnitsToAccrue = typeOfUnitsToAccrue; return this; } - /** + /** * The type of units accrued for the leave annually - * * @return typeOfUnitsToAccrue - */ + **/ @ApiModelProperty(value = "The type of units accrued for the leave annually") - /** + /** * The type of units accrued for the leave annually - * * @return typeOfUnitsToAccrue String - */ + **/ public String getTypeOfUnitsToAccrue() { return typeOfUnitsToAccrue; } - /** - * The type of units accrued for the leave annually - * - * @param typeOfUnitsToAccrue String - */ + /** + * The type of units accrued for the leave annually + * @param typeOfUnitsToAccrue String + **/ + public void setTypeOfUnitsToAccrue(String typeOfUnitsToAccrue) { this.typeOfUnitsToAccrue = typeOfUnitsToAccrue; } /** - * The maximum number of units that can be accrued for the leave - * - * @param maximumToAccrue Double - * @return EmployeeLeaveType - */ + * The maximum number of units that can be accrued for the leave + * @param maximumToAccrue Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType maximumToAccrue(Double maximumToAccrue) { this.maximumToAccrue = maximumToAccrue; return this; } - /** + /** * The maximum number of units that can be accrued for the leave - * * @return maximumToAccrue - */ + **/ @ApiModelProperty(value = "The maximum number of units that can be accrued for the leave") - /** + /** * The maximum number of units that can be accrued for the leave - * * @return maximumToAccrue Double - */ + **/ public Double getMaximumToAccrue() { return maximumToAccrue; } - /** - * The maximum number of units that can be accrued for the leave - * - * @param maximumToAccrue Double - */ + /** + * The maximum number of units that can be accrued for the leave + * @param maximumToAccrue Double + **/ + public void setMaximumToAccrue(Double maximumToAccrue) { this.maximumToAccrue = maximumToAccrue; } /** - * The initial number of units assigned when the leave was added to the employee - * - * @param openingBalance Double - * @return EmployeeLeaveType - */ + * The initial number of units assigned when the leave was added to the employee + * @param openingBalance Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType openingBalance(Double openingBalance) { this.openingBalance = openingBalance; return this; } - /** + /** * The initial number of units assigned when the leave was added to the employee - * * @return openingBalance - */ - @ApiModelProperty( - value = "The initial number of units assigned when the leave was added to the employee") - /** + **/ + @ApiModelProperty(value = "The initial number of units assigned when the leave was added to the employee") + /** * The initial number of units assigned when the leave was added to the employee - * * @return openingBalance Double - */ + **/ public Double getOpeningBalance() { return openingBalance; } - /** - * The initial number of units assigned when the leave was added to the employee - * - * @param openingBalance Double - */ + /** + * The initial number of units assigned when the leave was added to the employee + * @param openingBalance Double + **/ + public void setOpeningBalance(Double openingBalance) { this.openingBalance = openingBalance; } /** - * The type of units for the opening balance - * - * @param openingBalanceTypeOfUnits String - * @return EmployeeLeaveType - */ + * The type of units for the opening balance + * @param openingBalanceTypeOfUnits String + * @return EmployeeLeaveType + **/ public EmployeeLeaveType openingBalanceTypeOfUnits(String openingBalanceTypeOfUnits) { this.openingBalanceTypeOfUnits = openingBalanceTypeOfUnits; return this; } - /** + /** * The type of units for the opening balance - * * @return openingBalanceTypeOfUnits - */ + **/ @ApiModelProperty(value = "The type of units for the opening balance") - /** + /** * The type of units for the opening balance - * * @return openingBalanceTypeOfUnits String - */ + **/ public String getOpeningBalanceTypeOfUnits() { return openingBalanceTypeOfUnits; } - /** - * The type of units for the opening balance - * - * @param openingBalanceTypeOfUnits String - */ + /** + * The type of units for the opening balance + * @param openingBalanceTypeOfUnits String + **/ + public void setOpeningBalanceTypeOfUnits(String openingBalanceTypeOfUnits) { this.openingBalanceTypeOfUnits = openingBalanceTypeOfUnits; } /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * - * @param rateAccruedHourly Double - * @return EmployeeLeaveType - */ + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" + * @param rateAccruedHourly Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType rateAccruedHourly(Double rateAccruedHourly) { this.rateAccruedHourly = rateAccruedHourly; return this; } - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" * @return rateAccruedHourly - */ - @ApiModelProperty( - value = - "The number of hours added to the leave balance for every hour worked by the employee." - + " This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\"") - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * + **/ + @ApiModelProperty(value = "The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\"") + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" * @return rateAccruedHourly Double - */ + **/ public Double getRateAccruedHourly() { return rateAccruedHourly; } - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * - * @param rateAccruedHourly Double - */ + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" + * @param rateAccruedHourly Double + **/ + public void setRateAccruedHourly(Double rateAccruedHourly) { this.rateAccruedHourly = rateAccruedHourly; } /** - * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much - * percentage of gross earnings is accrued per pay period. - * - * @param percentageOfGrossEarnings Double - * @return EmployeeLeaveType - */ + * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period. + * @param percentageOfGrossEarnings Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType percentageOfGrossEarnings(Double percentageOfGrossEarnings) { this.percentageOfGrossEarnings = percentageOfGrossEarnings; return this; } - /** - * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much - * percentage of gross earnings is accrued per pay period. - * + /** + * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period. * @return percentageOfGrossEarnings - */ - @ApiModelProperty( - value = - "Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much" - + " percentage of gross earnings is accrued per pay period.") - /** - * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much - * percentage of gross earnings is accrued per pay period. - * + **/ + @ApiModelProperty(value = "Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period.") + /** + * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period. * @return percentageOfGrossEarnings Double - */ + **/ public Double getPercentageOfGrossEarnings() { return percentageOfGrossEarnings; } - /** - * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much - * percentage of gross earnings is accrued per pay period. - * - * @param percentageOfGrossEarnings Double - */ + /** + * Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period. + * @param percentageOfGrossEarnings Double + **/ + public void setPercentageOfGrossEarnings(Double percentageOfGrossEarnings) { this.percentageOfGrossEarnings = percentageOfGrossEarnings; } /** - * Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. - * - * @param includeHolidayPayEveryPay Boolean - * @return EmployeeLeaveType - */ + * Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. + * @param includeHolidayPayEveryPay Boolean + * @return EmployeeLeaveType + **/ public EmployeeLeaveType includeHolidayPayEveryPay(Boolean includeHolidayPayEveryPay) { this.includeHolidayPayEveryPay = includeHolidayPayEveryPay; return this; } - /** + /** * Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. - * * @return includeHolidayPayEveryPay - */ - @ApiModelProperty( - value = - "Specific to Holiday pay. Flag determining if pay for leave type is added on each pay" - + " run.") - /** + **/ + @ApiModelProperty(value = "Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run.") + /** * Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. - * * @return includeHolidayPayEveryPay Boolean - */ + **/ public Boolean getIncludeHolidayPayEveryPay() { return includeHolidayPayEveryPay; } - /** - * Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. - * - * @param includeHolidayPayEveryPay Boolean - */ + /** + * Specific to Holiday pay. Flag determining if pay for leave type is added on each pay run. + * @param includeHolidayPayEveryPay Boolean + **/ + public void setIncludeHolidayPayEveryPay(Boolean includeHolidayPayEveryPay) { this.includeHolidayPayEveryPay = includeHolidayPayEveryPay; } /** - * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in - * the payslip - * - * @param showAnnualLeaveInAdvance Boolean - * @return EmployeeLeaveType - */ + * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in the payslip + * @param showAnnualLeaveInAdvance Boolean + * @return EmployeeLeaveType + **/ public EmployeeLeaveType showAnnualLeaveInAdvance(Boolean showAnnualLeaveInAdvance) { this.showAnnualLeaveInAdvance = showAnnualLeaveInAdvance; return this; } - /** - * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in - * the payslip - * + /** + * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in the payslip * @return showAnnualLeaveInAdvance - */ - @ApiModelProperty( - value = - "Specific to Annual Leave. Flag to include leave available to take in advance in the" - + " balance in the payslip") - /** - * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in - * the payslip - * + **/ + @ApiModelProperty(value = "Specific to Annual Leave. Flag to include leave available to take in advance in the balance in the payslip") + /** + * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in the payslip * @return showAnnualLeaveInAdvance Boolean - */ + **/ public Boolean getShowAnnualLeaveInAdvance() { return showAnnualLeaveInAdvance; } - /** - * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in - * the payslip - * - * @param showAnnualLeaveInAdvance Boolean - */ + /** + * Specific to Annual Leave. Flag to include leave available to take in advance in the balance in the payslip + * @param showAnnualLeaveInAdvance Boolean + **/ + public void setShowAnnualLeaveInAdvance(Boolean showAnnualLeaveInAdvance) { this.showAnnualLeaveInAdvance = showAnnualLeaveInAdvance; } /** - * Specific to Annual Leave. Annual leave balance in dollars - * - * @param annualLeaveTotalAmountPaid Double - * @return EmployeeLeaveType - */ + * Specific to Annual Leave. Annual leave balance in dollars + * @param annualLeaveTotalAmountPaid Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType annualLeaveTotalAmountPaid(Double annualLeaveTotalAmountPaid) { this.annualLeaveTotalAmountPaid = annualLeaveTotalAmountPaid; return this; } - /** + /** * Specific to Annual Leave. Annual leave balance in dollars - * * @return annualLeaveTotalAmountPaid - */ + **/ @ApiModelProperty(value = "Specific to Annual Leave. Annual leave balance in dollars") - /** + /** * Specific to Annual Leave. Annual leave balance in dollars - * * @return annualLeaveTotalAmountPaid Double - */ + **/ public Double getAnnualLeaveTotalAmountPaid() { return annualLeaveTotalAmountPaid; } - /** - * Specific to Annual Leave. Annual leave balance in dollars - * - * @param annualLeaveTotalAmountPaid Double - */ + /** + * Specific to Annual Leave. Annual leave balance in dollars + * @param annualLeaveTotalAmountPaid Double + **/ + public void setAnnualLeaveTotalAmountPaid(Double annualLeaveTotalAmountPaid) { this.annualLeaveTotalAmountPaid = annualLeaveTotalAmountPaid; } /** - * The date when an employee becomes entitled to their accrual. - * - * @param scheduleOfAccrualDate LocalDate - * @return EmployeeLeaveType - */ + * The date when an employee becomes entitled to their accrual. + * @param scheduleOfAccrualDate LocalDate + * @return EmployeeLeaveType + **/ public EmployeeLeaveType scheduleOfAccrualDate(LocalDate scheduleOfAccrualDate) { this.scheduleOfAccrualDate = scheduleOfAccrualDate; return this; } - /** + /** * The date when an employee becomes entitled to their accrual. - * * @return scheduleOfAccrualDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = "The date when an employee becomes entitled to their accrual.") - /** + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "The date when an employee becomes entitled to their accrual.") + /** * The date when an employee becomes entitled to their accrual. - * * @return scheduleOfAccrualDate LocalDate - */ + **/ public LocalDate getScheduleOfAccrualDate() { return scheduleOfAccrualDate; } - /** - * The date when an employee becomes entitled to their accrual. - * - * @param scheduleOfAccrualDate LocalDate - */ + /** + * The date when an employee becomes entitled to their accrual. + * @param scheduleOfAccrualDate LocalDate + **/ + public void setScheduleOfAccrualDate(LocalDate scheduleOfAccrualDate) { this.scheduleOfAccrualDate = scheduleOfAccrualDate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -653,87 +598,53 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveType employeeLeaveType = (EmployeeLeaveType) o; - return Objects.equals(this.leaveTypeID, employeeLeaveType.leaveTypeID) - && Objects.equals(this.scheduleOfAccrual, employeeLeaveType.scheduleOfAccrual) - && Objects.equals(this.hoursAccruedAnnually, employeeLeaveType.hoursAccruedAnnually) - && Objects.equals(this.unitsAccruedAnnually, employeeLeaveType.unitsAccruedAnnually) - && Objects.equals(this.typeOfUnitsToAccrue, employeeLeaveType.typeOfUnitsToAccrue) - && Objects.equals(this.maximumToAccrue, employeeLeaveType.maximumToAccrue) - && Objects.equals(this.openingBalance, employeeLeaveType.openingBalance) - && Objects.equals( - this.openingBalanceTypeOfUnits, employeeLeaveType.openingBalanceTypeOfUnits) - && Objects.equals(this.rateAccruedHourly, employeeLeaveType.rateAccruedHourly) - && Objects.equals( - this.percentageOfGrossEarnings, employeeLeaveType.percentageOfGrossEarnings) - && Objects.equals( - this.includeHolidayPayEveryPay, employeeLeaveType.includeHolidayPayEveryPay) - && Objects.equals(this.showAnnualLeaveInAdvance, employeeLeaveType.showAnnualLeaveInAdvance) - && Objects.equals( - this.annualLeaveTotalAmountPaid, employeeLeaveType.annualLeaveTotalAmountPaid) - && Objects.equals(this.scheduleOfAccrualDate, employeeLeaveType.scheduleOfAccrualDate); + return Objects.equals(this.leaveTypeID, employeeLeaveType.leaveTypeID) && + Objects.equals(this.scheduleOfAccrual, employeeLeaveType.scheduleOfAccrual) && + Objects.equals(this.hoursAccruedAnnually, employeeLeaveType.hoursAccruedAnnually) && + Objects.equals(this.unitsAccruedAnnually, employeeLeaveType.unitsAccruedAnnually) && + Objects.equals(this.typeOfUnitsToAccrue, employeeLeaveType.typeOfUnitsToAccrue) && + Objects.equals(this.maximumToAccrue, employeeLeaveType.maximumToAccrue) && + Objects.equals(this.openingBalance, employeeLeaveType.openingBalance) && + Objects.equals(this.openingBalanceTypeOfUnits, employeeLeaveType.openingBalanceTypeOfUnits) && + Objects.equals(this.rateAccruedHourly, employeeLeaveType.rateAccruedHourly) && + Objects.equals(this.percentageOfGrossEarnings, employeeLeaveType.percentageOfGrossEarnings) && + Objects.equals(this.includeHolidayPayEveryPay, employeeLeaveType.includeHolidayPayEveryPay) && + Objects.equals(this.showAnnualLeaveInAdvance, employeeLeaveType.showAnnualLeaveInAdvance) && + Objects.equals(this.annualLeaveTotalAmountPaid, employeeLeaveType.annualLeaveTotalAmountPaid) && + Objects.equals(this.scheduleOfAccrualDate, employeeLeaveType.scheduleOfAccrualDate); } @Override public int hashCode() { - return Objects.hash( - leaveTypeID, - scheduleOfAccrual, - hoursAccruedAnnually, - unitsAccruedAnnually, - typeOfUnitsToAccrue, - maximumToAccrue, - openingBalance, - openingBalanceTypeOfUnits, - rateAccruedHourly, - percentageOfGrossEarnings, - includeHolidayPayEveryPay, - showAnnualLeaveInAdvance, - annualLeaveTotalAmountPaid, - scheduleOfAccrualDate); + return Objects.hash(leaveTypeID, scheduleOfAccrual, hoursAccruedAnnually, unitsAccruedAnnually, typeOfUnitsToAccrue, maximumToAccrue, openingBalance, openingBalanceTypeOfUnits, rateAccruedHourly, percentageOfGrossEarnings, includeHolidayPayEveryPay, showAnnualLeaveInAdvance, annualLeaveTotalAmountPaid, scheduleOfAccrualDate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeLeaveType {\n"); sb.append(" leaveTypeID: ").append(toIndentedString(leaveTypeID)).append("\n"); sb.append(" scheduleOfAccrual: ").append(toIndentedString(scheduleOfAccrual)).append("\n"); - sb.append(" hoursAccruedAnnually: ") - .append(toIndentedString(hoursAccruedAnnually)) - .append("\n"); - sb.append(" unitsAccruedAnnually: ") - .append(toIndentedString(unitsAccruedAnnually)) - .append("\n"); - sb.append(" typeOfUnitsToAccrue: ") - .append(toIndentedString(typeOfUnitsToAccrue)) - .append("\n"); + sb.append(" hoursAccruedAnnually: ").append(toIndentedString(hoursAccruedAnnually)).append("\n"); + sb.append(" unitsAccruedAnnually: ").append(toIndentedString(unitsAccruedAnnually)).append("\n"); + sb.append(" typeOfUnitsToAccrue: ").append(toIndentedString(typeOfUnitsToAccrue)).append("\n"); sb.append(" maximumToAccrue: ").append(toIndentedString(maximumToAccrue)).append("\n"); sb.append(" openingBalance: ").append(toIndentedString(openingBalance)).append("\n"); - sb.append(" openingBalanceTypeOfUnits: ") - .append(toIndentedString(openingBalanceTypeOfUnits)) - .append("\n"); + sb.append(" openingBalanceTypeOfUnits: ").append(toIndentedString(openingBalanceTypeOfUnits)).append("\n"); sb.append(" rateAccruedHourly: ").append(toIndentedString(rateAccruedHourly)).append("\n"); - sb.append(" percentageOfGrossEarnings: ") - .append(toIndentedString(percentageOfGrossEarnings)) - .append("\n"); - sb.append(" includeHolidayPayEveryPay: ") - .append(toIndentedString(includeHolidayPayEveryPay)) - .append("\n"); - sb.append(" showAnnualLeaveInAdvance: ") - .append(toIndentedString(showAnnualLeaveInAdvance)) - .append("\n"); - sb.append(" annualLeaveTotalAmountPaid: ") - .append(toIndentedString(annualLeaveTotalAmountPaid)) - .append("\n"); - sb.append(" scheduleOfAccrualDate: ") - .append(toIndentedString(scheduleOfAccrualDate)) - .append("\n"); + sb.append(" percentageOfGrossEarnings: ").append(toIndentedString(percentageOfGrossEarnings)).append("\n"); + sb.append(" includeHolidayPayEveryPay: ").append(toIndentedString(includeHolidayPayEveryPay)).append("\n"); + sb.append(" showAnnualLeaveInAdvance: ").append(toIndentedString(showAnnualLeaveInAdvance)).append("\n"); + sb.append(" annualLeaveTotalAmountPaid: ").append(toIndentedString(annualLeaveTotalAmountPaid)).append("\n"); + sb.append(" scheduleOfAccrualDate: ").append(toIndentedString(scheduleOfAccrualDate)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -741,4 +652,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypeObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypeObject.java index 3b280ab8d..74de7dc60 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypeObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypeObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeLeaveType; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveTypeObject + */ -/** EmployeeLeaveTypeObject */ public class EmployeeLeaveTypeObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeLeaveTypeObject { @JsonProperty("leaveType") private EmployeeLeaveType leaveType; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveTypeObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveTypeObject + **/ public EmployeeLeaveTypeObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveTypeObject - */ + * problem + * @param problem Problem + * @return EmployeeLeaveTypeObject + **/ public EmployeeLeaveTypeObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveType - * - * @param leaveType EmployeeLeaveType - * @return EmployeeLeaveTypeObject - */ + * leaveType + * @param leaveType EmployeeLeaveType + * @return EmployeeLeaveTypeObject + **/ public EmployeeLeaveTypeObject leaveType(EmployeeLeaveType leaveType) { this.leaveType = leaveType; return this; } - /** + /** * Get leaveType - * * @return leaveType - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveType - * * @return leaveType EmployeeLeaveType - */ + **/ public EmployeeLeaveType getLeaveType() { return leaveType; } - /** - * leaveType - * - * @param leaveType EmployeeLeaveType - */ + /** + * leaveType + * @param leaveType EmployeeLeaveType + **/ + public void setLeaveType(EmployeeLeaveType leaveType) { this.leaveType = leaveType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveTypeObject employeeLeaveTypeObject = (EmployeeLeaveTypeObject) o; - return Objects.equals(this.pagination, employeeLeaveTypeObject.pagination) - && Objects.equals(this.problem, employeeLeaveTypeObject.problem) - && Objects.equals(this.leaveType, employeeLeaveTypeObject.leaveType); + return Objects.equals(this.pagination, employeeLeaveTypeObject.pagination) && + Objects.equals(this.problem, employeeLeaveTypeObject.problem) && + Objects.equals(this.leaveType, employeeLeaveTypeObject.leaveType); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypes.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypes.java index 4a25ce51c..4f193b4f9 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypes.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaveTypes.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeLeaveType; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveTypes + */ -/** EmployeeLeaveTypes */ public class EmployeeLeaveTypes { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeeLeaveTypes { @JsonProperty("leaveTypes") private List leaveTypes = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveTypes - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveTypes + **/ public EmployeeLeaveTypes pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveTypes - */ + * problem + * @param problem Problem + * @return EmployeeLeaveTypes + **/ public EmployeeLeaveTypes problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveTypes - * - * @param leaveTypes List<EmployeeLeaveType> - * @return EmployeeLeaveTypes - */ + * leaveTypes + * @param leaveTypes List<EmployeeLeaveType> + * @return EmployeeLeaveTypes + **/ public EmployeeLeaveTypes leaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; return this; @@ -113,10 +126,9 @@ public EmployeeLeaveTypes leaveTypes(List leaveTypes) { /** * leaveTypes - * - * @param leaveTypesItem EmployeeLeaveType + * @param leaveTypesItem EmployeeLeaveType * @return EmployeeLeaveTypes - */ + **/ public EmployeeLeaveTypes addLeaveTypesItem(EmployeeLeaveType leaveTypesItem) { if (this.leaveTypes == null) { this.leaveTypes = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeeLeaveTypes addLeaveTypesItem(EmployeeLeaveType leaveTypesItem) { return this; } - /** + /** * Get leaveTypes - * * @return leaveTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveTypes - * * @return leaveTypes List - */ + **/ public List getLeaveTypes() { return leaveTypes; } - /** - * leaveTypes - * - * @param leaveTypes List<EmployeeLeaveType> - */ + /** + * leaveTypes + * @param leaveTypes List<EmployeeLeaveType> + **/ + public void setLeaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveTypes employeeLeaveTypes = (EmployeeLeaveTypes) o; - return Objects.equals(this.pagination, employeeLeaveTypes.pagination) - && Objects.equals(this.problem, employeeLeaveTypes.problem) - && Objects.equals(this.leaveTypes, employeeLeaveTypes.leaveTypes); + return Objects.equals(this.pagination, employeeLeaveTypes.pagination) && + Objects.equals(this.problem, employeeLeaveTypes.problem) && + Objects.equals(this.leaveTypes, employeeLeaveTypes.leaveTypes); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveTypes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeLeaves.java b/src/main/java/com/xero/models/payrollnz/EmployeeLeaves.java index a67f7feef..a553e20f5 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeLeaves.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeLeaves.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeLeave; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaves + */ -/** EmployeeLeaves */ public class EmployeeLeaves { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeeLeaves { @JsonProperty("leave") private List leave = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaves - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaves + **/ public EmployeeLeaves pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaves - */ + * problem + * @param problem Problem + * @return EmployeeLeaves + **/ public EmployeeLeaves problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leave - * - * @param leave List<EmployeeLeave> - * @return EmployeeLeaves - */ + * leave + * @param leave List<EmployeeLeave> + * @return EmployeeLeaves + **/ public EmployeeLeaves leave(List leave) { this.leave = leave; return this; @@ -113,10 +126,9 @@ public EmployeeLeaves leave(List leave) { /** * leave - * - * @param leaveItem EmployeeLeave + * @param leaveItem EmployeeLeave * @return EmployeeLeaves - */ + **/ public EmployeeLeaves addLeaveItem(EmployeeLeave leaveItem) { if (this.leave == null) { this.leave = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeeLeaves addLeaveItem(EmployeeLeave leaveItem) { return this; } - /** + /** * Get leave - * * @return leave - */ + **/ @ApiModelProperty(value = "") - /** + /** * leave - * * @return leave List - */ + **/ public List getLeave() { return leave; } - /** - * leave - * - * @param leave List<EmployeeLeave> - */ + /** + * leave + * @param leave List<EmployeeLeave> + **/ + public void setLeave(List leave) { this.leave = leave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaves employeeLeaves = (EmployeeLeaves) o; - return Objects.equals(this.pagination, employeeLeaves.pagination) - && Objects.equals(this.problem, employeeLeaves.problem) - && Objects.equals(this.leave, employeeLeaves.leave); + return Objects.equals(this.pagination, employeeLeaves.pagination) && + Objects.equals(this.problem, employeeLeaves.problem) && + Objects.equals(this.leave, employeeLeaves.leave); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeObject.java index 5986aa578..382aee020 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Employee; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeObject + */ -/** EmployeeObject */ public class EmployeeObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeObject { @JsonProperty("problem") private Problem problem; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeObject + **/ public EmployeeObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * employee - * - * @param employee Employee - * @return EmployeeObject - */ + * employee + * @param employee Employee + * @return EmployeeObject + **/ public EmployeeObject employee(Employee employee) { this.employee = employee; return this; } - /** + /** * Get employee - * * @return employee - */ + **/ @ApiModelProperty(value = "") - /** + /** * employee - * * @return employee Employee - */ + **/ public Employee getEmployee() { return employee; } - /** - * employee - * - * @param employee Employee - */ + /** + * employee + * @param employee Employee + **/ + public void setEmployee(Employee employee) { this.employee = employee; } /** - * problem - * - * @param problem Problem - * @return EmployeeObject - */ + * problem + * @param problem Problem + * @return EmployeeObject + **/ public EmployeeObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeObject employeeObject = (EmployeeObject) o; - return Objects.equals(this.pagination, employeeObject.pagination) - && Objects.equals(this.employee, employeeObject.employee) - && Objects.equals(this.problem, employeeObject.problem); + return Objects.equals(this.pagination, employeeObject.pagination) && + Objects.equals(this.employee, employeeObject.employee) && + Objects.equals(this.problem, employeeObject.problem); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, employee, problem); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalance.java b/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalance.java index 46e3a81e7..9e6ef560f 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalance.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalance.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeOpeningBalance + */ -/** EmployeeOpeningBalance */ public class EmployeeOpeningBalance { StringUtil util = new StringUtil(); @@ -33,145 +50,134 @@ public class EmployeeOpeningBalance { @JsonProperty("grossEarnings") private Double grossEarnings; /** - * The opening balance period end date. - * - * @param periodEndDate LocalDate - * @return EmployeeOpeningBalance - */ + * The opening balance period end date. + * @param periodEndDate LocalDate + * @return EmployeeOpeningBalance + **/ public EmployeeOpeningBalance periodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; return this; } - /** + /** * The opening balance period end date. - * * @return periodEndDate - */ + **/ @ApiModelProperty(value = "The opening balance period end date.") - /** + /** * The opening balance period end date. - * * @return periodEndDate LocalDate - */ + **/ public LocalDate getPeriodEndDate() { return periodEndDate; } - /** - * The opening balance period end date. - * - * @param periodEndDate LocalDate - */ + /** + * The opening balance period end date. + * @param periodEndDate LocalDate + **/ + public void setPeriodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; } /** - * The paid number of days. - * - * @param daysPaid Integer - * @return EmployeeOpeningBalance - */ + * The paid number of days. + * @param daysPaid Integer + * @return EmployeeOpeningBalance + **/ public EmployeeOpeningBalance daysPaid(Integer daysPaid) { this.daysPaid = daysPaid; return this; } - /** + /** * The paid number of days. - * * @return daysPaid - */ + **/ @ApiModelProperty(value = "The paid number of days.") - /** + /** * The paid number of days. - * * @return daysPaid Integer - */ + **/ public Integer getDaysPaid() { return daysPaid; } - /** - * The paid number of days. - * - * @param daysPaid Integer - */ + /** + * The paid number of days. + * @param daysPaid Integer + **/ + public void setDaysPaid(Integer daysPaid) { this.daysPaid = daysPaid; } /** - * The number of unpaid weeks. - * - * @param unpaidWeeks Integer - * @return EmployeeOpeningBalance - */ + * The number of unpaid weeks. + * @param unpaidWeeks Integer + * @return EmployeeOpeningBalance + **/ public EmployeeOpeningBalance unpaidWeeks(Integer unpaidWeeks) { this.unpaidWeeks = unpaidWeeks; return this; } - /** + /** * The number of unpaid weeks. - * * @return unpaidWeeks - */ + **/ @ApiModelProperty(value = "The number of unpaid weeks.") - /** + /** * The number of unpaid weeks. - * * @return unpaidWeeks Integer - */ + **/ public Integer getUnpaidWeeks() { return unpaidWeeks; } - /** - * The number of unpaid weeks. - * - * @param unpaidWeeks Integer - */ + /** + * The number of unpaid weeks. + * @param unpaidWeeks Integer + **/ + public void setUnpaidWeeks(Integer unpaidWeeks) { this.unpaidWeeks = unpaidWeeks; } /** - * The gross earnings during the period. - * - * @param grossEarnings Double - * @return EmployeeOpeningBalance - */ + * The gross earnings during the period. + * @param grossEarnings Double + * @return EmployeeOpeningBalance + **/ public EmployeeOpeningBalance grossEarnings(Double grossEarnings) { this.grossEarnings = grossEarnings; return this; } - /** + /** * The gross earnings during the period. - * * @return grossEarnings - */ + **/ @ApiModelProperty(value = "The gross earnings during the period.") - /** + /** * The gross earnings during the period. - * * @return grossEarnings Double - */ + **/ public Double getGrossEarnings() { return grossEarnings; } - /** - * The gross earnings during the period. - * - * @param grossEarnings Double - */ + /** + * The gross earnings during the period. + * @param grossEarnings Double + **/ + public void setGrossEarnings(Double grossEarnings) { this.grossEarnings = grossEarnings; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeOpeningBalance employeeOpeningBalance = (EmployeeOpeningBalance) o; - return Objects.equals(this.periodEndDate, employeeOpeningBalance.periodEndDate) - && Objects.equals(this.daysPaid, employeeOpeningBalance.daysPaid) - && Objects.equals(this.unpaidWeeks, employeeOpeningBalance.unpaidWeeks) - && Objects.equals(this.grossEarnings, employeeOpeningBalance.grossEarnings); + return Objects.equals(this.periodEndDate, employeeOpeningBalance.periodEndDate) && + Objects.equals(this.daysPaid, employeeOpeningBalance.daysPaid) && + Objects.equals(this.unpaidWeeks, employeeOpeningBalance.unpaidWeeks) && + Objects.equals(this.grossEarnings, employeeOpeningBalance.grossEarnings); } @Override @@ -192,6 +198,7 @@ public int hashCode() { return Objects.hash(periodEndDate, daysPaid, unpaidWeeks, grossEarnings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalancesObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalancesObject.java index d0b9e038f..ba6c32f11 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalancesObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeOpeningBalancesObject.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeOpeningBalance; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeOpeningBalancesObject + */ -/** EmployeeOpeningBalancesObject */ public class EmployeeOpeningBalancesObject { StringUtil util = new StringUtil(); @@ -31,95 +51,85 @@ public class EmployeeOpeningBalancesObject { @JsonProperty("openingBalances") private List openingBalances = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeOpeningBalancesObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeOpeningBalancesObject + **/ public EmployeeOpeningBalancesObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeOpeningBalancesObject - */ + * problem + * @param problem Problem + * @return EmployeeOpeningBalancesObject + **/ public EmployeeOpeningBalancesObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * openingBalances - * - * @param openingBalances List<EmployeeOpeningBalance> - * @return EmployeeOpeningBalancesObject - */ - public EmployeeOpeningBalancesObject openingBalances( - List openingBalances) { + * openingBalances + * @param openingBalances List<EmployeeOpeningBalance> + * @return EmployeeOpeningBalancesObject + **/ + public EmployeeOpeningBalancesObject openingBalances(List openingBalances) { this.openingBalances = openingBalances; return this; } /** * openingBalances - * - * @param openingBalancesItem EmployeeOpeningBalance + * @param openingBalancesItem EmployeeOpeningBalance * @return EmployeeOpeningBalancesObject - */ - public EmployeeOpeningBalancesObject addOpeningBalancesItem( - EmployeeOpeningBalance openingBalancesItem) { + **/ + public EmployeeOpeningBalancesObject addOpeningBalancesItem(EmployeeOpeningBalance openingBalancesItem) { if (this.openingBalances == null) { this.openingBalances = new ArrayList(); } @@ -127,30 +137,29 @@ public EmployeeOpeningBalancesObject addOpeningBalancesItem( return this; } - /** + /** * Get openingBalances - * * @return openingBalances - */ + **/ @ApiModelProperty(value = "") - /** + /** * openingBalances - * * @return openingBalances List - */ + **/ public List getOpeningBalances() { return openingBalances; } - /** - * openingBalances - * - * @param openingBalances List<EmployeeOpeningBalance> - */ + /** + * openingBalances + * @param openingBalances List<EmployeeOpeningBalance> + **/ + public void setOpeningBalances(List openingBalances) { this.openingBalances = openingBalances; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeOpeningBalancesObject employeeOpeningBalancesObject = (EmployeeOpeningBalancesObject) o; - return Objects.equals(this.pagination, employeeOpeningBalancesObject.pagination) - && Objects.equals(this.problem, employeeOpeningBalancesObject.problem) - && Objects.equals(this.openingBalances, employeeOpeningBalancesObject.openingBalances); + return Objects.equals(this.pagination, employeeOpeningBalancesObject.pagination) && + Objects.equals(this.problem, employeeOpeningBalancesObject.problem) && + Objects.equals(this.openingBalances, employeeOpeningBalancesObject.openingBalances); } @Override @@ -170,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, openingBalances); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -182,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -190,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeePayTemplate.java b/src/main/java/com/xero/models/payrollnz/EmployeePayTemplate.java index ef5f4ce88..a68b3de99 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeePayTemplate.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeePayTemplate.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EarningsTemplate; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeePayTemplate + */ -/** EmployeePayTemplate */ public class EmployeePayTemplate { StringUtil util = new StringUtil(); @@ -29,46 +47,42 @@ public class EmployeePayTemplate { @JsonProperty("earningTemplates") private List earningTemplates = new ArrayList(); /** - * Unique identifier for the employee - * - * @param employeeID UUID - * @return EmployeePayTemplate - */ + * Unique identifier for the employee + * @param employeeID UUID + * @return EmployeePayTemplate + **/ public EmployeePayTemplate employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * Unique identifier for the employee - * * @return employeeID - */ + **/ @ApiModelProperty(value = "Unique identifier for the employee") - /** + /** * Unique identifier for the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * Unique identifier for the employee - * - * @param employeeID UUID - */ + /** + * Unique identifier for the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - * @return EmployeePayTemplate - */ + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + * @return EmployeePayTemplate + **/ public EmployeePayTemplate earningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; return this; @@ -76,10 +90,9 @@ public EmployeePayTemplate earningTemplates(List earningTempla /** * earningTemplates - * - * @param earningTemplatesItem EarningsTemplate + * @param earningTemplatesItem EarningsTemplate * @return EmployeePayTemplate - */ + **/ public EmployeePayTemplate addEarningTemplatesItem(EarningsTemplate earningTemplatesItem) { if (this.earningTemplates == null) { this.earningTemplates = new ArrayList(); @@ -88,30 +101,29 @@ public EmployeePayTemplate addEarningTemplatesItem(EarningsTemplate earningTempl return this; } - /** + /** * Get earningTemplates - * * @return earningTemplates - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningTemplates - * * @return earningTemplates List - */ + **/ public List getEarningTemplates() { return earningTemplates; } - /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - */ + /** + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + **/ + public void setEarningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } EmployeePayTemplate employeePayTemplate = (EmployeePayTemplate) o; - return Objects.equals(this.employeeID, employeePayTemplate.employeeID) - && Objects.equals(this.earningTemplates, employeePayTemplate.earningTemplates); + return Objects.equals(this.employeeID, employeePayTemplate.employeeID) && + Objects.equals(this.earningTemplates, employeePayTemplate.earningTemplates); } @Override @@ -130,6 +142,7 @@ public int hashCode() { return Objects.hash(employeeID, earningTemplates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -149,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeePayTemplateObject.java b/src/main/java/com/xero/models/payrollnz/EmployeePayTemplateObject.java index 69b1dff13..095043e71 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeePayTemplateObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeePayTemplateObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeePayTemplate; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeePayTemplateObject + */ -/** EmployeePayTemplateObject */ public class EmployeePayTemplateObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeePayTemplateObject { @JsonProperty("payTemplate") private EmployeePayTemplate payTemplate; /** - * pagination - * - * @param pagination Pagination - * @return EmployeePayTemplateObject - */ + * pagination + * @param pagination Pagination + * @return EmployeePayTemplateObject + **/ public EmployeePayTemplateObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeePayTemplateObject - */ + * problem + * @param problem Problem + * @return EmployeePayTemplateObject + **/ public EmployeePayTemplateObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payTemplate - * - * @param payTemplate EmployeePayTemplate - * @return EmployeePayTemplateObject - */ + * payTemplate + * @param payTemplate EmployeePayTemplate + * @return EmployeePayTemplateObject + **/ public EmployeePayTemplateObject payTemplate(EmployeePayTemplate payTemplate) { this.payTemplate = payTemplate; return this; } - /** + /** * Get payTemplate - * * @return payTemplate - */ + **/ @ApiModelProperty(value = "") - /** + /** * payTemplate - * * @return payTemplate EmployeePayTemplate - */ + **/ public EmployeePayTemplate getPayTemplate() { return payTemplate; } - /** - * payTemplate - * - * @param payTemplate EmployeePayTemplate - */ + /** + * payTemplate + * @param payTemplate EmployeePayTemplate + **/ + public void setPayTemplate(EmployeePayTemplate payTemplate) { this.payTemplate = payTemplate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeePayTemplateObject employeePayTemplateObject = (EmployeePayTemplateObject) o; - return Objects.equals(this.pagination, employeePayTemplateObject.pagination) - && Objects.equals(this.problem, employeePayTemplateObject.problem) - && Objects.equals(this.payTemplate, employeePayTemplateObject.payTemplate); + return Objects.equals(this.pagination, employeePayTemplateObject.pagination) && + Objects.equals(this.problem, employeePayTemplateObject.problem) && + Objects.equals(this.payTemplate, employeePayTemplateObject.payTemplate); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payTemplate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeePayTemplates.java b/src/main/java/com/xero/models/payrollnz/EmployeePayTemplates.java index 7ae07a10c..ed07454b2 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeePayTemplates.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeePayTemplates.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeePayTemplate; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeePayTemplates + */ -/** EmployeePayTemplates */ public class EmployeePayTemplates { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeePayTemplates { @JsonProperty("payTemplate") private EmployeePayTemplate payTemplate; /** - * pagination - * - * @param pagination Pagination - * @return EmployeePayTemplates - */ + * pagination + * @param pagination Pagination + * @return EmployeePayTemplates + **/ public EmployeePayTemplates pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeePayTemplates - */ + * problem + * @param problem Problem + * @return EmployeePayTemplates + **/ public EmployeePayTemplates problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payTemplate - * - * @param payTemplate EmployeePayTemplate - * @return EmployeePayTemplates - */ + * payTemplate + * @param payTemplate EmployeePayTemplate + * @return EmployeePayTemplates + **/ public EmployeePayTemplates payTemplate(EmployeePayTemplate payTemplate) { this.payTemplate = payTemplate; return this; } - /** + /** * Get payTemplate - * * @return payTemplate - */ + **/ @ApiModelProperty(value = "") - /** + /** * payTemplate - * * @return payTemplate EmployeePayTemplate - */ + **/ public EmployeePayTemplate getPayTemplate() { return payTemplate; } - /** - * payTemplate - * - * @param payTemplate EmployeePayTemplate - */ + /** + * payTemplate + * @param payTemplate EmployeePayTemplate + **/ + public void setPayTemplate(EmployeePayTemplate payTemplate) { this.payTemplate = payTemplate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeePayTemplates employeePayTemplates = (EmployeePayTemplates) o; - return Objects.equals(this.pagination, employeePayTemplates.pagination) - && Objects.equals(this.problem, employeePayTemplates.problem) - && Objects.equals(this.payTemplate, employeePayTemplates.payTemplate); + return Objects.equals(this.pagination, employeePayTemplates.pagination) && + Objects.equals(this.problem, employeePayTemplates.problem) && + Objects.equals(this.payTemplate, employeePayTemplates.payTemplate); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payTemplate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalance.java b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalance.java index 0fb4fad71..804d8a403 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalance.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalance.java @@ -9,33 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeaveBalance + */ -/** EmployeeStatutoryLeaveBalance */ public class EmployeeStatutoryLeaveBalance { StringUtil util = new StringUtil(); - /** The type of statutory leave */ + /** + * The type of statutory leave + */ public enum LeaveTypeEnum { - /** SICK */ + /** + * SICK + */ SICK("Sick"), - - /** ADOPTION */ + + /** + * ADOPTION + */ ADOPTION("Adoption"), - - /** MATERNITY */ + + /** + * MATERNITY + */ MATERNITY("Maternity"), - - /** PATERNITY */ + + /** + * PATERNITY + */ PATERNITY("Paternity"), - - /** SHAREDPARENTAL */ + + /** + * SHAREDPARENTAL + */ SHAREDPARENTAL("Sharedparental"); private String value; @@ -44,31 +71,25 @@ public enum LeaveTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static LeaveTypeEnum fromValue(String value) { for (LeaveTypeEnum b : LeaveTypeEnum.values()) { @@ -80,14 +101,19 @@ public static LeaveTypeEnum fromValue(String value) { } } + @JsonProperty("leaveType") private LeaveTypeEnum leaveType; @JsonProperty("balanceRemaining") private Double balanceRemaining; - /** The units will be \"Hours\" */ + /** + * The units will be \"Hours\" + */ public enum UnitsEnum { - /** HOURS */ + /** + * HOURS + */ HOURS("Hours"); private String value; @@ -96,31 +122,25 @@ public enum UnitsEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static UnitsEnum fromValue(String value) { for (UnitsEnum b : UnitsEnum.values()) { @@ -132,114 +152,106 @@ public static UnitsEnum fromValue(String value) { } } + @JsonProperty("units") private UnitsEnum units; /** - * The type of statutory leave - * - * @param leaveType LeaveTypeEnum - * @return EmployeeStatutoryLeaveBalance - */ + * The type of statutory leave + * @param leaveType LeaveTypeEnum + * @return EmployeeStatutoryLeaveBalance + **/ public EmployeeStatutoryLeaveBalance leaveType(LeaveTypeEnum leaveType) { this.leaveType = leaveType; return this; } - /** + /** * The type of statutory leave - * * @return leaveType - */ + **/ @ApiModelProperty(value = "The type of statutory leave") - /** + /** * The type of statutory leave - * * @return leaveType LeaveTypeEnum - */ + **/ public LeaveTypeEnum getLeaveType() { return leaveType; } - /** - * The type of statutory leave - * - * @param leaveType LeaveTypeEnum - */ + /** + * The type of statutory leave + * @param leaveType LeaveTypeEnum + **/ + public void setLeaveType(LeaveTypeEnum leaveType) { this.leaveType = leaveType; } /** - * The balance remaining for the corresponding leave type as of specified date. - * - * @param balanceRemaining Double - * @return EmployeeStatutoryLeaveBalance - */ + * The balance remaining for the corresponding leave type as of specified date. + * @param balanceRemaining Double + * @return EmployeeStatutoryLeaveBalance + **/ public EmployeeStatutoryLeaveBalance balanceRemaining(Double balanceRemaining) { this.balanceRemaining = balanceRemaining; return this; } - /** + /** * The balance remaining for the corresponding leave type as of specified date. - * * @return balanceRemaining - */ - @ApiModelProperty( - value = "The balance remaining for the corresponding leave type as of specified date.") - /** + **/ + @ApiModelProperty(value = "The balance remaining for the corresponding leave type as of specified date.") + /** * The balance remaining for the corresponding leave type as of specified date. - * * @return balanceRemaining Double - */ + **/ public Double getBalanceRemaining() { return balanceRemaining; } - /** - * The balance remaining for the corresponding leave type as of specified date. - * - * @param balanceRemaining Double - */ + /** + * The balance remaining for the corresponding leave type as of specified date. + * @param balanceRemaining Double + **/ + public void setBalanceRemaining(Double balanceRemaining) { this.balanceRemaining = balanceRemaining; } /** - * The units will be \"Hours\" - * - * @param units UnitsEnum - * @return EmployeeStatutoryLeaveBalance - */ + * The units will be \"Hours\" + * @param units UnitsEnum + * @return EmployeeStatutoryLeaveBalance + **/ public EmployeeStatutoryLeaveBalance units(UnitsEnum units) { this.units = units; return this; } - /** + /** * The units will be \"Hours\" - * * @return units - */ + **/ @ApiModelProperty(value = "The units will be \"Hours\"") - /** + /** * The units will be \"Hours\" - * * @return units UnitsEnum - */ + **/ public UnitsEnum getUnits() { return units; } - /** - * The units will be \"Hours\" - * - * @param units UnitsEnum - */ + /** + * The units will be \"Hours\" + * @param units UnitsEnum + **/ + public void setUnits(UnitsEnum units) { this.units = units; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -249,9 +261,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutoryLeaveBalance employeeStatutoryLeaveBalance = (EmployeeStatutoryLeaveBalance) o; - return Objects.equals(this.leaveType, employeeStatutoryLeaveBalance.leaveType) - && Objects.equals(this.balanceRemaining, employeeStatutoryLeaveBalance.balanceRemaining) - && Objects.equals(this.units, employeeStatutoryLeaveBalance.units); + return Objects.equals(this.leaveType, employeeStatutoryLeaveBalance.leaveType) && + Objects.equals(this.balanceRemaining, employeeStatutoryLeaveBalance.balanceRemaining) && + Objects.equals(this.units, employeeStatutoryLeaveBalance.units); } @Override @@ -259,6 +271,7 @@ public int hashCode() { return Objects.hash(leaveType, balanceRemaining, units); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -271,7 +284,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -279,4 +293,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalanceObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalanceObject.java index d72e7d6f6..7dce0c948 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalanceObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveBalanceObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeStatutoryLeaveBalance; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeaveBalanceObject + */ -/** EmployeeStatutoryLeaveBalanceObject */ public class EmployeeStatutoryLeaveBalanceObject { StringUtil util = new StringUtil(); @@ -29,111 +49,102 @@ public class EmployeeStatutoryLeaveBalanceObject { @JsonProperty("leaveBalance") private EmployeeStatutoryLeaveBalance leaveBalance; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutoryLeaveBalanceObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutoryLeaveBalanceObject + **/ public EmployeeStatutoryLeaveBalanceObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutoryLeaveBalanceObject - */ + * problem + * @param problem Problem + * @return EmployeeStatutoryLeaveBalanceObject + **/ public EmployeeStatutoryLeaveBalanceObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveBalance - * - * @param leaveBalance EmployeeStatutoryLeaveBalance - * @return EmployeeStatutoryLeaveBalanceObject - */ - public EmployeeStatutoryLeaveBalanceObject leaveBalance( - EmployeeStatutoryLeaveBalance leaveBalance) { + * leaveBalance + * @param leaveBalance EmployeeStatutoryLeaveBalance + * @return EmployeeStatutoryLeaveBalanceObject + **/ + public EmployeeStatutoryLeaveBalanceObject leaveBalance(EmployeeStatutoryLeaveBalance leaveBalance) { this.leaveBalance = leaveBalance; return this; } - /** + /** * Get leaveBalance - * * @return leaveBalance - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveBalance - * * @return leaveBalance EmployeeStatutoryLeaveBalance - */ + **/ public EmployeeStatutoryLeaveBalance getLeaveBalance() { return leaveBalance; } - /** - * leaveBalance - * - * @param leaveBalance EmployeeStatutoryLeaveBalance - */ + /** + * leaveBalance + * @param leaveBalance EmployeeStatutoryLeaveBalance + **/ + public void setLeaveBalance(EmployeeStatutoryLeaveBalance leaveBalance) { this.leaveBalance = leaveBalance; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,11 +153,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeStatutoryLeaveBalanceObject employeeStatutoryLeaveBalanceObject = - (EmployeeStatutoryLeaveBalanceObject) o; - return Objects.equals(this.pagination, employeeStatutoryLeaveBalanceObject.pagination) - && Objects.equals(this.problem, employeeStatutoryLeaveBalanceObject.problem) - && Objects.equals(this.leaveBalance, employeeStatutoryLeaveBalanceObject.leaveBalance); + EmployeeStatutoryLeaveBalanceObject employeeStatutoryLeaveBalanceObject = (EmployeeStatutoryLeaveBalanceObject) o; + return Objects.equals(this.pagination, employeeStatutoryLeaveBalanceObject.pagination) && + Objects.equals(this.problem, employeeStatutoryLeaveBalanceObject.problem) && + Objects.equals(this.leaveBalance, employeeStatutoryLeaveBalanceObject.leaveBalance); } @Override @@ -154,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveBalance); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -166,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -174,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveSummary.java b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveSummary.java index 2846d2016..676fbbe89 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveSummary.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeaveSummary.java @@ -9,18 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeaveSummary + */ -/** EmployeeStatutoryLeaveSummary */ public class EmployeeStatutoryLeaveSummary { StringUtil util = new StringUtil(); @@ -29,21 +44,33 @@ public class EmployeeStatutoryLeaveSummary { @JsonProperty("employeeID") private UUID employeeID; - /** The category of statutory leave */ + /** + * The category of statutory leave + */ public enum TypeEnum { - /** SICK */ + /** + * SICK + */ SICK("Sick"), - - /** ADOPTION */ + + /** + * ADOPTION + */ ADOPTION("Adoption"), - - /** MATERNITY */ + + /** + * MATERNITY + */ MATERNITY("Maternity"), - - /** PATERNITY */ + + /** + * PATERNITY + */ PATERNITY("Paternity"), - - /** SHAREDPARENTAL */ + + /** + * SHAREDPARENTAL + */ SHAREDPARENTAL("Sharedparental"); private String value; @@ -52,31 +79,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -88,6 +109,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("type") private TypeEnum type; @@ -99,15 +121,23 @@ public static TypeEnum fromValue(String value) { @JsonProperty("isEntitled") private Boolean isEntitled; - /** The status of the leave */ + /** + * The status of the leave + */ public enum StatusEnum { - /** PENDING */ + /** + * PENDING + */ PENDING("Pending"), - - /** IN_PROGRESS */ + + /** + * IN_PROGRESS + */ IN_PROGRESS("In-Progress"), - - /** COMPLETED */ + + /** + * COMPLETED + */ COMPLETED("Completed"); private String value; @@ -116,31 +146,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -152,253 +176,234 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; /** - * The unique identifier (guid) of a statutory leave. - * - * @param statutoryLeaveID UUID - * @return EmployeeStatutoryLeaveSummary - */ + * The unique identifier (guid) of a statutory leave. + * @param statutoryLeaveID UUID + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary statutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; return this; } - /** + /** * The unique identifier (guid) of a statutory leave. - * * @return statutoryLeaveID - */ + **/ @ApiModelProperty(value = "The unique identifier (guid) of a statutory leave.") - /** + /** * The unique identifier (guid) of a statutory leave. - * * @return statutoryLeaveID UUID - */ + **/ public UUID getStatutoryLeaveID() { return statutoryLeaveID; } - /** - * The unique identifier (guid) of a statutory leave. - * - * @param statutoryLeaveID UUID - */ + /** + * The unique identifier (guid) of a statutory leave. + * @param statutoryLeaveID UUID + **/ + public void setStatutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; } /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - * @return EmployeeStatutoryLeaveSummary - */ + * The unique identifier (guid) of the employee + * @param employeeID UUID + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID - */ + **/ @ApiModelProperty(value = "The unique identifier (guid) of the employee") - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - */ + /** + * The unique identifier (guid) of the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The category of statutory leave - * - * @param type TypeEnum - * @return EmployeeStatutoryLeaveSummary - */ + * The category of statutory leave + * @param type TypeEnum + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary type(TypeEnum type) { this.type = type; return this; } - /** + /** * The category of statutory leave - * * @return type - */ + **/ @ApiModelProperty(value = "The category of statutory leave") - /** + /** * The category of statutory leave - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * The category of statutory leave - * - * @param type TypeEnum - */ + /** + * The category of statutory leave + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * The date when the leave starts - * - * @param startDate LocalDate - * @return EmployeeStatutoryLeaveSummary - */ + * The date when the leave starts + * @param startDate LocalDate + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * The date when the leave starts - * * @return startDate - */ + **/ @ApiModelProperty(value = "The date when the leave starts") - /** + /** * The date when the leave starts - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * The date when the leave starts - * - * @param startDate LocalDate - */ + /** + * The date when the leave starts + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * The date when the leave ends - * - * @param endDate LocalDate - * @return EmployeeStatutoryLeaveSummary - */ + * The date when the leave ends + * @param endDate LocalDate + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The date when the leave ends - * * @return endDate - */ + **/ @ApiModelProperty(value = "The date when the leave ends") - /** + /** * The date when the leave ends - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The date when the leave ends - * - * @param endDate LocalDate - */ + /** + * The date when the leave ends + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - * @return EmployeeStatutoryLeaveSummary - */ + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary isEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; return this; } - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled - */ + **/ @ApiModelProperty(value = "Whether the leave was entitled to receive payment") - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled Boolean - */ + **/ public Boolean getIsEntitled() { return isEntitled; } - /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - */ + /** + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + **/ + public void setIsEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; } /** - * The status of the leave - * - * @param status StatusEnum - * @return EmployeeStatutoryLeaveSummary - */ + * The status of the leave + * @param status StatusEnum + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary status(StatusEnum status) { this.status = status; return this; } - /** + /** * The status of the leave - * * @return status - */ + **/ @ApiModelProperty(value = "The status of the leave") - /** + /** * The status of the leave - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The status of the leave - * - * @param status StatusEnum - */ + /** + * The status of the leave + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -408,13 +413,13 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutoryLeaveSummary employeeStatutoryLeaveSummary = (EmployeeStatutoryLeaveSummary) o; - return Objects.equals(this.statutoryLeaveID, employeeStatutoryLeaveSummary.statutoryLeaveID) - && Objects.equals(this.employeeID, employeeStatutoryLeaveSummary.employeeID) - && Objects.equals(this.type, employeeStatutoryLeaveSummary.type) - && Objects.equals(this.startDate, employeeStatutoryLeaveSummary.startDate) - && Objects.equals(this.endDate, employeeStatutoryLeaveSummary.endDate) - && Objects.equals(this.isEntitled, employeeStatutoryLeaveSummary.isEntitled) - && Objects.equals(this.status, employeeStatutoryLeaveSummary.status); + return Objects.equals(this.statutoryLeaveID, employeeStatutoryLeaveSummary.statutoryLeaveID) && + Objects.equals(this.employeeID, employeeStatutoryLeaveSummary.employeeID) && + Objects.equals(this.type, employeeStatutoryLeaveSummary.type) && + Objects.equals(this.startDate, employeeStatutoryLeaveSummary.startDate) && + Objects.equals(this.endDate, employeeStatutoryLeaveSummary.endDate) && + Objects.equals(this.isEntitled, employeeStatutoryLeaveSummary.isEntitled) && + Objects.equals(this.status, employeeStatutoryLeaveSummary.status); } @Override @@ -422,6 +427,7 @@ public int hashCode() { return Objects.hash(statutoryLeaveID, employeeID, type, startDate, endDate, isEntitled, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -438,7 +444,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -446,4 +453,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeavesSummaries.java b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeavesSummaries.java index 651707cea..d218cd793 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeavesSummaries.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeStatutoryLeavesSummaries.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeStatutoryLeaveSummary; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeavesSummaries + */ -/** EmployeeStatutoryLeavesSummaries */ public class EmployeeStatutoryLeavesSummaries { StringUtil util = new StringUtil(); @@ -29,98 +49,87 @@ public class EmployeeStatutoryLeavesSummaries { private Problem problem; @JsonProperty("statutoryLeaves") - private List statutoryLeaves = - new ArrayList(); + private List statutoryLeaves = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutoryLeavesSummaries - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutoryLeavesSummaries + **/ public EmployeeStatutoryLeavesSummaries pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutoryLeavesSummaries - */ + * problem + * @param problem Problem + * @return EmployeeStatutoryLeavesSummaries + **/ public EmployeeStatutoryLeavesSummaries problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryLeaves - * - * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> - * @return EmployeeStatutoryLeavesSummaries - */ - public EmployeeStatutoryLeavesSummaries statutoryLeaves( - List statutoryLeaves) { + * statutoryLeaves + * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> + * @return EmployeeStatutoryLeavesSummaries + **/ + public EmployeeStatutoryLeavesSummaries statutoryLeaves(List statutoryLeaves) { this.statutoryLeaves = statutoryLeaves; return this; } /** * statutoryLeaves - * - * @param statutoryLeavesItem EmployeeStatutoryLeaveSummary + * @param statutoryLeavesItem EmployeeStatutoryLeaveSummary * @return EmployeeStatutoryLeavesSummaries - */ - public EmployeeStatutoryLeavesSummaries addStatutoryLeavesItem( - EmployeeStatutoryLeaveSummary statutoryLeavesItem) { + **/ + public EmployeeStatutoryLeavesSummaries addStatutoryLeavesItem(EmployeeStatutoryLeaveSummary statutoryLeavesItem) { if (this.statutoryLeaves == null) { this.statutoryLeaves = new ArrayList(); } @@ -128,30 +137,29 @@ public EmployeeStatutoryLeavesSummaries addStatutoryLeavesItem( return this; } - /** + /** * Get statutoryLeaves - * * @return statutoryLeaves - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryLeaves - * * @return statutoryLeaves List - */ + **/ public List getStatutoryLeaves() { return statutoryLeaves; } - /** - * statutoryLeaves - * - * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> - */ + /** + * statutoryLeaves + * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> + **/ + public void setStatutoryLeaves(List statutoryLeaves) { this.statutoryLeaves = statutoryLeaves; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,11 +168,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeStatutoryLeavesSummaries employeeStatutoryLeavesSummaries = - (EmployeeStatutoryLeavesSummaries) o; - return Objects.equals(this.pagination, employeeStatutoryLeavesSummaries.pagination) - && Objects.equals(this.problem, employeeStatutoryLeavesSummaries.problem) - && Objects.equals(this.statutoryLeaves, employeeStatutoryLeavesSummaries.statutoryLeaves); + EmployeeStatutoryLeavesSummaries employeeStatutoryLeavesSummaries = (EmployeeStatutoryLeavesSummaries) o; + return Objects.equals(this.pagination, employeeStatutoryLeavesSummaries.pagination) && + Objects.equals(this.problem, employeeStatutoryLeavesSummaries.problem) && + Objects.equals(this.statutoryLeaves, employeeStatutoryLeavesSummaries.statutoryLeaves); } @Override @@ -172,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryLeaves); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -184,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -192,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeave.java b/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeave.java index bec6cb6ea..05073451c 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeave.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeave.java @@ -9,20 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutorySickLeave + */ -/** EmployeeStatutorySickLeave */ public class EmployeeStatutorySickLeave { StringUtil util = new StringUtil(); @@ -70,24 +85,38 @@ public class EmployeeStatutorySickLeave { @JsonProperty("overlapsWithOtherLeave") private Boolean overlapsWithOtherLeave; - /** Gets or Sets entitlementFailureReasons */ + /** + * Gets or Sets entitlementFailureReasons + */ public enum EntitlementFailureReasonsEnum { - /** UNABLETOCALCULATEAWE */ + /** + * UNABLETOCALCULATEAWE + */ UNABLETOCALCULATEAWE("UnableToCalculateAwe"), - - /** AWELOWERTHANLEL */ + + /** + * AWELOWERTHANLEL + */ AWELOWERTHANLEL("AweLowerThanLel"), - - /** NOTQUALIFIEDINPREVIOUSPIW */ + + /** + * NOTQUALIFIEDINPREVIOUSPIW + */ NOTQUALIFIEDINPREVIOUSPIW("NotQualifiedInPreviousPiw"), - - /** EXCEEDEDMAXIMUMENTITLEMENTWEEKSOFSSP */ + + /** + * EXCEEDEDMAXIMUMENTITLEMENTWEEKSOFSSP + */ EXCEEDEDMAXIMUMENTITLEMENTWEEKSOFSSP("ExceededMaximumEntitlementWeeksOfSsp"), - - /** EXCEEDEDMAXIMUMDURATIONOFPIW */ + + /** + * EXCEEDEDMAXIMUMDURATIONOFPIW + */ EXCEEDEDMAXIMUMDURATIONOFPIW("ExceededMaximumDurationOfPiw"), - - /** SUFFICIENTNOTICENOTGIVEN */ + + /** + * SUFFICIENTNOTICENOTGIVEN + */ SUFFICIENTNOTICENOTGIVEN("SufficientNoticeNotGiven"); private String value; @@ -96,31 +125,25 @@ public enum EntitlementFailureReasonsEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static EntitlementFailureReasonsEnum fromValue(String value) { for (EntitlementFailureReasonsEnum b : EntitlementFailureReasonsEnum.values()) { @@ -132,267 +155,238 @@ public static EntitlementFailureReasonsEnum fromValue(String value) { } } + @JsonProperty("entitlementFailureReasons") - private List entitlementFailureReasons = - new ArrayList(); + private List entitlementFailureReasons = new ArrayList(); /** - * The unique identifier (guid) of a statutory leave - * - * @param statutoryLeaveID UUID - * @return EmployeeStatutorySickLeave - */ + * The unique identifier (guid) of a statutory leave + * @param statutoryLeaveID UUID + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave statutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; return this; } - /** + /** * The unique identifier (guid) of a statutory leave - * * @return statutoryLeaveID - */ + **/ @ApiModelProperty(value = "The unique identifier (guid) of a statutory leave") - /** + /** * The unique identifier (guid) of a statutory leave - * * @return statutoryLeaveID UUID - */ + **/ public UUID getStatutoryLeaveID() { return statutoryLeaveID; } - /** - * The unique identifier (guid) of a statutory leave - * - * @param statutoryLeaveID UUID - */ + /** + * The unique identifier (guid) of a statutory leave + * @param statutoryLeaveID UUID + **/ + public void setStatutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; } /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - * @return EmployeeStatutorySickLeave - */ + * The unique identifier (guid) of the employee + * @param employeeID UUID + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier (guid) of the employee") - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - */ + /** + * The unique identifier (guid) of the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * - * @param leaveTypeID UUID - * @return EmployeeStatutorySickLeave - */ + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item + * @param leaveTypeID UUID + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * + /** + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item * @return leaveTypeID - */ - @ApiModelProperty( - required = true, - value = - "The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item") - /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * + **/ + @ApiModelProperty(required = true, value = "The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item") + /** + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * - * @param leaveTypeID UUID - */ + /** + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The date when the leave starts - * - * @param startDate LocalDate - * @return EmployeeStatutorySickLeave - */ + * The date when the leave starts + * @param startDate LocalDate + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * The date when the leave starts - * * @return startDate - */ + **/ @ApiModelProperty(required = true, value = "The date when the leave starts") - /** + /** * The date when the leave starts - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * The date when the leave starts - * - * @param startDate LocalDate - */ + /** + * The date when the leave starts + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * The date when the leave ends - * - * @param endDate LocalDate - * @return EmployeeStatutorySickLeave - */ + * The date when the leave ends + * @param endDate LocalDate + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The date when the leave ends - * * @return endDate - */ + **/ @ApiModelProperty(required = true, value = "The date when the leave ends") - /** + /** * The date when the leave ends - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The date when the leave ends - * - * @param endDate LocalDate - */ + /** + * The date when the leave ends + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * the type of statutory leave - * - * @param type String - * @return EmployeeStatutorySickLeave - */ + * the type of statutory leave + * @param type String + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave type(String type) { this.type = type; return this; } - /** + /** * the type of statutory leave - * * @return type - */ + **/ @ApiModelProperty(example = "Sick", value = "the type of statutory leave") - /** + /** * the type of statutory leave - * * @return type String - */ + **/ public String getType() { return type; } - /** - * the type of statutory leave - * - * @param type String - */ + /** + * the type of statutory leave + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * the type of statutory leave - * - * @param status String - * @return EmployeeStatutorySickLeave - */ + * the type of statutory leave + * @param status String + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave status(String status) { this.status = status; return this; } - /** + /** * the type of statutory leave - * * @return status - */ + **/ @ApiModelProperty(example = "Pending", value = "the type of statutory leave") - /** + /** * the type of statutory leave - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * the type of statutory leave - * - * @param status String - */ + /** + * the type of statutory leave + * @param status String + **/ + public void setStatus(String status) { this.status = status; } /** - * The days of the work week the employee is scheduled to work at the time the leave is taken - * - * @param workPattern List<> - * @return EmployeeStatutorySickLeave - */ + * The days of the work week the employee is scheduled to work at the time the leave is taken + * @param workPattern List<> + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave workPattern(List workPattern) { this.workPattern = workPattern; return this; @@ -400,334 +394,276 @@ public EmployeeStatutorySickLeave workPattern(List workPattern) { /** * The days of the work week the employee is scheduled to work at the time the leave is taken - * - * @param workPatternItem String + * @param workPatternItem String * @return EmployeeStatutorySickLeave - */ + **/ public EmployeeStatutorySickLeave addWorkPatternItem(String workPatternItem) { this.workPattern.add(workPatternItem); return this; } - /** + /** * The days of the work week the employee is scheduled to work at the time the leave is taken - * * @return workPattern - */ - @ApiModelProperty( - required = true, - value = - "The days of the work week the employee is scheduled to work at the time the leave is" - + " taken") - /** + **/ + @ApiModelProperty(required = true, value = "The days of the work week the employee is scheduled to work at the time the leave is taken") + /** * The days of the work week the employee is scheduled to work at the time the leave is taken - * * @return workPattern List - */ + **/ public List getWorkPattern() { return workPattern; } - /** - * The days of the work week the employee is scheduled to work at the time the leave is taken - * - * @param workPattern List<> - */ + /** + * The days of the work week the employee is scheduled to work at the time the leave is taken + * @param workPattern List<> + **/ + public void setWorkPattern(List workPattern) { this.workPattern = workPattern; } /** - * Whether the sick leave was pregnancy related - * - * @param isPregnancyRelated Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether the sick leave was pregnancy related + * @param isPregnancyRelated Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave isPregnancyRelated(Boolean isPregnancyRelated) { this.isPregnancyRelated = isPregnancyRelated; return this; } - /** + /** * Whether the sick leave was pregnancy related - * * @return isPregnancyRelated - */ + **/ @ApiModelProperty(required = true, value = "Whether the sick leave was pregnancy related") - /** + /** * Whether the sick leave was pregnancy related - * * @return isPregnancyRelated Boolean - */ + **/ public Boolean getIsPregnancyRelated() { return isPregnancyRelated; } - /** - * Whether the sick leave was pregnancy related - * - * @param isPregnancyRelated Boolean - */ + /** + * Whether the sick leave was pregnancy related + * @param isPregnancyRelated Boolean + **/ + public void setIsPregnancyRelated(Boolean isPregnancyRelated) { this.isPregnancyRelated = isPregnancyRelated; } /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * - * @param sufficientNotice Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request + * @param sufficientNotice Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave sufficientNotice(Boolean sufficientNotice) { this.sufficientNotice = sufficientNotice; return this; } - /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * + /** + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request * @return sufficientNotice - */ - @ApiModelProperty( - required = true, - value = - "Whether the employee provided sufficient notice and documentation as required by the" - + " employer supporting the sick leave request") - /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * + **/ + @ApiModelProperty(required = true, value = "Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request") + /** + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request * @return sufficientNotice Boolean - */ + **/ public Boolean getSufficientNotice() { return sufficientNotice; } - /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * - * @param sufficientNotice Boolean - */ + /** + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request + * @param sufficientNotice Boolean + **/ + public void setSufficientNotice(Boolean sufficientNotice) { this.sufficientNotice = sufficientNotice; } /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave isEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; return this; } - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled - */ + **/ @ApiModelProperty(value = "Whether the leave was entitled to receive payment") - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled Boolean - */ + **/ public Boolean getIsEntitled() { return isEntitled; } - /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - */ + /** + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + **/ + public void setIsEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; } /** - * The amount of requested time (in weeks) - * - * @param entitlementWeeksRequested Double - * @return EmployeeStatutorySickLeave - */ + * The amount of requested time (in weeks) + * @param entitlementWeeksRequested Double + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave entitlementWeeksRequested(Double entitlementWeeksRequested) { this.entitlementWeeksRequested = entitlementWeeksRequested; return this; } - /** + /** * The amount of requested time (in weeks) - * * @return entitlementWeeksRequested - */ + **/ @ApiModelProperty(value = "The amount of requested time (in weeks)") - /** + /** * The amount of requested time (in weeks) - * * @return entitlementWeeksRequested Double - */ + **/ public Double getEntitlementWeeksRequested() { return entitlementWeeksRequested; } - /** - * The amount of requested time (in weeks) - * - * @param entitlementWeeksRequested Double - */ + /** + * The amount of requested time (in weeks) + * @param entitlementWeeksRequested Double + **/ + public void setEntitlementWeeksRequested(Double entitlementWeeksRequested) { this.entitlementWeeksRequested = entitlementWeeksRequested; } /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * - * @param entitlementWeeksQualified Double - * @return EmployeeStatutorySickLeave - */ + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + * @param entitlementWeeksQualified Double + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave entitlementWeeksQualified(Double entitlementWeeksQualified) { this.entitlementWeeksQualified = entitlementWeeksQualified; return this; } - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested * @return entitlementWeeksQualified - */ - @ApiModelProperty( - value = - "The amount of statutory sick leave time off (in weeks) that is available to take at the" - + " time the leave was requested") - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * + **/ + @ApiModelProperty(value = "The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested") + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested * @return entitlementWeeksQualified Double - */ + **/ public Double getEntitlementWeeksQualified() { return entitlementWeeksQualified; } - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * - * @param entitlementWeeksQualified Double - */ + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + * @param entitlementWeeksQualified Double + **/ + public void setEntitlementWeeksQualified(Double entitlementWeeksQualified) { this.entitlementWeeksQualified = entitlementWeeksQualified; } /** - * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * - * @param entitlementWeeksRemaining Double - * @return EmployeeStatutorySickLeave - */ + * A calculated amount of time (in weeks) that remains for the statutory sick leave period + * @param entitlementWeeksRemaining Double + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave entitlementWeeksRemaining(Double entitlementWeeksRemaining) { this.entitlementWeeksRemaining = entitlementWeeksRemaining; return this; } - /** + /** * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * * @return entitlementWeeksRemaining - */ - @ApiModelProperty( - value = - "A calculated amount of time (in weeks) that remains for the statutory sick leave period") - /** + **/ + @ApiModelProperty(value = "A calculated amount of time (in weeks) that remains for the statutory sick leave period") + /** * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * * @return entitlementWeeksRemaining Double - */ + **/ public Double getEntitlementWeeksRemaining() { return entitlementWeeksRemaining; } - /** - * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * - * @param entitlementWeeksRemaining Double - */ + /** + * A calculated amount of time (in weeks) that remains for the statutory sick leave period + * @param entitlementWeeksRemaining Double + **/ + public void setEntitlementWeeksRemaining(Double entitlementWeeksRemaining) { this.entitlementWeeksRemaining = entitlementWeeksRemaining; } /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * - * @param overlapsWithOtherLeave Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts + * @param overlapsWithOtherLeave Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave overlapsWithOtherLeave(Boolean overlapsWithOtherLeave) { this.overlapsWithOtherLeave = overlapsWithOtherLeave; return this; } - /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * + /** + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts * @return overlapsWithOtherLeave - */ - @ApiModelProperty( - value = - "Whether another leave (Paternity, Shared Parental specifically) occurs during the" - + " requested leave's period. While this is allowed it could affect payment amounts") - /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * + **/ + @ApiModelProperty(value = "Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts") + /** + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts * @return overlapsWithOtherLeave Boolean - */ + **/ public Boolean getOverlapsWithOtherLeave() { return overlapsWithOtherLeave; } - /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * - * @param overlapsWithOtherLeave Boolean - */ + /** + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts + * @param overlapsWithOtherLeave Boolean + **/ + public void setOverlapsWithOtherLeave(Boolean overlapsWithOtherLeave) { this.overlapsWithOtherLeave = overlapsWithOtherLeave; } /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * - * @param entitlementFailureReasons List<> - * @return EmployeeStatutorySickLeave - */ - public EmployeeStatutorySickLeave entitlementFailureReasons( - List entitlementFailureReasons) { + * If the leave requested was considered \"not entitled\", the reasons why are listed here. + * @param entitlementFailureReasons List<> + * @return EmployeeStatutorySickLeave + **/ + public EmployeeStatutorySickLeave entitlementFailureReasons(List entitlementFailureReasons) { this.entitlementFailureReasons = entitlementFailureReasons; return this; } /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * - * @param entitlementFailureReasonsItem EntitlementFailureReasonsEnum + * If the leave requested was considered \"not entitled\", the reasons why are listed here. + * @param entitlementFailureReasonsItem EntitlementFailureReasonsEnum * @return EmployeeStatutorySickLeave - */ - public EmployeeStatutorySickLeave addEntitlementFailureReasonsItem( - EntitlementFailureReasonsEnum entitlementFailureReasonsItem) { + **/ + public EmployeeStatutorySickLeave addEntitlementFailureReasonsItem(EntitlementFailureReasonsEnum entitlementFailureReasonsItem) { if (this.entitlementFailureReasons == null) { this.entitlementFailureReasons = new ArrayList(); } @@ -735,37 +671,29 @@ public EmployeeStatutorySickLeave addEntitlementFailureReasonsItem( return this; } - /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * + /** + * If the leave requested was considered \"not entitled\", the reasons why are listed here. * @return entitlementFailureReasons - */ - @ApiModelProperty( - value = - "If the leave requested was considered \"not entitled\", the reasons why are listed" - + " here.") - /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * + **/ + @ApiModelProperty(value = "If the leave requested was considered \"not entitled\", the reasons why are listed here.") + /** + * If the leave requested was considered \"not entitled\", the reasons why are listed here. * @return entitlementFailureReasons List - */ + **/ public List getEntitlementFailureReasons() { return entitlementFailureReasons; } - /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * - * @param entitlementFailureReasons List<> - */ - public void setEntitlementFailureReasons( - List entitlementFailureReasons) { + /** + * If the leave requested was considered \"not entitled\", the reasons why are listed here. + * @param entitlementFailureReasons List<> + **/ + + public void setEntitlementFailureReasons(List entitlementFailureReasons) { this.entitlementFailureReasons = entitlementFailureReasons; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -775,50 +703,30 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutorySickLeave employeeStatutorySickLeave = (EmployeeStatutorySickLeave) o; - return Objects.equals(this.statutoryLeaveID, employeeStatutorySickLeave.statutoryLeaveID) - && Objects.equals(this.employeeID, employeeStatutorySickLeave.employeeID) - && Objects.equals(this.leaveTypeID, employeeStatutorySickLeave.leaveTypeID) - && Objects.equals(this.startDate, employeeStatutorySickLeave.startDate) - && Objects.equals(this.endDate, employeeStatutorySickLeave.endDate) - && Objects.equals(this.type, employeeStatutorySickLeave.type) - && Objects.equals(this.status, employeeStatutorySickLeave.status) - && Objects.equals(this.workPattern, employeeStatutorySickLeave.workPattern) - && Objects.equals(this.isPregnancyRelated, employeeStatutorySickLeave.isPregnancyRelated) - && Objects.equals(this.sufficientNotice, employeeStatutorySickLeave.sufficientNotice) - && Objects.equals(this.isEntitled, employeeStatutorySickLeave.isEntitled) - && Objects.equals( - this.entitlementWeeksRequested, employeeStatutorySickLeave.entitlementWeeksRequested) - && Objects.equals( - this.entitlementWeeksQualified, employeeStatutorySickLeave.entitlementWeeksQualified) - && Objects.equals( - this.entitlementWeeksRemaining, employeeStatutorySickLeave.entitlementWeeksRemaining) - && Objects.equals( - this.overlapsWithOtherLeave, employeeStatutorySickLeave.overlapsWithOtherLeave) - && Objects.equals( - this.entitlementFailureReasons, employeeStatutorySickLeave.entitlementFailureReasons); + return Objects.equals(this.statutoryLeaveID, employeeStatutorySickLeave.statutoryLeaveID) && + Objects.equals(this.employeeID, employeeStatutorySickLeave.employeeID) && + Objects.equals(this.leaveTypeID, employeeStatutorySickLeave.leaveTypeID) && + Objects.equals(this.startDate, employeeStatutorySickLeave.startDate) && + Objects.equals(this.endDate, employeeStatutorySickLeave.endDate) && + Objects.equals(this.type, employeeStatutorySickLeave.type) && + Objects.equals(this.status, employeeStatutorySickLeave.status) && + Objects.equals(this.workPattern, employeeStatutorySickLeave.workPattern) && + Objects.equals(this.isPregnancyRelated, employeeStatutorySickLeave.isPregnancyRelated) && + Objects.equals(this.sufficientNotice, employeeStatutorySickLeave.sufficientNotice) && + Objects.equals(this.isEntitled, employeeStatutorySickLeave.isEntitled) && + Objects.equals(this.entitlementWeeksRequested, employeeStatutorySickLeave.entitlementWeeksRequested) && + Objects.equals(this.entitlementWeeksQualified, employeeStatutorySickLeave.entitlementWeeksQualified) && + Objects.equals(this.entitlementWeeksRemaining, employeeStatutorySickLeave.entitlementWeeksRemaining) && + Objects.equals(this.overlapsWithOtherLeave, employeeStatutorySickLeave.overlapsWithOtherLeave) && + Objects.equals(this.entitlementFailureReasons, employeeStatutorySickLeave.entitlementFailureReasons); } @Override public int hashCode() { - return Objects.hash( - statutoryLeaveID, - employeeID, - leaveTypeID, - startDate, - endDate, - type, - status, - workPattern, - isPregnancyRelated, - sufficientNotice, - isEntitled, - entitlementWeeksRequested, - entitlementWeeksQualified, - entitlementWeeksRemaining, - overlapsWithOtherLeave, - entitlementFailureReasons); + return Objects.hash(statutoryLeaveID, employeeID, leaveTypeID, startDate, endDate, type, status, workPattern, isPregnancyRelated, sufficientNotice, isEntitled, entitlementWeeksRequested, entitlementWeeksQualified, entitlementWeeksRemaining, overlapsWithOtherLeave, entitlementFailureReasons); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -834,27 +742,18 @@ public String toString() { sb.append(" isPregnancyRelated: ").append(toIndentedString(isPregnancyRelated)).append("\n"); sb.append(" sufficientNotice: ").append(toIndentedString(sufficientNotice)).append("\n"); sb.append(" isEntitled: ").append(toIndentedString(isEntitled)).append("\n"); - sb.append(" entitlementWeeksRequested: ") - .append(toIndentedString(entitlementWeeksRequested)) - .append("\n"); - sb.append(" entitlementWeeksQualified: ") - .append(toIndentedString(entitlementWeeksQualified)) - .append("\n"); - sb.append(" entitlementWeeksRemaining: ") - .append(toIndentedString(entitlementWeeksRemaining)) - .append("\n"); - sb.append(" overlapsWithOtherLeave: ") - .append(toIndentedString(overlapsWithOtherLeave)) - .append("\n"); - sb.append(" entitlementFailureReasons: ") - .append(toIndentedString(entitlementFailureReasons)) - .append("\n"); + sb.append(" entitlementWeeksRequested: ").append(toIndentedString(entitlementWeeksRequested)).append("\n"); + sb.append(" entitlementWeeksQualified: ").append(toIndentedString(entitlementWeeksQualified)).append("\n"); + sb.append(" entitlementWeeksRemaining: ").append(toIndentedString(entitlementWeeksRemaining)).append("\n"); + sb.append(" overlapsWithOtherLeave: ").append(toIndentedString(overlapsWithOtherLeave)).append("\n"); + sb.append(" entitlementFailureReasons: ").append(toIndentedString(entitlementFailureReasons)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -862,4 +761,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaveObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaveObject.java index 1d12a2074..bc828972f 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaveObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaveObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeStatutorySickLeave; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutorySickLeaveObject + */ -/** EmployeeStatutorySickLeaveObject */ public class EmployeeStatutorySickLeaveObject { StringUtil util = new StringUtil(); @@ -29,111 +49,102 @@ public class EmployeeStatutorySickLeaveObject { @JsonProperty("statutorySickLeave") private EmployeeStatutorySickLeave statutorySickLeave; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutorySickLeaveObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutorySickLeaveObject + **/ public EmployeeStatutorySickLeaveObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutorySickLeaveObject - */ + * problem + * @param problem Problem + * @return EmployeeStatutorySickLeaveObject + **/ public EmployeeStatutorySickLeaveObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutorySickLeave - * - * @param statutorySickLeave EmployeeStatutorySickLeave - * @return EmployeeStatutorySickLeaveObject - */ - public EmployeeStatutorySickLeaveObject statutorySickLeave( - EmployeeStatutorySickLeave statutorySickLeave) { + * statutorySickLeave + * @param statutorySickLeave EmployeeStatutorySickLeave + * @return EmployeeStatutorySickLeaveObject + **/ + public EmployeeStatutorySickLeaveObject statutorySickLeave(EmployeeStatutorySickLeave statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; return this; } - /** + /** * Get statutorySickLeave - * * @return statutorySickLeave - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutorySickLeave - * * @return statutorySickLeave EmployeeStatutorySickLeave - */ + **/ public EmployeeStatutorySickLeave getStatutorySickLeave() { return statutorySickLeave; } - /** - * statutorySickLeave - * - * @param statutorySickLeave EmployeeStatutorySickLeave - */ + /** + * statutorySickLeave + * @param statutorySickLeave EmployeeStatutorySickLeave + **/ + public void setStatutorySickLeave(EmployeeStatutorySickLeave statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,12 +153,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeStatutorySickLeaveObject employeeStatutorySickLeaveObject = - (EmployeeStatutorySickLeaveObject) o; - return Objects.equals(this.pagination, employeeStatutorySickLeaveObject.pagination) - && Objects.equals(this.problem, employeeStatutorySickLeaveObject.problem) - && Objects.equals( - this.statutorySickLeave, employeeStatutorySickLeaveObject.statutorySickLeave); + EmployeeStatutorySickLeaveObject employeeStatutorySickLeaveObject = (EmployeeStatutorySickLeaveObject) o; + return Objects.equals(this.pagination, employeeStatutorySickLeaveObject.pagination) && + Objects.equals(this.problem, employeeStatutorySickLeaveObject.problem) && + Objects.equals(this.statutorySickLeave, employeeStatutorySickLeaveObject.statutorySickLeave); } @Override @@ -155,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutorySickLeave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -167,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -175,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaves.java b/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaves.java index 5473ee94a..99e92d587 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaves.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeStatutorySickLeaves.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeStatutorySickLeave; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutorySickLeaves + */ -/** EmployeeStatutorySickLeaves */ public class EmployeeStatutorySickLeaves { StringUtil util = new StringUtil(); @@ -29,98 +49,87 @@ public class EmployeeStatutorySickLeaves { private Problem problem; @JsonProperty("statutorySickLeave") - private List statutorySickLeave = - new ArrayList(); + private List statutorySickLeave = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutorySickLeaves - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutorySickLeaves + **/ public EmployeeStatutorySickLeaves pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutorySickLeaves - */ + * problem + * @param problem Problem + * @return EmployeeStatutorySickLeaves + **/ public EmployeeStatutorySickLeaves problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutorySickLeave - * - * @param statutorySickLeave List<EmployeeStatutorySickLeave> - * @return EmployeeStatutorySickLeaves - */ - public EmployeeStatutorySickLeaves statutorySickLeave( - List statutorySickLeave) { + * statutorySickLeave + * @param statutorySickLeave List<EmployeeStatutorySickLeave> + * @return EmployeeStatutorySickLeaves + **/ + public EmployeeStatutorySickLeaves statutorySickLeave(List statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; return this; } /** * statutorySickLeave - * - * @param statutorySickLeaveItem EmployeeStatutorySickLeave + * @param statutorySickLeaveItem EmployeeStatutorySickLeave * @return EmployeeStatutorySickLeaves - */ - public EmployeeStatutorySickLeaves addStatutorySickLeaveItem( - EmployeeStatutorySickLeave statutorySickLeaveItem) { + **/ + public EmployeeStatutorySickLeaves addStatutorySickLeaveItem(EmployeeStatutorySickLeave statutorySickLeaveItem) { if (this.statutorySickLeave == null) { this.statutorySickLeave = new ArrayList(); } @@ -128,30 +137,29 @@ public EmployeeStatutorySickLeaves addStatutorySickLeaveItem( return this; } - /** + /** * Get statutorySickLeave - * * @return statutorySickLeave - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutorySickLeave - * * @return statutorySickLeave List - */ + **/ public List getStatutorySickLeave() { return statutorySickLeave; } - /** - * statutorySickLeave - * - * @param statutorySickLeave List<EmployeeStatutorySickLeave> - */ + /** + * statutorySickLeave + * @param statutorySickLeave List<EmployeeStatutorySickLeave> + **/ + public void setStatutorySickLeave(List statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -161,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutorySickLeaves employeeStatutorySickLeaves = (EmployeeStatutorySickLeaves) o; - return Objects.equals(this.pagination, employeeStatutorySickLeaves.pagination) - && Objects.equals(this.problem, employeeStatutorySickLeaves.problem) - && Objects.equals(this.statutorySickLeave, employeeStatutorySickLeaves.statutorySickLeave); + return Objects.equals(this.pagination, employeeStatutorySickLeaves.pagination) && + Objects.equals(this.problem, employeeStatutorySickLeaves.problem) && + Objects.equals(this.statutorySickLeave, employeeStatutorySickLeaves.statutorySickLeave); } @Override @@ -171,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutorySickLeave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -183,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -191,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeTax.java b/src/main/java/com/xero/models/payrollnz/EmployeeTax.java index 4460249d8..e6ee48ef1 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeTax.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeTax.java @@ -9,17 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollnz.TaxCode; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeTax + */ -/** EmployeeTax */ public class EmployeeTax { StringUtil util = new StringUtil(); @@ -44,24 +60,32 @@ public class EmployeeTax { @JsonProperty("esctRatePercentage") private Double esctRatePercentage; /** - * Contribution Option which can be 'MakeContributions' 'OptOut', - * 'OnAContributionsHoliday', 'OnASavingsSuspension', - * 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership + * Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership */ public enum KiwiSaverContributionsEnum { - /** MAKECONTRIBUTIONS */ + /** + * MAKECONTRIBUTIONS + */ MAKECONTRIBUTIONS("MakeContributions"), - - /** OPTOUT */ + + /** + * OPTOUT + */ OPTOUT("OptOut"), - - /** ONACONTRIBUTIONSHOLIDAY */ + + /** + * ONACONTRIBUTIONSHOLIDAY + */ ONACONTRIBUTIONSHOLIDAY("OnAContributionsHoliday"), - - /** ONASAVINGSSUSPENSION */ + + /** + * ONASAVINGSSUSPENSION + */ ONASAVINGSSUSPENSION("OnASavingsSuspension"), - - /** NOTCURRENTLYAKIWISAVERMEMBER */ + + /** + * NOTCURRENTLYAKIWISAVERMEMBER + */ NOTCURRENTLYAKIWISAVERMEMBER("NotCurrentlyAKiwiSaverMember"); private String value; @@ -70,31 +94,25 @@ public enum KiwiSaverContributionsEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static KiwiSaverContributionsEnum fromValue(String value) { for (KiwiSaverContributionsEnum b : KiwiSaverContributionsEnum.values()) { @@ -106,6 +124,7 @@ public static KiwiSaverContributionsEnum fromValue(String value) { } } + @JsonProperty("kiwiSaverContributions") private KiwiSaverContributionsEnum kiwiSaverContributions; @@ -133,600 +152,518 @@ public static KiwiSaverContributionsEnum fromValue(String value) { @JsonProperty("studentLoanAsAt") private LocalDate studentLoanAsAt; /** - * The IRD Number. - * - * @param irdNumber String - * @return EmployeeTax - */ + * The IRD Number. + * @param irdNumber String + * @return EmployeeTax + **/ public EmployeeTax irdNumber(String irdNumber) { this.irdNumber = irdNumber; return this; } - /** + /** * The IRD Number. - * * @return irdNumber - */ + **/ @ApiModelProperty(example = "111111111", value = "The IRD Number.") - /** + /** * The IRD Number. - * * @return irdNumber String - */ + **/ public String getIrdNumber() { return irdNumber; } - /** - * The IRD Number. - * - * @param irdNumber String - */ + /** + * The IRD Number. + * @param irdNumber String + **/ + public void setIrdNumber(String irdNumber) { this.irdNumber = irdNumber; } /** - * taxCode - * - * @param taxCode TaxCode - * @return EmployeeTax - */ + * taxCode + * @param taxCode TaxCode + * @return EmployeeTax + **/ public EmployeeTax taxCode(TaxCode taxCode) { this.taxCode = taxCode; return this; } - /** + /** * Get taxCode - * * @return taxCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxCode - * * @return taxCode TaxCode - */ + **/ public TaxCode getTaxCode() { return taxCode; } - /** - * taxCode - * - * @param taxCode TaxCode - */ + /** + * taxCode + * @param taxCode TaxCode + **/ + public void setTaxCode(TaxCode taxCode) { this.taxCode = taxCode; } /** - * Special tax rate percentage. - * - * @param specialTaxRatePercentage Double - * @return EmployeeTax - */ + * Special tax rate percentage. + * @param specialTaxRatePercentage Double + * @return EmployeeTax + **/ public EmployeeTax specialTaxRatePercentage(Double specialTaxRatePercentage) { this.specialTaxRatePercentage = specialTaxRatePercentage; return this; } - /** + /** * Special tax rate percentage. - * * @return specialTaxRatePercentage - */ + **/ @ApiModelProperty(example = "17.5", value = "Special tax rate percentage.") - /** + /** * Special tax rate percentage. - * * @return specialTaxRatePercentage Double - */ + **/ public Double getSpecialTaxRatePercentage() { return specialTaxRatePercentage; } - /** - * Special tax rate percentage. - * - * @param specialTaxRatePercentage Double - */ + /** + * Special tax rate percentage. + * @param specialTaxRatePercentage Double + **/ + public void setSpecialTaxRatePercentage(Double specialTaxRatePercentage) { this.specialTaxRatePercentage = specialTaxRatePercentage; } /** - * Does the employee has a special student loan rate? - * - * @param hasSpecialStudentLoanRate Boolean - * @return EmployeeTax - */ + * Does the employee has a special student loan rate? + * @param hasSpecialStudentLoanRate Boolean + * @return EmployeeTax + **/ public EmployeeTax hasSpecialStudentLoanRate(Boolean hasSpecialStudentLoanRate) { this.hasSpecialStudentLoanRate = hasSpecialStudentLoanRate; return this; } - /** + /** * Does the employee has a special student loan rate? - * * @return hasSpecialStudentLoanRate - */ + **/ @ApiModelProperty(example = "true", value = "Does the employee has a special student loan rate?") - /** + /** * Does the employee has a special student loan rate? - * * @return hasSpecialStudentLoanRate Boolean - */ + **/ public Boolean getHasSpecialStudentLoanRate() { return hasSpecialStudentLoanRate; } - /** - * Does the employee has a special student loan rate? - * - * @param hasSpecialStudentLoanRate Boolean - */ + /** + * Does the employee has a special student loan rate? + * @param hasSpecialStudentLoanRate Boolean + **/ + public void setHasSpecialStudentLoanRate(Boolean hasSpecialStudentLoanRate) { this.hasSpecialStudentLoanRate = hasSpecialStudentLoanRate; } /** - * The employee student loan rate percentage. - * - * @param specialStudentLoanRatePercentage Double - * @return EmployeeTax - */ + * The employee student loan rate percentage. + * @param specialStudentLoanRatePercentage Double + * @return EmployeeTax + **/ public EmployeeTax specialStudentLoanRatePercentage(Double specialStudentLoanRatePercentage) { this.specialStudentLoanRatePercentage = specialStudentLoanRatePercentage; return this; } - /** + /** * The employee student loan rate percentage. - * * @return specialStudentLoanRatePercentage - */ + **/ @ApiModelProperty(example = "2.0", value = "The employee student loan rate percentage.") - /** + /** * The employee student loan rate percentage. - * * @return specialStudentLoanRatePercentage Double - */ + **/ public Double getSpecialStudentLoanRatePercentage() { return specialStudentLoanRatePercentage; } - /** - * The employee student loan rate percentage. - * - * @param specialStudentLoanRatePercentage Double - */ + /** + * The employee student loan rate percentage. + * @param specialStudentLoanRatePercentage Double + **/ + public void setSpecialStudentLoanRatePercentage(Double specialStudentLoanRatePercentage) { this.specialStudentLoanRatePercentage = specialStudentLoanRatePercentage; } /** - * The employee eligibility for KiwiSaver. - * - * @param isEligibleForKiwiSaver Boolean - * @return EmployeeTax - */ + * The employee eligibility for KiwiSaver. + * @param isEligibleForKiwiSaver Boolean + * @return EmployeeTax + **/ public EmployeeTax isEligibleForKiwiSaver(Boolean isEligibleForKiwiSaver) { this.isEligibleForKiwiSaver = isEligibleForKiwiSaver; return this; } - /** + /** * The employee eligibility for KiwiSaver. - * * @return isEligibleForKiwiSaver - */ + **/ @ApiModelProperty(example = "true", value = "The employee eligibility for KiwiSaver.") - /** + /** * The employee eligibility for KiwiSaver. - * * @return isEligibleForKiwiSaver Boolean - */ + **/ public Boolean getIsEligibleForKiwiSaver() { return isEligibleForKiwiSaver; } - /** - * The employee eligibility for KiwiSaver. - * - * @param isEligibleForKiwiSaver Boolean - */ + /** + * The employee eligibility for KiwiSaver. + * @param isEligibleForKiwiSaver Boolean + **/ + public void setIsEligibleForKiwiSaver(Boolean isEligibleForKiwiSaver) { this.isEligibleForKiwiSaver = isEligibleForKiwiSaver; } /** - * Employer superannuation contribution tax rate. - * - * @param esctRatePercentage Double - * @return EmployeeTax - */ + * Employer superannuation contribution tax rate. + * @param esctRatePercentage Double + * @return EmployeeTax + **/ public EmployeeTax esctRatePercentage(Double esctRatePercentage) { this.esctRatePercentage = esctRatePercentage; return this; } - /** + /** * Employer superannuation contribution tax rate. - * * @return esctRatePercentage - */ + **/ @ApiModelProperty(example = "1.0", value = "Employer superannuation contribution tax rate.") - /** + /** * Employer superannuation contribution tax rate. - * * @return esctRatePercentage Double - */ + **/ public Double getEsctRatePercentage() { return esctRatePercentage; } - /** - * Employer superannuation contribution tax rate. - * - * @param esctRatePercentage Double - */ + /** + * Employer superannuation contribution tax rate. + * @param esctRatePercentage Double + **/ + public void setEsctRatePercentage(Double esctRatePercentage) { this.esctRatePercentage = esctRatePercentage; } /** - * Contribution Option which can be 'MakeContributions' 'OptOut', - * 'OnAContributionsHoliday', 'OnASavingsSuspension', - * 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership - * - * @param kiwiSaverContributions KiwiSaverContributionsEnum - * @return EmployeeTax - */ + * Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership + * @param kiwiSaverContributions KiwiSaverContributionsEnum + * @return EmployeeTax + **/ public EmployeeTax kiwiSaverContributions(KiwiSaverContributionsEnum kiwiSaverContributions) { this.kiwiSaverContributions = kiwiSaverContributions; return this; } - /** - * Contribution Option which can be 'MakeContributions' 'OptOut', - * 'OnAContributionsHoliday', 'OnASavingsSuspension', - * 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership - * + /** + * Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership * @return kiwiSaverContributions - */ - @ApiModelProperty( - example = "MakeContributions", - value = - "Contribution Option which can be 'MakeContributions' 'OptOut'," - + " 'OnAContributionsHoliday', 'OnASavingsSuspension'," - + " 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership") - /** - * Contribution Option which can be 'MakeContributions' 'OptOut', - * 'OnAContributionsHoliday', 'OnASavingsSuspension', - * 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership - * + **/ + @ApiModelProperty(example = "MakeContributions", value = "Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership") + /** + * Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership * @return kiwiSaverContributions KiwiSaverContributionsEnum - */ + **/ public KiwiSaverContributionsEnum getKiwiSaverContributions() { return kiwiSaverContributions; } - /** - * Contribution Option which can be 'MakeContributions' 'OptOut', - * 'OnAContributionsHoliday', 'OnASavingsSuspension', - * 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership - * - * @param kiwiSaverContributions KiwiSaverContributionsEnum - */ + /** + * Contribution Option which can be 'MakeContributions' 'OptOut', 'OnAContributionsHoliday', 'OnASavingsSuspension', 'NotCurrentlyAKiwiSaverMember' for employees without a KiwiSaver membership + * @param kiwiSaverContributions KiwiSaverContributionsEnum + **/ + public void setKiwiSaverContributions(KiwiSaverContributionsEnum kiwiSaverContributions) { this.kiwiSaverContributions = kiwiSaverContributions; } /** - * Employee Contribution percentage. - * - * @param kiwiSaverEmployeeContributionRatePercentage Double - * @return EmployeeTax - */ - public EmployeeTax kiwiSaverEmployeeContributionRatePercentage( - Double kiwiSaverEmployeeContributionRatePercentage) { + * Employee Contribution percentage. + * @param kiwiSaverEmployeeContributionRatePercentage Double + * @return EmployeeTax + **/ + public EmployeeTax kiwiSaverEmployeeContributionRatePercentage(Double kiwiSaverEmployeeContributionRatePercentage) { this.kiwiSaverEmployeeContributionRatePercentage = kiwiSaverEmployeeContributionRatePercentage; return this; } - /** + /** * Employee Contribution percentage. - * * @return kiwiSaverEmployeeContributionRatePercentage - */ + **/ @ApiModelProperty(example = "4.0", value = "Employee Contribution percentage.") - /** + /** * Employee Contribution percentage. - * * @return kiwiSaverEmployeeContributionRatePercentage Double - */ + **/ public Double getKiwiSaverEmployeeContributionRatePercentage() { return kiwiSaverEmployeeContributionRatePercentage; } - /** - * Employee Contribution percentage. - * - * @param kiwiSaverEmployeeContributionRatePercentage Double - */ - public void setKiwiSaverEmployeeContributionRatePercentage( - Double kiwiSaverEmployeeContributionRatePercentage) { + /** + * Employee Contribution percentage. + * @param kiwiSaverEmployeeContributionRatePercentage Double + **/ + + public void setKiwiSaverEmployeeContributionRatePercentage(Double kiwiSaverEmployeeContributionRatePercentage) { this.kiwiSaverEmployeeContributionRatePercentage = kiwiSaverEmployeeContributionRatePercentage; } /** - * Employer Contribution percentage. - * - * @param kiwiSaverEmployerContributionRatePercentage Double - * @return EmployeeTax - */ - public EmployeeTax kiwiSaverEmployerContributionRatePercentage( - Double kiwiSaverEmployerContributionRatePercentage) { + * Employer Contribution percentage. + * @param kiwiSaverEmployerContributionRatePercentage Double + * @return EmployeeTax + **/ + public EmployeeTax kiwiSaverEmployerContributionRatePercentage(Double kiwiSaverEmployerContributionRatePercentage) { this.kiwiSaverEmployerContributionRatePercentage = kiwiSaverEmployerContributionRatePercentage; return this; } - /** + /** * Employer Contribution percentage. - * * @return kiwiSaverEmployerContributionRatePercentage - */ + **/ @ApiModelProperty(example = "10.0", value = "Employer Contribution percentage.") - /** + /** * Employer Contribution percentage. - * * @return kiwiSaverEmployerContributionRatePercentage Double - */ + **/ public Double getKiwiSaverEmployerContributionRatePercentage() { return kiwiSaverEmployerContributionRatePercentage; } - /** - * Employer Contribution percentage. - * - * @param kiwiSaverEmployerContributionRatePercentage Double - */ - public void setKiwiSaverEmployerContributionRatePercentage( - Double kiwiSaverEmployerContributionRatePercentage) { + /** + * Employer Contribution percentage. + * @param kiwiSaverEmployerContributionRatePercentage Double + **/ + + public void setKiwiSaverEmployerContributionRatePercentage(Double kiwiSaverEmployerContributionRatePercentage) { this.kiwiSaverEmployerContributionRatePercentage = kiwiSaverEmployerContributionRatePercentage; } /** - * Employer Contribution through Salary Sacrifice percentage. - * - * @param kiwiSaverEmployerSalarySacrificeContributionRatePercentage Double - * @return EmployeeTax - */ - public EmployeeTax kiwiSaverEmployerSalarySacrificeContributionRatePercentage( - Double kiwiSaverEmployerSalarySacrificeContributionRatePercentage) { - this.kiwiSaverEmployerSalarySacrificeContributionRatePercentage = - kiwiSaverEmployerSalarySacrificeContributionRatePercentage; + * Employer Contribution through Salary Sacrifice percentage. + * @param kiwiSaverEmployerSalarySacrificeContributionRatePercentage Double + * @return EmployeeTax + **/ + public EmployeeTax kiwiSaverEmployerSalarySacrificeContributionRatePercentage(Double kiwiSaverEmployerSalarySacrificeContributionRatePercentage) { + this.kiwiSaverEmployerSalarySacrificeContributionRatePercentage = kiwiSaverEmployerSalarySacrificeContributionRatePercentage; return this; } - /** + /** * Employer Contribution through Salary Sacrifice percentage. - * * @return kiwiSaverEmployerSalarySacrificeContributionRatePercentage - */ - @ApiModelProperty( - example = "2.0", - value = "Employer Contribution through Salary Sacrifice percentage.") - /** + **/ + @ApiModelProperty(example = "2.0", value = "Employer Contribution through Salary Sacrifice percentage.") + /** * Employer Contribution through Salary Sacrifice percentage. - * * @return kiwiSaverEmployerSalarySacrificeContributionRatePercentage Double - */ + **/ public Double getKiwiSaverEmployerSalarySacrificeContributionRatePercentage() { return kiwiSaverEmployerSalarySacrificeContributionRatePercentage; } - /** - * Employer Contribution through Salary Sacrifice percentage. - * - * @param kiwiSaverEmployerSalarySacrificeContributionRatePercentage Double - */ - public void setKiwiSaverEmployerSalarySacrificeContributionRatePercentage( - Double kiwiSaverEmployerSalarySacrificeContributionRatePercentage) { - this.kiwiSaverEmployerSalarySacrificeContributionRatePercentage = - kiwiSaverEmployerSalarySacrificeContributionRatePercentage; + /** + * Employer Contribution through Salary Sacrifice percentage. + * @param kiwiSaverEmployerSalarySacrificeContributionRatePercentage Double + **/ + + public void setKiwiSaverEmployerSalarySacrificeContributionRatePercentage(Double kiwiSaverEmployerSalarySacrificeContributionRatePercentage) { + this.kiwiSaverEmployerSalarySacrificeContributionRatePercentage = kiwiSaverEmployerSalarySacrificeContributionRatePercentage; } /** - * Opt Out Date. - * - * @param kiwiSaverOptOutDate LocalDate - * @return EmployeeTax - */ + * Opt Out Date. + * @param kiwiSaverOptOutDate LocalDate + * @return EmployeeTax + **/ public EmployeeTax kiwiSaverOptOutDate(LocalDate kiwiSaverOptOutDate) { this.kiwiSaverOptOutDate = kiwiSaverOptOutDate; return this; } - /** + /** * Opt Out Date. - * * @return kiwiSaverOptOutDate - */ + **/ @ApiModelProperty(value = "Opt Out Date.") - /** + /** * Opt Out Date. - * * @return kiwiSaverOptOutDate LocalDate - */ + **/ public LocalDate getKiwiSaverOptOutDate() { return kiwiSaverOptOutDate; } - /** - * Opt Out Date. - * - * @param kiwiSaverOptOutDate LocalDate - */ + /** + * Opt Out Date. + * @param kiwiSaverOptOutDate LocalDate + **/ + public void setKiwiSaverOptOutDate(LocalDate kiwiSaverOptOutDate) { this.kiwiSaverOptOutDate = kiwiSaverOptOutDate; } /** - * Contribution holiday expiry date or end date. - * - * @param kiwiSaverContributionHolidayEndDate LocalDate - * @return EmployeeTax - */ - public EmployeeTax kiwiSaverContributionHolidayEndDate( - LocalDate kiwiSaverContributionHolidayEndDate) { + * Contribution holiday expiry date or end date. + * @param kiwiSaverContributionHolidayEndDate LocalDate + * @return EmployeeTax + **/ + public EmployeeTax kiwiSaverContributionHolidayEndDate(LocalDate kiwiSaverContributionHolidayEndDate) { this.kiwiSaverContributionHolidayEndDate = kiwiSaverContributionHolidayEndDate; return this; } - /** + /** * Contribution holiday expiry date or end date. - * * @return kiwiSaverContributionHolidayEndDate - */ + **/ @ApiModelProperty(value = "Contribution holiday expiry date or end date.") - /** + /** * Contribution holiday expiry date or end date. - * * @return kiwiSaverContributionHolidayEndDate LocalDate - */ + **/ public LocalDate getKiwiSaverContributionHolidayEndDate() { return kiwiSaverContributionHolidayEndDate; } - /** - * Contribution holiday expiry date or end date. - * - * @param kiwiSaverContributionHolidayEndDate LocalDate - */ - public void setKiwiSaverContributionHolidayEndDate( - LocalDate kiwiSaverContributionHolidayEndDate) { + /** + * Contribution holiday expiry date or end date. + * @param kiwiSaverContributionHolidayEndDate LocalDate + **/ + + public void setKiwiSaverContributionHolidayEndDate(LocalDate kiwiSaverContributionHolidayEndDate) { this.kiwiSaverContributionHolidayEndDate = kiwiSaverContributionHolidayEndDate; } /** - * Does the employee have a remaining student loan balance? Set a remaining balance if you have - * received a letter from IR. - * - * @param hasStudentLoanBalance Boolean - * @return EmployeeTax - */ + * Does the employee have a remaining student loan balance? Set a remaining balance if you have received a letter from IR. + * @param hasStudentLoanBalance Boolean + * @return EmployeeTax + **/ public EmployeeTax hasStudentLoanBalance(Boolean hasStudentLoanBalance) { this.hasStudentLoanBalance = hasStudentLoanBalance; return this; } - /** - * Does the employee have a remaining student loan balance? Set a remaining balance if you have - * received a letter from IR. - * + /** + * Does the employee have a remaining student loan balance? Set a remaining balance if you have received a letter from IR. * @return hasStudentLoanBalance - */ - @ApiModelProperty( - example = "false", - value = - "Does the employee have a remaining student loan balance? Set a remaining balance if you" - + " have received a letter from IR.") - /** - * Does the employee have a remaining student loan balance? Set a remaining balance if you have - * received a letter from IR. - * + **/ + @ApiModelProperty(example = "false", value = "Does the employee have a remaining student loan balance? Set a remaining balance if you have received a letter from IR.") + /** + * Does the employee have a remaining student loan balance? Set a remaining balance if you have received a letter from IR. * @return hasStudentLoanBalance Boolean - */ + **/ public Boolean getHasStudentLoanBalance() { return hasStudentLoanBalance; } - /** - * Does the employee have a remaining student loan balance? Set a remaining balance if you have - * received a letter from IR. - * - * @param hasStudentLoanBalance Boolean - */ + /** + * Does the employee have a remaining student loan balance? Set a remaining balance if you have received a letter from IR. + * @param hasStudentLoanBalance Boolean + **/ + public void setHasStudentLoanBalance(Boolean hasStudentLoanBalance) { this.hasStudentLoanBalance = hasStudentLoanBalance; } /** - * The employee's student loan balance shown on the letter from IR. - * - * @param studentLoanBalance Double - * @return EmployeeTax - */ + * The employee's student loan balance shown on the letter from IR. + * @param studentLoanBalance Double + * @return EmployeeTax + **/ public EmployeeTax studentLoanBalance(Double studentLoanBalance) { this.studentLoanBalance = studentLoanBalance; return this; } - /** + /** * The employee's student loan balance shown on the letter from IR. - * * @return studentLoanBalance - */ - @ApiModelProperty( - example = "30.0", - value = "The employee's student loan balance shown on the letter from IR.") - /** + **/ + @ApiModelProperty(example = "30.0", value = "The employee's student loan balance shown on the letter from IR.") + /** * The employee's student loan balance shown on the letter from IR. - * * @return studentLoanBalance Double - */ + **/ public Double getStudentLoanBalance() { return studentLoanBalance; } - /** - * The employee's student loan balance shown on the letter from IR. - * - * @param studentLoanBalance Double - */ + /** + * The employee's student loan balance shown on the letter from IR. + * @param studentLoanBalance Double + **/ + public void setStudentLoanBalance(Double studentLoanBalance) { this.studentLoanBalance = studentLoanBalance; } /** - * The date of the letter from IR. - * - * @param studentLoanAsAt LocalDate - * @return EmployeeTax - */ + * The date of the letter from IR. + * @param studentLoanAsAt LocalDate + * @return EmployeeTax + **/ public EmployeeTax studentLoanAsAt(LocalDate studentLoanAsAt) { this.studentLoanAsAt = studentLoanAsAt; return this; } - /** + /** * The date of the letter from IR. - * * @return studentLoanAsAt - */ + **/ @ApiModelProperty(value = "The date of the letter from IR.") - /** + /** * The date of the letter from IR. - * * @return studentLoanAsAt LocalDate - */ + **/ public LocalDate getStudentLoanAsAt() { return studentLoanAsAt; } - /** - * The date of the letter from IR. - * - * @param studentLoanAsAt LocalDate - */ + /** + * The date of the letter from IR. + * @param studentLoanAsAt LocalDate + **/ + public void setStudentLoanAsAt(LocalDate studentLoanAsAt) { this.studentLoanAsAt = studentLoanAsAt; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -736,94 +673,48 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeTax employeeTax = (EmployeeTax) o; - return Objects.equals(this.irdNumber, employeeTax.irdNumber) - && Objects.equals(this.taxCode, employeeTax.taxCode) - && Objects.equals(this.specialTaxRatePercentage, employeeTax.specialTaxRatePercentage) - && Objects.equals(this.hasSpecialStudentLoanRate, employeeTax.hasSpecialStudentLoanRate) - && Objects.equals( - this.specialStudentLoanRatePercentage, employeeTax.specialStudentLoanRatePercentage) - && Objects.equals(this.isEligibleForKiwiSaver, employeeTax.isEligibleForKiwiSaver) - && Objects.equals(this.esctRatePercentage, employeeTax.esctRatePercentage) - && Objects.equals(this.kiwiSaverContributions, employeeTax.kiwiSaverContributions) - && Objects.equals( - this.kiwiSaverEmployeeContributionRatePercentage, - employeeTax.kiwiSaverEmployeeContributionRatePercentage) - && Objects.equals( - this.kiwiSaverEmployerContributionRatePercentage, - employeeTax.kiwiSaverEmployerContributionRatePercentage) - && Objects.equals( - this.kiwiSaverEmployerSalarySacrificeContributionRatePercentage, - employeeTax.kiwiSaverEmployerSalarySacrificeContributionRatePercentage) - && Objects.equals(this.kiwiSaverOptOutDate, employeeTax.kiwiSaverOptOutDate) - && Objects.equals( - this.kiwiSaverContributionHolidayEndDate, - employeeTax.kiwiSaverContributionHolidayEndDate) - && Objects.equals(this.hasStudentLoanBalance, employeeTax.hasStudentLoanBalance) - && Objects.equals(this.studentLoanBalance, employeeTax.studentLoanBalance) - && Objects.equals(this.studentLoanAsAt, employeeTax.studentLoanAsAt); + return Objects.equals(this.irdNumber, employeeTax.irdNumber) && + Objects.equals(this.taxCode, employeeTax.taxCode) && + Objects.equals(this.specialTaxRatePercentage, employeeTax.specialTaxRatePercentage) && + Objects.equals(this.hasSpecialStudentLoanRate, employeeTax.hasSpecialStudentLoanRate) && + Objects.equals(this.specialStudentLoanRatePercentage, employeeTax.specialStudentLoanRatePercentage) && + Objects.equals(this.isEligibleForKiwiSaver, employeeTax.isEligibleForKiwiSaver) && + Objects.equals(this.esctRatePercentage, employeeTax.esctRatePercentage) && + Objects.equals(this.kiwiSaverContributions, employeeTax.kiwiSaverContributions) && + Objects.equals(this.kiwiSaverEmployeeContributionRatePercentage, employeeTax.kiwiSaverEmployeeContributionRatePercentage) && + Objects.equals(this.kiwiSaverEmployerContributionRatePercentage, employeeTax.kiwiSaverEmployerContributionRatePercentage) && + Objects.equals(this.kiwiSaverEmployerSalarySacrificeContributionRatePercentage, employeeTax.kiwiSaverEmployerSalarySacrificeContributionRatePercentage) && + Objects.equals(this.kiwiSaverOptOutDate, employeeTax.kiwiSaverOptOutDate) && + Objects.equals(this.kiwiSaverContributionHolidayEndDate, employeeTax.kiwiSaverContributionHolidayEndDate) && + Objects.equals(this.hasStudentLoanBalance, employeeTax.hasStudentLoanBalance) && + Objects.equals(this.studentLoanBalance, employeeTax.studentLoanBalance) && + Objects.equals(this.studentLoanAsAt, employeeTax.studentLoanAsAt); } @Override public int hashCode() { - return Objects.hash( - irdNumber, - taxCode, - specialTaxRatePercentage, - hasSpecialStudentLoanRate, - specialStudentLoanRatePercentage, - isEligibleForKiwiSaver, - esctRatePercentage, - kiwiSaverContributions, - kiwiSaverEmployeeContributionRatePercentage, - kiwiSaverEmployerContributionRatePercentage, - kiwiSaverEmployerSalarySacrificeContributionRatePercentage, - kiwiSaverOptOutDate, - kiwiSaverContributionHolidayEndDate, - hasStudentLoanBalance, - studentLoanBalance, - studentLoanAsAt); + return Objects.hash(irdNumber, taxCode, specialTaxRatePercentage, hasSpecialStudentLoanRate, specialStudentLoanRatePercentage, isEligibleForKiwiSaver, esctRatePercentage, kiwiSaverContributions, kiwiSaverEmployeeContributionRatePercentage, kiwiSaverEmployerContributionRatePercentage, kiwiSaverEmployerSalarySacrificeContributionRatePercentage, kiwiSaverOptOutDate, kiwiSaverContributionHolidayEndDate, hasStudentLoanBalance, studentLoanBalance, studentLoanAsAt); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeTax {\n"); sb.append(" irdNumber: ").append(toIndentedString(irdNumber)).append("\n"); sb.append(" taxCode: ").append(toIndentedString(taxCode)).append("\n"); - sb.append(" specialTaxRatePercentage: ") - .append(toIndentedString(specialTaxRatePercentage)) - .append("\n"); - sb.append(" hasSpecialStudentLoanRate: ") - .append(toIndentedString(hasSpecialStudentLoanRate)) - .append("\n"); - sb.append(" specialStudentLoanRatePercentage: ") - .append(toIndentedString(specialStudentLoanRatePercentage)) - .append("\n"); - sb.append(" isEligibleForKiwiSaver: ") - .append(toIndentedString(isEligibleForKiwiSaver)) - .append("\n"); + sb.append(" specialTaxRatePercentage: ").append(toIndentedString(specialTaxRatePercentage)).append("\n"); + sb.append(" hasSpecialStudentLoanRate: ").append(toIndentedString(hasSpecialStudentLoanRate)).append("\n"); + sb.append(" specialStudentLoanRatePercentage: ").append(toIndentedString(specialStudentLoanRatePercentage)).append("\n"); + sb.append(" isEligibleForKiwiSaver: ").append(toIndentedString(isEligibleForKiwiSaver)).append("\n"); sb.append(" esctRatePercentage: ").append(toIndentedString(esctRatePercentage)).append("\n"); - sb.append(" kiwiSaverContributions: ") - .append(toIndentedString(kiwiSaverContributions)) - .append("\n"); - sb.append(" kiwiSaverEmployeeContributionRatePercentage: ") - .append(toIndentedString(kiwiSaverEmployeeContributionRatePercentage)) - .append("\n"); - sb.append(" kiwiSaverEmployerContributionRatePercentage: ") - .append(toIndentedString(kiwiSaverEmployerContributionRatePercentage)) - .append("\n"); - sb.append(" kiwiSaverEmployerSalarySacrificeContributionRatePercentage: ") - .append(toIndentedString(kiwiSaverEmployerSalarySacrificeContributionRatePercentage)) - .append("\n"); - sb.append(" kiwiSaverOptOutDate: ") - .append(toIndentedString(kiwiSaverOptOutDate)) - .append("\n"); - sb.append(" kiwiSaverContributionHolidayEndDate: ") - .append(toIndentedString(kiwiSaverContributionHolidayEndDate)) - .append("\n"); - sb.append(" hasStudentLoanBalance: ") - .append(toIndentedString(hasStudentLoanBalance)) - .append("\n"); + sb.append(" kiwiSaverContributions: ").append(toIndentedString(kiwiSaverContributions)).append("\n"); + sb.append(" kiwiSaverEmployeeContributionRatePercentage: ").append(toIndentedString(kiwiSaverEmployeeContributionRatePercentage)).append("\n"); + sb.append(" kiwiSaverEmployerContributionRatePercentage: ").append(toIndentedString(kiwiSaverEmployerContributionRatePercentage)).append("\n"); + sb.append(" kiwiSaverEmployerSalarySacrificeContributionRatePercentage: ").append(toIndentedString(kiwiSaverEmployerSalarySacrificeContributionRatePercentage)).append("\n"); + sb.append(" kiwiSaverOptOutDate: ").append(toIndentedString(kiwiSaverOptOutDate)).append("\n"); + sb.append(" kiwiSaverContributionHolidayEndDate: ").append(toIndentedString(kiwiSaverContributionHolidayEndDate)).append("\n"); + sb.append(" hasStudentLoanBalance: ").append(toIndentedString(hasStudentLoanBalance)).append("\n"); sb.append(" studentLoanBalance: ").append(toIndentedString(studentLoanBalance)).append("\n"); sb.append(" studentLoanAsAt: ").append(toIndentedString(studentLoanAsAt)).append("\n"); sb.append("}"); @@ -831,7 +722,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -839,4 +731,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeTaxObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeTaxObject.java index a0b44ed70..e4e409d29 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeTaxObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeTaxObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeTax; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeTaxObject + */ -/** EmployeeTaxObject */ public class EmployeeTaxObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeTaxObject { @JsonProperty("employeeTax") private EmployeeTax employeeTax; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeTaxObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeTaxObject + **/ public EmployeeTaxObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeTaxObject - */ + * problem + * @param problem Problem + * @return EmployeeTaxObject + **/ public EmployeeTaxObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * employeeTax - * - * @param employeeTax EmployeeTax - * @return EmployeeTaxObject - */ + * employeeTax + * @param employeeTax EmployeeTax + * @return EmployeeTaxObject + **/ public EmployeeTaxObject employeeTax(EmployeeTax employeeTax) { this.employeeTax = employeeTax; return this; } - /** + /** * Get employeeTax - * * @return employeeTax - */ + **/ @ApiModelProperty(value = "") - /** + /** * employeeTax - * * @return employeeTax EmployeeTax - */ + **/ public EmployeeTax getEmployeeTax() { return employeeTax; } - /** - * employeeTax - * - * @param employeeTax EmployeeTax - */ + /** + * employeeTax + * @param employeeTax EmployeeTax + **/ + public void setEmployeeTax(EmployeeTax employeeTax) { this.employeeTax = employeeTax; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeTaxObject employeeTaxObject = (EmployeeTaxObject) o; - return Objects.equals(this.pagination, employeeTaxObject.pagination) - && Objects.equals(this.problem, employeeTaxObject.problem) - && Objects.equals(this.employeeTax, employeeTaxObject.employeeTax); + return Objects.equals(this.pagination, employeeTaxObject.pagination) && + Objects.equals(this.problem, employeeTaxObject.problem) && + Objects.equals(this.employeeTax, employeeTaxObject.employeeTax); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, employeeTax); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPattern.java b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPattern.java index 91025329c..568d87bc0 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPattern.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPattern.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeWorkingPattern + */ -/** EmployeeWorkingPattern */ public class EmployeeWorkingPattern { StringUtil util = new StringUtil(); @@ -28,77 +45,70 @@ public class EmployeeWorkingPattern { @JsonProperty("effectiveFrom") private LocalDate effectiveFrom; /** - * The Xero identifier for for Employee working pattern - * - * @param payeeWorkingPatternID UUID - * @return EmployeeWorkingPattern - */ + * The Xero identifier for for Employee working pattern + * @param payeeWorkingPatternID UUID + * @return EmployeeWorkingPattern + **/ public EmployeeWorkingPattern payeeWorkingPatternID(UUID payeeWorkingPatternID) { this.payeeWorkingPatternID = payeeWorkingPatternID; return this; } - /** + /** * The Xero identifier for for Employee working pattern - * * @return payeeWorkingPatternID - */ + **/ @ApiModelProperty(required = true, value = "The Xero identifier for for Employee working pattern") - /** + /** * The Xero identifier for for Employee working pattern - * * @return payeeWorkingPatternID UUID - */ + **/ public UUID getPayeeWorkingPatternID() { return payeeWorkingPatternID; } - /** - * The Xero identifier for for Employee working pattern - * - * @param payeeWorkingPatternID UUID - */ + /** + * The Xero identifier for for Employee working pattern + * @param payeeWorkingPatternID UUID + **/ + public void setPayeeWorkingPatternID(UUID payeeWorkingPatternID) { this.payeeWorkingPatternID = payeeWorkingPatternID; } /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - * @return EmployeeWorkingPattern - */ + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + * @return EmployeeWorkingPattern + **/ public EmployeeWorkingPattern effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; return this; } - /** + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom - */ - @ApiModelProperty( - required = true, - value = "The effective date of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The effective date of the corresponding salary and wages") + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom LocalDate - */ + **/ public LocalDate getEffectiveFrom() { return effectiveFrom; } - /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - */ + /** + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + **/ + public void setEffectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +118,8 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeWorkingPattern employeeWorkingPattern = (EmployeeWorkingPattern) o; - return Objects.equals(this.payeeWorkingPatternID, employeeWorkingPattern.payeeWorkingPatternID) - && Objects.equals(this.effectiveFrom, employeeWorkingPattern.effectiveFrom); + return Objects.equals(this.payeeWorkingPatternID, employeeWorkingPattern.payeeWorkingPatternID) && + Objects.equals(this.effectiveFrom, employeeWorkingPattern.effectiveFrom); } @Override @@ -117,20 +127,20 @@ public int hashCode() { return Objects.hash(payeeWorkingPatternID, effectiveFrom); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeWorkingPattern {\n"); - sb.append(" payeeWorkingPatternID: ") - .append(toIndentedString(payeeWorkingPatternID)) - .append("\n"); + sb.append(" payeeWorkingPatternID: ").append(toIndentedString(payeeWorkingPatternID)).append("\n"); sb.append(" effectiveFrom: ").append(toIndentedString(effectiveFrom)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -138,4 +148,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeks.java b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeks.java index 0d96df6a0..a3957a938 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeks.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeks.java @@ -9,18 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.WorkingWeek; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeWorkingPatternWithWorkingWeeks + */ -/** EmployeeWorkingPatternWithWorkingWeeks */ public class EmployeeWorkingPatternWithWorkingWeeks { StringUtil util = new StringUtil(); @@ -33,83 +51,74 @@ public class EmployeeWorkingPatternWithWorkingWeeks { @JsonProperty("workingWeeks") private List workingWeeks = new ArrayList(); /** - * The Xero identifier for for Employee working pattern - * - * @param payeeWorkingPatternID UUID - * @return EmployeeWorkingPatternWithWorkingWeeks - */ + * The Xero identifier for for Employee working pattern + * @param payeeWorkingPatternID UUID + * @return EmployeeWorkingPatternWithWorkingWeeks + **/ public EmployeeWorkingPatternWithWorkingWeeks payeeWorkingPatternID(UUID payeeWorkingPatternID) { this.payeeWorkingPatternID = payeeWorkingPatternID; return this; } - /** + /** * The Xero identifier for for Employee working pattern - * * @return payeeWorkingPatternID - */ + **/ @ApiModelProperty(required = true, value = "The Xero identifier for for Employee working pattern") - /** + /** * The Xero identifier for for Employee working pattern - * * @return payeeWorkingPatternID UUID - */ + **/ public UUID getPayeeWorkingPatternID() { return payeeWorkingPatternID; } - /** - * The Xero identifier for for Employee working pattern - * - * @param payeeWorkingPatternID UUID - */ + /** + * The Xero identifier for for Employee working pattern + * @param payeeWorkingPatternID UUID + **/ + public void setPayeeWorkingPatternID(UUID payeeWorkingPatternID) { this.payeeWorkingPatternID = payeeWorkingPatternID; } /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - * @return EmployeeWorkingPatternWithWorkingWeeks - */ + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + * @return EmployeeWorkingPatternWithWorkingWeeks + **/ public EmployeeWorkingPatternWithWorkingWeeks effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; return this; } - /** + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom - */ - @ApiModelProperty( - required = true, - value = "The effective date of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The effective date of the corresponding salary and wages") + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom LocalDate - */ + **/ public LocalDate getEffectiveFrom() { return effectiveFrom; } - /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - */ + /** + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + **/ + public void setEffectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; } /** - * workingWeeks - * - * @param workingWeeks List<WorkingWeek> - * @return EmployeeWorkingPatternWithWorkingWeeks - */ + * workingWeeks + * @param workingWeeks List<WorkingWeek> + * @return EmployeeWorkingPatternWithWorkingWeeks + **/ public EmployeeWorkingPatternWithWorkingWeeks workingWeeks(List workingWeeks) { this.workingWeeks = workingWeeks; return this; @@ -117,10 +126,9 @@ public EmployeeWorkingPatternWithWorkingWeeks workingWeeks(List wor /** * workingWeeks - * - * @param workingWeeksItem WorkingWeek + * @param workingWeeksItem WorkingWeek * @return EmployeeWorkingPatternWithWorkingWeeks - */ + **/ public EmployeeWorkingPatternWithWorkingWeeks addWorkingWeeksItem(WorkingWeek workingWeeksItem) { if (this.workingWeeks == null) { this.workingWeeks = new ArrayList(); @@ -129,30 +137,29 @@ public EmployeeWorkingPatternWithWorkingWeeks addWorkingWeeksItem(WorkingWeek wo return this; } - /** + /** * Get workingWeeks - * * @return workingWeeks - */ + **/ @ApiModelProperty(value = "") - /** + /** * workingWeeks - * * @return workingWeeks List - */ + **/ public List getWorkingWeeks() { return workingWeeks; } - /** - * workingWeeks - * - * @param workingWeeks List<WorkingWeek> - */ + /** + * workingWeeks + * @param workingWeeks List<WorkingWeek> + **/ + public void setWorkingWeeks(List workingWeeks) { this.workingWeeks = workingWeeks; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -161,13 +168,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeWorkingPatternWithWorkingWeeks employeeWorkingPatternWithWorkingWeeks = - (EmployeeWorkingPatternWithWorkingWeeks) o; - return Objects.equals( - this.payeeWorkingPatternID, - employeeWorkingPatternWithWorkingWeeks.payeeWorkingPatternID) - && Objects.equals(this.effectiveFrom, employeeWorkingPatternWithWorkingWeeks.effectiveFrom) - && Objects.equals(this.workingWeeks, employeeWorkingPatternWithWorkingWeeks.workingWeeks); + EmployeeWorkingPatternWithWorkingWeeks employeeWorkingPatternWithWorkingWeeks = (EmployeeWorkingPatternWithWorkingWeeks) o; + return Objects.equals(this.payeeWorkingPatternID, employeeWorkingPatternWithWorkingWeeks.payeeWorkingPatternID) && + Objects.equals(this.effectiveFrom, employeeWorkingPatternWithWorkingWeeks.effectiveFrom) && + Objects.equals(this.workingWeeks, employeeWorkingPatternWithWorkingWeeks.workingWeeks); } @Override @@ -175,13 +179,12 @@ public int hashCode() { return Objects.hash(payeeWorkingPatternID, effectiveFrom, workingWeeks); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeWorkingPatternWithWorkingWeeks {\n"); - sb.append(" payeeWorkingPatternID: ") - .append(toIndentedString(payeeWorkingPatternID)) - .append("\n"); + sb.append(" payeeWorkingPatternID: ").append(toIndentedString(payeeWorkingPatternID)).append("\n"); sb.append(" effectiveFrom: ").append(toIndentedString(effectiveFrom)).append("\n"); sb.append(" workingWeeks: ").append(toIndentedString(workingWeeks)).append("\n"); sb.append("}"); @@ -189,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -197,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksObject.java index 49c831624..5d0e0725d 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeWorkingPatternWithWorkingWeeks; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeWorkingPatternWithWorkingWeeksObject + */ -/** EmployeeWorkingPatternWithWorkingWeeksObject */ public class EmployeeWorkingPatternWithWorkingWeeksObject { StringUtil util = new StringUtil(); @@ -29,111 +49,102 @@ public class EmployeeWorkingPatternWithWorkingWeeksObject { @JsonProperty("payeeWorkingPattern") private EmployeeWorkingPatternWithWorkingWeeks payeeWorkingPattern; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeWorkingPatternWithWorkingWeeksObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeWorkingPatternWithWorkingWeeksObject + **/ public EmployeeWorkingPatternWithWorkingWeeksObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeWorkingPatternWithWorkingWeeksObject - */ + * problem + * @param problem Problem + * @return EmployeeWorkingPatternWithWorkingWeeksObject + **/ public EmployeeWorkingPatternWithWorkingWeeksObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payeeWorkingPattern - * - * @param payeeWorkingPattern EmployeeWorkingPatternWithWorkingWeeks - * @return EmployeeWorkingPatternWithWorkingWeeksObject - */ - public EmployeeWorkingPatternWithWorkingWeeksObject payeeWorkingPattern( - EmployeeWorkingPatternWithWorkingWeeks payeeWorkingPattern) { + * payeeWorkingPattern + * @param payeeWorkingPattern EmployeeWorkingPatternWithWorkingWeeks + * @return EmployeeWorkingPatternWithWorkingWeeksObject + **/ + public EmployeeWorkingPatternWithWorkingWeeksObject payeeWorkingPattern(EmployeeWorkingPatternWithWorkingWeeks payeeWorkingPattern) { this.payeeWorkingPattern = payeeWorkingPattern; return this; } - /** + /** * Get payeeWorkingPattern - * * @return payeeWorkingPattern - */ + **/ @ApiModelProperty(value = "") - /** + /** * payeeWorkingPattern - * * @return payeeWorkingPattern EmployeeWorkingPatternWithWorkingWeeks - */ + **/ public EmployeeWorkingPatternWithWorkingWeeks getPayeeWorkingPattern() { return payeeWorkingPattern; } - /** - * payeeWorkingPattern - * - * @param payeeWorkingPattern EmployeeWorkingPatternWithWorkingWeeks - */ + /** + * payeeWorkingPattern + * @param payeeWorkingPattern EmployeeWorkingPatternWithWorkingWeeks + **/ + public void setPayeeWorkingPattern(EmployeeWorkingPatternWithWorkingWeeks payeeWorkingPattern) { this.payeeWorkingPattern = payeeWorkingPattern; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,13 +153,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeWorkingPatternWithWorkingWeeksObject employeeWorkingPatternWithWorkingWeeksObject = - (EmployeeWorkingPatternWithWorkingWeeksObject) o; - return Objects.equals(this.pagination, employeeWorkingPatternWithWorkingWeeksObject.pagination) - && Objects.equals(this.problem, employeeWorkingPatternWithWorkingWeeksObject.problem) - && Objects.equals( - this.payeeWorkingPattern, - employeeWorkingPatternWithWorkingWeeksObject.payeeWorkingPattern); + EmployeeWorkingPatternWithWorkingWeeksObject employeeWorkingPatternWithWorkingWeeksObject = (EmployeeWorkingPatternWithWorkingWeeksObject) o; + return Objects.equals(this.pagination, employeeWorkingPatternWithWorkingWeeksObject.pagination) && + Objects.equals(this.problem, employeeWorkingPatternWithWorkingWeeksObject.problem) && + Objects.equals(this.payeeWorkingPattern, employeeWorkingPatternWithWorkingWeeksObject.payeeWorkingPattern); } @Override @@ -156,21 +164,21 @@ public int hashCode() { return Objects.hash(pagination, problem, payeeWorkingPattern); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeWorkingPatternWithWorkingWeeksObject {\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append(" problem: ").append(toIndentedString(problem)).append("\n"); - sb.append(" payeeWorkingPattern: ") - .append(toIndentedString(payeeWorkingPattern)) - .append("\n"); + sb.append(" payeeWorkingPattern: ").append(toIndentedString(payeeWorkingPattern)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -178,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksRequest.java b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksRequest.java index fb745e2cc..328c76482 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksRequest.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternWithWorkingWeeksRequest.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.WorkingWeek; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeWorkingPatternWithWorkingWeeksRequest + */ -/** EmployeeWorkingPatternWithWorkingWeeksRequest */ public class EmployeeWorkingPatternWithWorkingWeeksRequest { StringUtil util = new StringUtil(); @@ -29,90 +47,80 @@ public class EmployeeWorkingPatternWithWorkingWeeksRequest { @JsonProperty("workingWeeks") private List workingWeeks = new ArrayList(); /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - * @return EmployeeWorkingPatternWithWorkingWeeksRequest - */ + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + * @return EmployeeWorkingPatternWithWorkingWeeksRequest + **/ public EmployeeWorkingPatternWithWorkingWeeksRequest effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; return this; } - /** + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom - */ - @ApiModelProperty( - required = true, - value = "The effective date of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The effective date of the corresponding salary and wages") + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom LocalDate - */ + **/ public LocalDate getEffectiveFrom() { return effectiveFrom; } - /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - */ + /** + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + **/ + public void setEffectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; } /** - * workingWeeks - * - * @param workingWeeks List<WorkingWeek> - * @return EmployeeWorkingPatternWithWorkingWeeksRequest - */ - public EmployeeWorkingPatternWithWorkingWeeksRequest workingWeeks( - List workingWeeks) { + * workingWeeks + * @param workingWeeks List<WorkingWeek> + * @return EmployeeWorkingPatternWithWorkingWeeksRequest + **/ + public EmployeeWorkingPatternWithWorkingWeeksRequest workingWeeks(List workingWeeks) { this.workingWeeks = workingWeeks; return this; } /** * workingWeeks - * - * @param workingWeeksItem WorkingWeek + * @param workingWeeksItem WorkingWeek * @return EmployeeWorkingPatternWithWorkingWeeksRequest - */ - public EmployeeWorkingPatternWithWorkingWeeksRequest addWorkingWeeksItem( - WorkingWeek workingWeeksItem) { + **/ + public EmployeeWorkingPatternWithWorkingWeeksRequest addWorkingWeeksItem(WorkingWeek workingWeeksItem) { this.workingWeeks.add(workingWeeksItem); return this; } - /** + /** * Get workingWeeks - * * @return workingWeeks - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * workingWeeks - * * @return workingWeeks List - */ + **/ public List getWorkingWeeks() { return workingWeeks; } - /** - * workingWeeks - * - * @param workingWeeks List<WorkingWeek> - */ + /** + * workingWeeks + * @param workingWeeks List<WorkingWeek> + **/ + public void setWorkingWeeks(List workingWeeks) { this.workingWeeks = workingWeeks; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,12 +129,9 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeWorkingPatternWithWorkingWeeksRequest employeeWorkingPatternWithWorkingWeeksRequest = - (EmployeeWorkingPatternWithWorkingWeeksRequest) o; - return Objects.equals( - this.effectiveFrom, employeeWorkingPatternWithWorkingWeeksRequest.effectiveFrom) - && Objects.equals( - this.workingWeeks, employeeWorkingPatternWithWorkingWeeksRequest.workingWeeks); + EmployeeWorkingPatternWithWorkingWeeksRequest employeeWorkingPatternWithWorkingWeeksRequest = (EmployeeWorkingPatternWithWorkingWeeksRequest) o; + return Objects.equals(this.effectiveFrom, employeeWorkingPatternWithWorkingWeeksRequest.effectiveFrom) && + Objects.equals(this.workingWeeks, employeeWorkingPatternWithWorkingWeeksRequest.workingWeeks); } @Override @@ -134,6 +139,7 @@ public int hashCode() { return Objects.hash(effectiveFrom, workingWeeks); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -145,7 +151,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -153,4 +160,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternsObject.java b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternsObject.java index 5b53eecd8..efa9829dd 100644 --- a/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternsObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmployeeWorkingPatternsObject.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.EmployeeWorkingPattern; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeWorkingPatternsObject + */ -/** EmployeeWorkingPatternsObject */ public class EmployeeWorkingPatternsObject { StringUtil util = new StringUtil(); @@ -29,98 +49,87 @@ public class EmployeeWorkingPatternsObject { private Problem problem; @JsonProperty("payeeWorkingPatterns") - private List payeeWorkingPatterns = - new ArrayList(); + private List payeeWorkingPatterns = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeWorkingPatternsObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeWorkingPatternsObject + **/ public EmployeeWorkingPatternsObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeWorkingPatternsObject - */ + * problem + * @param problem Problem + * @return EmployeeWorkingPatternsObject + **/ public EmployeeWorkingPatternsObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payeeWorkingPatterns - * - * @param payeeWorkingPatterns List<EmployeeWorkingPattern> - * @return EmployeeWorkingPatternsObject - */ - public EmployeeWorkingPatternsObject payeeWorkingPatterns( - List payeeWorkingPatterns) { + * payeeWorkingPatterns + * @param payeeWorkingPatterns List<EmployeeWorkingPattern> + * @return EmployeeWorkingPatternsObject + **/ + public EmployeeWorkingPatternsObject payeeWorkingPatterns(List payeeWorkingPatterns) { this.payeeWorkingPatterns = payeeWorkingPatterns; return this; } /** * payeeWorkingPatterns - * - * @param payeeWorkingPatternsItem EmployeeWorkingPattern + * @param payeeWorkingPatternsItem EmployeeWorkingPattern * @return EmployeeWorkingPatternsObject - */ - public EmployeeWorkingPatternsObject addPayeeWorkingPatternsItem( - EmployeeWorkingPattern payeeWorkingPatternsItem) { + **/ + public EmployeeWorkingPatternsObject addPayeeWorkingPatternsItem(EmployeeWorkingPattern payeeWorkingPatternsItem) { if (this.payeeWorkingPatterns == null) { this.payeeWorkingPatterns = new ArrayList(); } @@ -128,30 +137,29 @@ public EmployeeWorkingPatternsObject addPayeeWorkingPatternsItem( return this; } - /** + /** * Get payeeWorkingPatterns - * * @return payeeWorkingPatterns - */ + **/ @ApiModelProperty(value = "") - /** + /** * payeeWorkingPatterns - * * @return payeeWorkingPatterns List - */ + **/ public List getPayeeWorkingPatterns() { return payeeWorkingPatterns; } - /** - * payeeWorkingPatterns - * - * @param payeeWorkingPatterns List<EmployeeWorkingPattern> - */ + /** + * payeeWorkingPatterns + * @param payeeWorkingPatterns List<EmployeeWorkingPattern> + **/ + public void setPayeeWorkingPatterns(List payeeWorkingPatterns) { this.payeeWorkingPatterns = payeeWorkingPatterns; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -161,10 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeWorkingPatternsObject employeeWorkingPatternsObject = (EmployeeWorkingPatternsObject) o; - return Objects.equals(this.pagination, employeeWorkingPatternsObject.pagination) - && Objects.equals(this.problem, employeeWorkingPatternsObject.problem) - && Objects.equals( - this.payeeWorkingPatterns, employeeWorkingPatternsObject.payeeWorkingPatterns); + return Objects.equals(this.pagination, employeeWorkingPatternsObject.pagination) && + Objects.equals(this.problem, employeeWorkingPatternsObject.problem) && + Objects.equals(this.payeeWorkingPatterns, employeeWorkingPatternsObject.payeeWorkingPatterns); } @Override @@ -172,21 +179,21 @@ public int hashCode() { return Objects.hash(pagination, problem, payeeWorkingPatterns); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeWorkingPatternsObject {\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append(" problem: ").append(toIndentedString(problem)).append("\n"); - sb.append(" payeeWorkingPatterns: ") - .append(toIndentedString(payeeWorkingPatterns)) - .append("\n"); + sb.append(" payeeWorkingPatterns: ").append(toIndentedString(payeeWorkingPatterns)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -194,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Employees.java b/src/main/java/com/xero/models/payrollnz/Employees.java index ee62d6546..75034b329 100644 --- a/src/main/java/com/xero/models/payrollnz/Employees.java +++ b/src/main/java/com/xero/models/payrollnz/Employees.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Employee; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employees + */ -/** Employees */ public class Employees { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Employees { @JsonProperty("employees") private List employees = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Employees - */ + * pagination + * @param pagination Pagination + * @return Employees + **/ public Employees pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Employees - */ + * problem + * @param problem Problem + * @return Employees + **/ public Employees problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * employees - * - * @param employees List<Employee> - * @return Employees - */ + * employees + * @param employees List<Employee> + * @return Employees + **/ public Employees employees(List employees) { this.employees = employees; return this; @@ -113,10 +126,9 @@ public Employees employees(List employees) { /** * employees - * - * @param employeesItem Employee + * @param employeesItem Employee * @return Employees - */ + **/ public Employees addEmployeesItem(Employee employeesItem) { if (this.employees == null) { this.employees = new ArrayList(); @@ -125,30 +137,29 @@ public Employees addEmployeesItem(Employee employeesItem) { return this; } - /** + /** * Get employees - * * @return employees - */ + **/ @ApiModelProperty(value = "") - /** + /** * employees - * * @return employees List - */ + **/ public List getEmployees() { return employees; } - /** - * employees - * - * @param employees List<Employee> - */ + /** + * employees + * @param employees List<Employee> + **/ + public void setEmployees(List employees) { this.employees = employees; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Employees employees = (Employees) o; - return Objects.equals(this.pagination, employees.pagination) - && Objects.equals(this.problem, employees.problem) - && Objects.equals(this.employees, employees.employees); + return Objects.equals(this.pagination, employees.pagination) && + Objects.equals(this.problem, employees.problem) && + Objects.equals(this.employees, employees.employees); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, employees); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Employment.java b/src/main/java/com/xero/models/payrollnz/Employment.java index 073a135aa..65b0653ef 100644 --- a/src/main/java/com/xero/models/payrollnz/Employment.java +++ b/src/main/java/com/xero/models/payrollnz/Employment.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employment + */ -/** Employment */ public class Employment { StringUtil util = new StringUtil(); @@ -37,185 +54,166 @@ public class Employment { @JsonProperty("fixedTermEndDate") private LocalDate fixedTermEndDate; /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - * @return Employment - */ + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + * @return Employment + **/ public Employment payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar of the employee") - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) - * - * @param payRunCalendarID UUID - * @return Employment - */ + * Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) + * @param payRunCalendarID UUID + * @return Employment + **/ public Employment payRunCalendarID(UUID payRunCalendarID) { this.payRunCalendarID = payRunCalendarID; return this; } - /** + /** * Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) - * * @return payRunCalendarID - */ - @ApiModelProperty( - value = - "Xero unique identifier for the payrun calendar for the employee (Deprecated in version" - + " 1.1.6)") - /** + **/ + @ApiModelProperty(value = "Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6)") + /** * Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) - * * @return payRunCalendarID UUID - */ + **/ public UUID getPayRunCalendarID() { return payRunCalendarID; } - /** - * Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) - * - * @param payRunCalendarID UUID - */ + /** + * Xero unique identifier for the payrun calendar for the employee (Deprecated in version 1.1.6) + * @param payRunCalendarID UUID + **/ + public void setPayRunCalendarID(UUID payRunCalendarID) { this.payRunCalendarID = payRunCalendarID; } /** - * Start date of the employment (YYYY-MM-DD) - * - * @param startDate LocalDate - * @return Employment - */ + * Start date of the employment (YYYY-MM-DD) + * @param startDate LocalDate + * @return Employment + **/ public Employment startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the employment (YYYY-MM-DD) - * * @return startDate - */ + **/ @ApiModelProperty(value = "Start date of the employment (YYYY-MM-DD)") - /** + /** * Start date of the employment (YYYY-MM-DD) - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the employment (YYYY-MM-DD) - * - * @param startDate LocalDate - */ + /** + * Start date of the employment (YYYY-MM-DD) + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * Engagement type of the employee - * - * @param engagementType String - * @return Employment - */ + * Engagement type of the employee + * @param engagementType String + * @return Employment + **/ public Employment engagementType(String engagementType) { this.engagementType = engagementType; return this; } - /** + /** * Engagement type of the employee - * * @return engagementType - */ + **/ @ApiModelProperty(example = "Permanent", value = "Engagement type of the employee") - /** + /** * Engagement type of the employee - * * @return engagementType String - */ + **/ public String getEngagementType() { return engagementType; } - /** - * Engagement type of the employee - * - * @param engagementType String - */ + /** + * Engagement type of the employee + * @param engagementType String + **/ + public void setEngagementType(String engagementType) { this.engagementType = engagementType; } /** - * End date for an employee with a fixed-term engagement type - * - * @param fixedTermEndDate LocalDate - * @return Employment - */ + * End date for an employee with a fixed-term engagement type + * @param fixedTermEndDate LocalDate + * @return Employment + **/ public Employment fixedTermEndDate(LocalDate fixedTermEndDate) { this.fixedTermEndDate = fixedTermEndDate; return this; } - /** + /** * End date for an employee with a fixed-term engagement type - * * @return fixedTermEndDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = "End date for an employee with a fixed-term engagement type") - /** + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "End date for an employee with a fixed-term engagement type") + /** * End date for an employee with a fixed-term engagement type - * * @return fixedTermEndDate LocalDate - */ + **/ public LocalDate getFixedTermEndDate() { return fixedTermEndDate; } - /** - * End date for an employee with a fixed-term engagement type - * - * @param fixedTermEndDate LocalDate - */ + /** + * End date for an employee with a fixed-term engagement type + * @param fixedTermEndDate LocalDate + **/ + public void setFixedTermEndDate(LocalDate fixedTermEndDate) { this.fixedTermEndDate = fixedTermEndDate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -225,19 +223,19 @@ public boolean equals(java.lang.Object o) { return false; } Employment employment = (Employment) o; - return Objects.equals(this.payrollCalendarID, employment.payrollCalendarID) - && Objects.equals(this.payRunCalendarID, employment.payRunCalendarID) - && Objects.equals(this.startDate, employment.startDate) - && Objects.equals(this.engagementType, employment.engagementType) - && Objects.equals(this.fixedTermEndDate, employment.fixedTermEndDate); + return Objects.equals(this.payrollCalendarID, employment.payrollCalendarID) && + Objects.equals(this.payRunCalendarID, employment.payRunCalendarID) && + Objects.equals(this.startDate, employment.startDate) && + Objects.equals(this.engagementType, employment.engagementType) && + Objects.equals(this.fixedTermEndDate, employment.fixedTermEndDate); } @Override public int hashCode() { - return Objects.hash( - payrollCalendarID, payRunCalendarID, startDate, engagementType, fixedTermEndDate); + return Objects.hash(payrollCalendarID, payRunCalendarID, startDate, engagementType, fixedTermEndDate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -252,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -260,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/EmploymentObject.java b/src/main/java/com/xero/models/payrollnz/EmploymentObject.java index 7e21e05a6..4eeee132d 100644 --- a/src/main/java/com/xero/models/payrollnz/EmploymentObject.java +++ b/src/main/java/com/xero/models/payrollnz/EmploymentObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Employment; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmploymentObject + */ -/** EmploymentObject */ public class EmploymentObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmploymentObject { @JsonProperty("employment") private Employment employment; /** - * pagination - * - * @param pagination Pagination - * @return EmploymentObject - */ + * pagination + * @param pagination Pagination + * @return EmploymentObject + **/ public EmploymentObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmploymentObject - */ + * problem + * @param problem Problem + * @return EmploymentObject + **/ public EmploymentObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * employment - * - * @param employment Employment - * @return EmploymentObject - */ + * employment + * @param employment Employment + * @return EmploymentObject + **/ public EmploymentObject employment(Employment employment) { this.employment = employment; return this; } - /** + /** * Get employment - * * @return employment - */ + **/ @ApiModelProperty(value = "") - /** + /** * employment - * * @return employment Employment - */ + **/ public Employment getEmployment() { return employment; } - /** - * employment - * - * @param employment Employment - */ + /** + * employment + * @param employment Employment + **/ + public void setEmployment(Employment employment) { this.employment = employment; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmploymentObject employmentObject = (EmploymentObject) o; - return Objects.equals(this.pagination, employmentObject.pagination) - && Objects.equals(this.problem, employmentObject.problem) - && Objects.equals(this.employment, employmentObject.employment); + return Objects.equals(this.pagination, employmentObject.pagination) && + Objects.equals(this.problem, employmentObject.problem) && + Objects.equals(this.employment, employmentObject.employment); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, employment); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/GrossEarningsHistory.java b/src/main/java/com/xero/models/payrollnz/GrossEarningsHistory.java index 4aad18247..a59184b95 100644 --- a/src/main/java/com/xero/models/payrollnz/GrossEarningsHistory.java +++ b/src/main/java/com/xero/models/payrollnz/GrossEarningsHistory.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * GrossEarningsHistory + */ -/** GrossEarningsHistory */ public class GrossEarningsHistory { StringUtil util = new StringUtil(); @@ -26,76 +43,70 @@ public class GrossEarningsHistory { @JsonProperty("unpaidWeeks") private Integer unpaidWeeks; /** - * Number of days the employee worked in the pay period (0 - 365) - * - * @param daysPaid Integer - * @return GrossEarningsHistory - */ + * Number of days the employee worked in the pay period (0 - 365) + * @param daysPaid Integer + * @return GrossEarningsHistory + **/ public GrossEarningsHistory daysPaid(Integer daysPaid) { this.daysPaid = daysPaid; return this; } - /** + /** * Number of days the employee worked in the pay period (0 - 365) - * * @return daysPaid - */ + **/ @ApiModelProperty(value = "Number of days the employee worked in the pay period (0 - 365)") - /** + /** * Number of days the employee worked in the pay period (0 - 365) - * * @return daysPaid Integer - */ + **/ public Integer getDaysPaid() { return daysPaid; } - /** - * Number of days the employee worked in the pay period (0 - 365) - * - * @param daysPaid Integer - */ + /** + * Number of days the employee worked in the pay period (0 - 365) + * @param daysPaid Integer + **/ + public void setDaysPaid(Integer daysPaid) { this.daysPaid = daysPaid; } /** - * Number of full weeks the employee didn't work in the pay period (0 - 52) - * - * @param unpaidWeeks Integer - * @return GrossEarningsHistory - */ + * Number of full weeks the employee didn't work in the pay period (0 - 52) + * @param unpaidWeeks Integer + * @return GrossEarningsHistory + **/ public GrossEarningsHistory unpaidWeeks(Integer unpaidWeeks) { this.unpaidWeeks = unpaidWeeks; return this; } - /** + /** * Number of full weeks the employee didn't work in the pay period (0 - 52) - * * @return unpaidWeeks - */ - @ApiModelProperty( - value = "Number of full weeks the employee didn't work in the pay period (0 - 52)") - /** + **/ + @ApiModelProperty(value = "Number of full weeks the employee didn't work in the pay period (0 - 52)") + /** * Number of full weeks the employee didn't work in the pay period (0 - 52) - * * @return unpaidWeeks Integer - */ + **/ public Integer getUnpaidWeeks() { return unpaidWeeks; } - /** - * Number of full weeks the employee didn't work in the pay period (0 - 52) - * - * @param unpaidWeeks Integer - */ + /** + * Number of full weeks the employee didn't work in the pay period (0 - 52) + * @param unpaidWeeks Integer + **/ + public void setUnpaidWeeks(Integer unpaidWeeks) { this.unpaidWeeks = unpaidWeeks; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } GrossEarningsHistory grossEarningsHistory = (GrossEarningsHistory) o; - return Objects.equals(this.daysPaid, grossEarningsHistory.daysPaid) - && Objects.equals(this.unpaidWeeks, grossEarningsHistory.unpaidWeeks); + return Objects.equals(this.daysPaid, grossEarningsHistory.daysPaid) && + Objects.equals(this.unpaidWeeks, grossEarningsHistory.unpaidWeeks); } @Override @@ -114,6 +125,7 @@ public int hashCode() { return Objects.hash(daysPaid, unpaidWeeks); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -125,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -133,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/InvalidField.java b/src/main/java/com/xero/models/payrollnz/InvalidField.java index b8ce32225..55706de08 100644 --- a/src/main/java/com/xero/models/payrollnz/InvalidField.java +++ b/src/main/java/com/xero/models/payrollnz/InvalidField.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * InvalidField + */ -/** InvalidField */ public class InvalidField { StringUtil util = new StringUtil(); @@ -26,77 +43,70 @@ public class InvalidField { @JsonProperty("reason") private String reason; /** - * The name of the field that caused the error - * - * @param name String - * @return InvalidField - */ + * The name of the field that caused the error + * @param name String + * @return InvalidField + **/ public InvalidField name(String name) { this.name = name; return this; } - /** + /** * The name of the field that caused the error - * * @return name - */ + **/ @ApiModelProperty(example = "DateOfBirth", value = "The name of the field that caused the error") - /** + /** * The name of the field that caused the error - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the field that caused the error - * - * @param name String - */ + /** + * The name of the field that caused the error + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The reason the error occurred - * - * @param reason String - * @return InvalidField - */ + * The reason the error occurred + * @param reason String + * @return InvalidField + **/ public InvalidField reason(String reason) { this.reason = reason; return this; } - /** + /** * The reason the error occurred - * * @return reason - */ - @ApiModelProperty( - example = "The Date of Birth is required.", - value = "The reason the error occurred") - /** + **/ + @ApiModelProperty(example = "The Date of Birth is required.", value = "The reason the error occurred") + /** * The reason the error occurred - * * @return reason String - */ + **/ public String getReason() { return reason; } - /** - * The reason the error occurred - * - * @param reason String - */ + /** + * The reason the error occurred + * @param reason String + **/ + public void setReason(String reason) { this.reason = reason; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -106,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } InvalidField invalidField = (InvalidField) o; - return Objects.equals(this.name, invalidField.name) - && Objects.equals(this.reason, invalidField.reason); + return Objects.equals(this.name, invalidField.name) && + Objects.equals(this.reason, invalidField.reason); } @Override @@ -115,6 +125,7 @@ public int hashCode() { return Objects.hash(name, reason); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -126,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -134,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/LeaveAccrualLine.java b/src/main/java/com/xero/models/payrollnz/LeaveAccrualLine.java index a733b71dd..98ea2f6d9 100644 --- a/src/main/java/com/xero/models/payrollnz/LeaveAccrualLine.java +++ b/src/main/java/com/xero/models/payrollnz/LeaveAccrualLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveAccrualLine + */ -/** LeaveAccrualLine */ public class LeaveAccrualLine { StringUtil util = new StringUtil(); @@ -27,75 +44,70 @@ public class LeaveAccrualLine { @JsonProperty("numberOfUnits") private Double numberOfUnits; /** - * Xero identifier for the Leave type - * - * @param leaveTypeID UUID - * @return LeaveAccrualLine - */ + * Xero identifier for the Leave type + * @param leaveTypeID UUID + * @return LeaveAccrualLine + **/ public LeaveAccrualLine leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero identifier for the Leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for the Leave type") - /** + /** * Xero identifier for the Leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero identifier for the Leave type - * - * @param leaveTypeID UUID - */ + /** + * Xero identifier for the Leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * Leave accrual number of units - * - * @param numberOfUnits Double - * @return LeaveAccrualLine - */ + * Leave accrual number of units + * @param numberOfUnits Double + * @return LeaveAccrualLine + **/ public LeaveAccrualLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Leave accrual number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Leave accrual number of units") - /** + /** * Leave accrual number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Leave accrual number of units - * - * @param numberOfUnits Double - */ + /** + * Leave accrual number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } LeaveAccrualLine leaveAccrualLine = (LeaveAccrualLine) o; - return Objects.equals(this.leaveTypeID, leaveAccrualLine.leaveTypeID) - && Objects.equals(this.numberOfUnits, leaveAccrualLine.numberOfUnits); + return Objects.equals(this.leaveTypeID, leaveAccrualLine.leaveTypeID) && + Objects.equals(this.numberOfUnits, leaveAccrualLine.numberOfUnits); } @Override @@ -114,6 +126,7 @@ public int hashCode() { return Objects.hash(leaveTypeID, numberOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -125,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -133,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/LeaveEarningsLine.java b/src/main/java/com/xero/models/payrollnz/LeaveEarningsLine.java index 03f60f7c5..2829a696b 100644 --- a/src/main/java/com/xero/models/payrollnz/LeaveEarningsLine.java +++ b/src/main/java/com/xero/models/payrollnz/LeaveEarningsLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveEarningsLine + */ -/** LeaveEarningsLine */ public class LeaveEarningsLine { StringUtil util = new StringUtil(); @@ -51,360 +68,326 @@ public class LeaveEarningsLine { @JsonProperty("isSystemGenerated") private Boolean isSystemGenerated; /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - * @return LeaveEarningsLine - */ + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + * @return LeaveEarningsLine + **/ public LeaveEarningsLine earningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; return this; } - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll earnings line") - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID UUID - */ + **/ public UUID getEarningsLineID() { return earningsLineID; } - /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - */ + /** + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + **/ + public void setEarningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; } /** - * Xero identifier for payroll leave earnings rate - * - * @param earningsRateID UUID - * @return LeaveEarningsLine - */ + * Xero identifier for payroll leave earnings rate + * @param earningsRateID UUID + * @return LeaveEarningsLine + **/ public LeaveEarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier for payroll leave earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll leave earnings rate") - /** + /** * Xero identifier for payroll leave earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier for payroll leave earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero identifier for payroll leave earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * name of earnings rate for display in UI - * - * @param displayName String - * @return LeaveEarningsLine - */ + * name of earnings rate for display in UI + * @param displayName String + * @return LeaveEarningsLine + **/ public LeaveEarningsLine displayName(String displayName) { this.displayName = displayName; return this; } - /** + /** * name of earnings rate for display in UI - * * @return displayName - */ + **/ @ApiModelProperty(value = "name of earnings rate for display in UI") - /** + /** * name of earnings rate for display in UI - * * @return displayName String - */ + **/ public String getDisplayName() { return displayName; } - /** - * name of earnings rate for display in UI - * - * @param displayName String - */ + /** + * name of earnings rate for display in UI + * @param displayName String + **/ + public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - * @return LeaveEarningsLine - */ + * Rate per unit for leave earnings line + * @param ratePerUnit Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "Rate per unit for leave earnings line") - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - */ + /** + * Rate per unit for leave earnings line + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Leave earnings number of units - * - * @param numberOfUnits Double - * @return LeaveEarningsLine - */ + * Leave earnings number of units + * @param numberOfUnits Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Leave earnings number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Leave earnings number of units") - /** + /** * Leave earnings number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Leave earnings number of units - * - * @param numberOfUnits Double - */ + /** + * Leave earnings number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - * @return LeaveEarningsLine - */ + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount - */ - @ApiModelProperty( - value = "Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") - /** + **/ + @ApiModelProperty(value = "Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") + /** * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - */ + /** + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The amount of the earnings line. - * - * @param amount Double - * @return LeaveEarningsLine - */ + * The amount of the earnings line. + * @param amount Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the earnings line. - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the earnings line.") - /** + /** * The amount of the earnings line. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the earnings line. - * - * @param amount Double - */ + /** + * The amount of the earnings line. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - * @return LeaveEarningsLine - */ + * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + * @return LeaveEarningsLine + **/ public LeaveEarningsLine isLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; return this; } - /** + /** * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet - */ - @ApiModelProperty( - value = - "Identifies if the leave earnings is taken from the timesheet. False for leave earnings" - + " line") - /** + **/ + @ApiModelProperty(value = "Identifies if the leave earnings is taken from the timesheet. False for leave earnings line") + /** * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet Boolean - */ + **/ public Boolean getIsLinkedToTimesheet() { return isLinkedToTimesheet; } - /** - * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - */ + /** + * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + **/ + public void setIsLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; } /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - * @return LeaveEarningsLine - */ + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + * @return LeaveEarningsLine + **/ public LeaveEarningsLine isAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; return this; } - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate - */ + **/ @ApiModelProperty(value = "Identifies if the earnings is using an average daily pay rate") - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate Boolean - */ + **/ public Boolean getIsAverageDailyPayRate() { return isAverageDailyPayRate; } - /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - */ + /** + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + **/ + public void setIsAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; } /** - * Flag to identify whether the earnings line is system generated or not. - * - * @param isSystemGenerated Boolean - * @return LeaveEarningsLine - */ + * Flag to identify whether the earnings line is system generated or not. + * @param isSystemGenerated Boolean + * @return LeaveEarningsLine + **/ public LeaveEarningsLine isSystemGenerated(Boolean isSystemGenerated) { this.isSystemGenerated = isSystemGenerated; return this; } - /** + /** * Flag to identify whether the earnings line is system generated or not. - * * @return isSystemGenerated - */ - @ApiModelProperty( - value = "Flag to identify whether the earnings line is system generated or not.") - /** + **/ + @ApiModelProperty(value = "Flag to identify whether the earnings line is system generated or not.") + /** * Flag to identify whether the earnings line is system generated or not. - * * @return isSystemGenerated Boolean - */ + **/ public Boolean getIsSystemGenerated() { return isSystemGenerated; } - /** - * Flag to identify whether the earnings line is system generated or not. - * - * @param isSystemGenerated Boolean - */ + /** + * Flag to identify whether the earnings line is system generated or not. + * @param isSystemGenerated Boolean + **/ + public void setIsSystemGenerated(Boolean isSystemGenerated) { this.isSystemGenerated = isSystemGenerated; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -414,33 +397,24 @@ public boolean equals(java.lang.Object o) { return false; } LeaveEarningsLine leaveEarningsLine = (LeaveEarningsLine) o; - return Objects.equals(this.earningsLineID, leaveEarningsLine.earningsLineID) - && Objects.equals(this.earningsRateID, leaveEarningsLine.earningsRateID) - && Objects.equals(this.displayName, leaveEarningsLine.displayName) - && Objects.equals(this.ratePerUnit, leaveEarningsLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, leaveEarningsLine.numberOfUnits) - && Objects.equals(this.fixedAmount, leaveEarningsLine.fixedAmount) - && Objects.equals(this.amount, leaveEarningsLine.amount) - && Objects.equals(this.isLinkedToTimesheet, leaveEarningsLine.isLinkedToTimesheet) - && Objects.equals(this.isAverageDailyPayRate, leaveEarningsLine.isAverageDailyPayRate) - && Objects.equals(this.isSystemGenerated, leaveEarningsLine.isSystemGenerated); + return Objects.equals(this.earningsLineID, leaveEarningsLine.earningsLineID) && + Objects.equals(this.earningsRateID, leaveEarningsLine.earningsRateID) && + Objects.equals(this.displayName, leaveEarningsLine.displayName) && + Objects.equals(this.ratePerUnit, leaveEarningsLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, leaveEarningsLine.numberOfUnits) && + Objects.equals(this.fixedAmount, leaveEarningsLine.fixedAmount) && + Objects.equals(this.amount, leaveEarningsLine.amount) && + Objects.equals(this.isLinkedToTimesheet, leaveEarningsLine.isLinkedToTimesheet) && + Objects.equals(this.isAverageDailyPayRate, leaveEarningsLine.isAverageDailyPayRate) && + Objects.equals(this.isSystemGenerated, leaveEarningsLine.isSystemGenerated); } @Override public int hashCode() { - return Objects.hash( - earningsLineID, - earningsRateID, - displayName, - ratePerUnit, - numberOfUnits, - fixedAmount, - amount, - isLinkedToTimesheet, - isAverageDailyPayRate, - isSystemGenerated); + return Objects.hash(earningsLineID, earningsRateID, displayName, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet, isAverageDailyPayRate, isSystemGenerated); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -452,19 +426,16 @@ public String toString() { sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" isLinkedToTimesheet: ") - .append(toIndentedString(isLinkedToTimesheet)) - .append("\n"); - sb.append(" isAverageDailyPayRate: ") - .append(toIndentedString(isAverageDailyPayRate)) - .append("\n"); + sb.append(" isLinkedToTimesheet: ").append(toIndentedString(isLinkedToTimesheet)).append("\n"); + sb.append(" isAverageDailyPayRate: ").append(toIndentedString(isAverageDailyPayRate)).append("\n"); sb.append(" isSystemGenerated: ").append(toIndentedString(isSystemGenerated)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -472,4 +443,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/LeavePeriod.java b/src/main/java/com/xero/models/payrollnz/LeavePeriod.java index b6be569d0..9788d34c9 100644 --- a/src/main/java/com/xero/models/payrollnz/LeavePeriod.java +++ b/src/main/java/com/xero/models/payrollnz/LeavePeriod.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeavePeriod + */ -/** LeavePeriod */ public class LeavePeriod { StringUtil util = new StringUtil(); @@ -40,15 +55,23 @@ public class LeavePeriod { @JsonProperty("typeOfUnitsTaken") private String typeOfUnitsTaken; - /** Status of leave */ + /** + * Status of leave + */ public enum PeriodStatusEnum { - /** APPROVED */ + /** + * APPROVED + */ APPROVED("Approved"), - - /** COMPLETED */ + + /** + * COMPLETED + */ COMPLETED("Completed"), - - /** ESTIMATED */ + + /** + * ESTIMATED + */ ESTIMATED("Estimated"); private String value; @@ -57,31 +80,25 @@ public enum PeriodStatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PeriodStatusEnum fromValue(String value) { for (PeriodStatusEnum b : PeriodStatusEnum.values()) { @@ -93,253 +110,234 @@ public static PeriodStatusEnum fromValue(String value) { } } + @JsonProperty("periodStatus") private PeriodStatusEnum periodStatus; /** - * The Pay Period Start Date (YYYY-MM-DD) - * - * @param periodStartDate LocalDate - * @return LeavePeriod - */ + * The Pay Period Start Date (YYYY-MM-DD) + * @param periodStartDate LocalDate + * @return LeavePeriod + **/ public LeavePeriod periodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; return this; } - /** + /** * The Pay Period Start Date (YYYY-MM-DD) - * * @return periodStartDate - */ + **/ @ApiModelProperty(value = "The Pay Period Start Date (YYYY-MM-DD)") - /** + /** * The Pay Period Start Date (YYYY-MM-DD) - * * @return periodStartDate LocalDate - */ + **/ public LocalDate getPeriodStartDate() { return periodStartDate; } - /** - * The Pay Period Start Date (YYYY-MM-DD) - * - * @param periodStartDate LocalDate - */ + /** + * The Pay Period Start Date (YYYY-MM-DD) + * @param periodStartDate LocalDate + **/ + public void setPeriodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; } /** - * The Pay Period End Date (YYYY-MM-DD) - * - * @param periodEndDate LocalDate - * @return LeavePeriod - */ + * The Pay Period End Date (YYYY-MM-DD) + * @param periodEndDate LocalDate + * @return LeavePeriod + **/ public LeavePeriod periodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; return this; } - /** + /** * The Pay Period End Date (YYYY-MM-DD) - * * @return periodEndDate - */ + **/ @ApiModelProperty(value = "The Pay Period End Date (YYYY-MM-DD)") - /** + /** * The Pay Period End Date (YYYY-MM-DD) - * * @return periodEndDate LocalDate - */ + **/ public LocalDate getPeriodEndDate() { return periodEndDate; } - /** - * The Pay Period End Date (YYYY-MM-DD) - * - * @param periodEndDate LocalDate - */ + /** + * The Pay Period End Date (YYYY-MM-DD) + * @param periodEndDate LocalDate + **/ + public void setPeriodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; } /** - * The Number of Units for the leave - * - * @param numberOfUnits Double - * @return LeavePeriod - */ + * The Number of Units for the leave + * @param numberOfUnits Double + * @return LeavePeriod + **/ public LeavePeriod numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The Number of Units for the leave - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "The Number of Units for the leave") - /** + /** * The Number of Units for the leave - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The Number of Units for the leave - * - * @param numberOfUnits Double - */ + /** + * The Number of Units for the leave + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * The number of units taken for the leave - * - * @param numberOfUnitsTaken Double - * @return LeavePeriod - */ + * The number of units taken for the leave + * @param numberOfUnitsTaken Double + * @return LeavePeriod + **/ public LeavePeriod numberOfUnitsTaken(Double numberOfUnitsTaken) { this.numberOfUnitsTaken = numberOfUnitsTaken; return this; } - /** + /** * The number of units taken for the leave - * * @return numberOfUnitsTaken - */ + **/ @ApiModelProperty(value = "The number of units taken for the leave") - /** + /** * The number of units taken for the leave - * * @return numberOfUnitsTaken Double - */ + **/ public Double getNumberOfUnitsTaken() { return numberOfUnitsTaken; } - /** - * The number of units taken for the leave - * - * @param numberOfUnitsTaken Double - */ + /** + * The number of units taken for the leave + * @param numberOfUnitsTaken Double + **/ + public void setNumberOfUnitsTaken(Double numberOfUnitsTaken) { this.numberOfUnitsTaken = numberOfUnitsTaken; } /** - * The type of units paid for the leave - * - * @param typeOfUnits String - * @return LeavePeriod - */ + * The type of units paid for the leave + * @param typeOfUnits String + * @return LeavePeriod + **/ public LeavePeriod typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * The type of units paid for the leave - * * @return typeOfUnits - */ + **/ @ApiModelProperty(value = "The type of units paid for the leave") - /** + /** * The type of units paid for the leave - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of units paid for the leave - * - * @param typeOfUnits String - */ + /** + * The type of units paid for the leave + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } /** - * The type of units taken for the leave - * - * @param typeOfUnitsTaken String - * @return LeavePeriod - */ + * The type of units taken for the leave + * @param typeOfUnitsTaken String + * @return LeavePeriod + **/ public LeavePeriod typeOfUnitsTaken(String typeOfUnitsTaken) { this.typeOfUnitsTaken = typeOfUnitsTaken; return this; } - /** + /** * The type of units taken for the leave - * * @return typeOfUnitsTaken - */ + **/ @ApiModelProperty(value = "The type of units taken for the leave") - /** + /** * The type of units taken for the leave - * * @return typeOfUnitsTaken String - */ + **/ public String getTypeOfUnitsTaken() { return typeOfUnitsTaken; } - /** - * The type of units taken for the leave - * - * @param typeOfUnitsTaken String - */ + /** + * The type of units taken for the leave + * @param typeOfUnitsTaken String + **/ + public void setTypeOfUnitsTaken(String typeOfUnitsTaken) { this.typeOfUnitsTaken = typeOfUnitsTaken; } /** - * Status of leave - * - * @param periodStatus PeriodStatusEnum - * @return LeavePeriod - */ + * Status of leave + * @param periodStatus PeriodStatusEnum + * @return LeavePeriod + **/ public LeavePeriod periodStatus(PeriodStatusEnum periodStatus) { this.periodStatus = periodStatus; return this; } - /** + /** * Status of leave - * * @return periodStatus - */ + **/ @ApiModelProperty(value = "Status of leave") - /** + /** * Status of leave - * * @return periodStatus PeriodStatusEnum - */ + **/ public PeriodStatusEnum getPeriodStatus() { return periodStatus; } - /** - * Status of leave - * - * @param periodStatus PeriodStatusEnum - */ + /** + * Status of leave + * @param periodStatus PeriodStatusEnum + **/ + public void setPeriodStatus(PeriodStatusEnum periodStatus) { this.periodStatus = periodStatus; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -349,27 +347,21 @@ public boolean equals(java.lang.Object o) { return false; } LeavePeriod leavePeriod = (LeavePeriod) o; - return Objects.equals(this.periodStartDate, leavePeriod.periodStartDate) - && Objects.equals(this.periodEndDate, leavePeriod.periodEndDate) - && Objects.equals(this.numberOfUnits, leavePeriod.numberOfUnits) - && Objects.equals(this.numberOfUnitsTaken, leavePeriod.numberOfUnitsTaken) - && Objects.equals(this.typeOfUnits, leavePeriod.typeOfUnits) - && Objects.equals(this.typeOfUnitsTaken, leavePeriod.typeOfUnitsTaken) - && Objects.equals(this.periodStatus, leavePeriod.periodStatus); + return Objects.equals(this.periodStartDate, leavePeriod.periodStartDate) && + Objects.equals(this.periodEndDate, leavePeriod.periodEndDate) && + Objects.equals(this.numberOfUnits, leavePeriod.numberOfUnits) && + Objects.equals(this.numberOfUnitsTaken, leavePeriod.numberOfUnitsTaken) && + Objects.equals(this.typeOfUnits, leavePeriod.typeOfUnits) && + Objects.equals(this.typeOfUnitsTaken, leavePeriod.typeOfUnitsTaken) && + Objects.equals(this.periodStatus, leavePeriod.periodStatus); } @Override public int hashCode() { - return Objects.hash( - periodStartDate, - periodEndDate, - numberOfUnits, - numberOfUnitsTaken, - typeOfUnits, - typeOfUnitsTaken, - periodStatus); + return Objects.hash(periodStartDate, periodEndDate, numberOfUnits, numberOfUnitsTaken, typeOfUnits, typeOfUnitsTaken, periodStatus); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -386,7 +378,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -394,4 +387,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/LeavePeriods.java b/src/main/java/com/xero/models/payrollnz/LeavePeriods.java index 63dd423bc..8145a0eee 100644 --- a/src/main/java/com/xero/models/payrollnz/LeavePeriods.java +++ b/src/main/java/com/xero/models/payrollnz/LeavePeriods.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.LeavePeriod; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeavePeriods + */ -/** LeavePeriods */ public class LeavePeriods { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class LeavePeriods { @JsonProperty("periods") private List periods = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return LeavePeriods - */ + * pagination + * @param pagination Pagination + * @return LeavePeriods + **/ public LeavePeriods pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return LeavePeriods - */ + * problem + * @param problem Problem + * @return LeavePeriods + **/ public LeavePeriods problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * periods - * - * @param periods List<LeavePeriod> - * @return LeavePeriods - */ + * periods + * @param periods List<LeavePeriod> + * @return LeavePeriods + **/ public LeavePeriods periods(List periods) { this.periods = periods; return this; @@ -113,10 +126,9 @@ public LeavePeriods periods(List periods) { /** * periods - * - * @param periodsItem LeavePeriod + * @param periodsItem LeavePeriod * @return LeavePeriods - */ + **/ public LeavePeriods addPeriodsItem(LeavePeriod periodsItem) { if (this.periods == null) { this.periods = new ArrayList(); @@ -125,30 +137,29 @@ public LeavePeriods addPeriodsItem(LeavePeriod periodsItem) { return this; } - /** + /** * Get periods - * * @return periods - */ + **/ @ApiModelProperty(value = "") - /** + /** * periods - * * @return periods List - */ + **/ public List getPeriods() { return periods; } - /** - * periods - * - * @param periods List<LeavePeriod> - */ + /** + * periods + * @param periods List<LeavePeriod> + **/ + public void setPeriods(List periods) { this.periods = periods; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } LeavePeriods leavePeriods = (LeavePeriods) o; - return Objects.equals(this.pagination, leavePeriods.pagination) - && Objects.equals(this.problem, leavePeriods.problem) - && Objects.equals(this.periods, leavePeriods.periods); + return Objects.equals(this.pagination, leavePeriods.pagination) && + Objects.equals(this.problem, leavePeriods.problem) && + Objects.equals(this.periods, leavePeriods.periods); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, periods); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/LeaveType.java b/src/main/java/com/xero/models/payrollnz/LeaveType.java index 6bca919b9..2ee517039 100644 --- a/src/main/java/com/xero/models/payrollnz/LeaveType.java +++ b/src/main/java/com/xero/models/payrollnz/LeaveType.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveType + */ -/** LeaveType */ public class LeaveType { StringUtil util = new StringUtil(); @@ -46,289 +63,262 @@ public class LeaveType { @JsonProperty("typeOfUnitsToAccrue") private String typeOfUnitsToAccrue; /** - * Xero unique identifier for the leave type - * - * @param leaveTypeID UUID - * @return LeaveType - */ + * Xero unique identifier for the leave type + * @param leaveTypeID UUID + * @return LeaveType + **/ public LeaveType leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero unique identifier for the leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the leave type") - /** + /** * Xero unique identifier for the leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero unique identifier for the leave type - * - * @param leaveTypeID UUID - */ + /** + * Xero unique identifier for the leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * Name of the leave type - * - * @param name String - * @return LeaveType - */ + * Name of the leave type + * @param name String + * @return LeaveType + **/ public LeaveType name(String name) { this.name = name; return this; } - /** + /** * Name of the leave type - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the leave type") - /** + /** * Name of the leave type - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the leave type - * - * @param name String - */ + /** + * Name of the leave type + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Indicate that an employee will be paid when taking this type of leave - * - * @param isPaidLeave Boolean - * @return LeaveType - */ + * Indicate that an employee will be paid when taking this type of leave + * @param isPaidLeave Boolean + * @return LeaveType + **/ public LeaveType isPaidLeave(Boolean isPaidLeave) { this.isPaidLeave = isPaidLeave; return this; } - /** + /** * Indicate that an employee will be paid when taking this type of leave - * * @return isPaidLeave - */ - @ApiModelProperty( - required = true, - value = "Indicate that an employee will be paid when taking this type of leave") - /** + **/ + @ApiModelProperty(required = true, value = "Indicate that an employee will be paid when taking this type of leave") + /** * Indicate that an employee will be paid when taking this type of leave - * * @return isPaidLeave Boolean - */ + **/ public Boolean getIsPaidLeave() { return isPaidLeave; } - /** - * Indicate that an employee will be paid when taking this type of leave - * - * @param isPaidLeave Boolean - */ + /** + * Indicate that an employee will be paid when taking this type of leave + * @param isPaidLeave Boolean + **/ + public void setIsPaidLeave(Boolean isPaidLeave) { this.isPaidLeave = isPaidLeave; } /** - * Indicate that a balance for this leave type to be shown on the employee’s payslips - * - * @param showOnPayslip Boolean - * @return LeaveType - */ + * Indicate that a balance for this leave type to be shown on the employee’s payslips + * @param showOnPayslip Boolean + * @return LeaveType + **/ public LeaveType showOnPayslip(Boolean showOnPayslip) { this.showOnPayslip = showOnPayslip; return this; } - /** + /** * Indicate that a balance for this leave type to be shown on the employee’s payslips - * * @return showOnPayslip - */ - @ApiModelProperty( - required = true, - value = "Indicate that a balance for this leave type to be shown on the employee’s payslips") - /** + **/ + @ApiModelProperty(required = true, value = "Indicate that a balance for this leave type to be shown on the employee’s payslips") + /** * Indicate that a balance for this leave type to be shown on the employee’s payslips - * * @return showOnPayslip Boolean - */ + **/ public Boolean getShowOnPayslip() { return showOnPayslip; } - /** - * Indicate that a balance for this leave type to be shown on the employee’s payslips - * - * @param showOnPayslip Boolean - */ + /** + * Indicate that a balance for this leave type to be shown on the employee’s payslips + * @param showOnPayslip Boolean + **/ + public void setShowOnPayslip(Boolean showOnPayslip) { this.showOnPayslip = showOnPayslip; } /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - * @return LeaveType - */ + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + * @return LeaveType + **/ public LeaveType updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of last update to the leave type note") - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } /** - * Shows whether the leave type is active or not - * - * @param isActive Boolean - * @return LeaveType - */ + * Shows whether the leave type is active or not + * @param isActive Boolean + * @return LeaveType + **/ public LeaveType isActive(Boolean isActive) { this.isActive = isActive; return this; } - /** + /** * Shows whether the leave type is active or not - * * @return isActive - */ + **/ @ApiModelProperty(value = "Shows whether the leave type is active or not") - /** + /** * Shows whether the leave type is active or not - * * @return isActive Boolean - */ + **/ public Boolean getIsActive() { return isActive; } - /** - * Shows whether the leave type is active or not - * - * @param isActive Boolean - */ + /** + * Shows whether the leave type is active or not + * @param isActive Boolean + **/ + public void setIsActive(Boolean isActive) { this.isActive = isActive; } /** - * The type of units to be paid for the leave type - * - * @param typeOfUnits String - * @return LeaveType - */ + * The type of units to be paid for the leave type + * @param typeOfUnits String + * @return LeaveType + **/ public LeaveType typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * The type of units to be paid for the leave type - * * @return typeOfUnits - */ + **/ @ApiModelProperty(value = "The type of units to be paid for the leave type") - /** + /** * The type of units to be paid for the leave type - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of units to be paid for the leave type - * - * @param typeOfUnits String - */ + /** + * The type of units to be paid for the leave type + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } /** - * The type of units to be accrued for the leave type - * - * @param typeOfUnitsToAccrue String - * @return LeaveType - */ + * The type of units to be accrued for the leave type + * @param typeOfUnitsToAccrue String + * @return LeaveType + **/ public LeaveType typeOfUnitsToAccrue(String typeOfUnitsToAccrue) { this.typeOfUnitsToAccrue = typeOfUnitsToAccrue; return this; } - /** + /** * The type of units to be accrued for the leave type - * * @return typeOfUnitsToAccrue - */ + **/ @ApiModelProperty(value = "The type of units to be accrued for the leave type") - /** + /** * The type of units to be accrued for the leave type - * * @return typeOfUnitsToAccrue String - */ + **/ public String getTypeOfUnitsToAccrue() { return typeOfUnitsToAccrue; } - /** - * The type of units to be accrued for the leave type - * - * @param typeOfUnitsToAccrue String - */ + /** + * The type of units to be accrued for the leave type + * @param typeOfUnitsToAccrue String + **/ + public void setTypeOfUnitsToAccrue(String typeOfUnitsToAccrue) { this.typeOfUnitsToAccrue = typeOfUnitsToAccrue; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -338,29 +328,22 @@ public boolean equals(java.lang.Object o) { return false; } LeaveType leaveType = (LeaveType) o; - return Objects.equals(this.leaveTypeID, leaveType.leaveTypeID) - && Objects.equals(this.name, leaveType.name) - && Objects.equals(this.isPaidLeave, leaveType.isPaidLeave) - && Objects.equals(this.showOnPayslip, leaveType.showOnPayslip) - && Objects.equals(this.updatedDateUTC, leaveType.updatedDateUTC) - && Objects.equals(this.isActive, leaveType.isActive) - && Objects.equals(this.typeOfUnits, leaveType.typeOfUnits) - && Objects.equals(this.typeOfUnitsToAccrue, leaveType.typeOfUnitsToAccrue); + return Objects.equals(this.leaveTypeID, leaveType.leaveTypeID) && + Objects.equals(this.name, leaveType.name) && + Objects.equals(this.isPaidLeave, leaveType.isPaidLeave) && + Objects.equals(this.showOnPayslip, leaveType.showOnPayslip) && + Objects.equals(this.updatedDateUTC, leaveType.updatedDateUTC) && + Objects.equals(this.isActive, leaveType.isActive) && + Objects.equals(this.typeOfUnits, leaveType.typeOfUnits) && + Objects.equals(this.typeOfUnitsToAccrue, leaveType.typeOfUnitsToAccrue); } @Override public int hashCode() { - return Objects.hash( - leaveTypeID, - name, - isPaidLeave, - showOnPayslip, - updatedDateUTC, - isActive, - typeOfUnits, - typeOfUnitsToAccrue); + return Objects.hash(leaveTypeID, name, isPaidLeave, showOnPayslip, updatedDateUTC, isActive, typeOfUnits, typeOfUnitsToAccrue); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -372,15 +355,14 @@ public String toString() { sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n"); sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); sb.append(" typeOfUnits: ").append(toIndentedString(typeOfUnits)).append("\n"); - sb.append(" typeOfUnitsToAccrue: ") - .append(toIndentedString(typeOfUnitsToAccrue)) - .append("\n"); + sb.append(" typeOfUnitsToAccrue: ").append(toIndentedString(typeOfUnitsToAccrue)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -388,4 +370,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/LeaveTypeObject.java b/src/main/java/com/xero/models/payrollnz/LeaveTypeObject.java index abfb36c06..6699788ce 100644 --- a/src/main/java/com/xero/models/payrollnz/LeaveTypeObject.java +++ b/src/main/java/com/xero/models/payrollnz/LeaveTypeObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.LeaveType; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveTypeObject + */ -/** LeaveTypeObject */ public class LeaveTypeObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class LeaveTypeObject { @JsonProperty("leaveType") private LeaveType leaveType; /** - * pagination - * - * @param pagination Pagination - * @return LeaveTypeObject - */ + * pagination + * @param pagination Pagination + * @return LeaveTypeObject + **/ public LeaveTypeObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return LeaveTypeObject - */ + * problem + * @param problem Problem + * @return LeaveTypeObject + **/ public LeaveTypeObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveType - * - * @param leaveType LeaveType - * @return LeaveTypeObject - */ + * leaveType + * @param leaveType LeaveType + * @return LeaveTypeObject + **/ public LeaveTypeObject leaveType(LeaveType leaveType) { this.leaveType = leaveType; return this; } - /** + /** * Get leaveType - * * @return leaveType - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveType - * * @return leaveType LeaveType - */ + **/ public LeaveType getLeaveType() { return leaveType; } - /** - * leaveType - * - * @param leaveType LeaveType - */ + /** + * leaveType + * @param leaveType LeaveType + **/ + public void setLeaveType(LeaveType leaveType) { this.leaveType = leaveType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } LeaveTypeObject leaveTypeObject = (LeaveTypeObject) o; - return Objects.equals(this.pagination, leaveTypeObject.pagination) - && Objects.equals(this.problem, leaveTypeObject.problem) - && Objects.equals(this.leaveType, leaveTypeObject.leaveType); + return Objects.equals(this.pagination, leaveTypeObject.pagination) && + Objects.equals(this.problem, leaveTypeObject.problem) && + Objects.equals(this.leaveType, leaveTypeObject.leaveType); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/LeaveTypes.java b/src/main/java/com/xero/models/payrollnz/LeaveTypes.java index 2beebcd1f..cb32ea072 100644 --- a/src/main/java/com/xero/models/payrollnz/LeaveTypes.java +++ b/src/main/java/com/xero/models/payrollnz/LeaveTypes.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.LeaveType; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveTypes + */ -/** LeaveTypes */ public class LeaveTypes { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class LeaveTypes { @JsonProperty("leaveTypes") private List leaveTypes = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return LeaveTypes - */ + * pagination + * @param pagination Pagination + * @return LeaveTypes + **/ public LeaveTypes pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return LeaveTypes - */ + * problem + * @param problem Problem + * @return LeaveTypes + **/ public LeaveTypes problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveTypes - * - * @param leaveTypes List<LeaveType> - * @return LeaveTypes - */ + * leaveTypes + * @param leaveTypes List<LeaveType> + * @return LeaveTypes + **/ public LeaveTypes leaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; return this; @@ -113,10 +126,9 @@ public LeaveTypes leaveTypes(List leaveTypes) { /** * leaveTypes - * - * @param leaveTypesItem LeaveType + * @param leaveTypesItem LeaveType * @return LeaveTypes - */ + **/ public LeaveTypes addLeaveTypesItem(LeaveType leaveTypesItem) { if (this.leaveTypes == null) { this.leaveTypes = new ArrayList(); @@ -125,30 +137,29 @@ public LeaveTypes addLeaveTypesItem(LeaveType leaveTypesItem) { return this; } - /** + /** * Get leaveTypes - * * @return leaveTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveTypes - * * @return leaveTypes List - */ + **/ public List getLeaveTypes() { return leaveTypes; } - /** - * leaveTypes - * - * @param leaveTypes List<LeaveType> - */ + /** + * leaveTypes + * @param leaveTypes List<LeaveType> + **/ + public void setLeaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } LeaveTypes leaveTypes = (LeaveTypes) o; - return Objects.equals(this.pagination, leaveTypes.pagination) - && Objects.equals(this.problem, leaveTypes.problem) - && Objects.equals(this.leaveTypes, leaveTypes.leaveTypes); + return Objects.equals(this.pagination, leaveTypes.pagination) && + Objects.equals(this.problem, leaveTypes.problem) && + Objects.equals(this.leaveTypes, leaveTypes.leaveTypes); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveTypes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Pagination.java b/src/main/java/com/xero/models/payrollnz/Pagination.java index 8e845d78a..1d04560f0 100644 --- a/src/main/java/com/xero/models/payrollnz/Pagination.java +++ b/src/main/java/com/xero/models/payrollnz/Pagination.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Pagination + */ -/** Pagination */ public class Pagination { StringUtil util = new StringUtil(); @@ -32,145 +49,134 @@ public class Pagination { @JsonProperty("itemCount") private Integer itemCount; /** - * page - * - * @param page Integer - * @return Pagination - */ + * page + * @param page Integer + * @return Pagination + **/ public Pagination page(Integer page) { this.page = page; return this; } - /** + /** * Get page - * * @return page - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * page - * * @return page Integer - */ + **/ public Integer getPage() { return page; } - /** - * page - * - * @param page Integer - */ + /** + * page + * @param page Integer + **/ + public void setPage(Integer page) { this.page = page; } /** - * pageSize - * - * @param pageSize Integer - * @return Pagination - */ + * pageSize + * @param pageSize Integer + * @return Pagination + **/ public Pagination pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } - /** + /** * Get pageSize - * * @return pageSize - */ + **/ @ApiModelProperty(example = "10", value = "") - /** + /** * pageSize - * * @return pageSize Integer - */ + **/ public Integer getPageSize() { return pageSize; } - /** - * pageSize - * - * @param pageSize Integer - */ + /** + * pageSize + * @param pageSize Integer + **/ + public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** - * pageCount - * - * @param pageCount Integer - * @return Pagination - */ + * pageCount + * @param pageCount Integer + * @return Pagination + **/ public Pagination pageCount(Integer pageCount) { this.pageCount = pageCount; return this; } - /** + /** * Get pageCount - * * @return pageCount - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * pageCount - * * @return pageCount Integer - */ + **/ public Integer getPageCount() { return pageCount; } - /** - * pageCount - * - * @param pageCount Integer - */ + /** + * pageCount + * @param pageCount Integer + **/ + public void setPageCount(Integer pageCount) { this.pageCount = pageCount; } /** - * itemCount - * - * @param itemCount Integer - * @return Pagination - */ + * itemCount + * @param itemCount Integer + * @return Pagination + **/ public Pagination itemCount(Integer itemCount) { this.itemCount = itemCount; return this; } - /** + /** * Get itemCount - * * @return itemCount - */ + **/ @ApiModelProperty(example = "2", value = "") - /** + /** * itemCount - * * @return itemCount Integer - */ + **/ public Integer getItemCount() { return itemCount; } - /** - * itemCount - * - * @param itemCount Integer - */ + /** + * itemCount + * @param itemCount Integer + **/ + public void setItemCount(Integer itemCount) { this.itemCount = itemCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } Pagination pagination = (Pagination) o; - return Objects.equals(this.page, pagination.page) - && Objects.equals(this.pageSize, pagination.pageSize) - && Objects.equals(this.pageCount, pagination.pageCount) - && Objects.equals(this.itemCount, pagination.itemCount); + return Objects.equals(this.page, pagination.page) && + Objects.equals(this.pageSize, pagination.pageSize) && + Objects.equals(this.pageCount, pagination.pageCount) && + Objects.equals(this.itemCount, pagination.itemCount); } @Override @@ -191,6 +197,7 @@ public int hashCode() { return Objects.hash(page, pageSize, pageCount, itemCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -212,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PayRun.java b/src/main/java/com/xero/models/payrollnz/PayRun.java index edc5a6519..5598c885f 100644 --- a/src/main/java/com/xero/models/payrollnz/PayRun.java +++ b/src/main/java/com/xero/models/payrollnz/PayRun.java @@ -9,20 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollnz.CalendarType; +import com.xero.models.payrollnz.PaySlip; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRun + */ -/** PayRun */ public class PayRun { StringUtil util = new StringUtil(); @@ -46,12 +63,18 @@ public class PayRun { @JsonProperty("totalPay") private Double totalPay; - /** Pay run status */ + /** + * Pay run status + */ public enum PayRunStatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("Draft"), - - /** POSTED */ + + /** + * POSTED + */ POSTED("Posted"); private String value; @@ -60,31 +83,25 @@ public enum PayRunStatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PayRunStatusEnum fromValue(String value) { for (PayRunStatusEnum b : PayRunStatusEnum.values()) { @@ -96,17 +113,26 @@ public static PayRunStatusEnum fromValue(String value) { } } + @JsonProperty("payRunStatus") private PayRunStatusEnum payRunStatus; - /** Pay run type */ + /** + * Pay run type + */ public enum PayRunTypeEnum { - /** SCHEDULED */ + /** + * SCHEDULED + */ SCHEDULED("Scheduled"), - - /** UNSCHEDULED */ + + /** + * UNSCHEDULED + */ UNSCHEDULED("Unscheduled"), - - /** EARLIERYEARUPDATE */ + + /** + * EARLIERYEARUPDATE + */ EARLIERYEARUPDATE("EarlierYearUpdate"); private String value; @@ -115,31 +141,25 @@ public enum PayRunTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PayRunTypeEnum fromValue(String value) { for (PayRunTypeEnum b : PayRunTypeEnum.values()) { @@ -151,6 +171,7 @@ public static PayRunTypeEnum fromValue(String value) { } } + @JsonProperty("payRunType") private PayRunTypeEnum payRunType; @@ -163,396 +184,362 @@ public static PayRunTypeEnum fromValue(String value) { @JsonProperty("paySlips") private List paySlips = new ArrayList(); /** - * Xero unique identifier for the pay run - * - * @param payRunID UUID - * @return PayRun - */ + * Xero unique identifier for the pay run + * @param payRunID UUID + * @return PayRun + **/ public PayRun payRunID(UUID payRunID) { this.payRunID = payRunID; return this; } - /** + /** * Xero unique identifier for the pay run - * * @return payRunID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the pay run") - /** + /** * Xero unique identifier for the pay run - * * @return payRunID UUID - */ + **/ public UUID getPayRunID() { return payRunID; } - /** - * Xero unique identifier for the pay run - * - * @param payRunID UUID - */ + /** + * Xero unique identifier for the pay run + * @param payRunID UUID + **/ + public void setPayRunID(UUID payRunID) { this.payRunID = payRunID; } /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - * @return PayRun - */ + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + * @return PayRun + **/ public PayRun payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar") - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * Period start date of the payroll calendar - * - * @param periodStartDate LocalDate - * @return PayRun - */ + * Period start date of the payroll calendar + * @param periodStartDate LocalDate + * @return PayRun + **/ public PayRun periodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; return this; } - /** + /** * Period start date of the payroll calendar - * * @return periodStartDate - */ + **/ @ApiModelProperty(value = "Period start date of the payroll calendar") - /** + /** * Period start date of the payroll calendar - * * @return periodStartDate LocalDate - */ + **/ public LocalDate getPeriodStartDate() { return periodStartDate; } - /** - * Period start date of the payroll calendar - * - * @param periodStartDate LocalDate - */ + /** + * Period start date of the payroll calendar + * @param periodStartDate LocalDate + **/ + public void setPeriodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; } /** - * Period end date of the payroll calendar - * - * @param periodEndDate LocalDate - * @return PayRun - */ + * Period end date of the payroll calendar + * @param periodEndDate LocalDate + * @return PayRun + **/ public PayRun periodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; return this; } - /** + /** * Period end date of the payroll calendar - * * @return periodEndDate - */ + **/ @ApiModelProperty(value = "Period end date of the payroll calendar") - /** + /** * Period end date of the payroll calendar - * * @return periodEndDate LocalDate - */ + **/ public LocalDate getPeriodEndDate() { return periodEndDate; } - /** - * Period end date of the payroll calendar - * - * @param periodEndDate LocalDate - */ + /** + * Period end date of the payroll calendar + * @param periodEndDate LocalDate + **/ + public void setPeriodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; } /** - * Payment date of the pay run - * - * @param paymentDate LocalDate - * @return PayRun - */ + * Payment date of the pay run + * @param paymentDate LocalDate + * @return PayRun + **/ public PayRun paymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; return this; } - /** + /** * Payment date of the pay run - * * @return paymentDate - */ + **/ @ApiModelProperty(value = "Payment date of the pay run") - /** + /** * Payment date of the pay run - * * @return paymentDate LocalDate - */ + **/ public LocalDate getPaymentDate() { return paymentDate; } - /** - * Payment date of the pay run - * - * @param paymentDate LocalDate - */ + /** + * Payment date of the pay run + * @param paymentDate LocalDate + **/ + public void setPaymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; } /** - * Total cost of the pay run - * - * @param totalCost Double - * @return PayRun - */ + * Total cost of the pay run + * @param totalCost Double + * @return PayRun + **/ public PayRun totalCost(Double totalCost) { this.totalCost = totalCost; return this; } - /** + /** * Total cost of the pay run - * * @return totalCost - */ + **/ @ApiModelProperty(value = "Total cost of the pay run") - /** + /** * Total cost of the pay run - * * @return totalCost Double - */ + **/ public Double getTotalCost() { return totalCost; } - /** - * Total cost of the pay run - * - * @param totalCost Double - */ + /** + * Total cost of the pay run + * @param totalCost Double + **/ + public void setTotalCost(Double totalCost) { this.totalCost = totalCost; } /** - * Total pay of the pay run - * - * @param totalPay Double - * @return PayRun - */ + * Total pay of the pay run + * @param totalPay Double + * @return PayRun + **/ public PayRun totalPay(Double totalPay) { this.totalPay = totalPay; return this; } - /** + /** * Total pay of the pay run - * * @return totalPay - */ + **/ @ApiModelProperty(value = "Total pay of the pay run") - /** + /** * Total pay of the pay run - * * @return totalPay Double - */ + **/ public Double getTotalPay() { return totalPay; } - /** - * Total pay of the pay run - * - * @param totalPay Double - */ + /** + * Total pay of the pay run + * @param totalPay Double + **/ + public void setTotalPay(Double totalPay) { this.totalPay = totalPay; } /** - * Pay run status - * - * @param payRunStatus PayRunStatusEnum - * @return PayRun - */ + * Pay run status + * @param payRunStatus PayRunStatusEnum + * @return PayRun + **/ public PayRun payRunStatus(PayRunStatusEnum payRunStatus) { this.payRunStatus = payRunStatus; return this; } - /** + /** * Pay run status - * * @return payRunStatus - */ + **/ @ApiModelProperty(value = "Pay run status") - /** + /** * Pay run status - * * @return payRunStatus PayRunStatusEnum - */ + **/ public PayRunStatusEnum getPayRunStatus() { return payRunStatus; } - /** - * Pay run status - * - * @param payRunStatus PayRunStatusEnum - */ + /** + * Pay run status + * @param payRunStatus PayRunStatusEnum + **/ + public void setPayRunStatus(PayRunStatusEnum payRunStatus) { this.payRunStatus = payRunStatus; } /** - * Pay run type - * - * @param payRunType PayRunTypeEnum - * @return PayRun - */ + * Pay run type + * @param payRunType PayRunTypeEnum + * @return PayRun + **/ public PayRun payRunType(PayRunTypeEnum payRunType) { this.payRunType = payRunType; return this; } - /** + /** * Pay run type - * * @return payRunType - */ + **/ @ApiModelProperty(value = "Pay run type") - /** + /** * Pay run type - * * @return payRunType PayRunTypeEnum - */ + **/ public PayRunTypeEnum getPayRunType() { return payRunType; } - /** - * Pay run type - * - * @param payRunType PayRunTypeEnum - */ + /** + * Pay run type + * @param payRunType PayRunTypeEnum + **/ + public void setPayRunType(PayRunTypeEnum payRunType) { this.payRunType = payRunType; } /** - * calendarType - * - * @param calendarType CalendarType - * @return PayRun - */ + * calendarType + * @param calendarType CalendarType + * @return PayRun + **/ public PayRun calendarType(CalendarType calendarType) { this.calendarType = calendarType; return this; } - /** + /** * Get calendarType - * * @return calendarType - */ + **/ @ApiModelProperty(value = "") - /** + /** * calendarType - * * @return calendarType CalendarType - */ + **/ public CalendarType getCalendarType() { return calendarType; } - /** - * calendarType - * - * @param calendarType CalendarType - */ + /** + * calendarType + * @param calendarType CalendarType + **/ + public void setCalendarType(CalendarType calendarType) { this.calendarType = calendarType; } /** - * Posted date time of the pay run - * - * @param postedDateTime LocalDate - * @return PayRun - */ + * Posted date time of the pay run + * @param postedDateTime LocalDate + * @return PayRun + **/ public PayRun postedDateTime(LocalDate postedDateTime) { this.postedDateTime = postedDateTime; return this; } - /** + /** * Posted date time of the pay run - * * @return postedDateTime - */ + **/ @ApiModelProperty(value = "Posted date time of the pay run") - /** + /** * Posted date time of the pay run - * * @return postedDateTime LocalDate - */ + **/ public LocalDate getPostedDateTime() { return postedDateTime; } - /** - * Posted date time of the pay run - * - * @param postedDateTime LocalDate - */ + /** + * Posted date time of the pay run + * @param postedDateTime LocalDate + **/ + public void setPostedDateTime(LocalDate postedDateTime) { this.postedDateTime = postedDateTime; } /** - * paySlips - * - * @param paySlips List<PaySlip> - * @return PayRun - */ + * paySlips + * @param paySlips List<PaySlip> + * @return PayRun + **/ public PayRun paySlips(List paySlips) { this.paySlips = paySlips; return this; @@ -560,10 +547,9 @@ public PayRun paySlips(List paySlips) { /** * paySlips - * - * @param paySlipsItem PaySlip + * @param paySlipsItem PaySlip * @return PayRun - */ + **/ public PayRun addPaySlipsItem(PaySlip paySlipsItem) { if (this.paySlips == null) { this.paySlips = new ArrayList(); @@ -572,30 +558,29 @@ public PayRun addPaySlipsItem(PaySlip paySlipsItem) { return this; } - /** + /** * Get paySlips - * * @return paySlips - */ + **/ @ApiModelProperty(value = "") - /** + /** * paySlips - * * @return paySlips List - */ + **/ public List getPaySlips() { return paySlips; } - /** - * paySlips - * - * @param paySlips List<PaySlip> - */ + /** + * paySlips + * @param paySlips List<PaySlip> + **/ + public void setPaySlips(List paySlips) { this.paySlips = paySlips; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -605,37 +590,26 @@ public boolean equals(java.lang.Object o) { return false; } PayRun payRun = (PayRun) o; - return Objects.equals(this.payRunID, payRun.payRunID) - && Objects.equals(this.payrollCalendarID, payRun.payrollCalendarID) - && Objects.equals(this.periodStartDate, payRun.periodStartDate) - && Objects.equals(this.periodEndDate, payRun.periodEndDate) - && Objects.equals(this.paymentDate, payRun.paymentDate) - && Objects.equals(this.totalCost, payRun.totalCost) - && Objects.equals(this.totalPay, payRun.totalPay) - && Objects.equals(this.payRunStatus, payRun.payRunStatus) - && Objects.equals(this.payRunType, payRun.payRunType) - && Objects.equals(this.calendarType, payRun.calendarType) - && Objects.equals(this.postedDateTime, payRun.postedDateTime) - && Objects.equals(this.paySlips, payRun.paySlips); + return Objects.equals(this.payRunID, payRun.payRunID) && + Objects.equals(this.payrollCalendarID, payRun.payrollCalendarID) && + Objects.equals(this.periodStartDate, payRun.periodStartDate) && + Objects.equals(this.periodEndDate, payRun.periodEndDate) && + Objects.equals(this.paymentDate, payRun.paymentDate) && + Objects.equals(this.totalCost, payRun.totalCost) && + Objects.equals(this.totalPay, payRun.totalPay) && + Objects.equals(this.payRunStatus, payRun.payRunStatus) && + Objects.equals(this.payRunType, payRun.payRunType) && + Objects.equals(this.calendarType, payRun.calendarType) && + Objects.equals(this.postedDateTime, payRun.postedDateTime) && + Objects.equals(this.paySlips, payRun.paySlips); } @Override public int hashCode() { - return Objects.hash( - payRunID, - payrollCalendarID, - periodStartDate, - periodEndDate, - paymentDate, - totalCost, - totalPay, - payRunStatus, - payRunType, - calendarType, - postedDateTime, - paySlips); + return Objects.hash(payRunID, payrollCalendarID, periodStartDate, periodEndDate, paymentDate, totalCost, totalPay, payRunStatus, payRunType, calendarType, postedDateTime, paySlips); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -657,7 +631,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -665,4 +640,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PayRunCalendar.java b/src/main/java/com/xero/models/payrollnz/PayRunCalendar.java index 95c570d4f..8968d7564 100644 --- a/src/main/java/com/xero/models/payrollnz/PayRunCalendar.java +++ b/src/main/java/com/xero/models/payrollnz/PayRunCalendar.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.CalendarType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunCalendar + */ -/** PayRunCalendar */ public class PayRunCalendar { StringUtil util = new StringUtil(); @@ -44,250 +62,230 @@ public class PayRunCalendar { @JsonProperty("updatedDateUTC") private LocalDateTime updatedDateUTC; /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - * @return PayRunCalendar - */ + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + * @return PayRunCalendar + **/ public PayRunCalendar payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar") - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * Name of the calendar - * - * @param name String - * @return PayRunCalendar - */ + * Name of the calendar + * @param name String + * @return PayRunCalendar + **/ public PayRunCalendar name(String name) { this.name = name; return this; } - /** + /** * Name of the calendar - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the calendar") - /** + /** * Name of the calendar - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the calendar - * - * @param name String - */ + /** + * Name of the calendar + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * calendarType - * - * @param calendarType CalendarType - * @return PayRunCalendar - */ + * calendarType + * @param calendarType CalendarType + * @return PayRunCalendar + **/ public PayRunCalendar calendarType(CalendarType calendarType) { this.calendarType = calendarType; return this; } - /** + /** * Get calendarType - * * @return calendarType - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * calendarType - * * @return calendarType CalendarType - */ + **/ public CalendarType getCalendarType() { return calendarType; } - /** - * calendarType - * - * @param calendarType CalendarType - */ + /** + * calendarType + * @param calendarType CalendarType + **/ + public void setCalendarType(CalendarType calendarType) { this.calendarType = calendarType; } /** - * Period start date of the calendar - * - * @param periodStartDate LocalDate - * @return PayRunCalendar - */ + * Period start date of the calendar + * @param periodStartDate LocalDate + * @return PayRunCalendar + **/ public PayRunCalendar periodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; return this; } - /** + /** * Period start date of the calendar - * * @return periodStartDate - */ + **/ @ApiModelProperty(required = true, value = "Period start date of the calendar") - /** + /** * Period start date of the calendar - * * @return periodStartDate LocalDate - */ + **/ public LocalDate getPeriodStartDate() { return periodStartDate; } - /** - * Period start date of the calendar - * - * @param periodStartDate LocalDate - */ + /** + * Period start date of the calendar + * @param periodStartDate LocalDate + **/ + public void setPeriodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; } /** - * Period end date of the calendar - * - * @param periodEndDate LocalDate - * @return PayRunCalendar - */ + * Period end date of the calendar + * @param periodEndDate LocalDate + * @return PayRunCalendar + **/ public PayRunCalendar periodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; return this; } - /** + /** * Period end date of the calendar - * * @return periodEndDate - */ + **/ @ApiModelProperty(value = "Period end date of the calendar") - /** + /** * Period end date of the calendar - * * @return periodEndDate LocalDate - */ + **/ public LocalDate getPeriodEndDate() { return periodEndDate; } - /** - * Period end date of the calendar - * - * @param periodEndDate LocalDate - */ + /** + * Period end date of the calendar + * @param periodEndDate LocalDate + **/ + public void setPeriodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; } /** - * Payment date of the calendar - * - * @param paymentDate LocalDate - * @return PayRunCalendar - */ + * Payment date of the calendar + * @param paymentDate LocalDate + * @return PayRunCalendar + **/ public PayRunCalendar paymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; return this; } - /** + /** * Payment date of the calendar - * * @return paymentDate - */ + **/ @ApiModelProperty(required = true, value = "Payment date of the calendar") - /** + /** * Payment date of the calendar - * * @return paymentDate LocalDate - */ + **/ public LocalDate getPaymentDate() { return paymentDate; } - /** - * Payment date of the calendar - * - * @param paymentDate LocalDate - */ + /** + * Payment date of the calendar + * @param paymentDate LocalDate + **/ + public void setPaymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; } /** - * UTC timestamp of the last update to the pay run calendar - * - * @param updatedDateUTC LocalDateTime - * @return PayRunCalendar - */ + * UTC timestamp of the last update to the pay run calendar + * @param updatedDateUTC LocalDateTime + * @return PayRunCalendar + **/ public PayRunCalendar updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of the last update to the pay run calendar - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of the last update to the pay run calendar") - /** + /** * UTC timestamp of the last update to the pay run calendar - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of the last update to the pay run calendar - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of the last update to the pay run calendar + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -297,27 +295,21 @@ public boolean equals(java.lang.Object o) { return false; } PayRunCalendar payRunCalendar = (PayRunCalendar) o; - return Objects.equals(this.payrollCalendarID, payRunCalendar.payrollCalendarID) - && Objects.equals(this.name, payRunCalendar.name) - && Objects.equals(this.calendarType, payRunCalendar.calendarType) - && Objects.equals(this.periodStartDate, payRunCalendar.periodStartDate) - && Objects.equals(this.periodEndDate, payRunCalendar.periodEndDate) - && Objects.equals(this.paymentDate, payRunCalendar.paymentDate) - && Objects.equals(this.updatedDateUTC, payRunCalendar.updatedDateUTC); + return Objects.equals(this.payrollCalendarID, payRunCalendar.payrollCalendarID) && + Objects.equals(this.name, payRunCalendar.name) && + Objects.equals(this.calendarType, payRunCalendar.calendarType) && + Objects.equals(this.periodStartDate, payRunCalendar.periodStartDate) && + Objects.equals(this.periodEndDate, payRunCalendar.periodEndDate) && + Objects.equals(this.paymentDate, payRunCalendar.paymentDate) && + Objects.equals(this.updatedDateUTC, payRunCalendar.updatedDateUTC); } @Override public int hashCode() { - return Objects.hash( - payrollCalendarID, - name, - calendarType, - periodStartDate, - periodEndDate, - paymentDate, - updatedDateUTC); + return Objects.hash(payrollCalendarID, name, calendarType, periodStartDate, periodEndDate, paymentDate, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -334,7 +326,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -342,4 +335,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PayRunCalendarObject.java b/src/main/java/com/xero/models/payrollnz/PayRunCalendarObject.java index d02504727..f14a2af35 100644 --- a/src/main/java/com/xero/models/payrollnz/PayRunCalendarObject.java +++ b/src/main/java/com/xero/models/payrollnz/PayRunCalendarObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.PayRunCalendar; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunCalendarObject + */ -/** PayRunCalendarObject */ public class PayRunCalendarObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PayRunCalendarObject { @JsonProperty("payRunCalendar") private PayRunCalendar payRunCalendar; /** - * pagination - * - * @param pagination Pagination - * @return PayRunCalendarObject - */ + * pagination + * @param pagination Pagination + * @return PayRunCalendarObject + **/ public PayRunCalendarObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRunCalendarObject - */ + * problem + * @param problem Problem + * @return PayRunCalendarObject + **/ public PayRunCalendarObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRunCalendar - * - * @param payRunCalendar PayRunCalendar - * @return PayRunCalendarObject - */ + * payRunCalendar + * @param payRunCalendar PayRunCalendar + * @return PayRunCalendarObject + **/ public PayRunCalendarObject payRunCalendar(PayRunCalendar payRunCalendar) { this.payRunCalendar = payRunCalendar; return this; } - /** + /** * Get payRunCalendar - * * @return payRunCalendar - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRunCalendar - * * @return payRunCalendar PayRunCalendar - */ + **/ public PayRunCalendar getPayRunCalendar() { return payRunCalendar; } - /** - * payRunCalendar - * - * @param payRunCalendar PayRunCalendar - */ + /** + * payRunCalendar + * @param payRunCalendar PayRunCalendar + **/ + public void setPayRunCalendar(PayRunCalendar payRunCalendar) { this.payRunCalendar = payRunCalendar; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRunCalendarObject payRunCalendarObject = (PayRunCalendarObject) o; - return Objects.equals(this.pagination, payRunCalendarObject.pagination) - && Objects.equals(this.problem, payRunCalendarObject.problem) - && Objects.equals(this.payRunCalendar, payRunCalendarObject.payRunCalendar); + return Objects.equals(this.pagination, payRunCalendarObject.pagination) && + Objects.equals(this.problem, payRunCalendarObject.problem) && + Objects.equals(this.payRunCalendar, payRunCalendarObject.payRunCalendar); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRunCalendar); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PayRunCalendars.java b/src/main/java/com/xero/models/payrollnz/PayRunCalendars.java index 93c43e317..b622f9ac5 100644 --- a/src/main/java/com/xero/models/payrollnz/PayRunCalendars.java +++ b/src/main/java/com/xero/models/payrollnz/PayRunCalendars.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.PayRunCalendar; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunCalendars + */ -/** PayRunCalendars */ public class PayRunCalendars { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class PayRunCalendars { @JsonProperty("payRunCalendars") private List payRunCalendars = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return PayRunCalendars - */ + * pagination + * @param pagination Pagination + * @return PayRunCalendars + **/ public PayRunCalendars pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRunCalendars - */ + * problem + * @param problem Problem + * @return PayRunCalendars + **/ public PayRunCalendars problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRunCalendars - * - * @param payRunCalendars List<PayRunCalendar> - * @return PayRunCalendars - */ + * payRunCalendars + * @param payRunCalendars List<PayRunCalendar> + * @return PayRunCalendars + **/ public PayRunCalendars payRunCalendars(List payRunCalendars) { this.payRunCalendars = payRunCalendars; return this; @@ -113,10 +126,9 @@ public PayRunCalendars payRunCalendars(List payRunCalendars) { /** * payRunCalendars - * - * @param payRunCalendarsItem PayRunCalendar + * @param payRunCalendarsItem PayRunCalendar * @return PayRunCalendars - */ + **/ public PayRunCalendars addPayRunCalendarsItem(PayRunCalendar payRunCalendarsItem) { if (this.payRunCalendars == null) { this.payRunCalendars = new ArrayList(); @@ -125,30 +137,29 @@ public PayRunCalendars addPayRunCalendarsItem(PayRunCalendar payRunCalendarsItem return this; } - /** + /** * Get payRunCalendars - * * @return payRunCalendars - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRunCalendars - * * @return payRunCalendars List - */ + **/ public List getPayRunCalendars() { return payRunCalendars; } - /** - * payRunCalendars - * - * @param payRunCalendars List<PayRunCalendar> - */ + /** + * payRunCalendars + * @param payRunCalendars List<PayRunCalendar> + **/ + public void setPayRunCalendars(List payRunCalendars) { this.payRunCalendars = payRunCalendars; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRunCalendars payRunCalendars = (PayRunCalendars) o; - return Objects.equals(this.pagination, payRunCalendars.pagination) - && Objects.equals(this.problem, payRunCalendars.problem) - && Objects.equals(this.payRunCalendars, payRunCalendars.payRunCalendars); + return Objects.equals(this.pagination, payRunCalendars.pagination) && + Objects.equals(this.problem, payRunCalendars.problem) && + Objects.equals(this.payRunCalendars, payRunCalendars.payRunCalendars); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRunCalendars); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PayRunObject.java b/src/main/java/com/xero/models/payrollnz/PayRunObject.java index 096d0a4bf..dd0a3f44c 100644 --- a/src/main/java/com/xero/models/payrollnz/PayRunObject.java +++ b/src/main/java/com/xero/models/payrollnz/PayRunObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.PayRun; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunObject + */ -/** PayRunObject */ public class PayRunObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PayRunObject { @JsonProperty("payRun") private PayRun payRun; /** - * pagination - * - * @param pagination Pagination - * @return PayRunObject - */ + * pagination + * @param pagination Pagination + * @return PayRunObject + **/ public PayRunObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRunObject - */ + * problem + * @param problem Problem + * @return PayRunObject + **/ public PayRunObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRun - * - * @param payRun PayRun - * @return PayRunObject - */ + * payRun + * @param payRun PayRun + * @return PayRunObject + **/ public PayRunObject payRun(PayRun payRun) { this.payRun = payRun; return this; } - /** + /** * Get payRun - * * @return payRun - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRun - * * @return payRun PayRun - */ + **/ public PayRun getPayRun() { return payRun; } - /** - * payRun - * - * @param payRun PayRun - */ + /** + * payRun + * @param payRun PayRun + **/ + public void setPayRun(PayRun payRun) { this.payRun = payRun; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRunObject payRunObject = (PayRunObject) o; - return Objects.equals(this.pagination, payRunObject.pagination) - && Objects.equals(this.problem, payRunObject.problem) - && Objects.equals(this.payRun, payRunObject.payRun); + return Objects.equals(this.pagination, payRunObject.pagination) && + Objects.equals(this.problem, payRunObject.problem) && + Objects.equals(this.payRun, payRunObject.payRun); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRun); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PayRuns.java b/src/main/java/com/xero/models/payrollnz/PayRuns.java index 5c6ff244e..617402d1d 100644 --- a/src/main/java/com/xero/models/payrollnz/PayRuns.java +++ b/src/main/java/com/xero/models/payrollnz/PayRuns.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.PayRun; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRuns + */ -/** PayRuns */ public class PayRuns { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class PayRuns { @JsonProperty("payRuns") private List payRuns = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return PayRuns - */ + * pagination + * @param pagination Pagination + * @return PayRuns + **/ public PayRuns pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRuns - */ + * problem + * @param problem Problem + * @return PayRuns + **/ public PayRuns problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRuns - * - * @param payRuns List<PayRun> - * @return PayRuns - */ + * payRuns + * @param payRuns List<PayRun> + * @return PayRuns + **/ public PayRuns payRuns(List payRuns) { this.payRuns = payRuns; return this; @@ -113,10 +126,9 @@ public PayRuns payRuns(List payRuns) { /** * payRuns - * - * @param payRunsItem PayRun + * @param payRunsItem PayRun * @return PayRuns - */ + **/ public PayRuns addPayRunsItem(PayRun payRunsItem) { if (this.payRuns == null) { this.payRuns = new ArrayList(); @@ -125,30 +137,29 @@ public PayRuns addPayRunsItem(PayRun payRunsItem) { return this; } - /** + /** * Get payRuns - * * @return payRuns - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRuns - * * @return payRuns List - */ + **/ public List getPayRuns() { return payRuns; } - /** - * payRuns - * - * @param payRuns List<PayRun> - */ + /** + * payRuns + * @param payRuns List<PayRun> + **/ + public void setPayRuns(List payRuns) { this.payRuns = payRuns; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRuns payRuns = (PayRuns) o; - return Objects.equals(this.pagination, payRuns.pagination) - && Objects.equals(this.problem, payRuns.problem) - && Objects.equals(this.payRuns, payRuns.payRuns); + return Objects.equals(this.pagination, payRuns.pagination) && + Objects.equals(this.problem, payRuns.problem) && + Objects.equals(this.payRuns, payRuns.payRuns); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRuns); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PaySlip.java b/src/main/java/com/xero/models/payrollnz/PaySlip.java index eef573e33..a2725ab39 100644 --- a/src/main/java/com/xero/models/payrollnz/PaySlip.java +++ b/src/main/java/com/xero/models/payrollnz/PaySlip.java @@ -9,20 +9,47 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollnz.DeductionLine; +import com.xero.models.payrollnz.EarningsLine; +import com.xero.models.payrollnz.GrossEarningsHistory; +import com.xero.models.payrollnz.LeaveAccrualLine; +import com.xero.models.payrollnz.LeaveEarningsLine; +import com.xero.models.payrollnz.PaymentLine; +import com.xero.models.payrollnz.ReimbursementLine; +import com.xero.models.payrollnz.StatutoryDeductionLine; +import com.xero.models.payrollnz.SuperannuationLine; +import com.xero.models.payrollnz.TaxLine; +import com.xero.models.payrollnz.TaxSettings; +import com.xero.models.payrollnz.TimesheetEarningsLine; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaySlip + */ -/** PaySlip */ public class PaySlip { StringUtil util = new StringUtil(); @@ -73,15 +100,23 @@ public class PaySlip { @JsonProperty("bacsHash") private String bacsHash; - /** The payment method code */ + /** + * The payment method code + */ public enum PaymentMethodEnum { - /** CHEQUE */ + /** + * CHEQUE + */ CHEQUE("Cheque"), - - /** ELECTRONICALLY */ + + /** + * ELECTRONICALLY + */ ELECTRONICALLY("Electronically"), - - /** MANUAL */ + + /** + * MANUAL + */ MANUAL("Manual"); private String value; @@ -90,31 +125,25 @@ public enum PaymentMethodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PaymentMethodEnum fromValue(String value) { for (PaymentMethodEnum b : PaymentMethodEnum.values()) { @@ -126,6 +155,7 @@ public static PaymentMethodEnum fromValue(String value) { } } + @JsonProperty("paymentMethod") private PaymentMethodEnum paymentMethod; @@ -136,8 +166,7 @@ public static PaymentMethodEnum fromValue(String value) { private List leaveEarningsLines = new ArrayList(); @JsonProperty("timesheetEarningsLines") - private List timesheetEarningsLines = - new ArrayList(); + private List timesheetEarningsLines = new ArrayList(); @JsonProperty("deductionLines") private List deductionLines = new ArrayList(); @@ -161,8 +190,7 @@ public static PaymentMethodEnum fromValue(String value) { private List employerTaxLines = new ArrayList(); @JsonProperty("statutoryDeductionLines") - private List statutoryDeductionLines = - new ArrayList(); + private List statutoryDeductionLines = new ArrayList(); @JsonProperty("taxSettings") private TaxSettings taxSettings; @@ -170,623 +198,554 @@ public static PaymentMethodEnum fromValue(String value) { @JsonProperty("grossEarningsHistory") private GrossEarningsHistory grossEarningsHistory; /** - * The Xero identifier for a PaySlip - * - * @param paySlipID UUID - * @return PaySlip - */ + * The Xero identifier for a PaySlip + * @param paySlipID UUID + * @return PaySlip + **/ public PaySlip paySlipID(UUID paySlipID) { this.paySlipID = paySlipID; return this; } - /** + /** * The Xero identifier for a PaySlip - * * @return paySlipID - */ + **/ @ApiModelProperty(value = "The Xero identifier for a PaySlip") - /** + /** * The Xero identifier for a PaySlip - * * @return paySlipID UUID - */ + **/ public UUID getPaySlipID() { return paySlipID; } - /** - * The Xero identifier for a PaySlip - * - * @param paySlipID UUID - */ + /** + * The Xero identifier for a PaySlip + * @param paySlipID UUID + **/ + public void setPaySlipID(UUID paySlipID) { this.paySlipID = paySlipID; } /** - * The Xero identifier for payroll employee - * - * @param employeeID UUID - * @return PaySlip - */ + * The Xero identifier for payroll employee + * @param employeeID UUID + * @return PaySlip + **/ public PaySlip employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for payroll employee - * * @return employeeID - */ + **/ @ApiModelProperty(value = "The Xero identifier for payroll employee") - /** + /** * The Xero identifier for payroll employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for payroll employee - * - * @param employeeID UUID - */ + /** + * The Xero identifier for payroll employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The Xero identifier for the associated payrun - * - * @param payRunID UUID - * @return PaySlip - */ + * The Xero identifier for the associated payrun + * @param payRunID UUID + * @return PaySlip + **/ public PaySlip payRunID(UUID payRunID) { this.payRunID = payRunID; return this; } - /** + /** * The Xero identifier for the associated payrun - * * @return payRunID - */ + **/ @ApiModelProperty(value = "The Xero identifier for the associated payrun") - /** + /** * The Xero identifier for the associated payrun - * * @return payRunID UUID - */ + **/ public UUID getPayRunID() { return payRunID; } - /** - * The Xero identifier for the associated payrun - * - * @param payRunID UUID - */ + /** + * The Xero identifier for the associated payrun + * @param payRunID UUID + **/ + public void setPayRunID(UUID payRunID) { this.payRunID = payRunID; } /** - * The date payslip was last updated - * - * @param lastEdited LocalDateTime - * @return PaySlip - */ + * The date payslip was last updated + * @param lastEdited LocalDateTime + * @return PaySlip + **/ public PaySlip lastEdited(LocalDateTime lastEdited) { this.lastEdited = lastEdited; return this; } - /** + /** * The date payslip was last updated - * * @return lastEdited - */ + **/ @ApiModelProperty(value = "The date payslip was last updated") - /** + /** * The date payslip was last updated - * * @return lastEdited LocalDateTime - */ + **/ public LocalDateTime getLastEdited() { return lastEdited; } - /** - * The date payslip was last updated - * - * @param lastEdited LocalDateTime - */ + /** + * The date payslip was last updated + * @param lastEdited LocalDateTime + **/ + public void setLastEdited(LocalDateTime lastEdited) { this.lastEdited = lastEdited; } /** - * Employee first name - * - * @param firstName String - * @return PaySlip - */ + * Employee first name + * @param firstName String + * @return PaySlip + **/ public PaySlip firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * Employee first name - * * @return firstName - */ + **/ @ApiModelProperty(value = "Employee first name") - /** + /** * Employee first name - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * Employee first name - * - * @param firstName String - */ + /** + * Employee first name + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Employee last name - * - * @param lastName String - * @return PaySlip - */ + * Employee last name + * @param lastName String + * @return PaySlip + **/ public PaySlip lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Employee last name - * * @return lastName - */ + **/ @ApiModelProperty(value = "Employee last name") - /** + /** * Employee last name - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Employee last name - * - * @param lastName String - */ + /** + * Employee last name + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Total earnings before any deductions. Same as gross earnings for NZ. - * - * @param totalEarnings Double - * @return PaySlip - */ + * Total earnings before any deductions. Same as gross earnings for NZ. + * @param totalEarnings Double + * @return PaySlip + **/ public PaySlip totalEarnings(Double totalEarnings) { this.totalEarnings = totalEarnings; return this; } - /** + /** * Total earnings before any deductions. Same as gross earnings for NZ. - * * @return totalEarnings - */ + **/ @ApiModelProperty(value = "Total earnings before any deductions. Same as gross earnings for NZ.") - /** + /** * Total earnings before any deductions. Same as gross earnings for NZ. - * * @return totalEarnings Double - */ + **/ public Double getTotalEarnings() { return totalEarnings; } - /** - * Total earnings before any deductions. Same as gross earnings for NZ. - * - * @param totalEarnings Double - */ + /** + * Total earnings before any deductions. Same as gross earnings for NZ. + * @param totalEarnings Double + **/ + public void setTotalEarnings(Double totalEarnings) { this.totalEarnings = totalEarnings; } /** - * Total earnings before any deductions. Same as total earnings for NZ. - * - * @param grossEarnings Double - * @return PaySlip - */ + * Total earnings before any deductions. Same as total earnings for NZ. + * @param grossEarnings Double + * @return PaySlip + **/ public PaySlip grossEarnings(Double grossEarnings) { this.grossEarnings = grossEarnings; return this; } - /** + /** * Total earnings before any deductions. Same as total earnings for NZ. - * * @return grossEarnings - */ + **/ @ApiModelProperty(value = "Total earnings before any deductions. Same as total earnings for NZ.") - /** + /** * Total earnings before any deductions. Same as total earnings for NZ. - * * @return grossEarnings Double - */ + **/ public Double getGrossEarnings() { return grossEarnings; } - /** - * Total earnings before any deductions. Same as total earnings for NZ. - * - * @param grossEarnings Double - */ + /** + * Total earnings before any deductions. Same as total earnings for NZ. + * @param grossEarnings Double + **/ + public void setGrossEarnings(Double grossEarnings) { this.grossEarnings = grossEarnings; } /** - * The employee net pay - * - * @param totalPay Double - * @return PaySlip - */ + * The employee net pay + * @param totalPay Double + * @return PaySlip + **/ public PaySlip totalPay(Double totalPay) { this.totalPay = totalPay; return this; } - /** + /** * The employee net pay - * * @return totalPay - */ + **/ @ApiModelProperty(value = "The employee net pay") - /** + /** * The employee net pay - * * @return totalPay Double - */ + **/ public Double getTotalPay() { return totalPay; } - /** - * The employee net pay - * - * @param totalPay Double - */ + /** + * The employee net pay + * @param totalPay Double + **/ + public void setTotalPay(Double totalPay) { this.totalPay = totalPay; } /** - * The employer's tax obligation - * - * @param totalEmployerTaxes Double - * @return PaySlip - */ + * The employer's tax obligation + * @param totalEmployerTaxes Double + * @return PaySlip + **/ public PaySlip totalEmployerTaxes(Double totalEmployerTaxes) { this.totalEmployerTaxes = totalEmployerTaxes; return this; } - /** + /** * The employer's tax obligation - * * @return totalEmployerTaxes - */ + **/ @ApiModelProperty(value = "The employer's tax obligation") - /** + /** * The employer's tax obligation - * * @return totalEmployerTaxes Double - */ + **/ public Double getTotalEmployerTaxes() { return totalEmployerTaxes; } - /** - * The employer's tax obligation - * - * @param totalEmployerTaxes Double - */ + /** + * The employer's tax obligation + * @param totalEmployerTaxes Double + **/ + public void setTotalEmployerTaxes(Double totalEmployerTaxes) { this.totalEmployerTaxes = totalEmployerTaxes; } /** - * The part of an employee's earnings that is deducted for tax purposes - * - * @param totalEmployeeTaxes Double - * @return PaySlip - */ + * The part of an employee's earnings that is deducted for tax purposes + * @param totalEmployeeTaxes Double + * @return PaySlip + **/ public PaySlip totalEmployeeTaxes(Double totalEmployeeTaxes) { this.totalEmployeeTaxes = totalEmployeeTaxes; return this; } - /** + /** * The part of an employee's earnings that is deducted for tax purposes - * * @return totalEmployeeTaxes - */ + **/ @ApiModelProperty(value = "The part of an employee's earnings that is deducted for tax purposes") - /** + /** * The part of an employee's earnings that is deducted for tax purposes - * * @return totalEmployeeTaxes Double - */ + **/ public Double getTotalEmployeeTaxes() { return totalEmployeeTaxes; } - /** - * The part of an employee's earnings that is deducted for tax purposes - * - * @param totalEmployeeTaxes Double - */ + /** + * The part of an employee's earnings that is deducted for tax purposes + * @param totalEmployeeTaxes Double + **/ + public void setTotalEmployeeTaxes(Double totalEmployeeTaxes) { this.totalEmployeeTaxes = totalEmployeeTaxes; } /** - * Total amount subtracted from an employee's earnings to reach total pay - * - * @param totalDeductions Double - * @return PaySlip - */ + * Total amount subtracted from an employee's earnings to reach total pay + * @param totalDeductions Double + * @return PaySlip + **/ public PaySlip totalDeductions(Double totalDeductions) { this.totalDeductions = totalDeductions; return this; } - /** + /** * Total amount subtracted from an employee's earnings to reach total pay - * * @return totalDeductions - */ - @ApiModelProperty( - value = "Total amount subtracted from an employee's earnings to reach total pay") - /** + **/ + @ApiModelProperty(value = "Total amount subtracted from an employee's earnings to reach total pay") + /** * Total amount subtracted from an employee's earnings to reach total pay - * * @return totalDeductions Double - */ + **/ public Double getTotalDeductions() { return totalDeductions; } - /** - * Total amount subtracted from an employee's earnings to reach total pay - * - * @param totalDeductions Double - */ + /** + * Total amount subtracted from an employee's earnings to reach total pay + * @param totalDeductions Double + **/ + public void setTotalDeductions(Double totalDeductions) { this.totalDeductions = totalDeductions; } /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * - * @param totalReimbursements Double - * @return PaySlip - */ + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + * @param totalReimbursements Double + * @return PaySlip + **/ public PaySlip totalReimbursements(Double totalReimbursements) { this.totalReimbursements = totalReimbursements; return this; } - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment * @return totalReimbursements - */ - @ApiModelProperty( - value = - "Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket" - + " expenses when the person incurs those expenses through employment") - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * + **/ + @ApiModelProperty(value = "Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment") + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment * @return totalReimbursements Double - */ + **/ public Double getTotalReimbursements() { return totalReimbursements; } - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * - * @param totalReimbursements Double - */ + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + * @param totalReimbursements Double + **/ + public void setTotalReimbursements(Double totalReimbursements) { this.totalReimbursements = totalReimbursements; } /** - * Total amounts required by law to subtract from the employee's earnings - * - * @param totalStatutoryDeductions Double - * @return PaySlip - */ + * Total amounts required by law to subtract from the employee's earnings + * @param totalStatutoryDeductions Double + * @return PaySlip + **/ public PaySlip totalStatutoryDeductions(Double totalStatutoryDeductions) { this.totalStatutoryDeductions = totalStatutoryDeductions; return this; } - /** + /** * Total amounts required by law to subtract from the employee's earnings - * * @return totalStatutoryDeductions - */ - @ApiModelProperty( - value = "Total amounts required by law to subtract from the employee's earnings") - /** + **/ + @ApiModelProperty(value = "Total amounts required by law to subtract from the employee's earnings") + /** * Total amounts required by law to subtract from the employee's earnings - * * @return totalStatutoryDeductions Double - */ + **/ public Double getTotalStatutoryDeductions() { return totalStatutoryDeductions; } - /** - * Total amounts required by law to subtract from the employee's earnings - * - * @param totalStatutoryDeductions Double - */ + /** + * Total amounts required by law to subtract from the employee's earnings + * @param totalStatutoryDeductions Double + **/ + public void setTotalStatutoryDeductions(Double totalStatutoryDeductions) { this.totalStatutoryDeductions = totalStatutoryDeductions; } /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * - * @param totalSuperannuation Double - * @return PaySlip - */ + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + * @param totalSuperannuation Double + * @return PaySlip + **/ public PaySlip totalSuperannuation(Double totalSuperannuation) { this.totalSuperannuation = totalSuperannuation; return this; } - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries * @return totalSuperannuation - */ - @ApiModelProperty( - value = - "Benefits (also called fringe benefits, perquisites or perks) are various non-earnings" - + " compensations provided to employees in addition to their normal earnings or" - + " salaries") - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * + **/ + @ApiModelProperty(value = "Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries") + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries * @return totalSuperannuation Double - */ + **/ public Double getTotalSuperannuation() { return totalSuperannuation; } - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * - * @param totalSuperannuation Double - */ + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + * @param totalSuperannuation Double + **/ + public void setTotalSuperannuation(Double totalSuperannuation) { this.totalSuperannuation = totalSuperannuation; } /** - * BACS Service User Number - * - * @param bacsHash String - * @return PaySlip - */ + * BACS Service User Number + * @param bacsHash String + * @return PaySlip + **/ public PaySlip bacsHash(String bacsHash) { this.bacsHash = bacsHash; return this; } - /** + /** * BACS Service User Number - * * @return bacsHash - */ + **/ @ApiModelProperty(value = "BACS Service User Number") - /** + /** * BACS Service User Number - * * @return bacsHash String - */ + **/ public String getBacsHash() { return bacsHash; } - /** - * BACS Service User Number - * - * @param bacsHash String - */ + /** + * BACS Service User Number + * @param bacsHash String + **/ + public void setBacsHash(String bacsHash) { this.bacsHash = bacsHash; } /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - * @return PaySlip - */ + * The payment method code + * @param paymentMethod PaymentMethodEnum + * @return PaySlip + **/ public PaySlip paymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; return this; } - /** + /** * The payment method code - * * @return paymentMethod - */ + **/ @ApiModelProperty(value = "The payment method code") - /** + /** * The payment method code - * * @return paymentMethod PaymentMethodEnum - */ + **/ public PaymentMethodEnum getPaymentMethod() { return paymentMethod; } - /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - */ + /** + * The payment method code + * @param paymentMethod PaymentMethodEnum + **/ + public void setPaymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; } /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - * @return PaySlip - */ + * earningsLines + * @param earningsLines List<EarningsLine> + * @return PaySlip + **/ public PaySlip earningsLines(List earningsLines) { this.earningsLines = earningsLines; return this; @@ -794,10 +753,9 @@ public PaySlip earningsLines(List earningsLines) { /** * earningsLines - * - * @param earningsLinesItem EarningsLine + * @param earningsLinesItem EarningsLine * @return PaySlip - */ + **/ public PaySlip addEarningsLinesItem(EarningsLine earningsLinesItem) { if (this.earningsLines == null) { this.earningsLines = new ArrayList(); @@ -806,36 +764,33 @@ public PaySlip addEarningsLinesItem(EarningsLine earningsLinesItem) { return this; } - /** + /** * Get earningsLines - * * @return earningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsLines - * * @return earningsLines List - */ + **/ public List getEarningsLines() { return earningsLines; } - /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - */ + /** + * earningsLines + * @param earningsLines List<EarningsLine> + **/ + public void setEarningsLines(List earningsLines) { this.earningsLines = earningsLines; } /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - * @return PaySlip - */ + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + * @return PaySlip + **/ public PaySlip leaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; return this; @@ -843,10 +798,9 @@ public PaySlip leaveEarningsLines(List leaveEarningsLines) { /** * leaveEarningsLines - * - * @param leaveEarningsLinesItem LeaveEarningsLine + * @param leaveEarningsLinesItem LeaveEarningsLine * @return PaySlip - */ + **/ public PaySlip addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLinesItem) { if (this.leaveEarningsLines == null) { this.leaveEarningsLines = new ArrayList(); @@ -855,36 +809,33 @@ public PaySlip addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLinesIte return this; } - /** + /** * Get leaveEarningsLines - * * @return leaveEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveEarningsLines - * * @return leaveEarningsLines List - */ + **/ public List getLeaveEarningsLines() { return leaveEarningsLines; } - /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - */ + /** + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + **/ + public void setLeaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; } /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<TimesheetEarningsLine> - * @return PaySlip - */ + * timesheetEarningsLines + * @param timesheetEarningsLines List<TimesheetEarningsLine> + * @return PaySlip + **/ public PaySlip timesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; return this; @@ -892,10 +843,9 @@ public PaySlip timesheetEarningsLines(List timesheetEarni /** * timesheetEarningsLines - * - * @param timesheetEarningsLinesItem TimesheetEarningsLine + * @param timesheetEarningsLinesItem TimesheetEarningsLine * @return PaySlip - */ + **/ public PaySlip addTimesheetEarningsLinesItem(TimesheetEarningsLine timesheetEarningsLinesItem) { if (this.timesheetEarningsLines == null) { this.timesheetEarningsLines = new ArrayList(); @@ -904,36 +854,33 @@ public PaySlip addTimesheetEarningsLinesItem(TimesheetEarningsLine timesheetEarn return this; } - /** + /** * Get timesheetEarningsLines - * * @return timesheetEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetEarningsLines - * * @return timesheetEarningsLines List - */ + **/ public List getTimesheetEarningsLines() { return timesheetEarningsLines; } - /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<TimesheetEarningsLine> - */ + /** + * timesheetEarningsLines + * @param timesheetEarningsLines List<TimesheetEarningsLine> + **/ + public void setTimesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; } /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - * @return PaySlip - */ + * deductionLines + * @param deductionLines List<DeductionLine> + * @return PaySlip + **/ public PaySlip deductionLines(List deductionLines) { this.deductionLines = deductionLines; return this; @@ -941,10 +888,9 @@ public PaySlip deductionLines(List deductionLines) { /** * deductionLines - * - * @param deductionLinesItem DeductionLine + * @param deductionLinesItem DeductionLine * @return PaySlip - */ + **/ public PaySlip addDeductionLinesItem(DeductionLine deductionLinesItem) { if (this.deductionLines == null) { this.deductionLines = new ArrayList(); @@ -953,36 +899,33 @@ public PaySlip addDeductionLinesItem(DeductionLine deductionLinesItem) { return this; } - /** + /** * Get deductionLines - * * @return deductionLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionLines - * * @return deductionLines List - */ + **/ public List getDeductionLines() { return deductionLines; } - /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - */ + /** + * deductionLines + * @param deductionLines List<DeductionLine> + **/ + public void setDeductionLines(List deductionLines) { this.deductionLines = deductionLines; } /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - * @return PaySlip - */ + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + * @return PaySlip + **/ public PaySlip reimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; return this; @@ -990,10 +933,9 @@ public PaySlip reimbursementLines(List reimbursementLines) { /** * reimbursementLines - * - * @param reimbursementLinesItem ReimbursementLine + * @param reimbursementLinesItem ReimbursementLine * @return PaySlip - */ + **/ public PaySlip addReimbursementLinesItem(ReimbursementLine reimbursementLinesItem) { if (this.reimbursementLines == null) { this.reimbursementLines = new ArrayList(); @@ -1002,36 +944,33 @@ public PaySlip addReimbursementLinesItem(ReimbursementLine reimbursementLinesIte return this; } - /** + /** * Get reimbursementLines - * * @return reimbursementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementLines - * * @return reimbursementLines List - */ + **/ public List getReimbursementLines() { return reimbursementLines; } - /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - */ + /** + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + **/ + public void setReimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; } /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - * @return PaySlip - */ + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + * @return PaySlip + **/ public PaySlip leaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; return this; @@ -1039,10 +978,9 @@ public PaySlip leaveAccrualLines(List leaveAccrualLines) { /** * leaveAccrualLines - * - * @param leaveAccrualLinesItem LeaveAccrualLine + * @param leaveAccrualLinesItem LeaveAccrualLine * @return PaySlip - */ + **/ public PaySlip addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesItem) { if (this.leaveAccrualLines == null) { this.leaveAccrualLines = new ArrayList(); @@ -1051,36 +989,33 @@ public PaySlip addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesItem) return this; } - /** + /** * Get leaveAccrualLines - * * @return leaveAccrualLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveAccrualLines - * * @return leaveAccrualLines List - */ + **/ public List getLeaveAccrualLines() { return leaveAccrualLines; } - /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - */ + /** + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + **/ + public void setLeaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; } /** - * superannuationLines - * - * @param superannuationLines List<SuperannuationLine> - * @return PaySlip - */ + * superannuationLines + * @param superannuationLines List<SuperannuationLine> + * @return PaySlip + **/ public PaySlip superannuationLines(List superannuationLines) { this.superannuationLines = superannuationLines; return this; @@ -1088,10 +1023,9 @@ public PaySlip superannuationLines(List superannuationLines) /** * superannuationLines - * - * @param superannuationLinesItem SuperannuationLine + * @param superannuationLinesItem SuperannuationLine * @return PaySlip - */ + **/ public PaySlip addSuperannuationLinesItem(SuperannuationLine superannuationLinesItem) { if (this.superannuationLines == null) { this.superannuationLines = new ArrayList(); @@ -1100,36 +1034,33 @@ public PaySlip addSuperannuationLinesItem(SuperannuationLine superannuationLines return this; } - /** + /** * Get superannuationLines - * * @return superannuationLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * superannuationLines - * * @return superannuationLines List - */ + **/ public List getSuperannuationLines() { return superannuationLines; } - /** - * superannuationLines - * - * @param superannuationLines List<SuperannuationLine> - */ + /** + * superannuationLines + * @param superannuationLines List<SuperannuationLine> + **/ + public void setSuperannuationLines(List superannuationLines) { this.superannuationLines = superannuationLines; } /** - * paymentLines - * - * @param paymentLines List<PaymentLine> - * @return PaySlip - */ + * paymentLines + * @param paymentLines List<PaymentLine> + * @return PaySlip + **/ public PaySlip paymentLines(List paymentLines) { this.paymentLines = paymentLines; return this; @@ -1137,10 +1068,9 @@ public PaySlip paymentLines(List paymentLines) { /** * paymentLines - * - * @param paymentLinesItem PaymentLine + * @param paymentLinesItem PaymentLine * @return PaySlip - */ + **/ public PaySlip addPaymentLinesItem(PaymentLine paymentLinesItem) { if (this.paymentLines == null) { this.paymentLines = new ArrayList(); @@ -1149,36 +1079,33 @@ public PaySlip addPaymentLinesItem(PaymentLine paymentLinesItem) { return this; } - /** + /** * Get paymentLines - * * @return paymentLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * paymentLines - * * @return paymentLines List - */ + **/ public List getPaymentLines() { return paymentLines; } - /** - * paymentLines - * - * @param paymentLines List<PaymentLine> - */ + /** + * paymentLines + * @param paymentLines List<PaymentLine> + **/ + public void setPaymentLines(List paymentLines) { this.paymentLines = paymentLines; } /** - * employeeTaxLines - * - * @param employeeTaxLines List<TaxLine> - * @return PaySlip - */ + * employeeTaxLines + * @param employeeTaxLines List<TaxLine> + * @return PaySlip + **/ public PaySlip employeeTaxLines(List employeeTaxLines) { this.employeeTaxLines = employeeTaxLines; return this; @@ -1186,10 +1113,9 @@ public PaySlip employeeTaxLines(List employeeTaxLines) { /** * employeeTaxLines - * - * @param employeeTaxLinesItem TaxLine + * @param employeeTaxLinesItem TaxLine * @return PaySlip - */ + **/ public PaySlip addEmployeeTaxLinesItem(TaxLine employeeTaxLinesItem) { if (this.employeeTaxLines == null) { this.employeeTaxLines = new ArrayList(); @@ -1198,36 +1124,33 @@ public PaySlip addEmployeeTaxLinesItem(TaxLine employeeTaxLinesItem) { return this; } - /** + /** * Get employeeTaxLines - * * @return employeeTaxLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * employeeTaxLines - * * @return employeeTaxLines List - */ + **/ public List getEmployeeTaxLines() { return employeeTaxLines; } - /** - * employeeTaxLines - * - * @param employeeTaxLines List<TaxLine> - */ + /** + * employeeTaxLines + * @param employeeTaxLines List<TaxLine> + **/ + public void setEmployeeTaxLines(List employeeTaxLines) { this.employeeTaxLines = employeeTaxLines; } /** - * employerTaxLines - * - * @param employerTaxLines List<TaxLine> - * @return PaySlip - */ + * employerTaxLines + * @param employerTaxLines List<TaxLine> + * @return PaySlip + **/ public PaySlip employerTaxLines(List employerTaxLines) { this.employerTaxLines = employerTaxLines; return this; @@ -1235,10 +1158,9 @@ public PaySlip employerTaxLines(List employerTaxLines) { /** * employerTaxLines - * - * @param employerTaxLinesItem TaxLine + * @param employerTaxLinesItem TaxLine * @return PaySlip - */ + **/ public PaySlip addEmployerTaxLinesItem(TaxLine employerTaxLinesItem) { if (this.employerTaxLines == null) { this.employerTaxLines = new ArrayList(); @@ -1247,36 +1169,33 @@ public PaySlip addEmployerTaxLinesItem(TaxLine employerTaxLinesItem) { return this; } - /** + /** * Get employerTaxLines - * * @return employerTaxLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * employerTaxLines - * * @return employerTaxLines List - */ + **/ public List getEmployerTaxLines() { return employerTaxLines; } - /** - * employerTaxLines - * - * @param employerTaxLines List<TaxLine> - */ + /** + * employerTaxLines + * @param employerTaxLines List<TaxLine> + **/ + public void setEmployerTaxLines(List employerTaxLines) { this.employerTaxLines = employerTaxLines; } /** - * statutoryDeductionLines - * - * @param statutoryDeductionLines List<StatutoryDeductionLine> - * @return PaySlip - */ + * statutoryDeductionLines + * @param statutoryDeductionLines List<StatutoryDeductionLine> + * @return PaySlip + **/ public PaySlip statutoryDeductionLines(List statutoryDeductionLines) { this.statutoryDeductionLines = statutoryDeductionLines; return this; @@ -1284,12 +1203,10 @@ public PaySlip statutoryDeductionLines(List statutoryDed /** * statutoryDeductionLines - * - * @param statutoryDeductionLinesItem StatutoryDeductionLine + * @param statutoryDeductionLinesItem StatutoryDeductionLine * @return PaySlip - */ - public PaySlip addStatutoryDeductionLinesItem( - StatutoryDeductionLine statutoryDeductionLinesItem) { + **/ + public PaySlip addStatutoryDeductionLinesItem(StatutoryDeductionLine statutoryDeductionLinesItem) { if (this.statutoryDeductionLines == null) { this.statutoryDeductionLines = new ArrayList(); } @@ -1297,100 +1214,93 @@ public PaySlip addStatutoryDeductionLinesItem( return this; } - /** + /** * Get statutoryDeductionLines - * * @return statutoryDeductionLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductionLines - * * @return statutoryDeductionLines List - */ + **/ public List getStatutoryDeductionLines() { return statutoryDeductionLines; } - /** - * statutoryDeductionLines - * - * @param statutoryDeductionLines List<StatutoryDeductionLine> - */ + /** + * statutoryDeductionLines + * @param statutoryDeductionLines List<StatutoryDeductionLine> + **/ + public void setStatutoryDeductionLines(List statutoryDeductionLines) { this.statutoryDeductionLines = statutoryDeductionLines; } /** - * taxSettings - * - * @param taxSettings TaxSettings - * @return PaySlip - */ + * taxSettings + * @param taxSettings TaxSettings + * @return PaySlip + **/ public PaySlip taxSettings(TaxSettings taxSettings) { this.taxSettings = taxSettings; return this; } - /** + /** * Get taxSettings - * * @return taxSettings - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxSettings - * * @return taxSettings TaxSettings - */ + **/ public TaxSettings getTaxSettings() { return taxSettings; } - /** - * taxSettings - * - * @param taxSettings TaxSettings - */ + /** + * taxSettings + * @param taxSettings TaxSettings + **/ + public void setTaxSettings(TaxSettings taxSettings) { this.taxSettings = taxSettings; } /** - * grossEarningsHistory - * - * @param grossEarningsHistory GrossEarningsHistory - * @return PaySlip - */ + * grossEarningsHistory + * @param grossEarningsHistory GrossEarningsHistory + * @return PaySlip + **/ public PaySlip grossEarningsHistory(GrossEarningsHistory grossEarningsHistory) { this.grossEarningsHistory = grossEarningsHistory; return this; } - /** + /** * Get grossEarningsHistory - * * @return grossEarningsHistory - */ + **/ @ApiModelProperty(value = "") - /** + /** * grossEarningsHistory - * * @return grossEarningsHistory GrossEarningsHistory - */ + **/ public GrossEarningsHistory getGrossEarningsHistory() { return grossEarningsHistory; } - /** - * grossEarningsHistory - * - * @param grossEarningsHistory GrossEarningsHistory - */ + /** + * grossEarningsHistory + * @param grossEarningsHistory GrossEarningsHistory + **/ + public void setGrossEarningsHistory(GrossEarningsHistory grossEarningsHistory) { this.grossEarningsHistory = grossEarningsHistory; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1400,73 +1310,44 @@ public boolean equals(java.lang.Object o) { return false; } PaySlip paySlip = (PaySlip) o; - return Objects.equals(this.paySlipID, paySlip.paySlipID) - && Objects.equals(this.employeeID, paySlip.employeeID) - && Objects.equals(this.payRunID, paySlip.payRunID) - && Objects.equals(this.lastEdited, paySlip.lastEdited) - && Objects.equals(this.firstName, paySlip.firstName) - && Objects.equals(this.lastName, paySlip.lastName) - && Objects.equals(this.totalEarnings, paySlip.totalEarnings) - && Objects.equals(this.grossEarnings, paySlip.grossEarnings) - && Objects.equals(this.totalPay, paySlip.totalPay) - && Objects.equals(this.totalEmployerTaxes, paySlip.totalEmployerTaxes) - && Objects.equals(this.totalEmployeeTaxes, paySlip.totalEmployeeTaxes) - && Objects.equals(this.totalDeductions, paySlip.totalDeductions) - && Objects.equals(this.totalReimbursements, paySlip.totalReimbursements) - && Objects.equals(this.totalStatutoryDeductions, paySlip.totalStatutoryDeductions) - && Objects.equals(this.totalSuperannuation, paySlip.totalSuperannuation) - && Objects.equals(this.bacsHash, paySlip.bacsHash) - && Objects.equals(this.paymentMethod, paySlip.paymentMethod) - && Objects.equals(this.earningsLines, paySlip.earningsLines) - && Objects.equals(this.leaveEarningsLines, paySlip.leaveEarningsLines) - && Objects.equals(this.timesheetEarningsLines, paySlip.timesheetEarningsLines) - && Objects.equals(this.deductionLines, paySlip.deductionLines) - && Objects.equals(this.reimbursementLines, paySlip.reimbursementLines) - && Objects.equals(this.leaveAccrualLines, paySlip.leaveAccrualLines) - && Objects.equals(this.superannuationLines, paySlip.superannuationLines) - && Objects.equals(this.paymentLines, paySlip.paymentLines) - && Objects.equals(this.employeeTaxLines, paySlip.employeeTaxLines) - && Objects.equals(this.employerTaxLines, paySlip.employerTaxLines) - && Objects.equals(this.statutoryDeductionLines, paySlip.statutoryDeductionLines) - && Objects.equals(this.taxSettings, paySlip.taxSettings) - && Objects.equals(this.grossEarningsHistory, paySlip.grossEarningsHistory); + return Objects.equals(this.paySlipID, paySlip.paySlipID) && + Objects.equals(this.employeeID, paySlip.employeeID) && + Objects.equals(this.payRunID, paySlip.payRunID) && + Objects.equals(this.lastEdited, paySlip.lastEdited) && + Objects.equals(this.firstName, paySlip.firstName) && + Objects.equals(this.lastName, paySlip.lastName) && + Objects.equals(this.totalEarnings, paySlip.totalEarnings) && + Objects.equals(this.grossEarnings, paySlip.grossEarnings) && + Objects.equals(this.totalPay, paySlip.totalPay) && + Objects.equals(this.totalEmployerTaxes, paySlip.totalEmployerTaxes) && + Objects.equals(this.totalEmployeeTaxes, paySlip.totalEmployeeTaxes) && + Objects.equals(this.totalDeductions, paySlip.totalDeductions) && + Objects.equals(this.totalReimbursements, paySlip.totalReimbursements) && + Objects.equals(this.totalStatutoryDeductions, paySlip.totalStatutoryDeductions) && + Objects.equals(this.totalSuperannuation, paySlip.totalSuperannuation) && + Objects.equals(this.bacsHash, paySlip.bacsHash) && + Objects.equals(this.paymentMethod, paySlip.paymentMethod) && + Objects.equals(this.earningsLines, paySlip.earningsLines) && + Objects.equals(this.leaveEarningsLines, paySlip.leaveEarningsLines) && + Objects.equals(this.timesheetEarningsLines, paySlip.timesheetEarningsLines) && + Objects.equals(this.deductionLines, paySlip.deductionLines) && + Objects.equals(this.reimbursementLines, paySlip.reimbursementLines) && + Objects.equals(this.leaveAccrualLines, paySlip.leaveAccrualLines) && + Objects.equals(this.superannuationLines, paySlip.superannuationLines) && + Objects.equals(this.paymentLines, paySlip.paymentLines) && + Objects.equals(this.employeeTaxLines, paySlip.employeeTaxLines) && + Objects.equals(this.employerTaxLines, paySlip.employerTaxLines) && + Objects.equals(this.statutoryDeductionLines, paySlip.statutoryDeductionLines) && + Objects.equals(this.taxSettings, paySlip.taxSettings) && + Objects.equals(this.grossEarningsHistory, paySlip.grossEarningsHistory); } @Override public int hashCode() { - return Objects.hash( - paySlipID, - employeeID, - payRunID, - lastEdited, - firstName, - lastName, - totalEarnings, - grossEarnings, - totalPay, - totalEmployerTaxes, - totalEmployeeTaxes, - totalDeductions, - totalReimbursements, - totalStatutoryDeductions, - totalSuperannuation, - bacsHash, - paymentMethod, - earningsLines, - leaveEarningsLines, - timesheetEarningsLines, - deductionLines, - reimbursementLines, - leaveAccrualLines, - superannuationLines, - paymentLines, - employeeTaxLines, - employerTaxLines, - statutoryDeductionLines, - taxSettings, - grossEarningsHistory); + return Objects.hash(paySlipID, employeeID, payRunID, lastEdited, firstName, lastName, totalEarnings, grossEarnings, totalPay, totalEmployerTaxes, totalEmployeeTaxes, totalDeductions, totalReimbursements, totalStatutoryDeductions, totalSuperannuation, bacsHash, paymentMethod, earningsLines, leaveEarningsLines, timesheetEarningsLines, deductionLines, reimbursementLines, leaveAccrualLines, superannuationLines, paymentLines, employeeTaxLines, employerTaxLines, statutoryDeductionLines, taxSettings, grossEarningsHistory); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1483,44 +1364,31 @@ public String toString() { sb.append(" totalEmployerTaxes: ").append(toIndentedString(totalEmployerTaxes)).append("\n"); sb.append(" totalEmployeeTaxes: ").append(toIndentedString(totalEmployeeTaxes)).append("\n"); sb.append(" totalDeductions: ").append(toIndentedString(totalDeductions)).append("\n"); - sb.append(" totalReimbursements: ") - .append(toIndentedString(totalReimbursements)) - .append("\n"); - sb.append(" totalStatutoryDeductions: ") - .append(toIndentedString(totalStatutoryDeductions)) - .append("\n"); - sb.append(" totalSuperannuation: ") - .append(toIndentedString(totalSuperannuation)) - .append("\n"); + sb.append(" totalReimbursements: ").append(toIndentedString(totalReimbursements)).append("\n"); + sb.append(" totalStatutoryDeductions: ").append(toIndentedString(totalStatutoryDeductions)).append("\n"); + sb.append(" totalSuperannuation: ").append(toIndentedString(totalSuperannuation)).append("\n"); sb.append(" bacsHash: ").append(toIndentedString(bacsHash)).append("\n"); sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" earningsLines: ").append(toIndentedString(earningsLines)).append("\n"); sb.append(" leaveEarningsLines: ").append(toIndentedString(leaveEarningsLines)).append("\n"); - sb.append(" timesheetEarningsLines: ") - .append(toIndentedString(timesheetEarningsLines)) - .append("\n"); + sb.append(" timesheetEarningsLines: ").append(toIndentedString(timesheetEarningsLines)).append("\n"); sb.append(" deductionLines: ").append(toIndentedString(deductionLines)).append("\n"); sb.append(" reimbursementLines: ").append(toIndentedString(reimbursementLines)).append("\n"); sb.append(" leaveAccrualLines: ").append(toIndentedString(leaveAccrualLines)).append("\n"); - sb.append(" superannuationLines: ") - .append(toIndentedString(superannuationLines)) - .append("\n"); + sb.append(" superannuationLines: ").append(toIndentedString(superannuationLines)).append("\n"); sb.append(" paymentLines: ").append(toIndentedString(paymentLines)).append("\n"); sb.append(" employeeTaxLines: ").append(toIndentedString(employeeTaxLines)).append("\n"); sb.append(" employerTaxLines: ").append(toIndentedString(employerTaxLines)).append("\n"); - sb.append(" statutoryDeductionLines: ") - .append(toIndentedString(statutoryDeductionLines)) - .append("\n"); + sb.append(" statutoryDeductionLines: ").append(toIndentedString(statutoryDeductionLines)).append("\n"); sb.append(" taxSettings: ").append(toIndentedString(taxSettings)).append("\n"); - sb.append(" grossEarningsHistory: ") - .append(toIndentedString(grossEarningsHistory)) - .append("\n"); + sb.append(" grossEarningsHistory: ").append(toIndentedString(grossEarningsHistory)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1528,4 +1396,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PaySlipObject.java b/src/main/java/com/xero/models/payrollnz/PaySlipObject.java index f84b65ff8..cbefc351e 100644 --- a/src/main/java/com/xero/models/payrollnz/PaySlipObject.java +++ b/src/main/java/com/xero/models/payrollnz/PaySlipObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.PaySlip; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaySlipObject + */ -/** PaySlipObject */ public class PaySlipObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PaySlipObject { @JsonProperty("paySlip") private PaySlip paySlip; /** - * pagination - * - * @param pagination Pagination - * @return PaySlipObject - */ + * pagination + * @param pagination Pagination + * @return PaySlipObject + **/ public PaySlipObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PaySlipObject - */ + * problem + * @param problem Problem + * @return PaySlipObject + **/ public PaySlipObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * paySlip - * - * @param paySlip PaySlip - * @return PaySlipObject - */ + * paySlip + * @param paySlip PaySlip + * @return PaySlipObject + **/ public PaySlipObject paySlip(PaySlip paySlip) { this.paySlip = paySlip; return this; } - /** + /** * Get paySlip - * * @return paySlip - */ + **/ @ApiModelProperty(value = "") - /** + /** * paySlip - * * @return paySlip PaySlip - */ + **/ public PaySlip getPaySlip() { return paySlip; } - /** - * paySlip - * - * @param paySlip PaySlip - */ + /** + * paySlip + * @param paySlip PaySlip + **/ + public void setPaySlip(PaySlip paySlip) { this.paySlip = paySlip; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PaySlipObject paySlipObject = (PaySlipObject) o; - return Objects.equals(this.pagination, paySlipObject.pagination) - && Objects.equals(this.problem, paySlipObject.problem) - && Objects.equals(this.paySlip, paySlipObject.paySlip); + return Objects.equals(this.pagination, paySlipObject.pagination) && + Objects.equals(this.problem, paySlipObject.problem) && + Objects.equals(this.paySlip, paySlipObject.paySlip); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, paySlip); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PaySlips.java b/src/main/java/com/xero/models/payrollnz/PaySlips.java index 7056e333e..35be9b0e5 100644 --- a/src/main/java/com/xero/models/payrollnz/PaySlips.java +++ b/src/main/java/com/xero/models/payrollnz/PaySlips.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.PaySlip; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaySlips + */ -/** PaySlips */ public class PaySlips { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class PaySlips { @JsonProperty("paySlips") private List paySlips = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return PaySlips - */ + * pagination + * @param pagination Pagination + * @return PaySlips + **/ public PaySlips pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PaySlips - */ + * problem + * @param problem Problem + * @return PaySlips + **/ public PaySlips problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * paySlips - * - * @param paySlips List<PaySlip> - * @return PaySlips - */ + * paySlips + * @param paySlips List<PaySlip> + * @return PaySlips + **/ public PaySlips paySlips(List paySlips) { this.paySlips = paySlips; return this; @@ -113,10 +126,9 @@ public PaySlips paySlips(List paySlips) { /** * paySlips - * - * @param paySlipsItem PaySlip + * @param paySlipsItem PaySlip * @return PaySlips - */ + **/ public PaySlips addPaySlipsItem(PaySlip paySlipsItem) { if (this.paySlips == null) { this.paySlips = new ArrayList(); @@ -125,30 +137,29 @@ public PaySlips addPaySlipsItem(PaySlip paySlipsItem) { return this; } - /** + /** * Get paySlips - * * @return paySlips - */ + **/ @ApiModelProperty(value = "") - /** + /** * paySlips - * * @return paySlips List - */ + **/ public List getPaySlips() { return paySlips; } - /** - * paySlips - * - * @param paySlips List<PaySlip> - */ + /** + * paySlips + * @param paySlips List<PaySlip> + **/ + public void setPaySlips(List paySlips) { this.paySlips = paySlips; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } PaySlips paySlips = (PaySlips) o; - return Objects.equals(this.pagination, paySlips.pagination) - && Objects.equals(this.problem, paySlips.problem) - && Objects.equals(this.paySlips, paySlips.paySlips); + return Objects.equals(this.pagination, paySlips.pagination) && + Objects.equals(this.problem, paySlips.problem) && + Objects.equals(this.paySlips, paySlips.paySlips); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, paySlips); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PaymentLine.java b/src/main/java/com/xero/models/payrollnz/PaymentLine.java index e6bf3e466..55748b64b 100644 --- a/src/main/java/com/xero/models/payrollnz/PaymentLine.java +++ b/src/main/java/com/xero/models/payrollnz/PaymentLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentLine + */ -/** PaymentLine */ public class PaymentLine { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class PaymentLine { @JsonProperty("accountName") private String accountName; /** - * Xero identifier for payroll payment line - * - * @param paymentLineID UUID - * @return PaymentLine - */ + * Xero identifier for payroll payment line + * @param paymentLineID UUID + * @return PaymentLine + **/ public PaymentLine paymentLineID(UUID paymentLineID) { this.paymentLineID = paymentLineID; return this; } - /** + /** * Xero identifier for payroll payment line - * * @return paymentLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll payment line") - /** + /** * Xero identifier for payroll payment line - * * @return paymentLineID UUID - */ + **/ public UUID getPaymentLineID() { return paymentLineID; } - /** - * Xero identifier for payroll payment line - * - * @param paymentLineID UUID - */ + /** + * Xero identifier for payroll payment line + * @param paymentLineID UUID + **/ + public void setPaymentLineID(UUID paymentLineID) { this.paymentLineID = paymentLineID; } /** - * The amount of the payment line - * - * @param amount Double - * @return PaymentLine - */ + * The amount of the payment line + * @param amount Double + * @return PaymentLine + **/ public PaymentLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the payment line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the payment line") - /** + /** * The amount of the payment line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the payment line - * - * @param amount Double - */ + /** + * The amount of the payment line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The account number - * - * @param accountNumber String - * @return PaymentLine - */ + * The account number + * @param accountNumber String + * @return PaymentLine + **/ public PaymentLine accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** + /** * The account number - * * @return accountNumber - */ + **/ @ApiModelProperty(value = "The account number") - /** + /** * The account number - * * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * The account number - * - * @param accountNumber String - */ + /** + * The account number + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * The account sort code - * - * @param sortCode String - * @return PaymentLine - */ + * The account sort code + * @param sortCode String + * @return PaymentLine + **/ public PaymentLine sortCode(String sortCode) { this.sortCode = sortCode; return this; } - /** + /** * The account sort code - * * @return sortCode - */ + **/ @ApiModelProperty(value = "The account sort code") - /** + /** * The account sort code - * * @return sortCode String - */ + **/ public String getSortCode() { return sortCode; } - /** - * The account sort code - * - * @param sortCode String - */ + /** + * The account sort code + * @param sortCode String + **/ + public void setSortCode(String sortCode) { this.sortCode = sortCode; } /** - * The account name - * - * @param accountName String - * @return PaymentLine - */ + * The account name + * @param accountName String + * @return PaymentLine + **/ public PaymentLine accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * The account name - * * @return accountName - */ + **/ @ApiModelProperty(value = "The account name") - /** + /** * The account name - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * The account name - * - * @param accountName String - */ + /** + * The account name + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } PaymentLine paymentLine = (PaymentLine) o; - return Objects.equals(this.paymentLineID, paymentLine.paymentLineID) - && Objects.equals(this.amount, paymentLine.amount) - && Objects.equals(this.accountNumber, paymentLine.accountNumber) - && Objects.equals(this.sortCode, paymentLine.sortCode) - && Objects.equals(this.accountName, paymentLine.accountName); + return Objects.equals(this.paymentLineID, paymentLine.paymentLineID) && + Objects.equals(this.amount, paymentLine.amount) && + Objects.equals(this.accountNumber, paymentLine.accountNumber) && + Objects.equals(this.sortCode, paymentLine.sortCode) && + Objects.equals(this.accountName, paymentLine.accountName); } @Override @@ -231,6 +234,7 @@ public int hashCode() { return Objects.hash(paymentLineID, amount, accountNumber, sortCode, accountName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PaymentMethod.java b/src/main/java/com/xero/models/payrollnz/PaymentMethod.java index 9217533d7..517ada70d 100644 --- a/src/main/java/com/xero/models/payrollnz/PaymentMethod.java +++ b/src/main/java/com/xero/models/payrollnz/PaymentMethod.java @@ -9,29 +9,53 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollnz.BankAccount; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentMethod + */ -/** PaymentMethod */ public class PaymentMethod { StringUtil util = new StringUtil(); - /** The payment method code */ + /** + * The payment method code + */ public enum PaymentMethodEnum { - /** CHEQUE */ + /** + * CHEQUE + */ CHEQUE("Cheque"), - - /** ELECTRONICALLY */ + + /** + * ELECTRONICALLY + */ ELECTRONICALLY("Electronically"), - - /** MANUAL */ + + /** + * MANUAL + */ MANUAL("Manual"); private String value; @@ -40,31 +64,25 @@ public enum PaymentMethodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PaymentMethodEnum fromValue(String value) { for (PaymentMethodEnum b : PaymentMethodEnum.values()) { @@ -76,52 +94,49 @@ public static PaymentMethodEnum fromValue(String value) { } } + @JsonProperty("paymentMethod") private PaymentMethodEnum paymentMethod; @JsonProperty("bankAccounts") private List bankAccounts = new ArrayList(); /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - * @return PaymentMethod - */ + * The payment method code + * @param paymentMethod PaymentMethodEnum + * @return PaymentMethod + **/ public PaymentMethod paymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; return this; } - /** + /** * The payment method code - * * @return paymentMethod - */ + **/ @ApiModelProperty(value = "The payment method code") - /** + /** * The payment method code - * * @return paymentMethod PaymentMethodEnum - */ + **/ public PaymentMethodEnum getPaymentMethod() { return paymentMethod; } - /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - */ + /** + * The payment method code + * @param paymentMethod PaymentMethodEnum + **/ + public void setPaymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; } /** - * bankAccounts - * - * @param bankAccounts List<BankAccount> - * @return PaymentMethod - */ + * bankAccounts + * @param bankAccounts List<BankAccount> + * @return PaymentMethod + **/ public PaymentMethod bankAccounts(List bankAccounts) { this.bankAccounts = bankAccounts; return this; @@ -129,10 +144,9 @@ public PaymentMethod bankAccounts(List bankAccounts) { /** * bankAccounts - * - * @param bankAccountsItem BankAccount + * @param bankAccountsItem BankAccount * @return PaymentMethod - */ + **/ public PaymentMethod addBankAccountsItem(BankAccount bankAccountsItem) { if (this.bankAccounts == null) { this.bankAccounts = new ArrayList(); @@ -141,30 +155,29 @@ public PaymentMethod addBankAccountsItem(BankAccount bankAccountsItem) { return this; } - /** + /** * Get bankAccounts - * * @return bankAccounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * bankAccounts - * * @return bankAccounts List - */ + **/ public List getBankAccounts() { return bankAccounts; } - /** - * bankAccounts - * - * @param bankAccounts List<BankAccount> - */ + /** + * bankAccounts + * @param bankAccounts List<BankAccount> + **/ + public void setBankAccounts(List bankAccounts) { this.bankAccounts = bankAccounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -174,8 +187,8 @@ public boolean equals(java.lang.Object o) { return false; } PaymentMethod paymentMethod = (PaymentMethod) o; - return Objects.equals(this.paymentMethod, paymentMethod.paymentMethod) - && Objects.equals(this.bankAccounts, paymentMethod.bankAccounts); + return Objects.equals(this.paymentMethod, paymentMethod.paymentMethod) && + Objects.equals(this.bankAccounts, paymentMethod.bankAccounts); } @Override @@ -183,6 +196,7 @@ public int hashCode() { return Objects.hash(paymentMethod, bankAccounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +208,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +217,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/PaymentMethodObject.java b/src/main/java/com/xero/models/payrollnz/PaymentMethodObject.java index 1994e6262..35b33c5ab 100644 --- a/src/main/java/com/xero/models/payrollnz/PaymentMethodObject.java +++ b/src/main/java/com/xero/models/payrollnz/PaymentMethodObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.PaymentMethod; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentMethodObject + */ -/** PaymentMethodObject */ public class PaymentMethodObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PaymentMethodObject { @JsonProperty("paymentMethod") private PaymentMethod paymentMethod; /** - * pagination - * - * @param pagination Pagination - * @return PaymentMethodObject - */ + * pagination + * @param pagination Pagination + * @return PaymentMethodObject + **/ public PaymentMethodObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PaymentMethodObject - */ + * problem + * @param problem Problem + * @return PaymentMethodObject + **/ public PaymentMethodObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * paymentMethod - * - * @param paymentMethod PaymentMethod - * @return PaymentMethodObject - */ + * paymentMethod + * @param paymentMethod PaymentMethod + * @return PaymentMethodObject + **/ public PaymentMethodObject paymentMethod(PaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; return this; } - /** + /** * Get paymentMethod - * * @return paymentMethod - */ + **/ @ApiModelProperty(value = "") - /** + /** * paymentMethod - * * @return paymentMethod PaymentMethod - */ + **/ public PaymentMethod getPaymentMethod() { return paymentMethod; } - /** - * paymentMethod - * - * @param paymentMethod PaymentMethod - */ + /** + * paymentMethod + * @param paymentMethod PaymentMethod + **/ + public void setPaymentMethod(PaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PaymentMethodObject paymentMethodObject = (PaymentMethodObject) o; - return Objects.equals(this.pagination, paymentMethodObject.pagination) - && Objects.equals(this.problem, paymentMethodObject.problem) - && Objects.equals(this.paymentMethod, paymentMethodObject.paymentMethod); + return Objects.equals(this.pagination, paymentMethodObject.pagination) && + Objects.equals(this.problem, paymentMethodObject.problem) && + Objects.equals(this.paymentMethod, paymentMethodObject.paymentMethod); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, paymentMethod); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Problem.java b/src/main/java/com/xero/models/payrollnz/Problem.java index 2ec0aa1b2..406e160d1 100644 --- a/src/main/java/com/xero/models/payrollnz/Problem.java +++ b/src/main/java/com/xero/models/payrollnz/Problem.java @@ -9,18 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.InvalidField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; -/** The object returned for a bad request */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The object returned for a bad request + */ @ApiModel(description = "The object returned for a bad request") + public class Problem { StringUtil util = new StringUtil(); @@ -42,186 +59,170 @@ public class Problem { @JsonProperty("invalidFields") private List invalidFields = new ArrayList(); /** - * The type of error format - * - * @param type String - * @return Problem - */ + * The type of error format + * @param type String + * @return Problem + **/ public Problem type(String type) { this.type = type; return this; } - /** + /** * The type of error format - * * @return type - */ + **/ @ApiModelProperty(example = "application/problem+json", value = "The type of error format") - /** + /** * The type of error format - * * @return type String - */ + **/ public String getType() { return type; } - /** - * The type of error format - * - * @param type String - */ + /** + * The type of error format + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * The type of the error - * - * @param title String - * @return Problem - */ + * The type of the error + * @param title String + * @return Problem + **/ public Problem title(String title) { this.title = title; return this; } - /** + /** * The type of the error - * * @return title - */ + **/ @ApiModelProperty(example = "BadRequest", value = "The type of the error") - /** + /** * The type of the error - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * The type of the error - * - * @param title String - */ + /** + * The type of the error + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * The error status code - * - * @param status String - * @return Problem - */ + * The error status code + * @param status String + * @return Problem + **/ public Problem status(String status) { this.status = status; return this; } - /** + /** * The error status code - * * @return status - */ + **/ @ApiModelProperty(example = "400", value = "The error status code") - /** + /** * The error status code - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * The error status code - * - * @param status String - */ + /** + * The error status code + * @param status String + **/ + public void setStatus(String status) { this.status = status; } /** - * A description of the error - * - * @param detail String - * @return Problem - */ + * A description of the error + * @param detail String + * @return Problem + **/ public Problem detail(String detail) { this.detail = detail; return this; } - /** + /** * A description of the error - * * @return detail - */ + **/ @ApiModelProperty(example = "Validation error occurred.", value = "A description of the error") - /** + /** * A description of the error - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * A description of the error - * - * @param detail String - */ + /** + * A description of the error + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } /** - * instance - * - * @param instance String - * @return Problem - */ + * instance + * @param instance String + * @return Problem + **/ public Problem instance(String instance) { this.instance = instance; return this; } - /** + /** * Get instance - * * @return instance - */ + **/ @ApiModelProperty(value = "") - /** + /** * instance - * * @return instance String - */ + **/ public String getInstance() { return instance; } - /** - * instance - * - * @param instance String - */ + /** + * instance + * @param instance String + **/ + public void setInstance(String instance) { this.instance = instance; } /** - * invalidFields - * - * @param invalidFields List<InvalidField> - * @return Problem - */ + * invalidFields + * @param invalidFields List<InvalidField> + * @return Problem + **/ public Problem invalidFields(List invalidFields) { this.invalidFields = invalidFields; return this; @@ -229,10 +230,9 @@ public Problem invalidFields(List invalidFields) { /** * invalidFields - * - * @param invalidFieldsItem InvalidField + * @param invalidFieldsItem InvalidField * @return Problem - */ + **/ public Problem addInvalidFieldsItem(InvalidField invalidFieldsItem) { if (this.invalidFields == null) { this.invalidFields = new ArrayList(); @@ -241,30 +241,29 @@ public Problem addInvalidFieldsItem(InvalidField invalidFieldsItem) { return this; } - /** + /** * Get invalidFields - * * @return invalidFields - */ + **/ @ApiModelProperty(value = "") - /** + /** * invalidFields - * * @return invalidFields List - */ + **/ public List getInvalidFields() { return invalidFields; } - /** - * invalidFields - * - * @param invalidFields List<InvalidField> - */ + /** + * invalidFields + * @param invalidFields List<InvalidField> + **/ + public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -274,12 +273,12 @@ public boolean equals(java.lang.Object o) { return false; } Problem problem = (Problem) o; - return Objects.equals(this.type, problem.type) - && Objects.equals(this.title, problem.title) - && Objects.equals(this.status, problem.status) - && Objects.equals(this.detail, problem.detail) - && Objects.equals(this.instance, problem.instance) - && Objects.equals(this.invalidFields, problem.invalidFields); + return Objects.equals(this.type, problem.type) && + Objects.equals(this.title, problem.title) && + Objects.equals(this.status, problem.status) && + Objects.equals(this.detail, problem.detail) && + Objects.equals(this.instance, problem.instance) && + Objects.equals(this.invalidFields, problem.invalidFields); } @Override @@ -287,6 +286,7 @@ public int hashCode() { return Objects.hash(type, title, status, detail, instance, invalidFields); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,7 +302,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -310,4 +311,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Reimbursement.java b/src/main/java/com/xero/models/payrollnz/Reimbursement.java index 491873664..b79d29b87 100644 --- a/src/main/java/com/xero/models/payrollnz/Reimbursement.java +++ b/src/main/java/com/xero/models/payrollnz/Reimbursement.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Reimbursement + */ -/** Reimbursement */ public class Reimbursement { StringUtil util = new StringUtil(); @@ -34,15 +49,23 @@ public class Reimbursement { @JsonProperty("currentRecord") private Boolean currentRecord; - /** See Reimbursement Categories */ + /** + * See Reimbursement Categories + */ public enum ReimbursementCategoryEnum { - /** GST */ + /** + * GST + */ GST("GST"), - - /** NOGST */ + + /** + * NOGST + */ NOGST("NoGST"), - - /** GSTINCLUSIVE */ + + /** + * GSTINCLUSIVE + */ GSTINCLUSIVE("GSTInclusive"); private String value; @@ -51,31 +74,25 @@ public enum ReimbursementCategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static ReimbursementCategoryEnum fromValue(String value) { for (ReimbursementCategoryEnum b : ReimbursementCategoryEnum.values()) { @@ -87,17 +104,26 @@ public static ReimbursementCategoryEnum fromValue(String value) { } } + @JsonProperty("reimbursementCategory") private ReimbursementCategoryEnum reimbursementCategory; - /** See Calculation Types */ + /** + * See Calculation Types + */ public enum CalculationTypeEnum { - /** UNKNOWN */ + /** + * UNKNOWN + */ UNKNOWN("Unknown"), - - /** FIXEDAMOUNT */ + + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FixedAmount"), - - /** RATEPERUNIT */ + + /** + * RATEPERUNIT + */ RATEPERUNIT("RatePerUnit"); private String value; @@ -106,31 +132,25 @@ public enum CalculationTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CalculationTypeEnum fromValue(String value) { for (CalculationTypeEnum b : CalculationTypeEnum.values()) { @@ -142,17 +162,24 @@ public static CalculationTypeEnum fromValue(String value) { } } + @JsonProperty("calculationType") private CalculationTypeEnum calculationType; @JsonProperty("standardAmount") private String standardAmount; - /** Optional Type Of Units. Applicable when calculation type is Rate Per Unit */ + /** + * Optional Type Of Units. Applicable when calculation type is Rate Per Unit + */ public enum StandardTypeOfUnitsEnum { - /** HOURS */ + /** + * HOURS + */ HOURS("Hours"), - - /** KM */ + + /** + * KM + */ KM("km"); private String value; @@ -161,31 +188,25 @@ public enum StandardTypeOfUnitsEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StandardTypeOfUnitsEnum fromValue(String value) { for (StandardTypeOfUnitsEnum b : StandardTypeOfUnitsEnum.values()) { @@ -197,331 +218,301 @@ public static StandardTypeOfUnitsEnum fromValue(String value) { } } + @JsonProperty("standardTypeOfUnits") private StandardTypeOfUnitsEnum standardTypeOfUnits; @JsonProperty("standardRatePerUnit") private Double standardRatePerUnit; /** - * Xero unique identifier for a reimbursement - * - * @param reimbursementID UUID - * @return Reimbursement - */ + * Xero unique identifier for a reimbursement + * @param reimbursementID UUID + * @return Reimbursement + **/ public Reimbursement reimbursementID(UUID reimbursementID) { this.reimbursementID = reimbursementID; return this; } - /** + /** * Xero unique identifier for a reimbursement - * * @return reimbursementID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for a reimbursement") - /** + /** * Xero unique identifier for a reimbursement - * * @return reimbursementID UUID - */ + **/ public UUID getReimbursementID() { return reimbursementID; } - /** - * Xero unique identifier for a reimbursement - * - * @param reimbursementID UUID - */ + /** + * Xero unique identifier for a reimbursement + * @param reimbursementID UUID + **/ + public void setReimbursementID(UUID reimbursementID) { this.reimbursementID = reimbursementID; } /** - * Name of the reimbursement - * - * @param name String - * @return Reimbursement - */ + * Name of the reimbursement + * @param name String + * @return Reimbursement + **/ public Reimbursement name(String name) { this.name = name; return this; } - /** + /** * Name of the reimbursement - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the reimbursement") - /** + /** * Name of the reimbursement - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the reimbursement - * - * @param name String - */ + /** + * Name of the reimbursement + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Xero unique identifier for the account used for the reimbursement - * - * @param accountID UUID - * @return Reimbursement - */ + * Xero unique identifier for the account used for the reimbursement + * @param accountID UUID + * @return Reimbursement + **/ public Reimbursement accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * Xero unique identifier for the account used for the reimbursement - * * @return accountID - */ - @ApiModelProperty( - required = true, - value = "Xero unique identifier for the account used for the reimbursement") - /** + **/ + @ApiModelProperty(required = true, value = "Xero unique identifier for the account used for the reimbursement") + /** * Xero unique identifier for the account used for the reimbursement - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * Xero unique identifier for the account used for the reimbursement - * - * @param accountID UUID - */ + /** + * Xero unique identifier for the account used for the reimbursement + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * Indicates that whether the reimbursement is active - * - * @param currentRecord Boolean - * @return Reimbursement - */ + * Indicates that whether the reimbursement is active + * @param currentRecord Boolean + * @return Reimbursement + **/ public Reimbursement currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Indicates that whether the reimbursement is active - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Indicates that whether the reimbursement is active") - /** + /** * Indicates that whether the reimbursement is active - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Indicates that whether the reimbursement is active - * - * @param currentRecord Boolean - */ + /** + * Indicates that whether the reimbursement is active + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * See Reimbursement Categories - * - * @param reimbursementCategory ReimbursementCategoryEnum - * @return Reimbursement - */ + * See Reimbursement Categories + * @param reimbursementCategory ReimbursementCategoryEnum + * @return Reimbursement + **/ public Reimbursement reimbursementCategory(ReimbursementCategoryEnum reimbursementCategory) { this.reimbursementCategory = reimbursementCategory; return this; } - /** + /** * See Reimbursement Categories - * * @return reimbursementCategory - */ + **/ @ApiModelProperty(value = "See Reimbursement Categories") - /** + /** * See Reimbursement Categories - * * @return reimbursementCategory ReimbursementCategoryEnum - */ + **/ public ReimbursementCategoryEnum getReimbursementCategory() { return reimbursementCategory; } - /** - * See Reimbursement Categories - * - * @param reimbursementCategory ReimbursementCategoryEnum - */ + /** + * See Reimbursement Categories + * @param reimbursementCategory ReimbursementCategoryEnum + **/ + public void setReimbursementCategory(ReimbursementCategoryEnum reimbursementCategory) { this.reimbursementCategory = reimbursementCategory; } /** - * See Calculation Types - * - * @param calculationType CalculationTypeEnum - * @return Reimbursement - */ + * See Calculation Types + * @param calculationType CalculationTypeEnum + * @return Reimbursement + **/ public Reimbursement calculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; return this; } - /** + /** * See Calculation Types - * * @return calculationType - */ + **/ @ApiModelProperty(value = "See Calculation Types") - /** + /** * See Calculation Types - * * @return calculationType CalculationTypeEnum - */ + **/ public CalculationTypeEnum getCalculationType() { return calculationType; } - /** - * See Calculation Types - * - * @param calculationType CalculationTypeEnum - */ + /** + * See Calculation Types + * @param calculationType CalculationTypeEnum + **/ + public void setCalculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; } /** - * Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount - * - * @param standardAmount String - * @return Reimbursement - */ + * Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount + * @param standardAmount String + * @return Reimbursement + **/ public Reimbursement standardAmount(String standardAmount) { this.standardAmount = standardAmount; return this; } - /** + /** * Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount - * * @return standardAmount - */ - @ApiModelProperty( - value = "Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount") - /** + **/ + @ApiModelProperty(value = "Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount") + /** * Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount - * * @return standardAmount String - */ + **/ public String getStandardAmount() { return standardAmount; } - /** - * Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount - * - * @param standardAmount String - */ + /** + * Optional Fixed Rate Amount. Applicable when calculation type is Fixed Amount + * @param standardAmount String + **/ + public void setStandardAmount(String standardAmount) { this.standardAmount = standardAmount; } /** - * Optional Type Of Units. Applicable when calculation type is Rate Per Unit - * - * @param standardTypeOfUnits StandardTypeOfUnitsEnum - * @return Reimbursement - */ + * Optional Type Of Units. Applicable when calculation type is Rate Per Unit + * @param standardTypeOfUnits StandardTypeOfUnitsEnum + * @return Reimbursement + **/ public Reimbursement standardTypeOfUnits(StandardTypeOfUnitsEnum standardTypeOfUnits) { this.standardTypeOfUnits = standardTypeOfUnits; return this; } - /** + /** * Optional Type Of Units. Applicable when calculation type is Rate Per Unit - * * @return standardTypeOfUnits - */ - @ApiModelProperty( - value = "Optional Type Of Units. Applicable when calculation type is Rate Per Unit") - /** + **/ + @ApiModelProperty(value = "Optional Type Of Units. Applicable when calculation type is Rate Per Unit") + /** * Optional Type Of Units. Applicable when calculation type is Rate Per Unit - * * @return standardTypeOfUnits StandardTypeOfUnitsEnum - */ + **/ public StandardTypeOfUnitsEnum getStandardTypeOfUnits() { return standardTypeOfUnits; } - /** - * Optional Type Of Units. Applicable when calculation type is Rate Per Unit - * - * @param standardTypeOfUnits StandardTypeOfUnitsEnum - */ + /** + * Optional Type Of Units. Applicable when calculation type is Rate Per Unit + * @param standardTypeOfUnits StandardTypeOfUnitsEnum + **/ + public void setStandardTypeOfUnits(StandardTypeOfUnitsEnum standardTypeOfUnits) { this.standardTypeOfUnits = standardTypeOfUnits; } /** - * Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit - * - * @param standardRatePerUnit Double - * @return Reimbursement - */ + * Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit + * @param standardRatePerUnit Double + * @return Reimbursement + **/ public Reimbursement standardRatePerUnit(Double standardRatePerUnit) { this.standardRatePerUnit = standardRatePerUnit; return this; } - /** + /** * Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit - * * @return standardRatePerUnit - */ - @ApiModelProperty( - value = "Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit") - /** + **/ + @ApiModelProperty(value = "Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit") + /** * Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit - * * @return standardRatePerUnit Double - */ + **/ public Double getStandardRatePerUnit() { return standardRatePerUnit; } - /** - * Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit - * - * @param standardRatePerUnit Double - */ + /** + * Optional Rate Per Unit. Applicable when calculation type is Rate Per Unit + * @param standardRatePerUnit Double + **/ + public void setStandardRatePerUnit(Double standardRatePerUnit) { this.standardRatePerUnit = standardRatePerUnit; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -531,31 +522,23 @@ public boolean equals(java.lang.Object o) { return false; } Reimbursement reimbursement = (Reimbursement) o; - return Objects.equals(this.reimbursementID, reimbursement.reimbursementID) - && Objects.equals(this.name, reimbursement.name) - && Objects.equals(this.accountID, reimbursement.accountID) - && Objects.equals(this.currentRecord, reimbursement.currentRecord) - && Objects.equals(this.reimbursementCategory, reimbursement.reimbursementCategory) - && Objects.equals(this.calculationType, reimbursement.calculationType) - && Objects.equals(this.standardAmount, reimbursement.standardAmount) - && Objects.equals(this.standardTypeOfUnits, reimbursement.standardTypeOfUnits) - && Objects.equals(this.standardRatePerUnit, reimbursement.standardRatePerUnit); + return Objects.equals(this.reimbursementID, reimbursement.reimbursementID) && + Objects.equals(this.name, reimbursement.name) && + Objects.equals(this.accountID, reimbursement.accountID) && + Objects.equals(this.currentRecord, reimbursement.currentRecord) && + Objects.equals(this.reimbursementCategory, reimbursement.reimbursementCategory) && + Objects.equals(this.calculationType, reimbursement.calculationType) && + Objects.equals(this.standardAmount, reimbursement.standardAmount) && + Objects.equals(this.standardTypeOfUnits, reimbursement.standardTypeOfUnits) && + Objects.equals(this.standardRatePerUnit, reimbursement.standardRatePerUnit); } @Override public int hashCode() { - return Objects.hash( - reimbursementID, - name, - accountID, - currentRecord, - reimbursementCategory, - calculationType, - standardAmount, - standardTypeOfUnits, - standardRatePerUnit); + return Objects.hash(reimbursementID, name, accountID, currentRecord, reimbursementCategory, calculationType, standardAmount, standardTypeOfUnits, standardRatePerUnit); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -564,23 +547,18 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" accountID: ").append(toIndentedString(accountID)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); - sb.append(" reimbursementCategory: ") - .append(toIndentedString(reimbursementCategory)) - .append("\n"); + sb.append(" reimbursementCategory: ").append(toIndentedString(reimbursementCategory)).append("\n"); sb.append(" calculationType: ").append(toIndentedString(calculationType)).append("\n"); sb.append(" standardAmount: ").append(toIndentedString(standardAmount)).append("\n"); - sb.append(" standardTypeOfUnits: ") - .append(toIndentedString(standardTypeOfUnits)) - .append("\n"); - sb.append(" standardRatePerUnit: ") - .append(toIndentedString(standardRatePerUnit)) - .append("\n"); + sb.append(" standardTypeOfUnits: ").append(toIndentedString(standardTypeOfUnits)).append("\n"); + sb.append(" standardRatePerUnit: ").append(toIndentedString(standardRatePerUnit)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -588,4 +566,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/ReimbursementLine.java b/src/main/java/com/xero/models/payrollnz/ReimbursementLine.java index aa89e9a2c..e8027fcc0 100644 --- a/src/main/java/com/xero/models/payrollnz/ReimbursementLine.java +++ b/src/main/java/com/xero/models/payrollnz/ReimbursementLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReimbursementLine + */ -/** ReimbursementLine */ public class ReimbursementLine { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class ReimbursementLine { @JsonProperty("numberOfUnits") private Double numberOfUnits; /** - * Xero identifier for payroll reimbursement - * - * @param reimbursementTypeID UUID - * @return ReimbursementLine - */ + * Xero identifier for payroll reimbursement + * @param reimbursementTypeID UUID + * @return ReimbursementLine + **/ public ReimbursementLine reimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; return this; } - /** + /** * Xero identifier for payroll reimbursement - * * @return reimbursementTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll reimbursement") - /** + /** * Xero identifier for payroll reimbursement - * * @return reimbursementTypeID UUID - */ + **/ public UUID getReimbursementTypeID() { return reimbursementTypeID; } - /** - * Xero identifier for payroll reimbursement - * - * @param reimbursementTypeID UUID - */ + /** + * Xero identifier for payroll reimbursement + * @param reimbursementTypeID UUID + **/ + public void setReimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; } /** - * Reimbursement line description - * - * @param description String - * @return ReimbursementLine - */ + * Reimbursement line description + * @param description String + * @return ReimbursementLine + **/ public ReimbursementLine description(String description) { this.description = description; return this; } - /** + /** * Reimbursement line description - * * @return description - */ + **/ @ApiModelProperty(value = "Reimbursement line description") - /** + /** * Reimbursement line description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Reimbursement line description - * - * @param description String - */ + /** + * Reimbursement line description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Reimbursement amount - * - * @param amount Double - * @return ReimbursementLine - */ + * Reimbursement amount + * @param amount Double + * @return ReimbursementLine + **/ public ReimbursementLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Reimbursement amount - * * @return amount - */ + **/ @ApiModelProperty(value = "Reimbursement amount") - /** + /** * Reimbursement amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Reimbursement amount - * - * @param amount Double - */ + /** + * Reimbursement amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - * @return ReimbursementLine - */ + * Rate per unit for leave earnings line + * @param ratePerUnit Double + * @return ReimbursementLine + **/ public ReimbursementLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "Rate per unit for leave earnings line") - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - */ + /** + * Rate per unit for leave earnings line + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Leave earnings number of units - * - * @param numberOfUnits Double - * @return ReimbursementLine - */ + * Leave earnings number of units + * @param numberOfUnits Double + * @return ReimbursementLine + **/ public ReimbursementLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Leave earnings number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Leave earnings number of units") - /** + /** * Leave earnings number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Leave earnings number of units - * - * @param numberOfUnits Double - */ + /** + * Leave earnings number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } ReimbursementLine reimbursementLine = (ReimbursementLine) o; - return Objects.equals(this.reimbursementTypeID, reimbursementLine.reimbursementTypeID) - && Objects.equals(this.description, reimbursementLine.description) - && Objects.equals(this.amount, reimbursementLine.amount) - && Objects.equals(this.ratePerUnit, reimbursementLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, reimbursementLine.numberOfUnits); + return Objects.equals(this.reimbursementTypeID, reimbursementLine.reimbursementTypeID) && + Objects.equals(this.description, reimbursementLine.description) && + Objects.equals(this.amount, reimbursementLine.amount) && + Objects.equals(this.ratePerUnit, reimbursementLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, reimbursementLine.numberOfUnits); } @Override @@ -231,13 +234,12 @@ public int hashCode() { return Objects.hash(reimbursementTypeID, description, amount, ratePerUnit, numberOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReimbursementLine {\n"); - sb.append(" reimbursementTypeID: ") - .append(toIndentedString(reimbursementTypeID)) - .append("\n"); + sb.append(" reimbursementTypeID: ").append(toIndentedString(reimbursementTypeID)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); @@ -247,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -255,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/ReimbursementObject.java b/src/main/java/com/xero/models/payrollnz/ReimbursementObject.java index 0799bfdfa..76a430e69 100644 --- a/src/main/java/com/xero/models/payrollnz/ReimbursementObject.java +++ b/src/main/java/com/xero/models/payrollnz/ReimbursementObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.Reimbursement; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReimbursementObject + */ -/** ReimbursementObject */ public class ReimbursementObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class ReimbursementObject { @JsonProperty("reimbursement") private Reimbursement reimbursement; /** - * pagination - * - * @param pagination Pagination - * @return ReimbursementObject - */ + * pagination + * @param pagination Pagination + * @return ReimbursementObject + **/ public ReimbursementObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return ReimbursementObject - */ + * problem + * @param problem Problem + * @return ReimbursementObject + **/ public ReimbursementObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * reimbursement - * - * @param reimbursement Reimbursement - * @return ReimbursementObject - */ + * reimbursement + * @param reimbursement Reimbursement + * @return ReimbursementObject + **/ public ReimbursementObject reimbursement(Reimbursement reimbursement) { this.reimbursement = reimbursement; return this; } - /** + /** * Get reimbursement - * * @return reimbursement - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursement - * * @return reimbursement Reimbursement - */ + **/ public Reimbursement getReimbursement() { return reimbursement; } - /** - * reimbursement - * - * @param reimbursement Reimbursement - */ + /** + * reimbursement + * @param reimbursement Reimbursement + **/ + public void setReimbursement(Reimbursement reimbursement) { this.reimbursement = reimbursement; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } ReimbursementObject reimbursementObject = (ReimbursementObject) o; - return Objects.equals(this.pagination, reimbursementObject.pagination) - && Objects.equals(this.problem, reimbursementObject.problem) - && Objects.equals(this.reimbursement, reimbursementObject.reimbursement); + return Objects.equals(this.pagination, reimbursementObject.pagination) && + Objects.equals(this.problem, reimbursementObject.problem) && + Objects.equals(this.reimbursement, reimbursementObject.reimbursement); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, reimbursement); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Reimbursements.java b/src/main/java/com/xero/models/payrollnz/Reimbursements.java index d16da69d8..18251eff5 100644 --- a/src/main/java/com/xero/models/payrollnz/Reimbursements.java +++ b/src/main/java/com/xero/models/payrollnz/Reimbursements.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.Reimbursement; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Reimbursements + */ -/** Reimbursements */ public class Reimbursements { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Reimbursements { @JsonProperty("reimbursements") private List reimbursements = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Reimbursements - */ + * pagination + * @param pagination Pagination + * @return Reimbursements + **/ public Reimbursements pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Reimbursements - */ + * problem + * @param problem Problem + * @return Reimbursements + **/ public Reimbursements problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * reimbursements - * - * @param reimbursements List<Reimbursement> - * @return Reimbursements - */ + * reimbursements + * @param reimbursements List<Reimbursement> + * @return Reimbursements + **/ public Reimbursements reimbursements(List reimbursements) { this.reimbursements = reimbursements; return this; @@ -113,10 +126,9 @@ public Reimbursements reimbursements(List reimbursements) { /** * reimbursements - * - * @param reimbursementsItem Reimbursement + * @param reimbursementsItem Reimbursement * @return Reimbursements - */ + **/ public Reimbursements addReimbursementsItem(Reimbursement reimbursementsItem) { if (this.reimbursements == null) { this.reimbursements = new ArrayList(); @@ -125,30 +137,29 @@ public Reimbursements addReimbursementsItem(Reimbursement reimbursementsItem) { return this; } - /** + /** * Get reimbursements - * * @return reimbursements - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursements - * * @return reimbursements List - */ + **/ public List getReimbursements() { return reimbursements; } - /** - * reimbursements - * - * @param reimbursements List<Reimbursement> - */ + /** + * reimbursements + * @param reimbursements List<Reimbursement> + **/ + public void setReimbursements(List reimbursements) { this.reimbursements = reimbursements; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Reimbursements reimbursements = (Reimbursements) o; - return Objects.equals(this.pagination, reimbursements.pagination) - && Objects.equals(this.problem, reimbursements.problem) - && Objects.equals(this.reimbursements, reimbursements.reimbursements); + return Objects.equals(this.pagination, reimbursements.pagination) && + Objects.equals(this.problem, reimbursements.problem) && + Objects.equals(this.reimbursements, reimbursements.reimbursements); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, reimbursements); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/SalaryAndWage.java b/src/main/java/com/xero/models/payrollnz/SalaryAndWage.java index 93c3b814d..fc3a9c119 100644 --- a/src/main/java/com/xero/models/payrollnz/SalaryAndWage.java +++ b/src/main/java/com/xero/models/payrollnz/SalaryAndWage.java @@ -9,18 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SalaryAndWage + */ -/** SalaryAndWage */ public class SalaryAndWage { StringUtil util = new StringUtil(); @@ -47,15 +62,23 @@ public class SalaryAndWage { @JsonProperty("annualSalary") private Double annualSalary; - /** The current status of the corresponding salary and wages */ + /** + * The current status of the corresponding salary and wages + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("Active"), - - /** PENDING */ + + /** + * PENDING + */ PENDING("Pending"), - - /** HISTORY */ + + /** + * HISTORY + */ HISTORY("History"); private String value; @@ -64,31 +87,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -100,14 +117,21 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; - /** The type of the payment of the corresponding salary and wages */ + /** + * The type of the payment of the corresponding salary and wages + */ public enum PaymentTypeEnum { - /** SALARY */ + /** + * SALARY + */ SALARY("Salary"), - - /** HOURLY */ + + /** + * HOURLY + */ HOURLY("Hourly"); private String value; @@ -116,31 +140,25 @@ public enum PaymentTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PaymentTypeEnum fromValue(String value) { for (PaymentTypeEnum b : PaymentTypeEnum.values()) { @@ -152,14 +170,21 @@ public static PaymentTypeEnum fromValue(String value) { } } + @JsonProperty("paymentType") private PaymentTypeEnum paymentType; - /** The type of the Working Pattern of the corresponding salary and wages */ + /** + * The type of the Working Pattern of the corresponding salary and wages + */ public enum WorkPatternTypeEnum { - /** DAYSANDHOURS */ + /** + * DAYSANDHOURS + */ DAYSANDHOURS("DaysAndHours"), - - /** REGULARWEEK */ + + /** + * REGULARWEEK + */ REGULARWEEK("RegularWeek"); private String value; @@ -168,31 +193,25 @@ public enum WorkPatternTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static WorkPatternTypeEnum fromValue(String value) { for (WorkPatternTypeEnum b : WorkPatternTypeEnum.values()) { @@ -204,403 +223,362 @@ public static WorkPatternTypeEnum fromValue(String value) { } } + @JsonProperty("workPatternType") private WorkPatternTypeEnum workPatternType; /** - * Xero unique identifier for a salary and wages record - * - * @param salaryAndWagesID UUID - * @return SalaryAndWage - */ + * Xero unique identifier for a salary and wages record + * @param salaryAndWagesID UUID + * @return SalaryAndWage + **/ public SalaryAndWage salaryAndWagesID(UUID salaryAndWagesID) { this.salaryAndWagesID = salaryAndWagesID; return this; } - /** + /** * Xero unique identifier for a salary and wages record - * * @return salaryAndWagesID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for a salary and wages record") - /** + /** * Xero unique identifier for a salary and wages record - * * @return salaryAndWagesID UUID - */ + **/ public UUID getSalaryAndWagesID() { return salaryAndWagesID; } - /** - * Xero unique identifier for a salary and wages record - * - * @param salaryAndWagesID UUID - */ + /** + * Xero unique identifier for a salary and wages record + * @param salaryAndWagesID UUID + **/ + public void setSalaryAndWagesID(UUID salaryAndWagesID) { this.salaryAndWagesID = salaryAndWagesID; } /** - * Xero unique identifier for an earnings rate - * - * @param earningsRateID UUID - * @return SalaryAndWage - */ + * Xero unique identifier for an earnings rate + * @param earningsRateID UUID + * @return SalaryAndWage + **/ public SalaryAndWage earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero unique identifier for an earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(required = true, value = "Xero unique identifier for an earnings rate") - /** + /** * Xero unique identifier for an earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero unique identifier for an earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero unique identifier for an earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * The Number of Units per week for the corresponding salary and wages - * - * @param numberOfUnitsPerWeek Double - * @return SalaryAndWage - */ + * The Number of Units per week for the corresponding salary and wages + * @param numberOfUnitsPerWeek Double + * @return SalaryAndWage + **/ public SalaryAndWage numberOfUnitsPerWeek(Double numberOfUnitsPerWeek) { this.numberOfUnitsPerWeek = numberOfUnitsPerWeek; return this; } - /** + /** * The Number of Units per week for the corresponding salary and wages - * * @return numberOfUnitsPerWeek - */ - @ApiModelProperty( - required = true, - value = "The Number of Units per week for the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The Number of Units per week for the corresponding salary and wages") + /** * The Number of Units per week for the corresponding salary and wages - * * @return numberOfUnitsPerWeek Double - */ + **/ public Double getNumberOfUnitsPerWeek() { return numberOfUnitsPerWeek; } - /** - * The Number of Units per week for the corresponding salary and wages - * - * @param numberOfUnitsPerWeek Double - */ + /** + * The Number of Units per week for the corresponding salary and wages + * @param numberOfUnitsPerWeek Double + **/ + public void setNumberOfUnitsPerWeek(Double numberOfUnitsPerWeek) { this.numberOfUnitsPerWeek = numberOfUnitsPerWeek; } /** - * The rate of each unit for the corresponding salary and wages - * - * @param ratePerUnit Double - * @return SalaryAndWage - */ + * The rate of each unit for the corresponding salary and wages + * @param ratePerUnit Double + * @return SalaryAndWage + **/ public SalaryAndWage ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * The rate of each unit for the corresponding salary and wages - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "The rate of each unit for the corresponding salary and wages") - /** + /** * The rate of each unit for the corresponding salary and wages - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * The rate of each unit for the corresponding salary and wages - * - * @param ratePerUnit Double - */ + /** + * The rate of each unit for the corresponding salary and wages + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * The Number of Units per day for the corresponding salary and wages - * - * @param numberOfUnitsPerDay Double - * @return SalaryAndWage - */ + * The Number of Units per day for the corresponding salary and wages + * @param numberOfUnitsPerDay Double + * @return SalaryAndWage + **/ public SalaryAndWage numberOfUnitsPerDay(Double numberOfUnitsPerDay) { this.numberOfUnitsPerDay = numberOfUnitsPerDay; return this; } - /** + /** * The Number of Units per day for the corresponding salary and wages - * * @return numberOfUnitsPerDay - */ - @ApiModelProperty( - required = true, - value = "The Number of Units per day for the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The Number of Units per day for the corresponding salary and wages") + /** * The Number of Units per day for the corresponding salary and wages - * * @return numberOfUnitsPerDay Double - */ + **/ public Double getNumberOfUnitsPerDay() { return numberOfUnitsPerDay; } - /** - * The Number of Units per day for the corresponding salary and wages - * - * @param numberOfUnitsPerDay Double - */ + /** + * The Number of Units per day for the corresponding salary and wages + * @param numberOfUnitsPerDay Double + **/ + public void setNumberOfUnitsPerDay(Double numberOfUnitsPerDay) { this.numberOfUnitsPerDay = numberOfUnitsPerDay; } /** - * The days per week for the salary. - * - * @param daysPerWeek Double - * @return SalaryAndWage - */ + * The days per week for the salary. + * @param daysPerWeek Double + * @return SalaryAndWage + **/ public SalaryAndWage daysPerWeek(Double daysPerWeek) { this.daysPerWeek = daysPerWeek; return this; } - /** + /** * The days per week for the salary. - * * @return daysPerWeek - */ + **/ @ApiModelProperty(value = "The days per week for the salary.") - /** + /** * The days per week for the salary. - * * @return daysPerWeek Double - */ + **/ public Double getDaysPerWeek() { return daysPerWeek; } - /** - * The days per week for the salary. - * - * @param daysPerWeek Double - */ + /** + * The days per week for the salary. + * @param daysPerWeek Double + **/ + public void setDaysPerWeek(Double daysPerWeek) { this.daysPerWeek = daysPerWeek; } /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - * @return SalaryAndWage - */ + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + * @return SalaryAndWage + **/ public SalaryAndWage effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; return this; } - /** + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom - */ - @ApiModelProperty( - required = true, - value = "The effective date of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The effective date of the corresponding salary and wages") + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom LocalDate - */ + **/ public LocalDate getEffectiveFrom() { return effectiveFrom; } - /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - */ + /** + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + **/ + public void setEffectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; } /** - * The annual salary - * - * @param annualSalary Double - * @return SalaryAndWage - */ + * The annual salary + * @param annualSalary Double + * @return SalaryAndWage + **/ public SalaryAndWage annualSalary(Double annualSalary) { this.annualSalary = annualSalary; return this; } - /** + /** * The annual salary - * * @return annualSalary - */ + **/ @ApiModelProperty(required = true, value = "The annual salary") - /** + /** * The annual salary - * * @return annualSalary Double - */ + **/ public Double getAnnualSalary() { return annualSalary; } - /** - * The annual salary - * - * @param annualSalary Double - */ + /** + * The annual salary + * @param annualSalary Double + **/ + public void setAnnualSalary(Double annualSalary) { this.annualSalary = annualSalary; } /** - * The current status of the corresponding salary and wages - * - * @param status StatusEnum - * @return SalaryAndWage - */ + * The current status of the corresponding salary and wages + * @param status StatusEnum + * @return SalaryAndWage + **/ public SalaryAndWage status(StatusEnum status) { this.status = status; return this; } - /** + /** * The current status of the corresponding salary and wages - * * @return status - */ - @ApiModelProperty( - required = true, - value = "The current status of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The current status of the corresponding salary and wages") + /** * The current status of the corresponding salary and wages - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The current status of the corresponding salary and wages - * - * @param status StatusEnum - */ + /** + * The current status of the corresponding salary and wages + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * The type of the payment of the corresponding salary and wages - * - * @param paymentType PaymentTypeEnum - * @return SalaryAndWage - */ + * The type of the payment of the corresponding salary and wages + * @param paymentType PaymentTypeEnum + * @return SalaryAndWage + **/ public SalaryAndWage paymentType(PaymentTypeEnum paymentType) { this.paymentType = paymentType; return this; } - /** + /** * The type of the payment of the corresponding salary and wages - * * @return paymentType - */ - @ApiModelProperty( - required = true, - value = "The type of the payment of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The type of the payment of the corresponding salary and wages") + /** * The type of the payment of the corresponding salary and wages - * * @return paymentType PaymentTypeEnum - */ + **/ public PaymentTypeEnum getPaymentType() { return paymentType; } - /** - * The type of the payment of the corresponding salary and wages - * - * @param paymentType PaymentTypeEnum - */ + /** + * The type of the payment of the corresponding salary and wages + * @param paymentType PaymentTypeEnum + **/ + public void setPaymentType(PaymentTypeEnum paymentType) { this.paymentType = paymentType; } /** - * The type of the Working Pattern of the corresponding salary and wages - * - * @param workPatternType WorkPatternTypeEnum - * @return SalaryAndWage - */ + * The type of the Working Pattern of the corresponding salary and wages + * @param workPatternType WorkPatternTypeEnum + * @return SalaryAndWage + **/ public SalaryAndWage workPatternType(WorkPatternTypeEnum workPatternType) { this.workPatternType = workPatternType; return this; } - /** + /** * The type of the Working Pattern of the corresponding salary and wages - * * @return workPatternType - */ + **/ @ApiModelProperty(value = "The type of the Working Pattern of the corresponding salary and wages") - /** + /** * The type of the Working Pattern of the corresponding salary and wages - * * @return workPatternType WorkPatternTypeEnum - */ + **/ public WorkPatternTypeEnum getWorkPatternType() { return workPatternType; } - /** - * The type of the Working Pattern of the corresponding salary and wages - * - * @param workPatternType WorkPatternTypeEnum - */ + /** + * The type of the Working Pattern of the corresponding salary and wages + * @param workPatternType WorkPatternTypeEnum + **/ + public void setWorkPatternType(WorkPatternTypeEnum workPatternType) { this.workPatternType = workPatternType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -610,48 +588,34 @@ public boolean equals(java.lang.Object o) { return false; } SalaryAndWage salaryAndWage = (SalaryAndWage) o; - return Objects.equals(this.salaryAndWagesID, salaryAndWage.salaryAndWagesID) - && Objects.equals(this.earningsRateID, salaryAndWage.earningsRateID) - && Objects.equals(this.numberOfUnitsPerWeek, salaryAndWage.numberOfUnitsPerWeek) - && Objects.equals(this.ratePerUnit, salaryAndWage.ratePerUnit) - && Objects.equals(this.numberOfUnitsPerDay, salaryAndWage.numberOfUnitsPerDay) - && Objects.equals(this.daysPerWeek, salaryAndWage.daysPerWeek) - && Objects.equals(this.effectiveFrom, salaryAndWage.effectiveFrom) - && Objects.equals(this.annualSalary, salaryAndWage.annualSalary) - && Objects.equals(this.status, salaryAndWage.status) - && Objects.equals(this.paymentType, salaryAndWage.paymentType) - && Objects.equals(this.workPatternType, salaryAndWage.workPatternType); + return Objects.equals(this.salaryAndWagesID, salaryAndWage.salaryAndWagesID) && + Objects.equals(this.earningsRateID, salaryAndWage.earningsRateID) && + Objects.equals(this.numberOfUnitsPerWeek, salaryAndWage.numberOfUnitsPerWeek) && + Objects.equals(this.ratePerUnit, salaryAndWage.ratePerUnit) && + Objects.equals(this.numberOfUnitsPerDay, salaryAndWage.numberOfUnitsPerDay) && + Objects.equals(this.daysPerWeek, salaryAndWage.daysPerWeek) && + Objects.equals(this.effectiveFrom, salaryAndWage.effectiveFrom) && + Objects.equals(this.annualSalary, salaryAndWage.annualSalary) && + Objects.equals(this.status, salaryAndWage.status) && + Objects.equals(this.paymentType, salaryAndWage.paymentType) && + Objects.equals(this.workPatternType, salaryAndWage.workPatternType); } @Override public int hashCode() { - return Objects.hash( - salaryAndWagesID, - earningsRateID, - numberOfUnitsPerWeek, - ratePerUnit, - numberOfUnitsPerDay, - daysPerWeek, - effectiveFrom, - annualSalary, - status, - paymentType, - workPatternType); + return Objects.hash(salaryAndWagesID, earningsRateID, numberOfUnitsPerWeek, ratePerUnit, numberOfUnitsPerDay, daysPerWeek, effectiveFrom, annualSalary, status, paymentType, workPatternType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SalaryAndWage {\n"); sb.append(" salaryAndWagesID: ").append(toIndentedString(salaryAndWagesID)).append("\n"); sb.append(" earningsRateID: ").append(toIndentedString(earningsRateID)).append("\n"); - sb.append(" numberOfUnitsPerWeek: ") - .append(toIndentedString(numberOfUnitsPerWeek)) - .append("\n"); + sb.append(" numberOfUnitsPerWeek: ").append(toIndentedString(numberOfUnitsPerWeek)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); - sb.append(" numberOfUnitsPerDay: ") - .append(toIndentedString(numberOfUnitsPerDay)) - .append("\n"); + sb.append(" numberOfUnitsPerDay: ").append(toIndentedString(numberOfUnitsPerDay)).append("\n"); sb.append(" daysPerWeek: ").append(toIndentedString(daysPerWeek)).append("\n"); sb.append(" effectiveFrom: ").append(toIndentedString(effectiveFrom)).append("\n"); sb.append(" annualSalary: ").append(toIndentedString(annualSalary)).append("\n"); @@ -663,7 +627,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -671,4 +636,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/SalaryAndWageObject.java b/src/main/java/com/xero/models/payrollnz/SalaryAndWageObject.java index cef144f37..a50fe2051 100644 --- a/src/main/java/com/xero/models/payrollnz/SalaryAndWageObject.java +++ b/src/main/java/com/xero/models/payrollnz/SalaryAndWageObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.SalaryAndWage; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SalaryAndWageObject + */ -/** SalaryAndWageObject */ public class SalaryAndWageObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class SalaryAndWageObject { @JsonProperty("salaryAndWages") private SalaryAndWage salaryAndWages; /** - * pagination - * - * @param pagination Pagination - * @return SalaryAndWageObject - */ + * pagination + * @param pagination Pagination + * @return SalaryAndWageObject + **/ public SalaryAndWageObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return SalaryAndWageObject - */ + * problem + * @param problem Problem + * @return SalaryAndWageObject + **/ public SalaryAndWageObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * salaryAndWages - * - * @param salaryAndWages SalaryAndWage - * @return SalaryAndWageObject - */ + * salaryAndWages + * @param salaryAndWages SalaryAndWage + * @return SalaryAndWageObject + **/ public SalaryAndWageObject salaryAndWages(SalaryAndWage salaryAndWages) { this.salaryAndWages = salaryAndWages; return this; } - /** + /** * Get salaryAndWages - * * @return salaryAndWages - */ + **/ @ApiModelProperty(value = "") - /** + /** * salaryAndWages - * * @return salaryAndWages SalaryAndWage - */ + **/ public SalaryAndWage getSalaryAndWages() { return salaryAndWages; } - /** - * salaryAndWages - * - * @param salaryAndWages SalaryAndWage - */ + /** + * salaryAndWages + * @param salaryAndWages SalaryAndWage + **/ + public void setSalaryAndWages(SalaryAndWage salaryAndWages) { this.salaryAndWages = salaryAndWages; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } SalaryAndWageObject salaryAndWageObject = (SalaryAndWageObject) o; - return Objects.equals(this.pagination, salaryAndWageObject.pagination) - && Objects.equals(this.problem, salaryAndWageObject.problem) - && Objects.equals(this.salaryAndWages, salaryAndWageObject.salaryAndWages); + return Objects.equals(this.pagination, salaryAndWageObject.pagination) && + Objects.equals(this.problem, salaryAndWageObject.problem) && + Objects.equals(this.salaryAndWages, salaryAndWageObject.salaryAndWages); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, salaryAndWages); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/SalaryAndWages.java b/src/main/java/com/xero/models/payrollnz/SalaryAndWages.java index c30a95ddf..e0c88c5b8 100644 --- a/src/main/java/com/xero/models/payrollnz/SalaryAndWages.java +++ b/src/main/java/com/xero/models/payrollnz/SalaryAndWages.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.SalaryAndWage; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SalaryAndWages + */ -/** SalaryAndWages */ public class SalaryAndWages { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class SalaryAndWages { @JsonProperty("salaryAndWages") private List salaryAndWages = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return SalaryAndWages - */ + * pagination + * @param pagination Pagination + * @return SalaryAndWages + **/ public SalaryAndWages pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return SalaryAndWages - */ + * problem + * @param problem Problem + * @return SalaryAndWages + **/ public SalaryAndWages problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * salaryAndWages - * - * @param salaryAndWages List<SalaryAndWage> - * @return SalaryAndWages - */ + * salaryAndWages + * @param salaryAndWages List<SalaryAndWage> + * @return SalaryAndWages + **/ public SalaryAndWages salaryAndWages(List salaryAndWages) { this.salaryAndWages = salaryAndWages; return this; @@ -113,10 +126,9 @@ public SalaryAndWages salaryAndWages(List salaryAndWages) { /** * salaryAndWages - * - * @param salaryAndWagesItem SalaryAndWage + * @param salaryAndWagesItem SalaryAndWage * @return SalaryAndWages - */ + **/ public SalaryAndWages addSalaryAndWagesItem(SalaryAndWage salaryAndWagesItem) { if (this.salaryAndWages == null) { this.salaryAndWages = new ArrayList(); @@ -125,30 +137,29 @@ public SalaryAndWages addSalaryAndWagesItem(SalaryAndWage salaryAndWagesItem) { return this; } - /** + /** * Get salaryAndWages - * * @return salaryAndWages - */ + **/ @ApiModelProperty(value = "") - /** + /** * salaryAndWages - * * @return salaryAndWages List - */ + **/ public List getSalaryAndWages() { return salaryAndWages; } - /** - * salaryAndWages - * - * @param salaryAndWages List<SalaryAndWage> - */ + /** + * salaryAndWages + * @param salaryAndWages List<SalaryAndWage> + **/ + public void setSalaryAndWages(List salaryAndWages) { this.salaryAndWages = salaryAndWages; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } SalaryAndWages salaryAndWages = (SalaryAndWages) o; - return Objects.equals(this.pagination, salaryAndWages.pagination) - && Objects.equals(this.problem, salaryAndWages.problem) - && Objects.equals(this.salaryAndWages, salaryAndWages.salaryAndWages); + return Objects.equals(this.pagination, salaryAndWages.pagination) && + Objects.equals(this.problem, salaryAndWages.problem) && + Objects.equals(this.salaryAndWages, salaryAndWages.salaryAndWages); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, salaryAndWages); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Settings.java b/src/main/java/com/xero/models/payrollnz/Settings.java index b33e272df..636277ea6 100644 --- a/src/main/java/com/xero/models/payrollnz/Settings.java +++ b/src/main/java/com/xero/models/payrollnz/Settings.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Accounts; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Settings + */ -/** Settings */ public class Settings { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class Settings { @JsonProperty("settings") private Accounts settings; /** - * pagination - * - * @param pagination Pagination - * @return Settings - */ + * pagination + * @param pagination Pagination + * @return Settings + **/ public Settings pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Settings - */ + * problem + * @param problem Problem + * @return Settings + **/ public Settings problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * settings - * - * @param settings Accounts - * @return Settings - */ + * settings + * @param settings Accounts + * @return Settings + **/ public Settings settings(Accounts settings) { this.settings = settings; return this; } - /** + /** * Get settings - * * @return settings - */ + **/ @ApiModelProperty(value = "") - /** + /** * settings - * * @return settings Accounts - */ + **/ public Accounts getSettings() { return settings; } - /** - * settings - * - * @param settings Accounts - */ + /** + * settings + * @param settings Accounts + **/ + public void setSettings(Accounts settings) { this.settings = settings; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } Settings settings = (Settings) o; - return Objects.equals(this.pagination, settings.pagination) - && Objects.equals(this.problem, settings.problem) - && Objects.equals(this.settings, settings.settings); + return Objects.equals(this.pagination, settings.pagination) && + Objects.equals(this.problem, settings.problem) && + Objects.equals(this.settings, settings.settings); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, settings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/StatutoryDeduction.java b/src/main/java/com/xero/models/payrollnz/StatutoryDeduction.java index 799474935..78f3c62ca 100644 --- a/src/main/java/com/xero/models/payrollnz/StatutoryDeduction.java +++ b/src/main/java/com/xero/models/payrollnz/StatutoryDeduction.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.StatutoryDeductionCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatutoryDeduction + */ -/** StatutoryDeduction */ public class StatutoryDeduction { StringUtil util = new StringUtil(); @@ -36,181 +54,166 @@ public class StatutoryDeduction { @JsonProperty("currentRecord") private Boolean currentRecord; /** - * The Xero identifier for earnings order - * - * @param id UUID - * @return StatutoryDeduction - */ + * The Xero identifier for earnings order + * @param id UUID + * @return StatutoryDeduction + **/ public StatutoryDeduction id(UUID id) { this.id = id; return this; } - /** + /** * The Xero identifier for earnings order - * * @return id - */ + **/ @ApiModelProperty(value = "The Xero identifier for earnings order") - /** + /** * The Xero identifier for earnings order - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The Xero identifier for earnings order - * - * @param id UUID - */ + /** + * The Xero identifier for earnings order + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Name of the earnings order - * - * @param name String - * @return StatutoryDeduction - */ + * Name of the earnings order + * @param name String + * @return StatutoryDeduction + **/ public StatutoryDeduction name(String name) { this.name = name; return this; } - /** + /** * Name of the earnings order - * * @return name - */ + **/ @ApiModelProperty(value = "Name of the earnings order") - /** + /** * Name of the earnings order - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earnings order - * - * @param name String - */ + /** + * Name of the earnings order + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - * @return StatutoryDeduction - */ - public StatutoryDeduction statutoryDeductionCategory( - StatutoryDeductionCategory statutoryDeductionCategory) { + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + * @return StatutoryDeduction + **/ + public StatutoryDeduction statutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; return this; } - /** + /** * Get statutoryDeductionCategory - * * @return statutoryDeductionCategory - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductionCategory - * * @return statutoryDeductionCategory StatutoryDeductionCategory - */ + **/ public StatutoryDeductionCategory getStatutoryDeductionCategory() { return statutoryDeductionCategory; } - /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - */ + /** + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + **/ + public void setStatutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return StatutoryDeduction - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return StatutoryDeduction + **/ public StatutoryDeduction liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return StatutoryDeduction - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return StatutoryDeduction + **/ public StatutoryDeduction currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,12 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } StatutoryDeduction statutoryDeduction = (StatutoryDeduction) o; - return Objects.equals(this.id, statutoryDeduction.id) - && Objects.equals(this.name, statutoryDeduction.name) - && Objects.equals( - this.statutoryDeductionCategory, statutoryDeduction.statutoryDeductionCategory) - && Objects.equals(this.liabilityAccountId, statutoryDeduction.liabilityAccountId) - && Objects.equals(this.currentRecord, statutoryDeduction.currentRecord); + return Objects.equals(this.id, statutoryDeduction.id) && + Objects.equals(this.name, statutoryDeduction.name) && + Objects.equals(this.statutoryDeductionCategory, statutoryDeduction.statutoryDeductionCategory) && + Objects.equals(this.liabilityAccountId, statutoryDeduction.liabilityAccountId) && + Objects.equals(this.currentRecord, statutoryDeduction.currentRecord); } @Override @@ -233,15 +235,14 @@ public int hashCode() { return Objects.hash(id, name, statutoryDeductionCategory, liabilityAccountId, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StatutoryDeduction {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" statutoryDeductionCategory: ") - .append(toIndentedString(statutoryDeductionCategory)) - .append("\n"); + sb.append(" statutoryDeductionCategory: ").append(toIndentedString(statutoryDeductionCategory)).append("\n"); sb.append(" liabilityAccountId: ").append(toIndentedString(liabilityAccountId)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append("}"); @@ -249,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -257,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/StatutoryDeductionCategory.java b/src/main/java/com/xero/models/payrollnz/StatutoryDeductionCategory.java index 49a0df226..af93b4f73 100644 --- a/src/main/java/com/xero/models/payrollnz/StatutoryDeductionCategory.java +++ b/src/main/java/com/xero/models/payrollnz/StatutoryDeductionCategory.java @@ -9,46 +9,80 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; - +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Statutory Deduction Category */ +/** + * Statutory Deduction Category + */ public enum StatutoryDeductionCategory { - - /** PRIORITYORDER */ + + /** + * PRIORITYORDER + */ PRIORITYORDER("PriorityOrder"), - - /** NONPRIORITYORDER */ + + /** + * NONPRIORITYORDER + */ NONPRIORITYORDER("NonPriorityOrder"), - - /** TABLEBASED */ + + /** + * TABLEBASED + */ TABLEBASED("TableBased"), - - /** CHILDSUPPORT */ + + /** + * CHILDSUPPORT + */ CHILDSUPPORT("ChildSupport"), - - /** COURTFINES */ + + /** + * COURTFINES + */ COURTFINES("CourtFines"), - - /** INLANDREVENUEARREARS */ + + /** + * INLANDREVENUEARREARS + */ INLANDREVENUEARREARS("InlandRevenueArrears"), - - /** MSDREPAYMENTS */ + + /** + * MSDREPAYMENTS + */ MSDREPAYMENTS("MsdRepayments"), - - /** STUDENTLOAN */ + + /** + * STUDENTLOAN + */ STUDENTLOAN("StudentLoan"), - - /** ADDITIONALSTUDENTLOAN */ + + /** + * ADDITIONALSTUDENTLOAN + */ ADDITIONALSTUDENTLOAN("AdditionalStudentLoan"), - - /** VOLUNTARYSTUDENTLOAN */ + + /** + * VOLUNTARYSTUDENTLOAN + */ VOLUNTARYSTUDENTLOAN("VoluntaryStudentLoan"), - - /** KIWISAVER */ + + /** + * KIWISAVER + */ KIWISAVER("KiwiSaver"); private String value; @@ -57,26 +91,24 @@ public enum StatutoryDeductionCategory { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static StatutoryDeductionCategory fromValue(String value) { @@ -88,3 +120,4 @@ public static StatutoryDeductionCategory fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollnz/StatutoryDeductionLine.java b/src/main/java/com/xero/models/payrollnz/StatutoryDeductionLine.java index 1a41a1e2e..da0141078 100644 --- a/src/main/java/com/xero/models/payrollnz/StatutoryDeductionLine.java +++ b/src/main/java/com/xero/models/payrollnz/StatutoryDeductionLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatutoryDeductionLine + */ -/** StatutoryDeductionLine */ public class StatutoryDeductionLine { StringUtil util = new StringUtil(); @@ -33,145 +50,134 @@ public class StatutoryDeductionLine { @JsonProperty("manualAdjustment") private Boolean manualAdjustment; /** - * Xero identifier for payroll statutory deduction type - * - * @param statutoryDeductionTypeID UUID - * @return StatutoryDeductionLine - */ + * Xero identifier for payroll statutory deduction type + * @param statutoryDeductionTypeID UUID + * @return StatutoryDeductionLine + **/ public StatutoryDeductionLine statutoryDeductionTypeID(UUID statutoryDeductionTypeID) { this.statutoryDeductionTypeID = statutoryDeductionTypeID; return this; } - /** + /** * Xero identifier for payroll statutory deduction type - * * @return statutoryDeductionTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll statutory deduction type") - /** + /** * Xero identifier for payroll statutory deduction type - * * @return statutoryDeductionTypeID UUID - */ + **/ public UUID getStatutoryDeductionTypeID() { return statutoryDeductionTypeID; } - /** - * Xero identifier for payroll statutory deduction type - * - * @param statutoryDeductionTypeID UUID - */ + /** + * Xero identifier for payroll statutory deduction type + * @param statutoryDeductionTypeID UUID + **/ + public void setStatutoryDeductionTypeID(UUID statutoryDeductionTypeID) { this.statutoryDeductionTypeID = statutoryDeductionTypeID; } /** - * The amount of the statutory deduction line - * - * @param amount Double - * @return StatutoryDeductionLine - */ + * The amount of the statutory deduction line + * @param amount Double + * @return StatutoryDeductionLine + **/ public StatutoryDeductionLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the statutory deduction line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the statutory deduction line") - /** + /** * The amount of the statutory deduction line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the statutory deduction line - * - * @param amount Double - */ + /** + * The amount of the statutory deduction line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Fixed Amount - * - * @param fixedAmount Double - * @return StatutoryDeductionLine - */ + * Fixed Amount + * @param fixedAmount Double + * @return StatutoryDeductionLine + **/ public StatutoryDeductionLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Fixed Amount - * * @return fixedAmount - */ + **/ @ApiModelProperty(value = "Fixed Amount") - /** + /** * Fixed Amount - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Fixed Amount - * - * @param fixedAmount Double - */ + /** + * Fixed Amount + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * Identifies if the tax line is a manual adjustment - * - * @param manualAdjustment Boolean - * @return StatutoryDeductionLine - */ + * Identifies if the tax line is a manual adjustment + * @param manualAdjustment Boolean + * @return StatutoryDeductionLine + **/ public StatutoryDeductionLine manualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; return this; } - /** + /** * Identifies if the tax line is a manual adjustment - * * @return manualAdjustment - */ + **/ @ApiModelProperty(value = "Identifies if the tax line is a manual adjustment") - /** + /** * Identifies if the tax line is a manual adjustment - * * @return manualAdjustment Boolean - */ + **/ public Boolean getManualAdjustment() { return manualAdjustment; } - /** - * Identifies if the tax line is a manual adjustment - * - * @param manualAdjustment Boolean - */ + /** + * Identifies if the tax line is a manual adjustment + * @param manualAdjustment Boolean + **/ + public void setManualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,11 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } StatutoryDeductionLine statutoryDeductionLine = (StatutoryDeductionLine) o; - return Objects.equals( - this.statutoryDeductionTypeID, statutoryDeductionLine.statutoryDeductionTypeID) - && Objects.equals(this.amount, statutoryDeductionLine.amount) - && Objects.equals(this.fixedAmount, statutoryDeductionLine.fixedAmount) - && Objects.equals(this.manualAdjustment, statutoryDeductionLine.manualAdjustment); + return Objects.equals(this.statutoryDeductionTypeID, statutoryDeductionLine.statutoryDeductionTypeID) && + Objects.equals(this.amount, statutoryDeductionLine.amount) && + Objects.equals(this.fixedAmount, statutoryDeductionLine.fixedAmount) && + Objects.equals(this.manualAdjustment, statutoryDeductionLine.manualAdjustment); } @Override @@ -193,13 +198,12 @@ public int hashCode() { return Objects.hash(statutoryDeductionTypeID, amount, fixedAmount, manualAdjustment); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StatutoryDeductionLine {\n"); - sb.append(" statutoryDeductionTypeID: ") - .append(toIndentedString(statutoryDeductionTypeID)) - .append("\n"); + sb.append(" statutoryDeductionTypeID: ").append(toIndentedString(statutoryDeductionTypeID)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append(" manualAdjustment: ").append(toIndentedString(manualAdjustment)).append("\n"); @@ -208,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -216,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/StatutoryDeductionObject.java b/src/main/java/com/xero/models/payrollnz/StatutoryDeductionObject.java index ba500f05a..94deea344 100644 --- a/src/main/java/com/xero/models/payrollnz/StatutoryDeductionObject.java +++ b/src/main/java/com/xero/models/payrollnz/StatutoryDeductionObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.StatutoryDeduction; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatutoryDeductionObject + */ -/** StatutoryDeductionObject */ public class StatutoryDeductionObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class StatutoryDeductionObject { @JsonProperty("statutoryDeduction") private StatutoryDeduction statutoryDeduction; /** - * pagination - * - * @param pagination Pagination - * @return StatutoryDeductionObject - */ + * pagination + * @param pagination Pagination + * @return StatutoryDeductionObject + **/ public StatutoryDeductionObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return StatutoryDeductionObject - */ + * problem + * @param problem Problem + * @return StatutoryDeductionObject + **/ public StatutoryDeductionObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryDeduction - * - * @param statutoryDeduction StatutoryDeduction - * @return StatutoryDeductionObject - */ + * statutoryDeduction + * @param statutoryDeduction StatutoryDeduction + * @return StatutoryDeductionObject + **/ public StatutoryDeductionObject statutoryDeduction(StatutoryDeduction statutoryDeduction) { this.statutoryDeduction = statutoryDeduction; return this; } - /** + /** * Get statutoryDeduction - * * @return statutoryDeduction - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeduction - * * @return statutoryDeduction StatutoryDeduction - */ + **/ public StatutoryDeduction getStatutoryDeduction() { return statutoryDeduction; } - /** - * statutoryDeduction - * - * @param statutoryDeduction StatutoryDeduction - */ + /** + * statutoryDeduction + * @param statutoryDeduction StatutoryDeduction + **/ + public void setStatutoryDeduction(StatutoryDeduction statutoryDeduction) { this.statutoryDeduction = statutoryDeduction; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } StatutoryDeductionObject statutoryDeductionObject = (StatutoryDeductionObject) o; - return Objects.equals(this.pagination, statutoryDeductionObject.pagination) - && Objects.equals(this.problem, statutoryDeductionObject.problem) - && Objects.equals(this.statutoryDeduction, statutoryDeductionObject.statutoryDeduction); + return Objects.equals(this.pagination, statutoryDeductionObject.pagination) && + Objects.equals(this.problem, statutoryDeductionObject.problem) && + Objects.equals(this.statutoryDeduction, statutoryDeductionObject.statutoryDeduction); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryDeduction); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/StatutoryDeductions.java b/src/main/java/com/xero/models/payrollnz/StatutoryDeductions.java index 6d1899fd4..f3d3ddc17 100644 --- a/src/main/java/com/xero/models/payrollnz/StatutoryDeductions.java +++ b/src/main/java/com/xero/models/payrollnz/StatutoryDeductions.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.StatutoryDeduction; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatutoryDeductions + */ -/** StatutoryDeductions */ public class StatutoryDeductions { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class StatutoryDeductions { @JsonProperty("statutoryDeductions") private List statutoryDeductions = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return StatutoryDeductions - */ + * pagination + * @param pagination Pagination + * @return StatutoryDeductions + **/ public StatutoryDeductions pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return StatutoryDeductions - */ + * problem + * @param problem Problem + * @return StatutoryDeductions + **/ public StatutoryDeductions problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryDeductions - * - * @param statutoryDeductions List<StatutoryDeduction> - * @return StatutoryDeductions - */ + * statutoryDeductions + * @param statutoryDeductions List<StatutoryDeduction> + * @return StatutoryDeductions + **/ public StatutoryDeductions statutoryDeductions(List statutoryDeductions) { this.statutoryDeductions = statutoryDeductions; return this; @@ -113,12 +126,10 @@ public StatutoryDeductions statutoryDeductions(List statutor /** * statutoryDeductions - * - * @param statutoryDeductionsItem StatutoryDeduction + * @param statutoryDeductionsItem StatutoryDeduction * @return StatutoryDeductions - */ - public StatutoryDeductions addStatutoryDeductionsItem( - StatutoryDeduction statutoryDeductionsItem) { + **/ + public StatutoryDeductions addStatutoryDeductionsItem(StatutoryDeduction statutoryDeductionsItem) { if (this.statutoryDeductions == null) { this.statutoryDeductions = new ArrayList(); } @@ -126,30 +137,29 @@ public StatutoryDeductions addStatutoryDeductionsItem( return this; } - /** + /** * Get statutoryDeductions - * * @return statutoryDeductions - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductions - * * @return statutoryDeductions List - */ + **/ public List getStatutoryDeductions() { return statutoryDeductions; } - /** - * statutoryDeductions - * - * @param statutoryDeductions List<StatutoryDeduction> - */ + /** + * statutoryDeductions + * @param statutoryDeductions List<StatutoryDeduction> + **/ + public void setStatutoryDeductions(List statutoryDeductions) { this.statutoryDeductions = statutoryDeductions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -159,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } StatutoryDeductions statutoryDeductions = (StatutoryDeductions) o; - return Objects.equals(this.pagination, statutoryDeductions.pagination) - && Objects.equals(this.problem, statutoryDeductions.problem) - && Objects.equals(this.statutoryDeductions, statutoryDeductions.statutoryDeductions); + return Objects.equals(this.pagination, statutoryDeductions.pagination) && + Objects.equals(this.problem, statutoryDeductions.problem) && + Objects.equals(this.statutoryDeductions, statutoryDeductions.statutoryDeductions); } @Override @@ -169,21 +179,21 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryDeductions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StatutoryDeductions {\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append(" problem: ").append(toIndentedString(problem)).append("\n"); - sb.append(" statutoryDeductions: ") - .append(toIndentedString(statutoryDeductions)) - .append("\n"); + sb.append(" statutoryDeductions: ").append(toIndentedString(statutoryDeductions)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -191,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/SuperannuationLine.java b/src/main/java/com/xero/models/payrollnz/SuperannuationLine.java index 2059aaa6e..fc2ce1e96 100644 --- a/src/main/java/com/xero/models/payrollnz/SuperannuationLine.java +++ b/src/main/java/com/xero/models/payrollnz/SuperannuationLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperannuationLine + */ -/** SuperannuationLine */ public class SuperannuationLine { StringUtil util = new StringUtil(); @@ -39,215 +56,198 @@ public class SuperannuationLine { @JsonProperty("manualAdjustment") private Boolean manualAdjustment; /** - * Xero identifier for payroll superannuation type - * - * @param superannuationTypeID UUID - * @return SuperannuationLine - */ + * Xero identifier for payroll superannuation type + * @param superannuationTypeID UUID + * @return SuperannuationLine + **/ public SuperannuationLine superannuationTypeID(UUID superannuationTypeID) { this.superannuationTypeID = superannuationTypeID; return this; } - /** + /** * Xero identifier for payroll superannuation type - * * @return superannuationTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll superannuation type") - /** + /** * Xero identifier for payroll superannuation type - * * @return superannuationTypeID UUID - */ + **/ public UUID getSuperannuationTypeID() { return superannuationTypeID; } - /** - * Xero identifier for payroll superannuation type - * - * @param superannuationTypeID UUID - */ + /** + * Xero identifier for payroll superannuation type + * @param superannuationTypeID UUID + **/ + public void setSuperannuationTypeID(UUID superannuationTypeID) { this.superannuationTypeID = superannuationTypeID; } /** - * Benefit display name - * - * @param displayName String - * @return SuperannuationLine - */ + * Benefit display name + * @param displayName String + * @return SuperannuationLine + **/ public SuperannuationLine displayName(String displayName) { this.displayName = displayName; return this; } - /** + /** * Benefit display name - * * @return displayName - */ + **/ @ApiModelProperty(value = "Benefit display name") - /** + /** * Benefit display name - * * @return displayName String - */ + **/ public String getDisplayName() { return displayName; } - /** - * Benefit display name - * - * @param displayName String - */ + /** + * Benefit display name + * @param displayName String + **/ + public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * The amount of the superannuation line - * - * @param amount Double - * @return SuperannuationLine - */ + * The amount of the superannuation line + * @param amount Double + * @return SuperannuationLine + **/ public SuperannuationLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the superannuation line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the superannuation line") - /** + /** * The amount of the superannuation line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the superannuation line - * - * @param amount Double - */ + /** + * The amount of the superannuation line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Superannuation fixed amount - * - * @param fixedAmount Double - * @return SuperannuationLine - */ + * Superannuation fixed amount + * @param fixedAmount Double + * @return SuperannuationLine + **/ public SuperannuationLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Superannuation fixed amount - * * @return fixedAmount - */ + **/ @ApiModelProperty(value = "Superannuation fixed amount") - /** + /** * Superannuation fixed amount - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Superannuation fixed amount - * - * @param fixedAmount Double - */ + /** + * Superannuation fixed amount + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * Superannuation rate percentage - * - * @param percentage Double - * @return SuperannuationLine - */ + * Superannuation rate percentage + * @param percentage Double + * @return SuperannuationLine + **/ public SuperannuationLine percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Superannuation rate percentage - * * @return percentage - */ + **/ @ApiModelProperty(value = "Superannuation rate percentage") - /** + /** * Superannuation rate percentage - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Superannuation rate percentage - * - * @param percentage Double - */ + /** + * Superannuation rate percentage + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } /** - * manual adjustment made - * - * @param manualAdjustment Boolean - * @return SuperannuationLine - */ + * manual adjustment made + * @param manualAdjustment Boolean + * @return SuperannuationLine + **/ public SuperannuationLine manualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; return this; } - /** + /** * manual adjustment made - * * @return manualAdjustment - */ + **/ @ApiModelProperty(value = "manual adjustment made") - /** + /** * manual adjustment made - * * @return manualAdjustment Boolean - */ + **/ public Boolean getManualAdjustment() { return manualAdjustment; } - /** - * manual adjustment made - * - * @param manualAdjustment Boolean - */ + /** + * manual adjustment made + * @param manualAdjustment Boolean + **/ + public void setManualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -257,27 +257,25 @@ public boolean equals(java.lang.Object o) { return false; } SuperannuationLine superannuationLine = (SuperannuationLine) o; - return Objects.equals(this.superannuationTypeID, superannuationLine.superannuationTypeID) - && Objects.equals(this.displayName, superannuationLine.displayName) - && Objects.equals(this.amount, superannuationLine.amount) - && Objects.equals(this.fixedAmount, superannuationLine.fixedAmount) - && Objects.equals(this.percentage, superannuationLine.percentage) - && Objects.equals(this.manualAdjustment, superannuationLine.manualAdjustment); + return Objects.equals(this.superannuationTypeID, superannuationLine.superannuationTypeID) && + Objects.equals(this.displayName, superannuationLine.displayName) && + Objects.equals(this.amount, superannuationLine.amount) && + Objects.equals(this.fixedAmount, superannuationLine.fixedAmount) && + Objects.equals(this.percentage, superannuationLine.percentage) && + Objects.equals(this.manualAdjustment, superannuationLine.manualAdjustment); } @Override public int hashCode() { - return Objects.hash( - superannuationTypeID, displayName, amount, fixedAmount, percentage, manualAdjustment); + return Objects.hash(superannuationTypeID, displayName, amount, fixedAmount, percentage, manualAdjustment); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SuperannuationLine {\n"); - sb.append(" superannuationTypeID: ") - .append(toIndentedString(superannuationTypeID)) - .append("\n"); + sb.append(" superannuationTypeID: ").append(toIndentedString(superannuationTypeID)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); @@ -288,7 +286,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -296,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/SuperannuationObject.java b/src/main/java/com/xero/models/payrollnz/SuperannuationObject.java index 0af6706d0..520e5889e 100644 --- a/src/main/java/com/xero/models/payrollnz/SuperannuationObject.java +++ b/src/main/java/com/xero/models/payrollnz/SuperannuationObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Benefit; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SuperannuationObject + */ -/** SuperannuationObject */ public class SuperannuationObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class SuperannuationObject { @JsonProperty("benefit") private Benefit benefit; /** - * pagination - * - * @param pagination Pagination - * @return SuperannuationObject - */ + * pagination + * @param pagination Pagination + * @return SuperannuationObject + **/ public SuperannuationObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return SuperannuationObject - */ + * problem + * @param problem Problem + * @return SuperannuationObject + **/ public SuperannuationObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * benefit - * - * @param benefit Benefit - * @return SuperannuationObject - */ + * benefit + * @param benefit Benefit + * @return SuperannuationObject + **/ public SuperannuationObject benefit(Benefit benefit) { this.benefit = benefit; return this; } - /** + /** * Get benefit - * * @return benefit - */ + **/ @ApiModelProperty(value = "") - /** + /** * benefit - * * @return benefit Benefit - */ + **/ public Benefit getBenefit() { return benefit; } - /** - * benefit - * - * @param benefit Benefit - */ + /** + * benefit + * @param benefit Benefit + **/ + public void setBenefit(Benefit benefit) { this.benefit = benefit; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } SuperannuationObject superannuationObject = (SuperannuationObject) o; - return Objects.equals(this.pagination, superannuationObject.pagination) - && Objects.equals(this.problem, superannuationObject.problem) - && Objects.equals(this.benefit, superannuationObject.benefit); + return Objects.equals(this.pagination, superannuationObject.pagination) && + Objects.equals(this.problem, superannuationObject.problem) && + Objects.equals(this.benefit, superannuationObject.benefit); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, benefit); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Superannuations.java b/src/main/java/com/xero/models/payrollnz/Superannuations.java index fe4b3e174..2abab1d6d 100644 --- a/src/main/java/com/xero/models/payrollnz/Superannuations.java +++ b/src/main/java/com/xero/models/payrollnz/Superannuations.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Benefit; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Superannuations + */ -/** Superannuations */ public class Superannuations { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Superannuations { @JsonProperty("benefits") private List benefits = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Superannuations - */ + * pagination + * @param pagination Pagination + * @return Superannuations + **/ public Superannuations pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Superannuations - */ + * problem + * @param problem Problem + * @return Superannuations + **/ public Superannuations problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * benefits - * - * @param benefits List<Benefit> - * @return Superannuations - */ + * benefits + * @param benefits List<Benefit> + * @return Superannuations + **/ public Superannuations benefits(List benefits) { this.benefits = benefits; return this; @@ -113,10 +126,9 @@ public Superannuations benefits(List benefits) { /** * benefits - * - * @param benefitsItem Benefit + * @param benefitsItem Benefit * @return Superannuations - */ + **/ public Superannuations addBenefitsItem(Benefit benefitsItem) { if (this.benefits == null) { this.benefits = new ArrayList(); @@ -125,30 +137,29 @@ public Superannuations addBenefitsItem(Benefit benefitsItem) { return this; } - /** + /** * Get benefits - * * @return benefits - */ + **/ @ApiModelProperty(value = "") - /** + /** * benefits - * * @return benefits List - */ + **/ public List getBenefits() { return benefits; } - /** - * benefits - * - * @param benefits List<Benefit> - */ + /** + * benefits + * @param benefits List<Benefit> + **/ + public void setBenefits(List benefits) { this.benefits = benefits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Superannuations superannuations = (Superannuations) o; - return Objects.equals(this.pagination, superannuations.pagination) - && Objects.equals(this.problem, superannuations.problem) - && Objects.equals(this.benefits, superannuations.benefits); + return Objects.equals(this.pagination, superannuations.pagination) && + Objects.equals(this.problem, superannuations.problem) && + Objects.equals(this.benefits, superannuations.benefits); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, benefits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TaxCode.java b/src/main/java/com/xero/models/payrollnz/TaxCode.java index 39cf1539c..e057761de 100644 --- a/src/main/java/com/xero/models/payrollnz/TaxCode.java +++ b/src/main/java/com/xero/models/payrollnz/TaxCode.java @@ -9,70 +9,120 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; - +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Tax codes used for employee tax */ +/** + * Tax codes used for employee tax + */ public enum TaxCode { - - /** ND */ + + /** + * ND + */ ND("ND"), - - /** M */ + + /** + * M + */ M("M"), - - /** ME */ + + /** + * ME + */ ME("ME"), - - /** MSL */ + + /** + * MSL + */ MSL("MSL"), - - /** MESL */ + + /** + * MESL + */ MESL("MESL"), - - /** SB */ + + /** + * SB + */ SB("SB"), - - /** S */ + + /** + * S + */ S("S"), - - /** SH */ + + /** + * SH + */ SH("SH"), - - /** ST */ + + /** + * ST + */ ST("ST"), - - /** SBSL */ + + /** + * SBSL + */ SBSL("SBSL"), - - /** SSL */ + + /** + * SSL + */ SSL("SSL"), - - /** SHSL */ + + /** + * SHSL + */ SHSL("SHSL"), - - /** STSL */ + + /** + * STSL + */ STSL("STSL"), - - /** WT */ + + /** + * WT + */ WT("WT"), - - /** CAE */ + + /** + * CAE + */ CAE("CAE"), - - /** EDW */ + + /** + * EDW + */ EDW("EDW"), - - /** NSW */ + + /** + * NSW + */ NSW("NSW"), - - /** STC */ + + /** + * STC + */ STC("STC"), - - /** STCSL */ + + /** + * STCSL + */ STCSL("STCSL"); private String value; @@ -81,26 +131,24 @@ public enum TaxCode { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static TaxCode fromValue(String value) { @@ -112,3 +160,4 @@ public static TaxCode fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrollnz/TaxLine.java b/src/main/java/com/xero/models/payrollnz/TaxLine.java index 7b9b426cf..c226f3a77 100644 --- a/src/main/java/com/xero/models/payrollnz/TaxLine.java +++ b/src/main/java/com/xero/models/payrollnz/TaxLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxLine + */ -/** TaxLine */ public class TaxLine { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class TaxLine { @JsonProperty("manualAdjustment") private Boolean manualAdjustment; /** - * Xero identifier for payroll tax line - * - * @param taxLineID UUID - * @return TaxLine - */ + * Xero identifier for payroll tax line + * @param taxLineID UUID + * @return TaxLine + **/ public TaxLine taxLineID(UUID taxLineID) { this.taxLineID = taxLineID; return this; } - /** + /** * Xero identifier for payroll tax line - * * @return taxLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll tax line") - /** + /** * Xero identifier for payroll tax line - * * @return taxLineID UUID - */ + **/ public UUID getTaxLineID() { return taxLineID; } - /** - * Xero identifier for payroll tax line - * - * @param taxLineID UUID - */ + /** + * Xero identifier for payroll tax line + * @param taxLineID UUID + **/ + public void setTaxLineID(UUID taxLineID) { this.taxLineID = taxLineID; } /** - * Tax line description - * - * @param description String - * @return TaxLine - */ + * Tax line description + * @param description String + * @return TaxLine + **/ public TaxLine description(String description) { this.description = description; return this; } - /** + /** * Tax line description - * * @return description - */ + **/ @ApiModelProperty(value = "Tax line description") - /** + /** * Tax line description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Tax line description - * - * @param description String - */ + /** + * Tax line description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * The amount of the tax line - * - * @param amount Double - * @return TaxLine - */ + * The amount of the tax line + * @param amount Double + * @return TaxLine + **/ public TaxLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the tax line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the tax line") - /** + /** * The amount of the tax line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the tax line - * - * @param amount Double - */ + /** + * The amount of the tax line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Tax type ID - * - * @param globalTaxTypeID String - * @return TaxLine - */ + * Tax type ID + * @param globalTaxTypeID String + * @return TaxLine + **/ public TaxLine globalTaxTypeID(String globalTaxTypeID) { this.globalTaxTypeID = globalTaxTypeID; return this; } - /** + /** * Tax type ID - * * @return globalTaxTypeID - */ + **/ @ApiModelProperty(value = "Tax type ID") - /** + /** * Tax type ID - * * @return globalTaxTypeID String - */ + **/ public String getGlobalTaxTypeID() { return globalTaxTypeID; } - /** - * Tax type ID - * - * @param globalTaxTypeID String - */ + /** + * Tax type ID + * @param globalTaxTypeID String + **/ + public void setGlobalTaxTypeID(String globalTaxTypeID) { this.globalTaxTypeID = globalTaxTypeID; } /** - * Identifies if the tax line is a manual adjustment - * - * @param manualAdjustment Boolean - * @return TaxLine - */ + * Identifies if the tax line is a manual adjustment + * @param manualAdjustment Boolean + * @return TaxLine + **/ public TaxLine manualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; return this; } - /** + /** * Identifies if the tax line is a manual adjustment - * * @return manualAdjustment - */ + **/ @ApiModelProperty(value = "Identifies if the tax line is a manual adjustment") - /** + /** * Identifies if the tax line is a manual adjustment - * * @return manualAdjustment Boolean - */ + **/ public Boolean getManualAdjustment() { return manualAdjustment; } - /** - * Identifies if the tax line is a manual adjustment - * - * @param manualAdjustment Boolean - */ + /** + * Identifies if the tax line is a manual adjustment + * @param manualAdjustment Boolean + **/ + public void setManualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } TaxLine taxLine = (TaxLine) o; - return Objects.equals(this.taxLineID, taxLine.taxLineID) - && Objects.equals(this.description, taxLine.description) - && Objects.equals(this.amount, taxLine.amount) - && Objects.equals(this.globalTaxTypeID, taxLine.globalTaxTypeID) - && Objects.equals(this.manualAdjustment, taxLine.manualAdjustment); + return Objects.equals(this.taxLineID, taxLine.taxLineID) && + Objects.equals(this.description, taxLine.description) && + Objects.equals(this.amount, taxLine.amount) && + Objects.equals(this.globalTaxTypeID, taxLine.globalTaxTypeID) && + Objects.equals(this.manualAdjustment, taxLine.manualAdjustment); } @Override @@ -231,6 +234,7 @@ public int hashCode() { return Objects.hash(taxLineID, description, amount, globalTaxTypeID, manualAdjustment); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TaxSettings.java b/src/main/java/com/xero/models/payrollnz/TaxSettings.java index cf7d4dc34..713bee5e4 100644 --- a/src/main/java/com/xero/models/payrollnz/TaxSettings.java +++ b/src/main/java/com/xero/models/payrollnz/TaxSettings.java @@ -9,27 +9,49 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollnz.TaxCode; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxSettings + */ -/** TaxSettings */ public class TaxSettings { StringUtil util = new StringUtil(); @JsonProperty("periodUnits") private Double periodUnits; - /** The type of period (\"weeks\" or \"months\") */ + /** + * The type of period (\"weeks\" or \"months\") + */ public enum PeriodTypeEnum { - /** WEEKS */ + /** + * WEEKS + */ WEEKS("weeks"), - - /** MONTHS */ + + /** + * MONTHS + */ MONTHS("months"); private String value; @@ -38,31 +60,25 @@ public enum PeriodTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PeriodTypeEnum fromValue(String value) { for (PeriodTypeEnum b : PeriodTypeEnum.values()) { @@ -74,6 +90,7 @@ public static PeriodTypeEnum fromValue(String value) { } } + @JsonProperty("periodType") private PeriodTypeEnum periodType; @@ -89,215 +106,198 @@ public static PeriodTypeEnum fromValue(String value) { @JsonProperty("lumpSumAmount") private String lumpSumAmount; /** - * The number of units for the period type - * - * @param periodUnits Double - * @return TaxSettings - */ + * The number of units for the period type + * @param periodUnits Double + * @return TaxSettings + **/ public TaxSettings periodUnits(Double periodUnits) { this.periodUnits = periodUnits; return this; } - /** + /** * The number of units for the period type - * * @return periodUnits - */ + **/ @ApiModelProperty(value = "The number of units for the period type") - /** + /** * The number of units for the period type - * * @return periodUnits Double - */ + **/ public Double getPeriodUnits() { return periodUnits; } - /** - * The number of units for the period type - * - * @param periodUnits Double - */ + /** + * The number of units for the period type + * @param periodUnits Double + **/ + public void setPeriodUnits(Double periodUnits) { this.periodUnits = periodUnits; } /** - * The type of period (\"weeks\" or \"months\") - * - * @param periodType PeriodTypeEnum - * @return TaxSettings - */ + * The type of period (\"weeks\" or \"months\") + * @param periodType PeriodTypeEnum + * @return TaxSettings + **/ public TaxSettings periodType(PeriodTypeEnum periodType) { this.periodType = periodType; return this; } - /** + /** * The type of period (\"weeks\" or \"months\") - * * @return periodType - */ + **/ @ApiModelProperty(example = "weeks", value = "The type of period (\"weeks\" or \"months\")") - /** + /** * The type of period (\"weeks\" or \"months\") - * * @return periodType PeriodTypeEnum - */ + **/ public PeriodTypeEnum getPeriodType() { return periodType; } - /** - * The type of period (\"weeks\" or \"months\") - * - * @param periodType PeriodTypeEnum - */ + /** + * The type of period (\"weeks\" or \"months\") + * @param periodType PeriodTypeEnum + **/ + public void setPeriodType(PeriodTypeEnum periodType) { this.periodType = periodType; } /** - * taxCode - * - * @param taxCode TaxCode - * @return TaxSettings - */ + * taxCode + * @param taxCode TaxCode + * @return TaxSettings + **/ public TaxSettings taxCode(TaxCode taxCode) { this.taxCode = taxCode; return this; } - /** + /** * Get taxCode - * * @return taxCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * taxCode - * * @return taxCode TaxCode - */ + **/ public TaxCode getTaxCode() { return taxCode; } - /** - * taxCode - * - * @param taxCode TaxCode - */ + /** + * taxCode + * @param taxCode TaxCode + **/ + public void setTaxCode(TaxCode taxCode) { this.taxCode = taxCode; } /** - * Tax rate for STC and WT - * - * @param specialTaxRate String - * @return TaxSettings - */ + * Tax rate for STC and WT + * @param specialTaxRate String + * @return TaxSettings + **/ public TaxSettings specialTaxRate(String specialTaxRate) { this.specialTaxRate = specialTaxRate; return this; } - /** + /** * Tax rate for STC and WT - * * @return specialTaxRate - */ + **/ @ApiModelProperty(value = "Tax rate for STC and WT") - /** + /** * Tax rate for STC and WT - * * @return specialTaxRate String - */ + **/ public String getSpecialTaxRate() { return specialTaxRate; } - /** - * Tax rate for STC and WT - * - * @param specialTaxRate String - */ + /** + * Tax rate for STC and WT + * @param specialTaxRate String + **/ + public void setSpecialTaxRate(String specialTaxRate) { this.specialTaxRate = specialTaxRate; } /** - * Tax code for a lump sum amount - * - * @param lumpSumTaxCode String - * @return TaxSettings - */ + * Tax code for a lump sum amount + * @param lumpSumTaxCode String + * @return TaxSettings + **/ public TaxSettings lumpSumTaxCode(String lumpSumTaxCode) { this.lumpSumTaxCode = lumpSumTaxCode; return this; } - /** + /** * Tax code for a lump sum amount - * * @return lumpSumTaxCode - */ + **/ @ApiModelProperty(value = "Tax code for a lump sum amount") - /** + /** * Tax code for a lump sum amount - * * @return lumpSumTaxCode String - */ + **/ public String getLumpSumTaxCode() { return lumpSumTaxCode; } - /** - * Tax code for a lump sum amount - * - * @param lumpSumTaxCode String - */ + /** + * Tax code for a lump sum amount + * @param lumpSumTaxCode String + **/ + public void setLumpSumTaxCode(String lumpSumTaxCode) { this.lumpSumTaxCode = lumpSumTaxCode; } /** - * The total of the lump sum amount - * - * @param lumpSumAmount String - * @return TaxSettings - */ + * The total of the lump sum amount + * @param lumpSumAmount String + * @return TaxSettings + **/ public TaxSettings lumpSumAmount(String lumpSumAmount) { this.lumpSumAmount = lumpSumAmount; return this; } - /** + /** * The total of the lump sum amount - * * @return lumpSumAmount - */ + **/ @ApiModelProperty(value = "The total of the lump sum amount") - /** + /** * The total of the lump sum amount - * * @return lumpSumAmount String - */ + **/ public String getLumpSumAmount() { return lumpSumAmount; } - /** - * The total of the lump sum amount - * - * @param lumpSumAmount String - */ + /** + * The total of the lump sum amount + * @param lumpSumAmount String + **/ + public void setLumpSumAmount(String lumpSumAmount) { this.lumpSumAmount = lumpSumAmount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -307,20 +307,20 @@ public boolean equals(java.lang.Object o) { return false; } TaxSettings taxSettings = (TaxSettings) o; - return Objects.equals(this.periodUnits, taxSettings.periodUnits) - && Objects.equals(this.periodType, taxSettings.periodType) - && Objects.equals(this.taxCode, taxSettings.taxCode) - && Objects.equals(this.specialTaxRate, taxSettings.specialTaxRate) - && Objects.equals(this.lumpSumTaxCode, taxSettings.lumpSumTaxCode) - && Objects.equals(this.lumpSumAmount, taxSettings.lumpSumAmount); + return Objects.equals(this.periodUnits, taxSettings.periodUnits) && + Objects.equals(this.periodType, taxSettings.periodType) && + Objects.equals(this.taxCode, taxSettings.taxCode) && + Objects.equals(this.specialTaxRate, taxSettings.specialTaxRate) && + Objects.equals(this.lumpSumTaxCode, taxSettings.lumpSumTaxCode) && + Objects.equals(this.lumpSumAmount, taxSettings.lumpSumAmount); } @Override public int hashCode() { - return Objects.hash( - periodUnits, periodType, taxCode, specialTaxRate, lumpSumTaxCode, lumpSumAmount); + return Objects.hash(periodUnits, periodType, taxCode, specialTaxRate, lumpSumTaxCode, lumpSumAmount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -336,7 +336,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -344,4 +345,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Timesheet.java b/src/main/java/com/xero/models/payrollnz/Timesheet.java index 1313a4b24..ae3d645e9 100644 --- a/src/main/java/com/xero/models/payrollnz/Timesheet.java +++ b/src/main/java/com/xero/models/payrollnz/Timesheet.java @@ -9,21 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrollnz.TimesheetLine; +import io.swagger.annotations.ApiModel; 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; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Timesheet + */ -/** Timesheet */ public class Timesheet { StringUtil util = new StringUtil(); @@ -41,18 +57,28 @@ public class Timesheet { @JsonProperty("endDate") private LocalDate endDate; - /** Status of the timesheet */ + /** + * Status of the timesheet + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("Draft"), - - /** APPROVED */ + + /** + * APPROVED + */ APPROVED("Approved"), - - /** COMPLETED */ + + /** + * COMPLETED + */ COMPLETED("Completed"), - - /** REQUESTED */ + + /** + * REQUESTED + */ REQUESTED("Requested"); private String value; @@ -61,31 +87,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -97,6 +117,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; @@ -109,295 +130,266 @@ public static StatusEnum fromValue(String value) { @JsonProperty("timesheetLines") private List timesheetLines = new ArrayList(); /** - * The Xero identifier for a Timesheet - * - * @param timesheetID UUID - * @return Timesheet - */ + * The Xero identifier for a Timesheet + * @param timesheetID UUID + * @return Timesheet + **/ public Timesheet timesheetID(UUID timesheetID) { this.timesheetID = timesheetID; return this; } - /** + /** * The Xero identifier for a Timesheet - * * @return timesheetID - */ + **/ @ApiModelProperty(value = "The Xero identifier for a Timesheet") - /** + /** * The Xero identifier for a Timesheet - * * @return timesheetID UUID - */ + **/ public UUID getTimesheetID() { return timesheetID; } - /** - * The Xero identifier for a Timesheet - * - * @param timesheetID UUID - */ + /** + * The Xero identifier for a Timesheet + * @param timesheetID UUID + **/ + public void setTimesheetID(UUID timesheetID) { this.timesheetID = timesheetID; } /** - * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * - * @param payrollCalendarID UUID - * @return Timesheet - */ + * The Xero identifier for the Payroll Calendar that the Timesheet applies to + * @param payrollCalendarID UUID + * @return Timesheet + **/ public Timesheet payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * * @return payrollCalendarID - */ - @ApiModelProperty( - required = true, - value = "The Xero identifier for the Payroll Calendar that the Timesheet applies to") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero identifier for the Payroll Calendar that the Timesheet applies to") + /** * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * - * @param payrollCalendarID UUID - */ + /** + * The Xero identifier for the Payroll Calendar that the Timesheet applies to + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * The Xero identifier for the Employee that the Timesheet is for - * - * @param employeeID UUID - * @return Timesheet - */ + * The Xero identifier for the Employee that the Timesheet is for + * @param employeeID UUID + * @return Timesheet + **/ public Timesheet employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for the Employee that the Timesheet is for - * * @return employeeID - */ - @ApiModelProperty( - required = true, - value = "The Xero identifier for the Employee that the Timesheet is for") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero identifier for the Employee that the Timesheet is for") + /** * The Xero identifier for the Employee that the Timesheet is for - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for the Employee that the Timesheet is for - * - * @param employeeID UUID - */ + /** + * The Xero identifier for the Employee that the Timesheet is for + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The Start Date of the Timesheet period (YYYY-MM-DD) - * - * @param startDate LocalDate - * @return Timesheet - */ + * The Start Date of the Timesheet period (YYYY-MM-DD) + * @param startDate LocalDate + * @return Timesheet + **/ public Timesheet startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * The Start Date of the Timesheet period (YYYY-MM-DD) - * * @return startDate - */ + **/ @ApiModelProperty(required = true, value = "The Start Date of the Timesheet period (YYYY-MM-DD)") - /** + /** * The Start Date of the Timesheet period (YYYY-MM-DD) - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * The Start Date of the Timesheet period (YYYY-MM-DD) - * - * @param startDate LocalDate - */ + /** + * The Start Date of the Timesheet period (YYYY-MM-DD) + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * The End Date of the Timesheet period (YYYY-MM-DD) - * - * @param endDate LocalDate - * @return Timesheet - */ + * The End Date of the Timesheet period (YYYY-MM-DD) + * @param endDate LocalDate + * @return Timesheet + **/ public Timesheet endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The End Date of the Timesheet period (YYYY-MM-DD) - * * @return endDate - */ + **/ @ApiModelProperty(required = true, value = "The End Date of the Timesheet period (YYYY-MM-DD)") - /** + /** * The End Date of the Timesheet period (YYYY-MM-DD) - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The End Date of the Timesheet period (YYYY-MM-DD) - * - * @param endDate LocalDate - */ + /** + * The End Date of the Timesheet period (YYYY-MM-DD) + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Status of the timesheet - * - * @param status StatusEnum - * @return Timesheet - */ + * Status of the timesheet + * @param status StatusEnum + * @return Timesheet + **/ public Timesheet status(StatusEnum status) { this.status = status; return this; } - /** + /** * Status of the timesheet - * * @return status - */ + **/ @ApiModelProperty(value = "Status of the timesheet") - /** + /** * Status of the timesheet - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the timesheet - * - * @param status StatusEnum - */ + /** + * Status of the timesheet + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * The Total Hours of the Timesheet - * - * @param totalHours Double - * @return Timesheet - */ + * The Total Hours of the Timesheet + * @param totalHours Double + * @return Timesheet + **/ public Timesheet totalHours(Double totalHours) { this.totalHours = totalHours; return this; } - /** + /** * The Total Hours of the Timesheet - * * @return totalHours - */ + **/ @ApiModelProperty(value = "The Total Hours of the Timesheet") - /** + /** * The Total Hours of the Timesheet - * * @return totalHours Double - */ + **/ public Double getTotalHours() { return totalHours; } - /** - * The Total Hours of the Timesheet - * - * @param totalHours Double - */ + /** + * The Total Hours of the Timesheet + * @param totalHours Double + **/ + public void setTotalHours(Double totalHours) { this.totalHours = totalHours; } /** - * The UTC date time that the Timesheet was last updated - * - * @param updatedDateUTC LocalDateTime - * @return Timesheet - */ + * The UTC date time that the Timesheet was last updated + * @param updatedDateUTC LocalDateTime + * @return Timesheet + **/ public Timesheet updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * The UTC date time that the Timesheet was last updated - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "The UTC date time that the Timesheet was last updated") - /** + /** * The UTC date time that the Timesheet was last updated - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * The UTC date time that the Timesheet was last updated - * - * @param updatedDateUTC LocalDateTime - */ + /** + * The UTC date time that the Timesheet was last updated + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } /** - * timesheetLines - * - * @param timesheetLines List<TimesheetLine> - * @return Timesheet - */ + * timesheetLines + * @param timesheetLines List<TimesheetLine> + * @return Timesheet + **/ public Timesheet timesheetLines(List timesheetLines) { this.timesheetLines = timesheetLines; return this; @@ -405,10 +397,9 @@ public Timesheet timesheetLines(List timesheetLines) { /** * timesheetLines - * - * @param timesheetLinesItem TimesheetLine + * @param timesheetLinesItem TimesheetLine * @return Timesheet - */ + **/ public Timesheet addTimesheetLinesItem(TimesheetLine timesheetLinesItem) { if (this.timesheetLines == null) { this.timesheetLines = new ArrayList(); @@ -417,30 +408,29 @@ public Timesheet addTimesheetLinesItem(TimesheetLine timesheetLinesItem) { return this; } - /** + /** * Get timesheetLines - * * @return timesheetLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetLines - * * @return timesheetLines List - */ + **/ public List getTimesheetLines() { return timesheetLines; } - /** - * timesheetLines - * - * @param timesheetLines List<TimesheetLine> - */ + /** + * timesheetLines + * @param timesheetLines List<TimesheetLine> + **/ + public void setTimesheetLines(List timesheetLines) { this.timesheetLines = timesheetLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -450,31 +440,23 @@ public boolean equals(java.lang.Object o) { return false; } Timesheet timesheet = (Timesheet) o; - return Objects.equals(this.timesheetID, timesheet.timesheetID) - && Objects.equals(this.payrollCalendarID, timesheet.payrollCalendarID) - && Objects.equals(this.employeeID, timesheet.employeeID) - && Objects.equals(this.startDate, timesheet.startDate) - && Objects.equals(this.endDate, timesheet.endDate) - && Objects.equals(this.status, timesheet.status) - && Objects.equals(this.totalHours, timesheet.totalHours) - && Objects.equals(this.updatedDateUTC, timesheet.updatedDateUTC) - && Objects.equals(this.timesheetLines, timesheet.timesheetLines); + return Objects.equals(this.timesheetID, timesheet.timesheetID) && + Objects.equals(this.payrollCalendarID, timesheet.payrollCalendarID) && + Objects.equals(this.employeeID, timesheet.employeeID) && + Objects.equals(this.startDate, timesheet.startDate) && + Objects.equals(this.endDate, timesheet.endDate) && + Objects.equals(this.status, timesheet.status) && + Objects.equals(this.totalHours, timesheet.totalHours) && + Objects.equals(this.updatedDateUTC, timesheet.updatedDateUTC) && + Objects.equals(this.timesheetLines, timesheet.timesheetLines); } @Override public int hashCode() { - return Objects.hash( - timesheetID, - payrollCalendarID, - employeeID, - startDate, - endDate, - status, - totalHours, - updatedDateUTC, - timesheetLines); + return Objects.hash(timesheetID, payrollCalendarID, employeeID, startDate, endDate, status, totalHours, updatedDateUTC, timesheetLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -493,7 +475,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -501,4 +484,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TimesheetEarningsLine.java b/src/main/java/com/xero/models/payrollnz/TimesheetEarningsLine.java index d12bd9cf2..00a9c55a1 100644 --- a/src/main/java/com/xero/models/payrollnz/TimesheetEarningsLine.java +++ b/src/main/java/com/xero/models/payrollnz/TimesheetEarningsLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetEarningsLine + */ -/** TimesheetEarningsLine */ public class TimesheetEarningsLine { StringUtil util = new StringUtil(); @@ -51,360 +68,326 @@ public class TimesheetEarningsLine { @JsonProperty("isSystemGenerated") private Boolean isSystemGenerated; /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - * @return TimesheetEarningsLine - */ + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine earningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; return this; } - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll earnings line") - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID UUID - */ + **/ public UUID getEarningsLineID() { return earningsLineID; } - /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - */ + /** + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + **/ + public void setEarningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; } /** - * Xero identifier for payroll leave earnings rate - * - * @param earningsRateID UUID - * @return TimesheetEarningsLine - */ + * Xero identifier for payroll leave earnings rate + * @param earningsRateID UUID + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier for payroll leave earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll leave earnings rate") - /** + /** * Xero identifier for payroll leave earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier for payroll leave earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero identifier for payroll leave earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * name of earnings rate for display in UI - * - * @param displayName String - * @return TimesheetEarningsLine - */ + * name of earnings rate for display in UI + * @param displayName String + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine displayName(String displayName) { this.displayName = displayName; return this; } - /** + /** * name of earnings rate for display in UI - * * @return displayName - */ + **/ @ApiModelProperty(value = "name of earnings rate for display in UI") - /** + /** * name of earnings rate for display in UI - * * @return displayName String - */ + **/ public String getDisplayName() { return displayName; } - /** - * name of earnings rate for display in UI - * - * @param displayName String - */ + /** + * name of earnings rate for display in UI + * @param displayName String + **/ + public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - * @return TimesheetEarningsLine - */ + * Rate per unit for leave earnings line + * @param ratePerUnit Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "Rate per unit for leave earnings line") - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - */ + /** + * Rate per unit for leave earnings line + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Leave earnings number of units - * - * @param numberOfUnits Double - * @return TimesheetEarningsLine - */ + * Leave earnings number of units + * @param numberOfUnits Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Leave earnings number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Leave earnings number of units") - /** + /** * Leave earnings number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Leave earnings number of units - * - * @param numberOfUnits Double - */ + /** + * Leave earnings number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - * @return TimesheetEarningsLine - */ + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount - */ - @ApiModelProperty( - value = "Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") - /** + **/ + @ApiModelProperty(value = "Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") + /** * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - */ + /** + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The amount of the earnings line. - * - * @param amount Double - * @return TimesheetEarningsLine - */ + * The amount of the earnings line. + * @param amount Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the earnings line. - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the earnings line.") - /** + /** * The amount of the earnings line. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the earnings line. - * - * @param amount Double - */ + /** + * The amount of the earnings line. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - * @return TimesheetEarningsLine - */ + * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine isLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; return this; } - /** + /** * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet - */ - @ApiModelProperty( - value = - "Identifies if the leave earnings is taken from the timesheet. False for leave earnings" - + " line") - /** + **/ + @ApiModelProperty(value = "Identifies if the leave earnings is taken from the timesheet. False for leave earnings line") + /** * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet Boolean - */ + **/ public Boolean getIsLinkedToTimesheet() { return isLinkedToTimesheet; } - /** - * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - */ + /** + * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + **/ + public void setIsLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; } /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - * @return TimesheetEarningsLine - */ + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine isAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; return this; } - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate - */ + **/ @ApiModelProperty(value = "Identifies if the earnings is using an average daily pay rate") - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate Boolean - */ + **/ public Boolean getIsAverageDailyPayRate() { return isAverageDailyPayRate; } - /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - */ + /** + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + **/ + public void setIsAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; } /** - * Flag to identify whether the earnings line is system generated or not. - * - * @param isSystemGenerated Boolean - * @return TimesheetEarningsLine - */ + * Flag to identify whether the earnings line is system generated or not. + * @param isSystemGenerated Boolean + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine isSystemGenerated(Boolean isSystemGenerated) { this.isSystemGenerated = isSystemGenerated; return this; } - /** + /** * Flag to identify whether the earnings line is system generated or not. - * * @return isSystemGenerated - */ - @ApiModelProperty( - value = "Flag to identify whether the earnings line is system generated or not.") - /** + **/ + @ApiModelProperty(value = "Flag to identify whether the earnings line is system generated or not.") + /** * Flag to identify whether the earnings line is system generated or not. - * * @return isSystemGenerated Boolean - */ + **/ public Boolean getIsSystemGenerated() { return isSystemGenerated; } - /** - * Flag to identify whether the earnings line is system generated or not. - * - * @param isSystemGenerated Boolean - */ + /** + * Flag to identify whether the earnings line is system generated or not. + * @param isSystemGenerated Boolean + **/ + public void setIsSystemGenerated(Boolean isSystemGenerated) { this.isSystemGenerated = isSystemGenerated; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -414,33 +397,24 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetEarningsLine timesheetEarningsLine = (TimesheetEarningsLine) o; - return Objects.equals(this.earningsLineID, timesheetEarningsLine.earningsLineID) - && Objects.equals(this.earningsRateID, timesheetEarningsLine.earningsRateID) - && Objects.equals(this.displayName, timesheetEarningsLine.displayName) - && Objects.equals(this.ratePerUnit, timesheetEarningsLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, timesheetEarningsLine.numberOfUnits) - && Objects.equals(this.fixedAmount, timesheetEarningsLine.fixedAmount) - && Objects.equals(this.amount, timesheetEarningsLine.amount) - && Objects.equals(this.isLinkedToTimesheet, timesheetEarningsLine.isLinkedToTimesheet) - && Objects.equals(this.isAverageDailyPayRate, timesheetEarningsLine.isAverageDailyPayRate) - && Objects.equals(this.isSystemGenerated, timesheetEarningsLine.isSystemGenerated); + return Objects.equals(this.earningsLineID, timesheetEarningsLine.earningsLineID) && + Objects.equals(this.earningsRateID, timesheetEarningsLine.earningsRateID) && + Objects.equals(this.displayName, timesheetEarningsLine.displayName) && + Objects.equals(this.ratePerUnit, timesheetEarningsLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, timesheetEarningsLine.numberOfUnits) && + Objects.equals(this.fixedAmount, timesheetEarningsLine.fixedAmount) && + Objects.equals(this.amount, timesheetEarningsLine.amount) && + Objects.equals(this.isLinkedToTimesheet, timesheetEarningsLine.isLinkedToTimesheet) && + Objects.equals(this.isAverageDailyPayRate, timesheetEarningsLine.isAverageDailyPayRate) && + Objects.equals(this.isSystemGenerated, timesheetEarningsLine.isSystemGenerated); } @Override public int hashCode() { - return Objects.hash( - earningsLineID, - earningsRateID, - displayName, - ratePerUnit, - numberOfUnits, - fixedAmount, - amount, - isLinkedToTimesheet, - isAverageDailyPayRate, - isSystemGenerated); + return Objects.hash(earningsLineID, earningsRateID, displayName, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet, isAverageDailyPayRate, isSystemGenerated); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -452,19 +426,16 @@ public String toString() { sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" isLinkedToTimesheet: ") - .append(toIndentedString(isLinkedToTimesheet)) - .append("\n"); - sb.append(" isAverageDailyPayRate: ") - .append(toIndentedString(isAverageDailyPayRate)) - .append("\n"); + sb.append(" isLinkedToTimesheet: ").append(toIndentedString(isLinkedToTimesheet)).append("\n"); + sb.append(" isAverageDailyPayRate: ").append(toIndentedString(isAverageDailyPayRate)).append("\n"); sb.append(" isSystemGenerated: ").append(toIndentedString(isSystemGenerated)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -472,4 +443,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TimesheetLine.java b/src/main/java/com/xero/models/payrollnz/TimesheetLine.java index edc876cb6..3e7402c01 100644 --- a/src/main/java/com/xero/models/payrollnz/TimesheetLine.java +++ b/src/main/java/com/xero/models/payrollnz/TimesheetLine.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetLine + */ -/** TimesheetLine */ public class TimesheetLine { StringUtil util = new StringUtil(); @@ -37,184 +54,166 @@ public class TimesheetLine { @JsonProperty("numberOfUnits") private Double numberOfUnits; /** - * The Xero identifier for a Timesheet Line - * - * @param timesheetLineID UUID - * @return TimesheetLine - */ + * The Xero identifier for a Timesheet Line + * @param timesheetLineID UUID + * @return TimesheetLine + **/ public TimesheetLine timesheetLineID(UUID timesheetLineID) { this.timesheetLineID = timesheetLineID; return this; } - /** + /** * The Xero identifier for a Timesheet Line - * * @return timesheetLineID - */ + **/ @ApiModelProperty(value = "The Xero identifier for a Timesheet Line") - /** + /** * The Xero identifier for a Timesheet Line - * * @return timesheetLineID UUID - */ + **/ public UUID getTimesheetLineID() { return timesheetLineID; } - /** - * The Xero identifier for a Timesheet Line - * - * @param timesheetLineID UUID - */ + /** + * The Xero identifier for a Timesheet Line + * @param timesheetLineID UUID + **/ + public void setTimesheetLineID(UUID timesheetLineID) { this.timesheetLineID = timesheetLineID; } /** - * The Date that this Timesheet Line is for (YYYY-MM-DD) - * - * @param date LocalDate - * @return TimesheetLine - */ + * The Date that this Timesheet Line is for (YYYY-MM-DD) + * @param date LocalDate + * @return TimesheetLine + **/ public TimesheetLine date(LocalDate date) { this.date = date; return this; } - /** + /** * The Date that this Timesheet Line is for (YYYY-MM-DD) - * * @return date - */ - @ApiModelProperty( - required = true, - value = "The Date that this Timesheet Line is for (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(required = true, value = "The Date that this Timesheet Line is for (YYYY-MM-DD)") + /** * The Date that this Timesheet Line is for (YYYY-MM-DD) - * * @return date LocalDate - */ + **/ public LocalDate getDate() { return date; } - /** - * The Date that this Timesheet Line is for (YYYY-MM-DD) - * - * @param date LocalDate - */ + /** + * The Date that this Timesheet Line is for (YYYY-MM-DD) + * @param date LocalDate + **/ + public void setDate(LocalDate date) { this.date = date; } /** - * The Xero identifier for the Earnings Rate that the Timesheet is for - * - * @param earningsRateID UUID - * @return TimesheetLine - */ + * The Xero identifier for the Earnings Rate that the Timesheet is for + * @param earningsRateID UUID + * @return TimesheetLine + **/ public TimesheetLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * The Xero identifier for the Earnings Rate that the Timesheet is for - * * @return earningsRateID - */ - @ApiModelProperty( - required = true, - value = "The Xero identifier for the Earnings Rate that the Timesheet is for") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero identifier for the Earnings Rate that the Timesheet is for") + /** * The Xero identifier for the Earnings Rate that the Timesheet is for - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * The Xero identifier for the Earnings Rate that the Timesheet is for - * - * @param earningsRateID UUID - */ + /** + * The Xero identifier for the Earnings Rate that the Timesheet is for + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * The Xero identifier for the Tracking Item that the Timesheet is for - * - * @param trackingItemID UUID - * @return TimesheetLine - */ + * The Xero identifier for the Tracking Item that the Timesheet is for + * @param trackingItemID UUID + * @return TimesheetLine + **/ public TimesheetLine trackingItemID(UUID trackingItemID) { this.trackingItemID = trackingItemID; return this; } - /** + /** * The Xero identifier for the Tracking Item that the Timesheet is for - * * @return trackingItemID - */ + **/ @ApiModelProperty(value = "The Xero identifier for the Tracking Item that the Timesheet is for") - /** + /** * The Xero identifier for the Tracking Item that the Timesheet is for - * * @return trackingItemID UUID - */ + **/ public UUID getTrackingItemID() { return trackingItemID; } - /** - * The Xero identifier for the Tracking Item that the Timesheet is for - * - * @param trackingItemID UUID - */ + /** + * The Xero identifier for the Tracking Item that the Timesheet is for + * @param trackingItemID UUID + **/ + public void setTrackingItemID(UUID trackingItemID) { this.trackingItemID = trackingItemID; } /** - * The Number of Units of the Timesheet Line - * - * @param numberOfUnits Double - * @return TimesheetLine - */ + * The Number of Units of the Timesheet Line + * @param numberOfUnits Double + * @return TimesheetLine + **/ public TimesheetLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The Number of Units of the Timesheet Line - * * @return numberOfUnits - */ + **/ @ApiModelProperty(required = true, value = "The Number of Units of the Timesheet Line") - /** + /** * The Number of Units of the Timesheet Line - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The Number of Units of the Timesheet Line - * - * @param numberOfUnits Double - */ + /** + * The Number of Units of the Timesheet Line + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -224,11 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetLine timesheetLine = (TimesheetLine) o; - return Objects.equals(this.timesheetLineID, timesheetLine.timesheetLineID) - && Objects.equals(this.date, timesheetLine.date) - && Objects.equals(this.earningsRateID, timesheetLine.earningsRateID) - && Objects.equals(this.trackingItemID, timesheetLine.trackingItemID) - && Objects.equals(this.numberOfUnits, timesheetLine.numberOfUnits); + return Objects.equals(this.timesheetLineID, timesheetLine.timesheetLineID) && + Objects.equals(this.date, timesheetLine.date) && + Objects.equals(this.earningsRateID, timesheetLine.earningsRateID) && + Objects.equals(this.trackingItemID, timesheetLine.trackingItemID) && + Objects.equals(this.numberOfUnits, timesheetLine.numberOfUnits); } @Override @@ -236,6 +235,7 @@ public int hashCode() { return Objects.hash(timesheetLineID, date, earningsRateID, trackingItemID, numberOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -258,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TimesheetLineObject.java b/src/main/java/com/xero/models/payrollnz/TimesheetLineObject.java index 1b9fa112d..76106bc44 100644 --- a/src/main/java/com/xero/models/payrollnz/TimesheetLineObject.java +++ b/src/main/java/com/xero/models/payrollnz/TimesheetLineObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.TimesheetLine; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetLineObject + */ -/** TimesheetLineObject */ public class TimesheetLineObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class TimesheetLineObject { @JsonProperty("timesheetLine") private TimesheetLine timesheetLine; /** - * pagination - * - * @param pagination Pagination - * @return TimesheetLineObject - */ + * pagination + * @param pagination Pagination + * @return TimesheetLineObject + **/ public TimesheetLineObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return TimesheetLineObject - */ + * problem + * @param problem Problem + * @return TimesheetLineObject + **/ public TimesheetLineObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * timesheetLine - * - * @param timesheetLine TimesheetLine - * @return TimesheetLineObject - */ + * timesheetLine + * @param timesheetLine TimesheetLine + * @return TimesheetLineObject + **/ public TimesheetLineObject timesheetLine(TimesheetLine timesheetLine) { this.timesheetLine = timesheetLine; return this; } - /** + /** * Get timesheetLine - * * @return timesheetLine - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetLine - * * @return timesheetLine TimesheetLine - */ + **/ public TimesheetLine getTimesheetLine() { return timesheetLine; } - /** - * timesheetLine - * - * @param timesheetLine TimesheetLine - */ + /** + * timesheetLine + * @param timesheetLine TimesheetLine + **/ + public void setTimesheetLine(TimesheetLine timesheetLine) { this.timesheetLine = timesheetLine; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetLineObject timesheetLineObject = (TimesheetLineObject) o; - return Objects.equals(this.pagination, timesheetLineObject.pagination) - && Objects.equals(this.problem, timesheetLineObject.problem) - && Objects.equals(this.timesheetLine, timesheetLineObject.timesheetLine); + return Objects.equals(this.pagination, timesheetLineObject.pagination) && + Objects.equals(this.problem, timesheetLineObject.problem) && + Objects.equals(this.timesheetLine, timesheetLineObject.timesheetLine); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, timesheetLine); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TimesheetObject.java b/src/main/java/com/xero/models/payrollnz/TimesheetObject.java index 099a95721..75f46ff03 100644 --- a/src/main/java/com/xero/models/payrollnz/TimesheetObject.java +++ b/src/main/java/com/xero/models/payrollnz/TimesheetObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.Timesheet; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetObject + */ -/** TimesheetObject */ public class TimesheetObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class TimesheetObject { @JsonProperty("timesheet") private Timesheet timesheet; /** - * pagination - * - * @param pagination Pagination - * @return TimesheetObject - */ + * pagination + * @param pagination Pagination + * @return TimesheetObject + **/ public TimesheetObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return TimesheetObject - */ + * problem + * @param problem Problem + * @return TimesheetObject + **/ public TimesheetObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * timesheet - * - * @param timesheet Timesheet - * @return TimesheetObject - */ + * timesheet + * @param timesheet Timesheet + * @return TimesheetObject + **/ public TimesheetObject timesheet(Timesheet timesheet) { this.timesheet = timesheet; return this; } - /** + /** * Get timesheet - * * @return timesheet - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheet - * * @return timesheet Timesheet - */ + **/ public Timesheet getTimesheet() { return timesheet; } - /** - * timesheet - * - * @param timesheet Timesheet - */ + /** + * timesheet + * @param timesheet Timesheet + **/ + public void setTimesheet(Timesheet timesheet) { this.timesheet = timesheet; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetObject timesheetObject = (TimesheetObject) o; - return Objects.equals(this.pagination, timesheetObject.pagination) - && Objects.equals(this.problem, timesheetObject.problem) - && Objects.equals(this.timesheet, timesheetObject.timesheet); + return Objects.equals(this.pagination, timesheetObject.pagination) && + Objects.equals(this.problem, timesheetObject.problem) && + Objects.equals(this.timesheet, timesheetObject.timesheet); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, timesheet); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/Timesheets.java b/src/main/java/com/xero/models/payrollnz/Timesheets.java index d3a0b6183..b02af8095 100644 --- a/src/main/java/com/xero/models/payrollnz/Timesheets.java +++ b/src/main/java/com/xero/models/payrollnz/Timesheets.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.Timesheet; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Timesheets + */ -/** Timesheets */ public class Timesheets { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Timesheets { @JsonProperty("timesheets") private List timesheets = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Timesheets - */ + * pagination + * @param pagination Pagination + * @return Timesheets + **/ public Timesheets pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Timesheets - */ + * problem + * @param problem Problem + * @return Timesheets + **/ public Timesheets problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * timesheets - * - * @param timesheets List<Timesheet> - * @return Timesheets - */ + * timesheets + * @param timesheets List<Timesheet> + * @return Timesheets + **/ public Timesheets timesheets(List timesheets) { this.timesheets = timesheets; return this; @@ -113,10 +126,9 @@ public Timesheets timesheets(List timesheets) { /** * timesheets - * - * @param timesheetsItem Timesheet + * @param timesheetsItem Timesheet * @return Timesheets - */ + **/ public Timesheets addTimesheetsItem(Timesheet timesheetsItem) { if (this.timesheets == null) { this.timesheets = new ArrayList(); @@ -125,30 +137,29 @@ public Timesheets addTimesheetsItem(Timesheet timesheetsItem) { return this; } - /** + /** * Get timesheets - * * @return timesheets - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheets - * * @return timesheets List - */ + **/ public List getTimesheets() { return timesheets; } - /** - * timesheets - * - * @param timesheets List<Timesheet> - */ + /** + * timesheets + * @param timesheets List<Timesheet> + **/ + public void setTimesheets(List timesheets) { this.timesheets = timesheets; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Timesheets timesheets = (Timesheets) o; - return Objects.equals(this.pagination, timesheets.pagination) - && Objects.equals(this.problem, timesheets.problem) - && Objects.equals(this.timesheets, timesheets.timesheets); + return Objects.equals(this.pagination, timesheets.pagination) && + Objects.equals(this.problem, timesheets.problem) && + Objects.equals(this.timesheets, timesheets.timesheets); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, timesheets); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TrackingCategories.java b/src/main/java/com/xero/models/payrollnz/TrackingCategories.java index cda7e1f47..4f9a9d9d2 100644 --- a/src/main/java/com/xero/models/payrollnz/TrackingCategories.java +++ b/src/main/java/com/xero/models/payrollnz/TrackingCategories.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrollnz.Pagination; +import com.xero.models.payrollnz.Problem; +import com.xero.models.payrollnz.TrackingCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingCategories + */ -/** TrackingCategories */ public class TrackingCategories { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class TrackingCategories { @JsonProperty("trackingCategories") private TrackingCategory trackingCategories; /** - * pagination - * - * @param pagination Pagination - * @return TrackingCategories - */ + * pagination + * @param pagination Pagination + * @return TrackingCategories + **/ public TrackingCategories pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return TrackingCategories - */ + * problem + * @param problem Problem + * @return TrackingCategories + **/ public TrackingCategories problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * trackingCategories - * - * @param trackingCategories TrackingCategory - * @return TrackingCategories - */ + * trackingCategories + * @param trackingCategories TrackingCategory + * @return TrackingCategories + **/ public TrackingCategories trackingCategories(TrackingCategory trackingCategories) { this.trackingCategories = trackingCategories; return this; } - /** + /** * Get trackingCategories - * * @return trackingCategories - */ + **/ @ApiModelProperty(value = "") - /** + /** * trackingCategories - * * @return trackingCategories TrackingCategory - */ + **/ public TrackingCategory getTrackingCategories() { return trackingCategories; } - /** - * trackingCategories - * - * @param trackingCategories TrackingCategory - */ + /** + * trackingCategories + * @param trackingCategories TrackingCategory + **/ + public void setTrackingCategories(TrackingCategory trackingCategories) { this.trackingCategories = trackingCategories; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } TrackingCategories trackingCategories = (TrackingCategories) o; - return Objects.equals(this.pagination, trackingCategories.pagination) - && Objects.equals(this.problem, trackingCategories.problem) - && Objects.equals(this.trackingCategories, trackingCategories.trackingCategories); + return Objects.equals(this.pagination, trackingCategories.pagination) && + Objects.equals(this.problem, trackingCategories.problem) && + Objects.equals(this.trackingCategories, trackingCategories.trackingCategories); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, trackingCategories); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/TrackingCategory.java b/src/main/java/com/xero/models/payrollnz/TrackingCategory.java index e5a5cd07e..d1b56d072 100644 --- a/src/main/java/com/xero/models/payrollnz/TrackingCategory.java +++ b/src/main/java/com/xero/models/payrollnz/TrackingCategory.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingCategory + */ -/** TrackingCategory */ public class TrackingCategory { StringUtil util = new StringUtil(); @@ -27,75 +44,70 @@ public class TrackingCategory { @JsonProperty("timesheetTrackingCategoryID") private UUID timesheetTrackingCategoryID; /** - * The Xero identifier for Employee groups tracking category. - * - * @param employeeGroupsTrackingCategoryID UUID - * @return TrackingCategory - */ + * The Xero identifier for Employee groups tracking category. + * @param employeeGroupsTrackingCategoryID UUID + * @return TrackingCategory + **/ public TrackingCategory employeeGroupsTrackingCategoryID(UUID employeeGroupsTrackingCategoryID) { this.employeeGroupsTrackingCategoryID = employeeGroupsTrackingCategoryID; return this; } - /** + /** * The Xero identifier for Employee groups tracking category. - * * @return employeeGroupsTrackingCategoryID - */ + **/ @ApiModelProperty(value = "The Xero identifier for Employee groups tracking category.") - /** + /** * The Xero identifier for Employee groups tracking category. - * * @return employeeGroupsTrackingCategoryID UUID - */ + **/ public UUID getEmployeeGroupsTrackingCategoryID() { return employeeGroupsTrackingCategoryID; } - /** - * The Xero identifier for Employee groups tracking category. - * - * @param employeeGroupsTrackingCategoryID UUID - */ + /** + * The Xero identifier for Employee groups tracking category. + * @param employeeGroupsTrackingCategoryID UUID + **/ + public void setEmployeeGroupsTrackingCategoryID(UUID employeeGroupsTrackingCategoryID) { this.employeeGroupsTrackingCategoryID = employeeGroupsTrackingCategoryID; } /** - * The Xero identifier for Timesheet tracking category. - * - * @param timesheetTrackingCategoryID UUID - * @return TrackingCategory - */ + * The Xero identifier for Timesheet tracking category. + * @param timesheetTrackingCategoryID UUID + * @return TrackingCategory + **/ public TrackingCategory timesheetTrackingCategoryID(UUID timesheetTrackingCategoryID) { this.timesheetTrackingCategoryID = timesheetTrackingCategoryID; return this; } - /** + /** * The Xero identifier for Timesheet tracking category. - * * @return timesheetTrackingCategoryID - */ + **/ @ApiModelProperty(value = "The Xero identifier for Timesheet tracking category.") - /** + /** * The Xero identifier for Timesheet tracking category. - * * @return timesheetTrackingCategoryID UUID - */ + **/ public UUID getTimesheetTrackingCategoryID() { return timesheetTrackingCategoryID; } - /** - * The Xero identifier for Timesheet tracking category. - * - * @param timesheetTrackingCategoryID UUID - */ + /** + * The Xero identifier for Timesheet tracking category. + * @param timesheetTrackingCategoryID UUID + **/ + public void setTimesheetTrackingCategoryID(UUID timesheetTrackingCategoryID) { this.timesheetTrackingCategoryID = timesheetTrackingCategoryID; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,11 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } TrackingCategory trackingCategory = (TrackingCategory) o; - return Objects.equals( - this.employeeGroupsTrackingCategoryID, - trackingCategory.employeeGroupsTrackingCategoryID) - && Objects.equals( - this.timesheetTrackingCategoryID, trackingCategory.timesheetTrackingCategoryID); + return Objects.equals(this.employeeGroupsTrackingCategoryID, trackingCategory.employeeGroupsTrackingCategoryID) && + Objects.equals(this.timesheetTrackingCategoryID, trackingCategory.timesheetTrackingCategoryID); } @Override @@ -117,22 +126,20 @@ public int hashCode() { return Objects.hash(employeeGroupsTrackingCategoryID, timesheetTrackingCategoryID); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TrackingCategory {\n"); - sb.append(" employeeGroupsTrackingCategoryID: ") - .append(toIndentedString(employeeGroupsTrackingCategoryID)) - .append("\n"); - sb.append(" timesheetTrackingCategoryID: ") - .append(toIndentedString(timesheetTrackingCategoryID)) - .append("\n"); + sb.append(" employeeGroupsTrackingCategoryID: ").append(toIndentedString(employeeGroupsTrackingCategoryID)).append("\n"); + sb.append(" timesheetTrackingCategoryID: ").append(toIndentedString(timesheetTrackingCategoryID)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -140,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrollnz/WorkingWeek.java b/src/main/java/com/xero/models/payrollnz/WorkingWeek.java index bd6eea169..dacc2567b 100644 --- a/src/main/java/com/xero/models/payrollnz/WorkingWeek.java +++ b/src/main/java/com/xero/models/payrollnz/WorkingWeek.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrollnz; +package com.xero.models.payrollnz; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * WorkingWeek + */ -/** WorkingWeek */ public class WorkingWeek { StringUtil util = new StringUtil(); @@ -41,250 +58,230 @@ public class WorkingWeek { @JsonProperty("sunday") private Double sunday; /** - * The number of hours worked on a Monday - * - * @param monday Double - * @return WorkingWeek - */ + * The number of hours worked on a Monday + * @param monday Double + * @return WorkingWeek + **/ public WorkingWeek monday(Double monday) { this.monday = monday; return this; } - /** + /** * The number of hours worked on a Monday - * * @return monday - */ + **/ @ApiModelProperty(required = true, value = "The number of hours worked on a Monday") - /** + /** * The number of hours worked on a Monday - * * @return monday Double - */ + **/ public Double getMonday() { return monday; } - /** - * The number of hours worked on a Monday - * - * @param monday Double - */ + /** + * The number of hours worked on a Monday + * @param monday Double + **/ + public void setMonday(Double monday) { this.monday = monday; } /** - * The number of hours worked on a Tuesday - * - * @param tuesday Double - * @return WorkingWeek - */ + * The number of hours worked on a Tuesday + * @param tuesday Double + * @return WorkingWeek + **/ public WorkingWeek tuesday(Double tuesday) { this.tuesday = tuesday; return this; } - /** + /** * The number of hours worked on a Tuesday - * * @return tuesday - */ + **/ @ApiModelProperty(required = true, value = "The number of hours worked on a Tuesday") - /** + /** * The number of hours worked on a Tuesday - * * @return tuesday Double - */ + **/ public Double getTuesday() { return tuesday; } - /** - * The number of hours worked on a Tuesday - * - * @param tuesday Double - */ + /** + * The number of hours worked on a Tuesday + * @param tuesday Double + **/ + public void setTuesday(Double tuesday) { this.tuesday = tuesday; } /** - * The number of hours worked on a Wednesday - * - * @param wednesday Double - * @return WorkingWeek - */ + * The number of hours worked on a Wednesday + * @param wednesday Double + * @return WorkingWeek + **/ public WorkingWeek wednesday(Double wednesday) { this.wednesday = wednesday; return this; } - /** + /** * The number of hours worked on a Wednesday - * * @return wednesday - */ + **/ @ApiModelProperty(required = true, value = "The number of hours worked on a Wednesday") - /** + /** * The number of hours worked on a Wednesday - * * @return wednesday Double - */ + **/ public Double getWednesday() { return wednesday; } - /** - * The number of hours worked on a Wednesday - * - * @param wednesday Double - */ + /** + * The number of hours worked on a Wednesday + * @param wednesday Double + **/ + public void setWednesday(Double wednesday) { this.wednesday = wednesday; } /** - * The number of hours worked on a Thursday - * - * @param thursday Double - * @return WorkingWeek - */ + * The number of hours worked on a Thursday + * @param thursday Double + * @return WorkingWeek + **/ public WorkingWeek thursday(Double thursday) { this.thursday = thursday; return this; } - /** + /** * The number of hours worked on a Thursday - * * @return thursday - */ + **/ @ApiModelProperty(required = true, value = "The number of hours worked on a Thursday") - /** + /** * The number of hours worked on a Thursday - * * @return thursday Double - */ + **/ public Double getThursday() { return thursday; } - /** - * The number of hours worked on a Thursday - * - * @param thursday Double - */ + /** + * The number of hours worked on a Thursday + * @param thursday Double + **/ + public void setThursday(Double thursday) { this.thursday = thursday; } /** - * The number of hours worked on a Friday - * - * @param friday Double - * @return WorkingWeek - */ + * The number of hours worked on a Friday + * @param friday Double + * @return WorkingWeek + **/ public WorkingWeek friday(Double friday) { this.friday = friday; return this; } - /** + /** * The number of hours worked on a Friday - * * @return friday - */ + **/ @ApiModelProperty(required = true, value = "The number of hours worked on a Friday") - /** + /** * The number of hours worked on a Friday - * * @return friday Double - */ + **/ public Double getFriday() { return friday; } - /** - * The number of hours worked on a Friday - * - * @param friday Double - */ + /** + * The number of hours worked on a Friday + * @param friday Double + **/ + public void setFriday(Double friday) { this.friday = friday; } /** - * The number of hours worked on a Saturday - * - * @param saturday Double - * @return WorkingWeek - */ + * The number of hours worked on a Saturday + * @param saturday Double + * @return WorkingWeek + **/ public WorkingWeek saturday(Double saturday) { this.saturday = saturday; return this; } - /** + /** * The number of hours worked on a Saturday - * * @return saturday - */ + **/ @ApiModelProperty(required = true, value = "The number of hours worked on a Saturday") - /** + /** * The number of hours worked on a Saturday - * * @return saturday Double - */ + **/ public Double getSaturday() { return saturday; } - /** - * The number of hours worked on a Saturday - * - * @param saturday Double - */ + /** + * The number of hours worked on a Saturday + * @param saturday Double + **/ + public void setSaturday(Double saturday) { this.saturday = saturday; } /** - * The number of hours worked on a Sunday - * - * @param sunday Double - * @return WorkingWeek - */ + * The number of hours worked on a Sunday + * @param sunday Double + * @return WorkingWeek + **/ public WorkingWeek sunday(Double sunday) { this.sunday = sunday; return this; } - /** + /** * The number of hours worked on a Sunday - * * @return sunday - */ + **/ @ApiModelProperty(required = true, value = "The number of hours worked on a Sunday") - /** + /** * The number of hours worked on a Sunday - * * @return sunday Double - */ + **/ public Double getSunday() { return sunday; } - /** - * The number of hours worked on a Sunday - * - * @param sunday Double - */ + /** + * The number of hours worked on a Sunday + * @param sunday Double + **/ + public void setSunday(Double sunday) { this.sunday = sunday; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -294,13 +291,13 @@ public boolean equals(java.lang.Object o) { return false; } WorkingWeek workingWeek = (WorkingWeek) o; - return Objects.equals(this.monday, workingWeek.monday) - && Objects.equals(this.tuesday, workingWeek.tuesday) - && Objects.equals(this.wednesday, workingWeek.wednesday) - && Objects.equals(this.thursday, workingWeek.thursday) - && Objects.equals(this.friday, workingWeek.friday) - && Objects.equals(this.saturday, workingWeek.saturday) - && Objects.equals(this.sunday, workingWeek.sunday); + return Objects.equals(this.monday, workingWeek.monday) && + Objects.equals(this.tuesday, workingWeek.tuesday) && + Objects.equals(this.wednesday, workingWeek.wednesday) && + Objects.equals(this.thursday, workingWeek.thursday) && + Objects.equals(this.friday, workingWeek.friday) && + Objects.equals(this.saturday, workingWeek.saturday) && + Objects.equals(this.sunday, workingWeek.sunday); } @Override @@ -308,6 +305,7 @@ public int hashCode() { return Objects.hash(monday, tuesday, wednesday, thursday, friday, saturday, sunday); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -324,7 +322,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -332,4 +331,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Account.java b/src/main/java/com/xero/models/payrolluk/Account.java index 3e06a8784..fa25b6c5a 100644 --- a/src/main/java/com/xero/models/payrolluk/Account.java +++ b/src/main/java/com/xero/models/payrolluk/Account.java @@ -9,43 +9,74 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Account + */ -/** Account */ public class Account { StringUtil util = new StringUtil(); @JsonProperty("accountID") private UUID accountID; - /** The assigned AccountType */ + /** + * The assigned AccountType + */ public enum TypeEnum { - /** BANK */ + /** + * BANK + */ BANK("BANK"), - - /** EMPLOYERSNIC */ + + /** + * EMPLOYERSNIC + */ EMPLOYERSNIC("EMPLOYERSNIC"), - - /** NICLIABILITY */ + + /** + * NICLIABILITY + */ NICLIABILITY("NICLIABILITY"), - - /** PAYEECONTRIBUTION */ + + /** + * PAYEECONTRIBUTION + */ PAYEECONTRIBUTION("PAYEECONTRIBUTION"), - - /** PAYELIABILITY */ + + /** + * PAYELIABILITY + */ PAYELIABILITY("PAYELIABILITY"), - - /** WAGESPAYABLE */ + + /** + * WAGESPAYABLE + */ WAGESPAYABLE("WAGESPAYABLE"), - - /** WAGESEXPENSE */ + + /** + * WAGESEXPENSE + */ WAGESEXPENSE("WAGESEXPENSE"); private String value; @@ -54,31 +85,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -90,6 +115,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("type") private TypeEnum type; @@ -99,145 +125,134 @@ public static TypeEnum fromValue(String value) { @JsonProperty("name") private String name; /** - * The Xero identifier for Settings. - * - * @param accountID UUID - * @return Account - */ + * The Xero identifier for Settings. + * @param accountID UUID + * @return Account + **/ public Account accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * The Xero identifier for Settings. - * * @return accountID - */ + **/ @ApiModelProperty(value = "The Xero identifier for Settings.") - /** + /** * The Xero identifier for Settings. - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * The Xero identifier for Settings. - * - * @param accountID UUID - */ + /** + * The Xero identifier for Settings. + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * The assigned AccountType - * - * @param type TypeEnum - * @return Account - */ + * The assigned AccountType + * @param type TypeEnum + * @return Account + **/ public Account type(TypeEnum type) { this.type = type; return this; } - /** + /** * The assigned AccountType - * * @return type - */ + **/ @ApiModelProperty(value = "The assigned AccountType") - /** + /** * The assigned AccountType - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * The assigned AccountType - * - * @param type TypeEnum - */ + /** + * The assigned AccountType + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * A unique 3 digit number for each Account - * - * @param code String - * @return Account - */ + * A unique 3 digit number for each Account + * @param code String + * @return Account + **/ public Account code(String code) { this.code = code; return this; } - /** + /** * A unique 3 digit number for each Account - * * @return code - */ + **/ @ApiModelProperty(value = "A unique 3 digit number for each Account") - /** + /** * A unique 3 digit number for each Account - * * @return code String - */ + **/ public String getCode() { return code; } - /** - * A unique 3 digit number for each Account - * - * @param code String - */ + /** + * A unique 3 digit number for each Account + * @param code String + **/ + public void setCode(String code) { this.code = code; } /** - * Name of the Account. - * - * @param name String - * @return Account - */ + * Name of the Account. + * @param name String + * @return Account + **/ public Account name(String name) { this.name = name; return this; } - /** + /** * Name of the Account. - * * @return name - */ + **/ @ApiModelProperty(value = "Name of the Account.") - /** + /** * Name of the Account. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the Account. - * - * @param name String - */ + /** + * Name of the Account. + * @param name String + **/ + public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -247,10 +262,10 @@ public boolean equals(java.lang.Object o) { return false; } Account account = (Account) o; - return Objects.equals(this.accountID, account.accountID) - && Objects.equals(this.type, account.type) - && Objects.equals(this.code, account.code) - && Objects.equals(this.name, account.name); + return Objects.equals(this.accountID, account.accountID) && + Objects.equals(this.type, account.type) && + Objects.equals(this.code, account.code) && + Objects.equals(this.name, account.name); } @Override @@ -258,6 +273,7 @@ public int hashCode() { return Objects.hash(accountID, type, code, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -271,7 +287,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -279,4 +296,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Accounts.java b/src/main/java/com/xero/models/payrolluk/Accounts.java index 76a2f2965..f5ae0e334 100644 --- a/src/main/java/com/xero/models/payrolluk/Accounts.java +++ b/src/main/java/com/xero/models/payrolluk/Accounts.java @@ -9,27 +9,44 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Account; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Accounts + */ -/** Accounts */ public class Accounts { StringUtil util = new StringUtil(); @JsonProperty("accounts") private List accounts = new ArrayList(); /** - * accounts - * - * @param accounts List<Account> - * @return Accounts - */ + * accounts + * @param accounts List<Account> + * @return Accounts + **/ public Accounts accounts(List accounts) { this.accounts = accounts; return this; @@ -37,10 +54,9 @@ public Accounts accounts(List accounts) { /** * accounts - * - * @param accountsItem Account + * @param accountsItem Account * @return Accounts - */ + **/ public Accounts addAccountsItem(Account accountsItem) { if (this.accounts == null) { this.accounts = new ArrayList(); @@ -49,30 +65,29 @@ public Accounts addAccountsItem(Account accountsItem) { return this; } - /** + /** * Get accounts - * * @return accounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * accounts - * * @return accounts List - */ + **/ public List getAccounts() { return accounts; } - /** - * accounts - * - * @param accounts List<Account> - */ + /** + * accounts + * @param accounts List<Account> + **/ + public void setAccounts(List accounts) { this.accounts = accounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,6 +105,7 @@ public int hashCode() { return Objects.hash(accounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,7 +116,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -108,4 +125,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Address.java b/src/main/java/com/xero/models/payrolluk/Address.java index 658657a98..677d5022b 100644 --- a/src/main/java/com/xero/models/payrolluk/Address.java +++ b/src/main/java/com/xero/models/payrolluk/Address.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Address + */ -/** Address */ public class Address { StringUtil util = new StringUtil(); @@ -35,186 +52,166 @@ public class Address { @JsonProperty("countryName") private String countryName; /** - * Address line 1 for employee home address - * - * @param addressLine1 String - * @return Address - */ + * Address line 1 for employee home address + * @param addressLine1 String + * @return Address + **/ public Address addressLine1(String addressLine1) { this.addressLine1 = addressLine1; return this; } - /** + /** * Address line 1 for employee home address - * * @return addressLine1 - */ - @ApiModelProperty( - example = "123 Main St", - required = true, - value = "Address line 1 for employee home address") - /** + **/ + @ApiModelProperty(example = "123 Main St", required = true, value = "Address line 1 for employee home address") + /** * Address line 1 for employee home address - * * @return addressLine1 String - */ + **/ public String getAddressLine1() { return addressLine1; } - /** - * Address line 1 for employee home address - * - * @param addressLine1 String - */ + /** + * Address line 1 for employee home address + * @param addressLine1 String + **/ + public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } /** - * Address line 2 for employee home address - * - * @param addressLine2 String - * @return Address - */ + * Address line 2 for employee home address + * @param addressLine2 String + * @return Address + **/ public Address addressLine2(String addressLine2) { this.addressLine2 = addressLine2; return this; } - /** + /** * Address line 2 for employee home address - * * @return addressLine2 - */ + **/ @ApiModelProperty(example = "Apt 4", value = "Address line 2 for employee home address") - /** + /** * Address line 2 for employee home address - * * @return addressLine2 String - */ + **/ public String getAddressLine2() { return addressLine2; } - /** - * Address line 2 for employee home address - * - * @param addressLine2 String - */ + /** + * Address line 2 for employee home address + * @param addressLine2 String + **/ + public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } /** - * Suburb for employee home address - * - * @param city String - * @return Address - */ + * Suburb for employee home address + * @param city String + * @return Address + **/ public Address city(String city) { this.city = city; return this; } - /** + /** * Suburb for employee home address - * * @return city - */ + **/ @ApiModelProperty(example = "Fulham", required = true, value = "Suburb for employee home address") - /** + /** * Suburb for employee home address - * * @return city String - */ + **/ public String getCity() { return city; } - /** - * Suburb for employee home address - * - * @param city String - */ + /** + * Suburb for employee home address + * @param city String + **/ + public void setCity(String city) { this.city = city; } /** - * PostCode for employee home address - * - * @param postCode String - * @return Address - */ + * PostCode for employee home address + * @param postCode String + * @return Address + **/ public Address postCode(String postCode) { this.postCode = postCode; return this; } - /** + /** * PostCode for employee home address - * * @return postCode - */ - @ApiModelProperty( - example = "SW6 6EY", - required = true, - value = "PostCode for employee home address") - /** + **/ + @ApiModelProperty(example = "SW6 6EY", required = true, value = "PostCode for employee home address") + /** * PostCode for employee home address - * * @return postCode String - */ + **/ public String getPostCode() { return postCode; } - /** - * PostCode for employee home address - * - * @param postCode String - */ + /** + * PostCode for employee home address + * @param postCode String + **/ + public void setPostCode(String postCode) { this.postCode = postCode; } /** - * Country of HomeAddress - * - * @param countryName String - * @return Address - */ + * Country of HomeAddress + * @param countryName String + * @return Address + **/ public Address countryName(String countryName) { this.countryName = countryName; return this; } - /** + /** * Country of HomeAddress - * * @return countryName - */ + **/ @ApiModelProperty(example = "United Kingdom", value = "Country of HomeAddress") - /** + /** * Country of HomeAddress - * * @return countryName String - */ + **/ public String getCountryName() { return countryName; } - /** - * Country of HomeAddress - * - * @param countryName String - */ + /** + * Country of HomeAddress + * @param countryName String + **/ + public void setCountryName(String countryName) { this.countryName = countryName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -224,11 +221,11 @@ public boolean equals(java.lang.Object o) { return false; } Address address = (Address) o; - return Objects.equals(this.addressLine1, address.addressLine1) - && Objects.equals(this.addressLine2, address.addressLine2) - && Objects.equals(this.city, address.city) - && Objects.equals(this.postCode, address.postCode) - && Objects.equals(this.countryName, address.countryName); + return Objects.equals(this.addressLine1, address.addressLine1) && + Objects.equals(this.addressLine2, address.addressLine2) && + Objects.equals(this.city, address.city) && + Objects.equals(this.postCode, address.postCode) && + Objects.equals(this.countryName, address.countryName); } @Override @@ -236,6 +233,7 @@ public int hashCode() { return Objects.hash(addressLine1, addressLine2, city, postCode, countryName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,7 +248,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -258,4 +257,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/BankAccount.java b/src/main/java/com/xero/models/payrolluk/BankAccount.java index a01b72189..0c97ab0f6 100644 --- a/src/main/java/com/xero/models/payrolluk/BankAccount.java +++ b/src/main/java/com/xero/models/payrolluk/BankAccount.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BankAccount + */ -/** BankAccount */ public class BankAccount { StringUtil util = new StringUtil(); @@ -29,110 +46,102 @@ public class BankAccount { @JsonProperty("sortCode") private String sortCode; /** - * Bank account name (max length = 32) - * - * @param accountName String - * @return BankAccount - */ + * Bank account name (max length = 32) + * @param accountName String + * @return BankAccount + **/ public BankAccount accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * Bank account name (max length = 32) - * * @return accountName - */ + **/ @ApiModelProperty(required = true, value = "Bank account name (max length = 32)") - /** + /** * Bank account name (max length = 32) - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * Bank account name (max length = 32) - * - * @param accountName String - */ + /** + * Bank account name (max length = 32) + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } /** - * Bank account number (digits only; max length = 8) - * - * @param accountNumber String - * @return BankAccount - */ + * Bank account number (digits only; max length = 8) + * @param accountNumber String + * @return BankAccount + **/ public BankAccount accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** + /** * Bank account number (digits only; max length = 8) - * * @return accountNumber - */ + **/ @ApiModelProperty(required = true, value = "Bank account number (digits only; max length = 8)") - /** + /** * Bank account number (digits only; max length = 8) - * * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * Bank account number (digits only; max length = 8) - * - * @param accountNumber String - */ + /** + * Bank account number (digits only; max length = 8) + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * Bank account sort code (6 digits) - * - * @param sortCode String - * @return BankAccount - */ + * Bank account sort code (6 digits) + * @param sortCode String + * @return BankAccount + **/ public BankAccount sortCode(String sortCode) { this.sortCode = sortCode; return this; } - /** + /** * Bank account sort code (6 digits) - * * @return sortCode - */ + **/ @ApiModelProperty(required = true, value = "Bank account sort code (6 digits)") - /** + /** * Bank account sort code (6 digits) - * * @return sortCode String - */ + **/ public String getSortCode() { return sortCode; } - /** - * Bank account sort code (6 digits) - * - * @param sortCode String - */ + /** + * Bank account sort code (6 digits) + * @param sortCode String + **/ + public void setSortCode(String sortCode) { this.sortCode = sortCode; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +151,9 @@ public boolean equals(java.lang.Object o) { return false; } BankAccount bankAccount = (BankAccount) o; - return Objects.equals(this.accountName, bankAccount.accountName) - && Objects.equals(this.accountNumber, bankAccount.accountNumber) - && Objects.equals(this.sortCode, bankAccount.sortCode); + return Objects.equals(this.accountName, bankAccount.accountName) && + Objects.equals(this.accountNumber, bankAccount.accountNumber) && + Objects.equals(this.sortCode, bankAccount.sortCode); } @Override @@ -152,6 +161,7 @@ public int hashCode() { return Objects.hash(accountName, accountNumber, sortCode); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +174,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +183,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Benefit.java b/src/main/java/com/xero/models/payrolluk/Benefit.java index 2016363b0..2bddad724 100644 --- a/src/main/java/com/xero/models/payrolluk/Benefit.java +++ b/src/main/java/com/xero/models/payrolluk/Benefit.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Benefit + */ -/** Benefit */ public class Benefit { StringUtil util = new StringUtil(); @@ -28,12 +43,18 @@ public class Benefit { @JsonProperty("name") private String name; - /** Category type of the employer pension */ + /** + * Category type of the employer pension + */ public enum CategoryEnum { - /** STAKEHOLDERPENSION */ + /** + * STAKEHOLDERPENSION + */ STAKEHOLDERPENSION("StakeholderPension"), - - /** OTHER */ + + /** + * OTHER + */ OTHER("Other"); private String value; @@ -42,31 +63,25 @@ public enum CategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CategoryEnum fromValue(String value) { for (CategoryEnum b : CategoryEnum.values()) { @@ -78,6 +93,7 @@ public static CategoryEnum fromValue(String value) { } } + @JsonProperty("category") private CategoryEnum category; @@ -92,12 +108,18 @@ public static CategoryEnum fromValue(String value) { @JsonProperty("percentage") private Double percentage; - /** Calculation Type of the employer pension (FixedAmount or PercentageOfGross). */ + /** + * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). + */ public enum CalculationTypeEnum { - /** FIXEDAMOUNT */ + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FixedAmount"), - - /** PERCENTAGEOFGROSS */ + + /** + * PERCENTAGEOFGROSS + */ PERCENTAGEOFGROSS("PercentageOfGross"); private String value; @@ -106,31 +128,25 @@ public enum CalculationTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CalculationTypeEnum fromValue(String value) { for (CalculationTypeEnum b : CalculationTypeEnum.values()) { @@ -142,6 +158,7 @@ public static CalculationTypeEnum fromValue(String value) { } } + @JsonProperty("calculationType") private CalculationTypeEnum calculationType; @@ -163,497 +180,454 @@ public static CalculationTypeEnum fromValue(String value) { @JsonProperty("showBalanceToEmployee") private Boolean showBalanceToEmployee; /** - * unique identifier in Xero - * - * @param id UUID - * @return Benefit - */ + * unique identifier in Xero + * @param id UUID + * @return Benefit + **/ public Benefit id(UUID id) { this.id = id; return this; } - /** + /** * unique identifier in Xero - * * @return id - */ + **/ @ApiModelProperty(value = "unique identifier in Xero") - /** + /** * unique identifier in Xero - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * unique identifier in Xero - * - * @param id UUID - */ + /** + * unique identifier in Xero + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Name of the employer pension - * - * @param name String - * @return Benefit - */ + * Name of the employer pension + * @param name String + * @return Benefit + **/ public Benefit name(String name) { this.name = name; return this; } - /** + /** * Name of the employer pension - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the employer pension") - /** + /** * Name of the employer pension - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the employer pension - * - * @param name String - */ + /** + * Name of the employer pension + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Category type of the employer pension - * - * @param category CategoryEnum - * @return Benefit - */ + * Category type of the employer pension + * @param category CategoryEnum + * @return Benefit + **/ public Benefit category(CategoryEnum category) { this.category = category; return this; } - /** + /** * Category type of the employer pension - * * @return category - */ + **/ @ApiModelProperty(required = true, value = "Category type of the employer pension") - /** + /** * Category type of the employer pension - * * @return category CategoryEnum - */ + **/ public CategoryEnum getCategory() { return category; } - /** - * Category type of the employer pension - * - * @param category CategoryEnum - */ + /** + * Category type of the employer pension + * @param category CategoryEnum + **/ + public void setCategory(CategoryEnum category) { this.category = category; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return Benefit - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return Benefit + **/ public Benefit liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(required = true, value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Xero identifier for Expense Account - * - * @param expenseAccountId UUID - * @return Benefit - */ + * Xero identifier for Expense Account + * @param expenseAccountId UUID + * @return Benefit + **/ public Benefit expenseAccountId(UUID expenseAccountId) { this.expenseAccountId = expenseAccountId; return this; } - /** + /** * Xero identifier for Expense Account - * * @return expenseAccountId - */ + **/ @ApiModelProperty(required = true, value = "Xero identifier for Expense Account") - /** + /** * Xero identifier for Expense Account - * * @return expenseAccountId UUID - */ + **/ public UUID getExpenseAccountId() { return expenseAccountId; } - /** - * Xero identifier for Expense Account - * - * @param expenseAccountId UUID - */ + /** + * Xero identifier for Expense Account + * @param expenseAccountId UUID + **/ + public void setExpenseAccountId(UUID expenseAccountId) { this.expenseAccountId = expenseAccountId; } /** - * Standard amount of the employer pension - * - * @param standardAmount Double - * @return Benefit - */ + * Standard amount of the employer pension + * @param standardAmount Double + * @return Benefit + **/ public Benefit standardAmount(Double standardAmount) { this.standardAmount = standardAmount; return this; } - /** + /** * Standard amount of the employer pension - * * @return standardAmount - */ + **/ @ApiModelProperty(value = "Standard amount of the employer pension") - /** + /** * Standard amount of the employer pension - * * @return standardAmount Double - */ + **/ public Double getStandardAmount() { return standardAmount; } - /** - * Standard amount of the employer pension - * - * @param standardAmount Double - */ + /** + * Standard amount of the employer pension + * @param standardAmount Double + **/ + public void setStandardAmount(Double standardAmount) { this.standardAmount = standardAmount; } /** - * Percentage of gross of the employer pension - * - * @param percentage Double - * @return Benefit - */ + * Percentage of gross of the employer pension + * @param percentage Double + * @return Benefit + **/ public Benefit percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Percentage of gross of the employer pension - * * @return percentage - */ + **/ @ApiModelProperty(required = true, value = "Percentage of gross of the employer pension") - /** + /** * Percentage of gross of the employer pension - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Percentage of gross of the employer pension - * - * @param percentage Double - */ + /** + * Percentage of gross of the employer pension + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } /** - * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). - * - * @param calculationType CalculationTypeEnum - * @return Benefit - */ + * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). + * @param calculationType CalculationTypeEnum + * @return Benefit + **/ public Benefit calculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; return this; } - /** + /** * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). - * * @return calculationType - */ - @ApiModelProperty( - required = true, - value = "Calculation Type of the employer pension (FixedAmount or PercentageOfGross).") - /** + **/ + @ApiModelProperty(required = true, value = "Calculation Type of the employer pension (FixedAmount or PercentageOfGross).") + /** * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). - * * @return calculationType CalculationTypeEnum - */ + **/ public CalculationTypeEnum getCalculationType() { return calculationType; } - /** - * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). - * - * @param calculationType CalculationTypeEnum - */ + /** + * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). + * @param calculationType CalculationTypeEnum + **/ + public void setCalculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return Benefit - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return Benefit + **/ public Benefit currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * Identifier of subject To NIC - * - * @param subjectToNIC Boolean - * @return Benefit - */ + * Identifier of subject To NIC + * @param subjectToNIC Boolean + * @return Benefit + **/ public Benefit subjectToNIC(Boolean subjectToNIC) { this.subjectToNIC = subjectToNIC; return this; } - /** + /** * Identifier of subject To NIC - * * @return subjectToNIC - */ + **/ @ApiModelProperty(value = "Identifier of subject To NIC") - /** + /** * Identifier of subject To NIC - * * @return subjectToNIC Boolean - */ + **/ public Boolean getSubjectToNIC() { return subjectToNIC; } - /** - * Identifier of subject To NIC - * - * @param subjectToNIC Boolean - */ + /** + * Identifier of subject To NIC + * @param subjectToNIC Boolean + **/ + public void setSubjectToNIC(Boolean subjectToNIC) { this.subjectToNIC = subjectToNIC; } /** - * Identifier of subject To pension - * - * @param subjectToPension Boolean - * @return Benefit - */ + * Identifier of subject To pension + * @param subjectToPension Boolean + * @return Benefit + **/ public Benefit subjectToPension(Boolean subjectToPension) { this.subjectToPension = subjectToPension; return this; } - /** + /** * Identifier of subject To pension - * * @return subjectToPension - */ + **/ @ApiModelProperty(value = "Identifier of subject To pension") - /** + /** * Identifier of subject To pension - * * @return subjectToPension Boolean - */ + **/ public Boolean getSubjectToPension() { return subjectToPension; } - /** - * Identifier of subject To pension - * - * @param subjectToPension Boolean - */ + /** + * Identifier of subject To pension + * @param subjectToPension Boolean + **/ + public void setSubjectToPension(Boolean subjectToPension) { this.subjectToPension = subjectToPension; } /** - * Identifier of subject To Tax - * - * @param subjectToTax Boolean - * @return Benefit - */ + * Identifier of subject To Tax + * @param subjectToTax Boolean + * @return Benefit + **/ public Benefit subjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; return this; } - /** + /** * Identifier of subject To Tax - * * @return subjectToTax - */ + **/ @ApiModelProperty(value = "Identifier of subject To Tax") - /** + /** * Identifier of subject To Tax - * * @return subjectToTax Boolean - */ + **/ public Boolean getSubjectToTax() { return subjectToTax; } - /** - * Identifier of subject To Tax - * - * @param subjectToTax Boolean - */ + /** + * Identifier of subject To Tax + * @param subjectToTax Boolean + **/ + public void setSubjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; } /** - * Identifier of calculating on qualifying earnings - * - * @param isCalculatingOnQualifyingEarnings Boolean - * @return Benefit - */ + * Identifier of calculating on qualifying earnings + * @param isCalculatingOnQualifyingEarnings Boolean + * @return Benefit + **/ public Benefit isCalculatingOnQualifyingEarnings(Boolean isCalculatingOnQualifyingEarnings) { this.isCalculatingOnQualifyingEarnings = isCalculatingOnQualifyingEarnings; return this; } - /** + /** * Identifier of calculating on qualifying earnings - * * @return isCalculatingOnQualifyingEarnings - */ + **/ @ApiModelProperty(value = "Identifier of calculating on qualifying earnings") - /** + /** * Identifier of calculating on qualifying earnings - * * @return isCalculatingOnQualifyingEarnings Boolean - */ + **/ public Boolean getIsCalculatingOnQualifyingEarnings() { return isCalculatingOnQualifyingEarnings; } - /** - * Identifier of calculating on qualifying earnings - * - * @param isCalculatingOnQualifyingEarnings Boolean - */ + /** + * Identifier of calculating on qualifying earnings + * @param isCalculatingOnQualifyingEarnings Boolean + **/ + public void setIsCalculatingOnQualifyingEarnings(Boolean isCalculatingOnQualifyingEarnings) { this.isCalculatingOnQualifyingEarnings = isCalculatingOnQualifyingEarnings; } /** - * display the balance to employee - * - * @param showBalanceToEmployee Boolean - * @return Benefit - */ + * display the balance to employee + * @param showBalanceToEmployee Boolean + * @return Benefit + **/ public Benefit showBalanceToEmployee(Boolean showBalanceToEmployee) { this.showBalanceToEmployee = showBalanceToEmployee; return this; } - /** + /** * display the balance to employee - * * @return showBalanceToEmployee - */ + **/ @ApiModelProperty(value = "display the balance to employee") - /** + /** * display the balance to employee - * * @return showBalanceToEmployee Boolean - */ + **/ public Boolean getShowBalanceToEmployee() { return showBalanceToEmployee; } - /** - * display the balance to employee - * - * @param showBalanceToEmployee Boolean - */ + /** + * display the balance to employee + * @param showBalanceToEmployee Boolean + **/ + public void setShowBalanceToEmployee(Boolean showBalanceToEmployee) { this.showBalanceToEmployee = showBalanceToEmployee; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -663,42 +637,28 @@ public boolean equals(java.lang.Object o) { return false; } Benefit benefit = (Benefit) o; - return Objects.equals(this.id, benefit.id) - && Objects.equals(this.name, benefit.name) - && Objects.equals(this.category, benefit.category) - && Objects.equals(this.liabilityAccountId, benefit.liabilityAccountId) - && Objects.equals(this.expenseAccountId, benefit.expenseAccountId) - && Objects.equals(this.standardAmount, benefit.standardAmount) - && Objects.equals(this.percentage, benefit.percentage) - && Objects.equals(this.calculationType, benefit.calculationType) - && Objects.equals(this.currentRecord, benefit.currentRecord) - && Objects.equals(this.subjectToNIC, benefit.subjectToNIC) - && Objects.equals(this.subjectToPension, benefit.subjectToPension) - && Objects.equals(this.subjectToTax, benefit.subjectToTax) - && Objects.equals( - this.isCalculatingOnQualifyingEarnings, benefit.isCalculatingOnQualifyingEarnings) - && Objects.equals(this.showBalanceToEmployee, benefit.showBalanceToEmployee); + return Objects.equals(this.id, benefit.id) && + Objects.equals(this.name, benefit.name) && + Objects.equals(this.category, benefit.category) && + Objects.equals(this.liabilityAccountId, benefit.liabilityAccountId) && + Objects.equals(this.expenseAccountId, benefit.expenseAccountId) && + Objects.equals(this.standardAmount, benefit.standardAmount) && + Objects.equals(this.percentage, benefit.percentage) && + Objects.equals(this.calculationType, benefit.calculationType) && + Objects.equals(this.currentRecord, benefit.currentRecord) && + Objects.equals(this.subjectToNIC, benefit.subjectToNIC) && + Objects.equals(this.subjectToPension, benefit.subjectToPension) && + Objects.equals(this.subjectToTax, benefit.subjectToTax) && + Objects.equals(this.isCalculatingOnQualifyingEarnings, benefit.isCalculatingOnQualifyingEarnings) && + Objects.equals(this.showBalanceToEmployee, benefit.showBalanceToEmployee); } @Override public int hashCode() { - return Objects.hash( - id, - name, - category, - liabilityAccountId, - expenseAccountId, - standardAmount, - percentage, - calculationType, - currentRecord, - subjectToNIC, - subjectToPension, - subjectToTax, - isCalculatingOnQualifyingEarnings, - showBalanceToEmployee); + return Objects.hash(id, name, category, liabilityAccountId, expenseAccountId, standardAmount, percentage, calculationType, currentRecord, subjectToNIC, subjectToPension, subjectToTax, isCalculatingOnQualifyingEarnings, showBalanceToEmployee); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -715,18 +675,15 @@ public String toString() { sb.append(" subjectToNIC: ").append(toIndentedString(subjectToNIC)).append("\n"); sb.append(" subjectToPension: ").append(toIndentedString(subjectToPension)).append("\n"); sb.append(" subjectToTax: ").append(toIndentedString(subjectToTax)).append("\n"); - sb.append(" isCalculatingOnQualifyingEarnings: ") - .append(toIndentedString(isCalculatingOnQualifyingEarnings)) - .append("\n"); - sb.append(" showBalanceToEmployee: ") - .append(toIndentedString(showBalanceToEmployee)) - .append("\n"); + sb.append(" isCalculatingOnQualifyingEarnings: ").append(toIndentedString(isCalculatingOnQualifyingEarnings)).append("\n"); + sb.append(" showBalanceToEmployee: ").append(toIndentedString(showBalanceToEmployee)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -734,4 +691,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/BenefitLine.java b/src/main/java/com/xero/models/payrolluk/BenefitLine.java index 5394a9cde..c5fdc3c78 100644 --- a/src/main/java/com/xero/models/payrolluk/BenefitLine.java +++ b/src/main/java/com/xero/models/payrolluk/BenefitLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BenefitLine + */ -/** BenefitLine */ public class BenefitLine { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class BenefitLine { @JsonProperty("percentage") private Double percentage; /** - * Xero identifier for payroll benefit type - * - * @param benefitTypeID UUID - * @return BenefitLine - */ + * Xero identifier for payroll benefit type + * @param benefitTypeID UUID + * @return BenefitLine + **/ public BenefitLine benefitTypeID(UUID benefitTypeID) { this.benefitTypeID = benefitTypeID; return this; } - /** + /** * Xero identifier for payroll benefit type - * * @return benefitTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll benefit type") - /** + /** * Xero identifier for payroll benefit type - * * @return benefitTypeID UUID - */ + **/ public UUID getBenefitTypeID() { return benefitTypeID; } - /** - * Xero identifier for payroll benefit type - * - * @param benefitTypeID UUID - */ + /** + * Xero identifier for payroll benefit type + * @param benefitTypeID UUID + **/ + public void setBenefitTypeID(UUID benefitTypeID) { this.benefitTypeID = benefitTypeID; } /** - * Benefit display name - * - * @param displayName String - * @return BenefitLine - */ + * Benefit display name + * @param displayName String + * @return BenefitLine + **/ public BenefitLine displayName(String displayName) { this.displayName = displayName; return this; } - /** + /** * Benefit display name - * * @return displayName - */ + **/ @ApiModelProperty(value = "Benefit display name") - /** + /** * Benefit display name - * * @return displayName String - */ + **/ public String getDisplayName() { return displayName; } - /** - * Benefit display name - * - * @param displayName String - */ + /** + * Benefit display name + * @param displayName String + **/ + public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * The amount of the benefit line. - * - * @param amount Double - * @return BenefitLine - */ + * The amount of the benefit line. + * @param amount Double + * @return BenefitLine + **/ public BenefitLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the benefit line. - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the benefit line.") - /** + /** * The amount of the benefit line. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the benefit line. - * - * @param amount Double - */ + /** + * The amount of the benefit line. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Benefit fixed amount - * - * @param fixedAmount Double - * @return BenefitLine - */ + * Benefit fixed amount + * @param fixedAmount Double + * @return BenefitLine + **/ public BenefitLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Benefit fixed amount - * * @return fixedAmount - */ + **/ @ApiModelProperty(value = "Benefit fixed amount") - /** + /** * Benefit fixed amount - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Benefit fixed amount - * - * @param fixedAmount Double - */ + /** + * Benefit fixed amount + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * Benefit rate percentage - * - * @param percentage Double - * @return BenefitLine - */ + * Benefit rate percentage + * @param percentage Double + * @return BenefitLine + **/ public BenefitLine percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Benefit rate percentage - * * @return percentage - */ + **/ @ApiModelProperty(value = "Benefit rate percentage") - /** + /** * Benefit rate percentage - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Benefit rate percentage - * - * @param percentage Double - */ + /** + * Benefit rate percentage + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } BenefitLine benefitLine = (BenefitLine) o; - return Objects.equals(this.benefitTypeID, benefitLine.benefitTypeID) - && Objects.equals(this.displayName, benefitLine.displayName) - && Objects.equals(this.amount, benefitLine.amount) - && Objects.equals(this.fixedAmount, benefitLine.fixedAmount) - && Objects.equals(this.percentage, benefitLine.percentage); + return Objects.equals(this.benefitTypeID, benefitLine.benefitTypeID) && + Objects.equals(this.displayName, benefitLine.displayName) && + Objects.equals(this.amount, benefitLine.amount) && + Objects.equals(this.fixedAmount, benefitLine.fixedAmount) && + Objects.equals(this.percentage, benefitLine.percentage); } @Override @@ -231,6 +234,7 @@ public int hashCode() { return Objects.hash(benefitTypeID, displayName, amount, fixedAmount, percentage); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/BenefitObject.java b/src/main/java/com/xero/models/payrolluk/BenefitObject.java index 379cbf189..cb55731df 100644 --- a/src/main/java/com/xero/models/payrolluk/BenefitObject.java +++ b/src/main/java/com/xero/models/payrolluk/BenefitObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Benefit; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * BenefitObject + */ -/** BenefitObject */ public class BenefitObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class BenefitObject { @JsonProperty("benefit") private Benefit benefit; /** - * pagination - * - * @param pagination Pagination - * @return BenefitObject - */ + * pagination + * @param pagination Pagination + * @return BenefitObject + **/ public BenefitObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return BenefitObject - */ + * problem + * @param problem Problem + * @return BenefitObject + **/ public BenefitObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * benefit - * - * @param benefit Benefit - * @return BenefitObject - */ + * benefit + * @param benefit Benefit + * @return BenefitObject + **/ public BenefitObject benefit(Benefit benefit) { this.benefit = benefit; return this; } - /** + /** * Get benefit - * * @return benefit - */ + **/ @ApiModelProperty(value = "") - /** + /** * benefit - * * @return benefit Benefit - */ + **/ public Benefit getBenefit() { return benefit; } - /** - * benefit - * - * @param benefit Benefit - */ + /** + * benefit + * @param benefit Benefit + **/ + public void setBenefit(Benefit benefit) { this.benefit = benefit; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } BenefitObject benefitObject = (BenefitObject) o; - return Objects.equals(this.pagination, benefitObject.pagination) - && Objects.equals(this.problem, benefitObject.problem) - && Objects.equals(this.benefit, benefitObject.benefit); + return Objects.equals(this.pagination, benefitObject.pagination) && + Objects.equals(this.problem, benefitObject.problem) && + Objects.equals(this.benefit, benefitObject.benefit); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, benefit); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Benefits.java b/src/main/java/com/xero/models/payrolluk/Benefits.java index 35347dd5b..953835b1e 100644 --- a/src/main/java/com/xero/models/payrolluk/Benefits.java +++ b/src/main/java/com/xero/models/payrolluk/Benefits.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Benefit; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Benefits + */ -/** Benefits */ public class Benefits { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Benefits { @JsonProperty("benefits") private List benefits = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Benefits - */ + * pagination + * @param pagination Pagination + * @return Benefits + **/ public Benefits pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Benefits - */ + * problem + * @param problem Problem + * @return Benefits + **/ public Benefits problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * benefits - * - * @param benefits List<Benefit> - * @return Benefits - */ + * benefits + * @param benefits List<Benefit> + * @return Benefits + **/ public Benefits benefits(List benefits) { this.benefits = benefits; return this; @@ -113,10 +126,9 @@ public Benefits benefits(List benefits) { /** * benefits - * - * @param benefitsItem Benefit + * @param benefitsItem Benefit * @return Benefits - */ + **/ public Benefits addBenefitsItem(Benefit benefitsItem) { if (this.benefits == null) { this.benefits = new ArrayList(); @@ -125,30 +137,29 @@ public Benefits addBenefitsItem(Benefit benefitsItem) { return this; } - /** + /** * Get benefits - * * @return benefits - */ + **/ @ApiModelProperty(value = "") - /** + /** * benefits - * * @return benefits List - */ + **/ public List getBenefits() { return benefits; } - /** - * benefits - * - * @param benefits List<Benefit> - */ + /** + * benefits + * @param benefits List<Benefit> + **/ + public void setBenefits(List benefits) { this.benefits = benefits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Benefits benefits = (Benefits) o; - return Objects.equals(this.pagination, benefits.pagination) - && Objects.equals(this.problem, benefits.problem) - && Objects.equals(this.benefits, benefits.benefits); + return Objects.equals(this.pagination, benefits.pagination) && + Objects.equals(this.problem, benefits.problem) && + Objects.equals(this.benefits, benefits.benefits); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, benefits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/CourtOrderLine.java b/src/main/java/com/xero/models/payrolluk/CourtOrderLine.java index b8d803279..7f74db797 100644 --- a/src/main/java/com/xero/models/payrolluk/CourtOrderLine.java +++ b/src/main/java/com/xero/models/payrolluk/CourtOrderLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * CourtOrderLine + */ -/** CourtOrderLine */ public class CourtOrderLine { StringUtil util = new StringUtil(); @@ -27,75 +44,70 @@ public class CourtOrderLine { @JsonProperty("amount") private Double amount; /** - * Xero identifier for payroll court order type - * - * @param courtOrderTypeID UUID - * @return CourtOrderLine - */ + * Xero identifier for payroll court order type + * @param courtOrderTypeID UUID + * @return CourtOrderLine + **/ public CourtOrderLine courtOrderTypeID(UUID courtOrderTypeID) { this.courtOrderTypeID = courtOrderTypeID; return this; } - /** + /** * Xero identifier for payroll court order type - * * @return courtOrderTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll court order type") - /** + /** * Xero identifier for payroll court order type - * * @return courtOrderTypeID UUID - */ + **/ public UUID getCourtOrderTypeID() { return courtOrderTypeID; } - /** - * Xero identifier for payroll court order type - * - * @param courtOrderTypeID UUID - */ + /** + * Xero identifier for payroll court order type + * @param courtOrderTypeID UUID + **/ + public void setCourtOrderTypeID(UUID courtOrderTypeID) { this.courtOrderTypeID = courtOrderTypeID; } /** - * Amount - * - * @param amount Double - * @return CourtOrderLine - */ + * Amount + * @param amount Double + * @return CourtOrderLine + **/ public CourtOrderLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Amount - * * @return amount - */ + **/ @ApiModelProperty(value = "Amount") - /** + /** * Amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Amount - * - * @param amount Double - */ + /** + * Amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } CourtOrderLine courtOrderLine = (CourtOrderLine) o; - return Objects.equals(this.courtOrderTypeID, courtOrderLine.courtOrderTypeID) - && Objects.equals(this.amount, courtOrderLine.amount); + return Objects.equals(this.courtOrderTypeID, courtOrderLine.courtOrderTypeID) && + Objects.equals(this.amount, courtOrderLine.amount); } @Override @@ -114,6 +126,7 @@ public int hashCode() { return Objects.hash(courtOrderTypeID, amount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -125,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -133,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Deduction.java b/src/main/java/com/xero/models/payrolluk/Deduction.java index f03628659..2eae3b9ad 100644 --- a/src/main/java/com/xero/models/payrolluk/Deduction.java +++ b/src/main/java/com/xero/models/payrolluk/Deduction.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Deduction + */ -/** Deduction */ public class Deduction { StringUtil util = new StringUtil(); @@ -28,36 +43,58 @@ public class Deduction { @JsonProperty("deductionName") private String deductionName; - /** Deduction Category type */ + /** + * Deduction Category type + */ public enum DeductionCategoryEnum { - /** CAPITALCONTRIBUTIONS */ + /** + * CAPITALCONTRIBUTIONS + */ CAPITALCONTRIBUTIONS("CapitalContributions"), - - /** CHILDCAREVOUCHER */ + + /** + * CHILDCAREVOUCHER + */ CHILDCAREVOUCHER("ChildCareVoucher"), - - /** MAKINGGOOD */ + + /** + * MAKINGGOOD + */ MAKINGGOOD("MakingGood"), - - /** POSTGRADUATELOANDEDUCTIONS */ + + /** + * POSTGRADUATELOANDEDUCTIONS + */ POSTGRADUATELOANDEDUCTIONS("PostgraduateLoanDeductions"), - - /** PRIVATEUSEPAYMENTS */ + + /** + * PRIVATEUSEPAYMENTS + */ PRIVATEUSEPAYMENTS("PrivateUsePayments"), - - /** SALARYSACRIFICE */ + + /** + * SALARYSACRIFICE + */ SALARYSACRIFICE("SalarySacrifice"), - - /** STAKEHOLDERPENSION */ + + /** + * STAKEHOLDERPENSION + */ STAKEHOLDERPENSION("StakeholderPension"), - - /** STAKEHOLDERPENSIONPOSTTAX */ + + /** + * STAKEHOLDERPENSIONPOSTTAX + */ STAKEHOLDERPENSIONPOSTTAX("StakeholderPensionPostTax"), - - /** STUDENTLOANDEDUCTIONS */ + + /** + * STUDENTLOANDEDUCTIONS + */ STUDENTLOANDEDUCTIONS("StudentLoanDeductions"), - - /** UKOTHER */ + + /** + * UKOTHER + */ UKOTHER("UkOther"); private String value; @@ -66,31 +103,25 @@ public enum DeductionCategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static DeductionCategoryEnum fromValue(String value) { for (DeductionCategoryEnum b : DeductionCategoryEnum.values()) { @@ -102,6 +133,7 @@ public static DeductionCategoryEnum fromValue(String value) { } } + @JsonProperty("deductionCategory") private DeductionCategoryEnum deductionCategory; @@ -119,12 +151,18 @@ public static DeductionCategoryEnum fromValue(String value) { @JsonProperty("reducesTaxLiability") private Boolean reducesTaxLiability; - /** determine the calculation type whether fixed amount or percentage of gross */ + /** + * determine the calculation type whether fixed amount or percentage of gross + */ public enum CalculationTypeEnum { - /** FIXEDAMOUNT */ + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FixedAmount"), - - /** PERCENTAGEOFGROSS */ + + /** + * PERCENTAGEOFGROSS + */ PERCENTAGEOFGROSS("PercentageOfGross"); private String value; @@ -133,31 +171,25 @@ public enum CalculationTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CalculationTypeEnum fromValue(String value) { for (CalculationTypeEnum b : CalculationTypeEnum.values()) { @@ -169,6 +201,7 @@ public static CalculationTypeEnum fromValue(String value) { } } + @JsonProperty("calculationType") private CalculationTypeEnum calculationType; @@ -193,566 +226,518 @@ public static CalculationTypeEnum fromValue(String value) { @JsonProperty("isPension") private Boolean isPension; /** - * The Xero identifier for Deduction - * - * @param deductionId UUID - * @return Deduction - */ + * The Xero identifier for Deduction + * @param deductionId UUID + * @return Deduction + **/ public Deduction deductionId(UUID deductionId) { this.deductionId = deductionId; return this; } - /** + /** * The Xero identifier for Deduction - * * @return deductionId - */ + **/ @ApiModelProperty(value = "The Xero identifier for Deduction") - /** + /** * The Xero identifier for Deduction - * * @return deductionId UUID - */ + **/ public UUID getDeductionId() { return deductionId; } - /** - * The Xero identifier for Deduction - * - * @param deductionId UUID - */ + /** + * The Xero identifier for Deduction + * @param deductionId UUID + **/ + public void setDeductionId(UUID deductionId) { this.deductionId = deductionId; } /** - * Name of the deduction - * - * @param deductionName String - * @return Deduction - */ + * Name of the deduction + * @param deductionName String + * @return Deduction + **/ public Deduction deductionName(String deductionName) { this.deductionName = deductionName; return this; } - /** + /** * Name of the deduction - * * @return deductionName - */ + **/ @ApiModelProperty(required = true, value = "Name of the deduction") - /** + /** * Name of the deduction - * * @return deductionName String - */ + **/ public String getDeductionName() { return deductionName; } - /** - * Name of the deduction - * - * @param deductionName String - */ + /** + * Name of the deduction + * @param deductionName String + **/ + public void setDeductionName(String deductionName) { this.deductionName = deductionName; } /** - * Deduction Category type - * - * @param deductionCategory DeductionCategoryEnum - * @return Deduction - */ + * Deduction Category type + * @param deductionCategory DeductionCategoryEnum + * @return Deduction + **/ public Deduction deductionCategory(DeductionCategoryEnum deductionCategory) { this.deductionCategory = deductionCategory; return this; } - /** + /** * Deduction Category type - * * @return deductionCategory - */ + **/ @ApiModelProperty(value = "Deduction Category type") - /** + /** * Deduction Category type - * * @return deductionCategory DeductionCategoryEnum - */ + **/ public DeductionCategoryEnum getDeductionCategory() { return deductionCategory; } - /** - * Deduction Category type - * - * @param deductionCategory DeductionCategoryEnum - */ + /** + * Deduction Category type + * @param deductionCategory DeductionCategoryEnum + **/ + public void setDeductionCategory(DeductionCategoryEnum deductionCategory) { this.deductionCategory = deductionCategory; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return Deduction - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return Deduction + **/ public Deduction liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(required = true, value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return Deduction - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return Deduction + **/ public Deduction currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * Standard amount of the deduction - * - * @param standardAmount Double - * @return Deduction - */ + * Standard amount of the deduction + * @param standardAmount Double + * @return Deduction + **/ public Deduction standardAmount(Double standardAmount) { this.standardAmount = standardAmount; return this; } - /** + /** * Standard amount of the deduction - * * @return standardAmount - */ + **/ @ApiModelProperty(value = "Standard amount of the deduction") - /** + /** * Standard amount of the deduction - * * @return standardAmount Double - */ + **/ public Double getStandardAmount() { return standardAmount; } - /** - * Standard amount of the deduction - * - * @param standardAmount Double - */ + /** + * Standard amount of the deduction + * @param standardAmount Double + **/ + public void setStandardAmount(Double standardAmount) { this.standardAmount = standardAmount; } /** - * Identifier of reduces super liability - * - * @param reducesSuperLiability Boolean - * @return Deduction - */ + * Identifier of reduces super liability + * @param reducesSuperLiability Boolean + * @return Deduction + **/ public Deduction reducesSuperLiability(Boolean reducesSuperLiability) { this.reducesSuperLiability = reducesSuperLiability; return this; } - /** + /** * Identifier of reduces super liability - * * @return reducesSuperLiability - */ + **/ @ApiModelProperty(value = "Identifier of reduces super liability") - /** + /** * Identifier of reduces super liability - * * @return reducesSuperLiability Boolean - */ + **/ public Boolean getReducesSuperLiability() { return reducesSuperLiability; } - /** - * Identifier of reduces super liability - * - * @param reducesSuperLiability Boolean - */ + /** + * Identifier of reduces super liability + * @param reducesSuperLiability Boolean + **/ + public void setReducesSuperLiability(Boolean reducesSuperLiability) { this.reducesSuperLiability = reducesSuperLiability; } /** - * Identifier of reduces tax liability - * - * @param reducesTaxLiability Boolean - * @return Deduction - */ + * Identifier of reduces tax liability + * @param reducesTaxLiability Boolean + * @return Deduction + **/ public Deduction reducesTaxLiability(Boolean reducesTaxLiability) { this.reducesTaxLiability = reducesTaxLiability; return this; } - /** + /** * Identifier of reduces tax liability - * * @return reducesTaxLiability - */ + **/ @ApiModelProperty(value = "Identifier of reduces tax liability") - /** + /** * Identifier of reduces tax liability - * * @return reducesTaxLiability Boolean - */ + **/ public Boolean getReducesTaxLiability() { return reducesTaxLiability; } - /** - * Identifier of reduces tax liability - * - * @param reducesTaxLiability Boolean - */ + /** + * Identifier of reduces tax liability + * @param reducesTaxLiability Boolean + **/ + public void setReducesTaxLiability(Boolean reducesTaxLiability) { this.reducesTaxLiability = reducesTaxLiability; } /** - * determine the calculation type whether fixed amount or percentage of gross - * - * @param calculationType CalculationTypeEnum - * @return Deduction - */ + * determine the calculation type whether fixed amount or percentage of gross + * @param calculationType CalculationTypeEnum + * @return Deduction + **/ public Deduction calculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; return this; } - /** + /** * determine the calculation type whether fixed amount or percentage of gross - * * @return calculationType - */ - @ApiModelProperty( - value = "determine the calculation type whether fixed amount or percentage of gross") - /** + **/ + @ApiModelProperty(value = "determine the calculation type whether fixed amount or percentage of gross") + /** * determine the calculation type whether fixed amount or percentage of gross - * * @return calculationType CalculationTypeEnum - */ + **/ public CalculationTypeEnum getCalculationType() { return calculationType; } - /** - * determine the calculation type whether fixed amount or percentage of gross - * - * @param calculationType CalculationTypeEnum - */ + /** + * determine the calculation type whether fixed amount or percentage of gross + * @param calculationType CalculationTypeEnum + **/ + public void setCalculationType(CalculationTypeEnum calculationType) { this.calculationType = calculationType; } /** - * Percentage of gross - * - * @param percentage Double - * @return Deduction - */ + * Percentage of gross + * @param percentage Double + * @return Deduction + **/ public Deduction percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Percentage of gross - * * @return percentage - */ + **/ @ApiModelProperty(value = "Percentage of gross") - /** + /** * Percentage of gross - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Percentage of gross - * - * @param percentage Double - */ + /** + * Percentage of gross + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } /** - * Identifier of subject To NIC - * - * @param subjectToNIC Boolean - * @return Deduction - */ + * Identifier of subject To NIC + * @param subjectToNIC Boolean + * @return Deduction + **/ public Deduction subjectToNIC(Boolean subjectToNIC) { this.subjectToNIC = subjectToNIC; return this; } - /** + /** * Identifier of subject To NIC - * * @return subjectToNIC - */ + **/ @ApiModelProperty(value = "Identifier of subject To NIC") - /** + /** * Identifier of subject To NIC - * * @return subjectToNIC Boolean - */ + **/ public Boolean getSubjectToNIC() { return subjectToNIC; } - /** - * Identifier of subject To NIC - * - * @param subjectToNIC Boolean - */ + /** + * Identifier of subject To NIC + * @param subjectToNIC Boolean + **/ + public void setSubjectToNIC(Boolean subjectToNIC) { this.subjectToNIC = subjectToNIC; } /** - * Identifier of subject To Tax - * - * @param subjectToTax Boolean - * @return Deduction - */ + * Identifier of subject To Tax + * @param subjectToTax Boolean + * @return Deduction + **/ public Deduction subjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; return this; } - /** + /** * Identifier of subject To Tax - * * @return subjectToTax - */ + **/ @ApiModelProperty(value = "Identifier of subject To Tax") - /** + /** * Identifier of subject To Tax - * * @return subjectToTax Boolean - */ + **/ public Boolean getSubjectToTax() { return subjectToTax; } - /** - * Identifier of subject To Tax - * - * @param subjectToTax Boolean - */ + /** + * Identifier of subject To Tax + * @param subjectToTax Boolean + **/ + public void setSubjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; } /** - * Identifier of reduced by basic rate applicable or not - * - * @param isReducedByBasicRate Boolean - * @return Deduction - */ + * Identifier of reduced by basic rate applicable or not + * @param isReducedByBasicRate Boolean + * @return Deduction + **/ public Deduction isReducedByBasicRate(Boolean isReducedByBasicRate) { this.isReducedByBasicRate = isReducedByBasicRate; return this; } - /** + /** * Identifier of reduced by basic rate applicable or not - * * @return isReducedByBasicRate - */ + **/ @ApiModelProperty(value = "Identifier of reduced by basic rate applicable or not") - /** + /** * Identifier of reduced by basic rate applicable or not - * * @return isReducedByBasicRate Boolean - */ + **/ public Boolean getIsReducedByBasicRate() { return isReducedByBasicRate; } - /** - * Identifier of reduced by basic rate applicable or not - * - * @param isReducedByBasicRate Boolean - */ + /** + * Identifier of reduced by basic rate applicable or not + * @param isReducedByBasicRate Boolean + **/ + public void setIsReducedByBasicRate(Boolean isReducedByBasicRate) { this.isReducedByBasicRate = isReducedByBasicRate; } /** - * Identifier for apply to pension calculations - * - * @param applyToPensionCalculations Boolean - * @return Deduction - */ + * Identifier for apply to pension calculations + * @param applyToPensionCalculations Boolean + * @return Deduction + **/ public Deduction applyToPensionCalculations(Boolean applyToPensionCalculations) { this.applyToPensionCalculations = applyToPensionCalculations; return this; } - /** + /** * Identifier for apply to pension calculations - * * @return applyToPensionCalculations - */ + **/ @ApiModelProperty(value = "Identifier for apply to pension calculations") - /** + /** * Identifier for apply to pension calculations - * * @return applyToPensionCalculations Boolean - */ + **/ public Boolean getApplyToPensionCalculations() { return applyToPensionCalculations; } - /** - * Identifier for apply to pension calculations - * - * @param applyToPensionCalculations Boolean - */ + /** + * Identifier for apply to pension calculations + * @param applyToPensionCalculations Boolean + **/ + public void setApplyToPensionCalculations(Boolean applyToPensionCalculations) { this.applyToPensionCalculations = applyToPensionCalculations; } /** - * Identifier of calculating on qualifying earnings - * - * @param isCalculatingOnQualifyingEarnings Boolean - * @return Deduction - */ + * Identifier of calculating on qualifying earnings + * @param isCalculatingOnQualifyingEarnings Boolean + * @return Deduction + **/ public Deduction isCalculatingOnQualifyingEarnings(Boolean isCalculatingOnQualifyingEarnings) { this.isCalculatingOnQualifyingEarnings = isCalculatingOnQualifyingEarnings; return this; } - /** + /** * Identifier of calculating on qualifying earnings - * * @return isCalculatingOnQualifyingEarnings - */ + **/ @ApiModelProperty(value = "Identifier of calculating on qualifying earnings") - /** + /** * Identifier of calculating on qualifying earnings - * * @return isCalculatingOnQualifyingEarnings Boolean - */ + **/ public Boolean getIsCalculatingOnQualifyingEarnings() { return isCalculatingOnQualifyingEarnings; } - /** - * Identifier of calculating on qualifying earnings - * - * @param isCalculatingOnQualifyingEarnings Boolean - */ + /** + * Identifier of calculating on qualifying earnings + * @param isCalculatingOnQualifyingEarnings Boolean + **/ + public void setIsCalculatingOnQualifyingEarnings(Boolean isCalculatingOnQualifyingEarnings) { this.isCalculatingOnQualifyingEarnings = isCalculatingOnQualifyingEarnings; } /** - * Identifier of applicable for pension or not - * - * @param isPension Boolean - * @return Deduction - */ + * Identifier of applicable for pension or not + * @param isPension Boolean + * @return Deduction + **/ public Deduction isPension(Boolean isPension) { this.isPension = isPension; return this; } - /** + /** * Identifier of applicable for pension or not - * * @return isPension - */ + **/ @ApiModelProperty(value = "Identifier of applicable for pension or not") - /** + /** * Identifier of applicable for pension or not - * * @return isPension Boolean - */ + **/ public Boolean getIsPension() { return isPension; } - /** - * Identifier of applicable for pension or not - * - * @param isPension Boolean - */ + /** + * Identifier of applicable for pension or not + * @param isPension Boolean + **/ + public void setIsPension(Boolean isPension) { this.isPension = isPension; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -762,46 +747,30 @@ public boolean equals(java.lang.Object o) { return false; } Deduction deduction = (Deduction) o; - return Objects.equals(this.deductionId, deduction.deductionId) - && Objects.equals(this.deductionName, deduction.deductionName) - && Objects.equals(this.deductionCategory, deduction.deductionCategory) - && Objects.equals(this.liabilityAccountId, deduction.liabilityAccountId) - && Objects.equals(this.currentRecord, deduction.currentRecord) - && Objects.equals(this.standardAmount, deduction.standardAmount) - && Objects.equals(this.reducesSuperLiability, deduction.reducesSuperLiability) - && Objects.equals(this.reducesTaxLiability, deduction.reducesTaxLiability) - && Objects.equals(this.calculationType, deduction.calculationType) - && Objects.equals(this.percentage, deduction.percentage) - && Objects.equals(this.subjectToNIC, deduction.subjectToNIC) - && Objects.equals(this.subjectToTax, deduction.subjectToTax) - && Objects.equals(this.isReducedByBasicRate, deduction.isReducedByBasicRate) - && Objects.equals(this.applyToPensionCalculations, deduction.applyToPensionCalculations) - && Objects.equals( - this.isCalculatingOnQualifyingEarnings, deduction.isCalculatingOnQualifyingEarnings) - && Objects.equals(this.isPension, deduction.isPension); + return Objects.equals(this.deductionId, deduction.deductionId) && + Objects.equals(this.deductionName, deduction.deductionName) && + Objects.equals(this.deductionCategory, deduction.deductionCategory) && + Objects.equals(this.liabilityAccountId, deduction.liabilityAccountId) && + Objects.equals(this.currentRecord, deduction.currentRecord) && + Objects.equals(this.standardAmount, deduction.standardAmount) && + Objects.equals(this.reducesSuperLiability, deduction.reducesSuperLiability) && + Objects.equals(this.reducesTaxLiability, deduction.reducesTaxLiability) && + Objects.equals(this.calculationType, deduction.calculationType) && + Objects.equals(this.percentage, deduction.percentage) && + Objects.equals(this.subjectToNIC, deduction.subjectToNIC) && + Objects.equals(this.subjectToTax, deduction.subjectToTax) && + Objects.equals(this.isReducedByBasicRate, deduction.isReducedByBasicRate) && + Objects.equals(this.applyToPensionCalculations, deduction.applyToPensionCalculations) && + Objects.equals(this.isCalculatingOnQualifyingEarnings, deduction.isCalculatingOnQualifyingEarnings) && + Objects.equals(this.isPension, deduction.isPension); } @Override public int hashCode() { - return Objects.hash( - deductionId, - deductionName, - deductionCategory, - liabilityAccountId, - currentRecord, - standardAmount, - reducesSuperLiability, - reducesTaxLiability, - calculationType, - percentage, - subjectToNIC, - subjectToTax, - isReducedByBasicRate, - applyToPensionCalculations, - isCalculatingOnQualifyingEarnings, - isPension); + return Objects.hash(deductionId, deductionName, deductionCategory, liabilityAccountId, currentRecord, standardAmount, reducesSuperLiability, reducesTaxLiability, calculationType, percentage, subjectToNIC, subjectToTax, isReducedByBasicRate, applyToPensionCalculations, isCalculatingOnQualifyingEarnings, isPension); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -812,32 +781,23 @@ public String toString() { sb.append(" liabilityAccountId: ").append(toIndentedString(liabilityAccountId)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append(" standardAmount: ").append(toIndentedString(standardAmount)).append("\n"); - sb.append(" reducesSuperLiability: ") - .append(toIndentedString(reducesSuperLiability)) - .append("\n"); - sb.append(" reducesTaxLiability: ") - .append(toIndentedString(reducesTaxLiability)) - .append("\n"); + sb.append(" reducesSuperLiability: ").append(toIndentedString(reducesSuperLiability)).append("\n"); + sb.append(" reducesTaxLiability: ").append(toIndentedString(reducesTaxLiability)).append("\n"); sb.append(" calculationType: ").append(toIndentedString(calculationType)).append("\n"); sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); sb.append(" subjectToNIC: ").append(toIndentedString(subjectToNIC)).append("\n"); sb.append(" subjectToTax: ").append(toIndentedString(subjectToTax)).append("\n"); - sb.append(" isReducedByBasicRate: ") - .append(toIndentedString(isReducedByBasicRate)) - .append("\n"); - sb.append(" applyToPensionCalculations: ") - .append(toIndentedString(applyToPensionCalculations)) - .append("\n"); - sb.append(" isCalculatingOnQualifyingEarnings: ") - .append(toIndentedString(isCalculatingOnQualifyingEarnings)) - .append("\n"); + sb.append(" isReducedByBasicRate: ").append(toIndentedString(isReducedByBasicRate)).append("\n"); + sb.append(" applyToPensionCalculations: ").append(toIndentedString(applyToPensionCalculations)).append("\n"); + sb.append(" isCalculatingOnQualifyingEarnings: ").append(toIndentedString(isCalculatingOnQualifyingEarnings)).append("\n"); sb.append(" isPension: ").append(toIndentedString(isPension)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -845,4 +805,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/DeductionLine.java b/src/main/java/com/xero/models/payrolluk/DeductionLine.java index 8dcbe3ee0..7e9c48021 100644 --- a/src/main/java/com/xero/models/payrolluk/DeductionLine.java +++ b/src/main/java/com/xero/models/payrolluk/DeductionLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * DeductionLine + */ -/** DeductionLine */ public class DeductionLine { StringUtil util = new StringUtil(); @@ -33,145 +50,134 @@ public class DeductionLine { @JsonProperty("percentage") private Double percentage; /** - * Xero identifier for payroll deduction - * - * @param deductionTypeID UUID - * @return DeductionLine - */ + * Xero identifier for payroll deduction + * @param deductionTypeID UUID + * @return DeductionLine + **/ public DeductionLine deductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; return this; } - /** + /** * Xero identifier for payroll deduction - * * @return deductionTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll deduction") - /** + /** * Xero identifier for payroll deduction - * * @return deductionTypeID UUID - */ + **/ public UUID getDeductionTypeID() { return deductionTypeID; } - /** - * Xero identifier for payroll deduction - * - * @param deductionTypeID UUID - */ + /** + * Xero identifier for payroll deduction + * @param deductionTypeID UUID + **/ + public void setDeductionTypeID(UUID deductionTypeID) { this.deductionTypeID = deductionTypeID; } /** - * The amount of the deduction line - * - * @param amount Double - * @return DeductionLine - */ + * The amount of the deduction line + * @param amount Double + * @return DeductionLine + **/ public DeductionLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the deduction line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the deduction line") - /** + /** * The amount of the deduction line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the deduction line - * - * @param amount Double - */ + /** + * The amount of the deduction line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the deduction is subject to tax - * - * @param subjectToTax Boolean - * @return DeductionLine - */ + * Identifies if the deduction is subject to tax + * @param subjectToTax Boolean + * @return DeductionLine + **/ public DeductionLine subjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; return this; } - /** + /** * Identifies if the deduction is subject to tax - * * @return subjectToTax - */ + **/ @ApiModelProperty(value = "Identifies if the deduction is subject to tax") - /** + /** * Identifies if the deduction is subject to tax - * * @return subjectToTax Boolean - */ + **/ public Boolean getSubjectToTax() { return subjectToTax; } - /** - * Identifies if the deduction is subject to tax - * - * @param subjectToTax Boolean - */ + /** + * Identifies if the deduction is subject to tax + * @param subjectToTax Boolean + **/ + public void setSubjectToTax(Boolean subjectToTax) { this.subjectToTax = subjectToTax; } /** - * Deduction rate percentage - * - * @param percentage Double - * @return DeductionLine - */ + * Deduction rate percentage + * @param percentage Double + * @return DeductionLine + **/ public DeductionLine percentage(Double percentage) { this.percentage = percentage; return this; } - /** + /** * Deduction rate percentage - * * @return percentage - */ + **/ @ApiModelProperty(value = "Deduction rate percentage") - /** + /** * Deduction rate percentage - * * @return percentage Double - */ + **/ public Double getPercentage() { return percentage; } - /** - * Deduction rate percentage - * - * @param percentage Double - */ + /** + * Deduction rate percentage + * @param percentage Double + **/ + public void setPercentage(Double percentage) { this.percentage = percentage; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } DeductionLine deductionLine = (DeductionLine) o; - return Objects.equals(this.deductionTypeID, deductionLine.deductionTypeID) - && Objects.equals(this.amount, deductionLine.amount) - && Objects.equals(this.subjectToTax, deductionLine.subjectToTax) - && Objects.equals(this.percentage, deductionLine.percentage); + return Objects.equals(this.deductionTypeID, deductionLine.deductionTypeID) && + Objects.equals(this.amount, deductionLine.amount) && + Objects.equals(this.subjectToTax, deductionLine.subjectToTax) && + Objects.equals(this.percentage, deductionLine.percentage); } @Override @@ -192,6 +198,7 @@ public int hashCode() { return Objects.hash(deductionTypeID, amount, subjectToTax, percentage); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/DeductionObject.java b/src/main/java/com/xero/models/payrolluk/DeductionObject.java index a6e1ff4d0..7a429c0d6 100644 --- a/src/main/java/com/xero/models/payrolluk/DeductionObject.java +++ b/src/main/java/com/xero/models/payrolluk/DeductionObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Deduction; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * DeductionObject + */ -/** DeductionObject */ public class DeductionObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class DeductionObject { @JsonProperty("deduction") private Deduction deduction; /** - * pagination - * - * @param pagination Pagination - * @return DeductionObject - */ + * pagination + * @param pagination Pagination + * @return DeductionObject + **/ public DeductionObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return DeductionObject - */ + * problem + * @param problem Problem + * @return DeductionObject + **/ public DeductionObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * deduction - * - * @param deduction Deduction - * @return DeductionObject - */ + * deduction + * @param deduction Deduction + * @return DeductionObject + **/ public DeductionObject deduction(Deduction deduction) { this.deduction = deduction; return this; } - /** + /** * Get deduction - * * @return deduction - */ + **/ @ApiModelProperty(value = "") - /** + /** * deduction - * * @return deduction Deduction - */ + **/ public Deduction getDeduction() { return deduction; } - /** - * deduction - * - * @param deduction Deduction - */ + /** + * deduction + * @param deduction Deduction + **/ + public void setDeduction(Deduction deduction) { this.deduction = deduction; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } DeductionObject deductionObject = (DeductionObject) o; - return Objects.equals(this.pagination, deductionObject.pagination) - && Objects.equals(this.problem, deductionObject.problem) - && Objects.equals(this.deduction, deductionObject.deduction); + return Objects.equals(this.pagination, deductionObject.pagination) && + Objects.equals(this.problem, deductionObject.problem) && + Objects.equals(this.deduction, deductionObject.deduction); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, deduction); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Deductions.java b/src/main/java/com/xero/models/payrolluk/Deductions.java index b8ae6ffcb..94db96c0e 100644 --- a/src/main/java/com/xero/models/payrolluk/Deductions.java +++ b/src/main/java/com/xero/models/payrolluk/Deductions.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Deduction; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Deductions + */ -/** Deductions */ public class Deductions { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Deductions { @JsonProperty("deductions") private List deductions = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Deductions - */ + * pagination + * @param pagination Pagination + * @return Deductions + **/ public Deductions pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Deductions - */ + * problem + * @param problem Problem + * @return Deductions + **/ public Deductions problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * deductions - * - * @param deductions List<Deduction> - * @return Deductions - */ + * deductions + * @param deductions List<Deduction> + * @return Deductions + **/ public Deductions deductions(List deductions) { this.deductions = deductions; return this; @@ -113,10 +126,9 @@ public Deductions deductions(List deductions) { /** * deductions - * - * @param deductionsItem Deduction + * @param deductionsItem Deduction * @return Deductions - */ + **/ public Deductions addDeductionsItem(Deduction deductionsItem) { if (this.deductions == null) { this.deductions = new ArrayList(); @@ -125,30 +137,29 @@ public Deductions addDeductionsItem(Deduction deductionsItem) { return this; } - /** + /** * Get deductions - * * @return deductions - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductions - * * @return deductions List - */ + **/ public List getDeductions() { return deductions; } - /** - * deductions - * - * @param deductions List<Deduction> - */ + /** + * deductions + * @param deductions List<Deduction> + **/ + public void setDeductions(List deductions) { this.deductions = deductions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Deductions deductions = (Deductions) o; - return Objects.equals(this.pagination, deductions.pagination) - && Objects.equals(this.problem, deductions.problem) - && Objects.equals(this.deductions, deductions.deductions); + return Objects.equals(this.pagination, deductions.pagination) && + Objects.equals(this.problem, deductions.problem) && + Objects.equals(this.deductions, deductions.deductions); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, deductions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsLine.java b/src/main/java/com/xero/models/payrolluk/EarningsLine.java index 29cce5464..f529c2754 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsLine.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsLine + */ -/** EarningsLine */ public class EarningsLine { StringUtil util = new StringUtil(); @@ -48,322 +65,294 @@ public class EarningsLine { @JsonProperty("isAverageDailyPayRate") private Boolean isAverageDailyPayRate; /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - * @return EarningsLine - */ + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + * @return EarningsLine + **/ public EarningsLine earningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; return this; } - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll earnings line") - /** + /** * Xero identifier for payroll earnings line - * * @return earningsLineID UUID - */ + **/ public UUID getEarningsLineID() { return earningsLineID; } - /** - * Xero identifier for payroll earnings line - * - * @param earningsLineID UUID - */ + /** + * Xero identifier for payroll earnings line + * @param earningsLineID UUID + **/ + public void setEarningsLineID(UUID earningsLineID) { this.earningsLineID = earningsLineID; } /** - * Xero identifier for payroll earnings rate - * - * @param earningsRateID UUID - * @return EarningsLine - */ + * Xero identifier for payroll earnings rate + * @param earningsRateID UUID + * @return EarningsLine + **/ public EarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier for payroll earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll earnings rate") - /** + /** * Xero identifier for payroll earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier for payroll earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero identifier for payroll earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * name of earnings rate for display in UI - * - * @param displayName String - * @return EarningsLine - */ + * name of earnings rate for display in UI + * @param displayName String + * @return EarningsLine + **/ public EarningsLine displayName(String displayName) { this.displayName = displayName; return this; } - /** + /** * name of earnings rate for display in UI - * * @return displayName - */ + **/ @ApiModelProperty(value = "name of earnings rate for display in UI") - /** + /** * name of earnings rate for display in UI - * * @return displayName String - */ + **/ public String getDisplayName() { return displayName; } - /** - * name of earnings rate for display in UI - * - * @param displayName String - */ + /** + * name of earnings rate for display in UI + * @param displayName String + **/ + public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * Rate per unit for earnings line - * - * @param ratePerUnit Double - * @return EarningsLine - */ + * Rate per unit for earnings line + * @param ratePerUnit Double + * @return EarningsLine + **/ public EarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit for earnings line - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "Rate per unit for earnings line") - /** + /** * Rate per unit for earnings line - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit for earnings line - * - * @param ratePerUnit Double - */ + /** + * Rate per unit for earnings line + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Earnings number of units - * - * @param numberOfUnits Double - * @return EarningsLine - */ + * Earnings number of units + * @param numberOfUnits Double + * @return EarningsLine + **/ public EarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Earnings number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Earnings number of units") - /** + /** * Earnings number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Earnings number of units - * - * @param numberOfUnits Double - */ + /** + * Earnings number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - * @return EarningsLine - */ + * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + * @return EarningsLine + **/ public EarningsLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount - */ - @ApiModelProperty( - value = "Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") - /** + **/ + @ApiModelProperty(value = "Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") + /** * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - */ + /** + * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The amount of the earnings line. - * - * @param amount Double - * @return EarningsLine - */ + * The amount of the earnings line. + * @param amount Double + * @return EarningsLine + **/ public EarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the earnings line. - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the earnings line.") - /** + /** * The amount of the earnings line. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the earnings line. - * - * @param amount Double - */ + /** + * The amount of the earnings line. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the earnings is taken from the timesheet. False for earnings line - * - * @param isLinkedToTimesheet Boolean - * @return EarningsLine - */ + * Identifies if the earnings is taken from the timesheet. False for earnings line + * @param isLinkedToTimesheet Boolean + * @return EarningsLine + **/ public EarningsLine isLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; return this; } - /** + /** * Identifies if the earnings is taken from the timesheet. False for earnings line - * * @return isLinkedToTimesheet - */ - @ApiModelProperty( - value = "Identifies if the earnings is taken from the timesheet. False for earnings line") - /** + **/ + @ApiModelProperty(value = "Identifies if the earnings is taken from the timesheet. False for earnings line") + /** * Identifies if the earnings is taken from the timesheet. False for earnings line - * * @return isLinkedToTimesheet Boolean - */ + **/ public Boolean getIsLinkedToTimesheet() { return isLinkedToTimesheet; } - /** - * Identifies if the earnings is taken from the timesheet. False for earnings line - * - * @param isLinkedToTimesheet Boolean - */ + /** + * Identifies if the earnings is taken from the timesheet. False for earnings line + * @param isLinkedToTimesheet Boolean + **/ + public void setIsLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; } /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - * @return EarningsLine - */ + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + * @return EarningsLine + **/ public EarningsLine isAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; return this; } - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate - */ + **/ @ApiModelProperty(value = "Identifies if the earnings is using an average daily pay rate") - /** + /** * Identifies if the earnings is using an average daily pay rate - * * @return isAverageDailyPayRate Boolean - */ + **/ public Boolean getIsAverageDailyPayRate() { return isAverageDailyPayRate; } - /** - * Identifies if the earnings is using an average daily pay rate - * - * @param isAverageDailyPayRate Boolean - */ + /** + * Identifies if the earnings is using an average daily pay rate + * @param isAverageDailyPayRate Boolean + **/ + public void setIsAverageDailyPayRate(Boolean isAverageDailyPayRate) { this.isAverageDailyPayRate = isAverageDailyPayRate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -373,31 +362,23 @@ public boolean equals(java.lang.Object o) { return false; } EarningsLine earningsLine = (EarningsLine) o; - return Objects.equals(this.earningsLineID, earningsLine.earningsLineID) - && Objects.equals(this.earningsRateID, earningsLine.earningsRateID) - && Objects.equals(this.displayName, earningsLine.displayName) - && Objects.equals(this.ratePerUnit, earningsLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, earningsLine.numberOfUnits) - && Objects.equals(this.fixedAmount, earningsLine.fixedAmount) - && Objects.equals(this.amount, earningsLine.amount) - && Objects.equals(this.isLinkedToTimesheet, earningsLine.isLinkedToTimesheet) - && Objects.equals(this.isAverageDailyPayRate, earningsLine.isAverageDailyPayRate); + return Objects.equals(this.earningsLineID, earningsLine.earningsLineID) && + Objects.equals(this.earningsRateID, earningsLine.earningsRateID) && + Objects.equals(this.displayName, earningsLine.displayName) && + Objects.equals(this.ratePerUnit, earningsLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, earningsLine.numberOfUnits) && + Objects.equals(this.fixedAmount, earningsLine.fixedAmount) && + Objects.equals(this.amount, earningsLine.amount) && + Objects.equals(this.isLinkedToTimesheet, earningsLine.isLinkedToTimesheet) && + Objects.equals(this.isAverageDailyPayRate, earningsLine.isAverageDailyPayRate); } @Override public int hashCode() { - return Objects.hash( - earningsLineID, - earningsRateID, - displayName, - ratePerUnit, - numberOfUnits, - fixedAmount, - amount, - isLinkedToTimesheet, - isAverageDailyPayRate); + return Objects.hash(earningsLineID, earningsRateID, displayName, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet, isAverageDailyPayRate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -409,18 +390,15 @@ public String toString() { sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" isLinkedToTimesheet: ") - .append(toIndentedString(isLinkedToTimesheet)) - .append("\n"); - sb.append(" isAverageDailyPayRate: ") - .append(toIndentedString(isAverageDailyPayRate)) - .append("\n"); + sb.append(" isLinkedToTimesheet: ").append(toIndentedString(isLinkedToTimesheet)).append("\n"); + sb.append(" isAverageDailyPayRate: ").append(toIndentedString(isAverageDailyPayRate)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -428,4 +406,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsOrder.java b/src/main/java/com/xero/models/payrolluk/EarningsOrder.java index 8687b8b34..a3cbef80f 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsOrder.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsOrder.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.StatutoryDeductionCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsOrder + */ -/** EarningsOrder */ public class EarningsOrder { StringUtil util = new StringUtil(); @@ -36,181 +54,166 @@ public class EarningsOrder { @JsonProperty("currentRecord") private Boolean currentRecord = true; /** - * Xero unique identifier for an earning rate - * - * @param id UUID - * @return EarningsOrder - */ + * Xero unique identifier for an earning rate + * @param id UUID + * @return EarningsOrder + **/ public EarningsOrder id(UUID id) { this.id = id; return this; } - /** + /** * Xero unique identifier for an earning rate - * * @return id - */ + **/ @ApiModelProperty(value = "Xero unique identifier for an earning rate") - /** + /** * Xero unique identifier for an earning rate - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * Xero unique identifier for an earning rate - * - * @param id UUID - */ + /** + * Xero unique identifier for an earning rate + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Name of the earning order - * - * @param name String - * @return EarningsOrder - */ + * Name of the earning order + * @param name String + * @return EarningsOrder + **/ public EarningsOrder name(String name) { this.name = name; return this; } - /** + /** * Name of the earning order - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the earning order") - /** + /** * Name of the earning order - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earning order - * - * @param name String - */ + /** + * Name of the earning order + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - * @return EarningsOrder - */ - public EarningsOrder statutoryDeductionCategory( - StatutoryDeductionCategory statutoryDeductionCategory) { + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + * @return EarningsOrder + **/ + public EarningsOrder statutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; return this; } - /** + /** * Get statutoryDeductionCategory - * * @return statutoryDeductionCategory - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductionCategory - * * @return statutoryDeductionCategory StatutoryDeductionCategory - */ + **/ public StatutoryDeductionCategory getStatutoryDeductionCategory() { return statutoryDeductionCategory; } - /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - */ + /** + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + **/ + public void setStatutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return EarningsOrder - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return EarningsOrder + **/ public EarningsOrder liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return EarningsOrder - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return EarningsOrder + **/ public EarningsOrder currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,11 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } EarningsOrder earningsOrder = (EarningsOrder) o; - return Objects.equals(this.id, earningsOrder.id) - && Objects.equals(this.name, earningsOrder.name) - && Objects.equals(this.statutoryDeductionCategory, earningsOrder.statutoryDeductionCategory) - && Objects.equals(this.liabilityAccountId, earningsOrder.liabilityAccountId) - && Objects.equals(this.currentRecord, earningsOrder.currentRecord); + return Objects.equals(this.id, earningsOrder.id) && + Objects.equals(this.name, earningsOrder.name) && + Objects.equals(this.statutoryDeductionCategory, earningsOrder.statutoryDeductionCategory) && + Objects.equals(this.liabilityAccountId, earningsOrder.liabilityAccountId) && + Objects.equals(this.currentRecord, earningsOrder.currentRecord); } @Override @@ -232,15 +235,14 @@ public int hashCode() { return Objects.hash(id, name, statutoryDeductionCategory, liabilityAccountId, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EarningsOrder {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" statutoryDeductionCategory: ") - .append(toIndentedString(statutoryDeductionCategory)) - .append("\n"); + sb.append(" statutoryDeductionCategory: ").append(toIndentedString(statutoryDeductionCategory)).append("\n"); sb.append(" liabilityAccountId: ").append(toIndentedString(liabilityAccountId)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append("}"); @@ -248,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -256,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsOrderObject.java b/src/main/java/com/xero/models/payrolluk/EarningsOrderObject.java index c2ab55fac..12c6e7998 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsOrderObject.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsOrderObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EarningsOrder; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsOrderObject + */ -/** EarningsOrderObject */ public class EarningsOrderObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EarningsOrderObject { @JsonProperty("statutoryDeduction") private EarningsOrder statutoryDeduction; /** - * pagination - * - * @param pagination Pagination - * @return EarningsOrderObject - */ + * pagination + * @param pagination Pagination + * @return EarningsOrderObject + **/ public EarningsOrderObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsOrderObject - */ + * problem + * @param problem Problem + * @return EarningsOrderObject + **/ public EarningsOrderObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryDeduction - * - * @param statutoryDeduction EarningsOrder - * @return EarningsOrderObject - */ + * statutoryDeduction + * @param statutoryDeduction EarningsOrder + * @return EarningsOrderObject + **/ public EarningsOrderObject statutoryDeduction(EarningsOrder statutoryDeduction) { this.statutoryDeduction = statutoryDeduction; return this; } - /** + /** * Get statutoryDeduction - * * @return statutoryDeduction - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeduction - * * @return statutoryDeduction EarningsOrder - */ + **/ public EarningsOrder getStatutoryDeduction() { return statutoryDeduction; } - /** - * statutoryDeduction - * - * @param statutoryDeduction EarningsOrder - */ + /** + * statutoryDeduction + * @param statutoryDeduction EarningsOrder + **/ + public void setStatutoryDeduction(EarningsOrder statutoryDeduction) { this.statutoryDeduction = statutoryDeduction; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsOrderObject earningsOrderObject = (EarningsOrderObject) o; - return Objects.equals(this.pagination, earningsOrderObject.pagination) - && Objects.equals(this.problem, earningsOrderObject.problem) - && Objects.equals(this.statutoryDeduction, earningsOrderObject.statutoryDeduction); + return Objects.equals(this.pagination, earningsOrderObject.pagination) && + Objects.equals(this.problem, earningsOrderObject.problem) && + Objects.equals(this.statutoryDeduction, earningsOrderObject.statutoryDeduction); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryDeduction); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsOrders.java b/src/main/java/com/xero/models/payrolluk/EarningsOrders.java index 11e902427..993fefaac 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsOrders.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsOrders.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EarningsOrder; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsOrders + */ -/** EarningsOrders */ public class EarningsOrders { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EarningsOrders { @JsonProperty("statutoryDeductions") private List statutoryDeductions = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EarningsOrders - */ + * pagination + * @param pagination Pagination + * @return EarningsOrders + **/ public EarningsOrders pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsOrders - */ + * problem + * @param problem Problem + * @return EarningsOrders + **/ public EarningsOrders problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryDeductions - * - * @param statutoryDeductions List<EarningsOrder> - * @return EarningsOrders - */ + * statutoryDeductions + * @param statutoryDeductions List<EarningsOrder> + * @return EarningsOrders + **/ public EarningsOrders statutoryDeductions(List statutoryDeductions) { this.statutoryDeductions = statutoryDeductions; return this; @@ -113,10 +126,9 @@ public EarningsOrders statutoryDeductions(List statutoryDeduction /** * statutoryDeductions - * - * @param statutoryDeductionsItem EarningsOrder + * @param statutoryDeductionsItem EarningsOrder * @return EarningsOrders - */ + **/ public EarningsOrders addStatutoryDeductionsItem(EarningsOrder statutoryDeductionsItem) { if (this.statutoryDeductions == null) { this.statutoryDeductions = new ArrayList(); @@ -125,30 +137,29 @@ public EarningsOrders addStatutoryDeductionsItem(EarningsOrder statutoryDeductio return this; } - /** + /** * Get statutoryDeductions - * * @return statutoryDeductions - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductions - * * @return statutoryDeductions List - */ + **/ public List getStatutoryDeductions() { return statutoryDeductions; } - /** - * statutoryDeductions - * - * @param statutoryDeductions List<EarningsOrder> - */ + /** + * statutoryDeductions + * @param statutoryDeductions List<EarningsOrder> + **/ + public void setStatutoryDeductions(List statutoryDeductions) { this.statutoryDeductions = statutoryDeductions; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsOrders earningsOrders = (EarningsOrders) o; - return Objects.equals(this.pagination, earningsOrders.pagination) - && Objects.equals(this.problem, earningsOrders.problem) - && Objects.equals(this.statutoryDeductions, earningsOrders.statutoryDeductions); + return Objects.equals(this.pagination, earningsOrders.pagination) && + Objects.equals(this.problem, earningsOrders.problem) && + Objects.equals(this.statutoryDeductions, earningsOrders.statutoryDeductions); } @Override @@ -168,21 +179,21 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryDeductions); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EarningsOrders {\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append(" problem: ").append(toIndentedString(problem)).append("\n"); - sb.append(" statutoryDeductions: ") - .append(toIndentedString(statutoryDeductions)) - .append("\n"); + sb.append(" statutoryDeductions: ").append(toIndentedString(statutoryDeductions)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -190,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsRate.java b/src/main/java/com/xero/models/payrolluk/EarningsRate.java index 2d6f3ed14..a595bc6cf 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsRate.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsRate.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsRate + */ -/** EarningsRate */ public class EarningsRate { StringUtil util = new StringUtil(); @@ -28,81 +43,133 @@ public class EarningsRate { @JsonProperty("name") private String name; - /** Indicates how an employee will be paid when taking this type of earning */ + /** + * Indicates how an employee will be paid when taking this type of earning + */ public enum EarningsTypeEnum { - /** ALLOWANCE */ + /** + * ALLOWANCE + */ ALLOWANCE("Allowance"), - - /** BACKPAY */ + + /** + * BACKPAY + */ BACKPAY("BackPay"), - - /** BONUS */ + + /** + * BONUS + */ BONUS("Bonus"), - - /** COMMISSION */ + + /** + * COMMISSION + */ COMMISSION("Commission"), - - /** LUMPSUM */ + + /** + * LUMPSUM + */ LUMPSUM("LumpSum"), - - /** OTHEREARNINGS */ + + /** + * OTHEREARNINGS + */ OTHEREARNINGS("OtherEarnings"), - - /** OVERTIMEEARNINGS */ + + /** + * OVERTIMEEARNINGS + */ OVERTIMEEARNINGS("OvertimeEarnings"), - - /** REGULAREARNINGS */ + + /** + * REGULAREARNINGS + */ REGULAREARNINGS("RegularEarnings"), - - /** STATUTORYADOPTIONPAY */ + + /** + * STATUTORYADOPTIONPAY + */ STATUTORYADOPTIONPAY("StatutoryAdoptionPay"), - - /** STATUTORYADOPTIONPAYNONPENSIONABLE */ + + /** + * STATUTORYADOPTIONPAYNONPENSIONABLE + */ STATUTORYADOPTIONPAYNONPENSIONABLE("StatutoryAdoptionPayNonPensionable"), - - /** STATUTORYBEREAVEMENTPAY */ + + /** + * STATUTORYBEREAVEMENTPAY + */ STATUTORYBEREAVEMENTPAY("StatutoryBereavementPay"), - - /** STATUTORYMATERNITYPAY */ + + /** + * STATUTORYMATERNITYPAY + */ STATUTORYMATERNITYPAY("StatutoryMaternityPay"), - - /** STATUTORYMATERNITYPAYNONPENSIONABLE */ + + /** + * STATUTORYMATERNITYPAYNONPENSIONABLE + */ STATUTORYMATERNITYPAYNONPENSIONABLE("StatutoryMaternityPayNonPensionable"), - - /** STATUTORYPATERNITYPAY */ + + /** + * STATUTORYPATERNITYPAY + */ STATUTORYPATERNITYPAY("StatutoryPaternityPay"), - - /** STATUTORYPATERNITYPAYNONPENSIONABLE */ + + /** + * STATUTORYPATERNITYPAYNONPENSIONABLE + */ STATUTORYPATERNITYPAYNONPENSIONABLE("StatutoryPaternityPayNonPensionable"), - - /** STATUTORYPARENTALBEREAVEMENTPAYNONPENSIONABLE */ + + /** + * STATUTORYPARENTALBEREAVEMENTPAYNONPENSIONABLE + */ STATUTORYPARENTALBEREAVEMENTPAYNONPENSIONABLE("StatutoryParentalBereavementPayNonPensionable"), - - /** STATUTORYSHAREDPARENTALPAY */ + + /** + * STATUTORYSHAREDPARENTALPAY + */ STATUTORYSHAREDPARENTALPAY("StatutorySharedParentalPay"), - - /** STATUTORYSHAREDPARENTALPAYNONPENSIONABLE */ + + /** + * STATUTORYSHAREDPARENTALPAYNONPENSIONABLE + */ STATUTORYSHAREDPARENTALPAYNONPENSIONABLE("StatutorySharedParentalPayNonPensionable"), - - /** STATUTORYSICKPAY */ + + /** + * STATUTORYSICKPAY + */ STATUTORYSICKPAY("StatutorySickPay"), - - /** STATUTORYSICKPAYNONPENSIONABLE */ + + /** + * STATUTORYSICKPAYNONPENSIONABLE + */ STATUTORYSICKPAYNONPENSIONABLE("StatutorySickPayNonPensionable"), - - /** TIPSNONDIRECT */ + + /** + * TIPSNONDIRECT + */ TIPSNONDIRECT("TipsNonDirect"), - - /** TIPSDIRECT */ + + /** + * TIPSDIRECT + */ TIPSDIRECT("TipsDirect"), - - /** TERMINATIONPAY */ + + /** + * TERMINATIONPAY + */ TERMINATIONPAY("TerminationPay"), - - /** STATUTORYNEONATALCAREPAY */ + + /** + * STATUTORYNEONATALCAREPAY + */ STATUTORYNEONATALCAREPAY("StatutoryNeonatalCarePay"), - - /** STATUTORYNEONATALCAREPAYNONPENSIONABLE */ + + /** + * STATUTORYNEONATALCAREPAYNONPENSIONABLE + */ STATUTORYNEONATALCAREPAYNONPENSIONABLE("StatutoryNeonatalCarePayNonPensionable"); private String value; @@ -111,31 +178,25 @@ public enum EarningsTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static EarningsTypeEnum fromValue(String value) { for (EarningsTypeEnum b : EarningsTypeEnum.values()) { @@ -147,17 +208,26 @@ public static EarningsTypeEnum fromValue(String value) { } } + @JsonProperty("earningsType") private EarningsTypeEnum earningsType; - /** Indicates the type of the earning rate */ + /** + * Indicates the type of the earning rate + */ public enum RateTypeEnum { - /** RATEPERUNIT */ + /** + * RATEPERUNIT + */ RATEPERUNIT("RatePerUnit"), - - /** MULTIPLEOFORDINARYEARNINGSRATE */ + + /** + * MULTIPLEOFORDINARYEARNINGSRATE + */ MULTIPLEOFORDINARYEARNINGSRATE("MultipleOfOrdinaryEarningsRate"), - - /** FIXEDAMOUNT */ + + /** + * FIXEDAMOUNT + */ FIXEDAMOUNT("FixedAmount"); private String value; @@ -166,31 +236,25 @@ public enum RateTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static RateTypeEnum fromValue(String value) { for (RateTypeEnum b : RateTypeEnum.values()) { @@ -202,6 +266,7 @@ public static RateTypeEnum fromValue(String value) { } } + @JsonProperty("rateType") private RateTypeEnum rateType; @@ -223,370 +288,326 @@ public static RateTypeEnum fromValue(String value) { @JsonProperty("fixedAmount") private Double fixedAmount; /** - * Xero unique identifier for an earning rate - * - * @param earningsRateID UUID - * @return EarningsRate - */ + * Xero unique identifier for an earning rate + * @param earningsRateID UUID + * @return EarningsRate + **/ public EarningsRate earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero unique identifier for an earning rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for an earning rate") - /** + /** * Xero unique identifier for an earning rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero unique identifier for an earning rate - * - * @param earningsRateID UUID - */ + /** + * Xero unique identifier for an earning rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * Name of the earning rate - * - * @param name String - * @return EarningsRate - */ + * Name of the earning rate + * @param name String + * @return EarningsRate + **/ public EarningsRate name(String name) { this.name = name; return this; } - /** + /** * Name of the earning rate - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the earning rate") - /** + /** * Name of the earning rate - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earning rate - * - * @param name String - */ + /** + * Name of the earning rate + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Indicates how an employee will be paid when taking this type of earning - * - * @param earningsType EarningsTypeEnum - * @return EarningsRate - */ + * Indicates how an employee will be paid when taking this type of earning + * @param earningsType EarningsTypeEnum + * @return EarningsRate + **/ public EarningsRate earningsType(EarningsTypeEnum earningsType) { this.earningsType = earningsType; return this; } - /** + /** * Indicates how an employee will be paid when taking this type of earning - * * @return earningsType - */ - @ApiModelProperty( - required = true, - value = "Indicates how an employee will be paid when taking this type of earning") - /** + **/ + @ApiModelProperty(required = true, value = "Indicates how an employee will be paid when taking this type of earning") + /** * Indicates how an employee will be paid when taking this type of earning - * * @return earningsType EarningsTypeEnum - */ + **/ public EarningsTypeEnum getEarningsType() { return earningsType; } - /** - * Indicates how an employee will be paid when taking this type of earning - * - * @param earningsType EarningsTypeEnum - */ + /** + * Indicates how an employee will be paid when taking this type of earning + * @param earningsType EarningsTypeEnum + **/ + public void setEarningsType(EarningsTypeEnum earningsType) { this.earningsType = earningsType; } /** - * Indicates the type of the earning rate - * - * @param rateType RateTypeEnum - * @return EarningsRate - */ + * Indicates the type of the earning rate + * @param rateType RateTypeEnum + * @return EarningsRate + **/ public EarningsRate rateType(RateTypeEnum rateType) { this.rateType = rateType; return this; } - /** + /** * Indicates the type of the earning rate - * * @return rateType - */ + **/ @ApiModelProperty(required = true, value = "Indicates the type of the earning rate") - /** + /** * Indicates the type of the earning rate - * * @return rateType RateTypeEnum - */ + **/ public RateTypeEnum getRateType() { return rateType; } - /** - * Indicates the type of the earning rate - * - * @param rateType RateTypeEnum - */ + /** + * Indicates the type of the earning rate + * @param rateType RateTypeEnum + **/ + public void setRateType(RateTypeEnum rateType) { this.rateType = rateType; } /** - * The type of units used to record earnings - * - * @param typeOfUnits String - * @return EarningsRate - */ + * The type of units used to record earnings + * @param typeOfUnits String + * @return EarningsRate + **/ public EarningsRate typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * The type of units used to record earnings - * * @return typeOfUnits - */ + **/ @ApiModelProperty(required = true, value = "The type of units used to record earnings") - /** + /** * The type of units used to record earnings - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of units used to record earnings - * - * @param typeOfUnits String - */ + /** + * The type of units used to record earnings + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } /** - * Indicates whether an earning type is active - * - * @param currentRecord Boolean - * @return EarningsRate - */ + * Indicates whether an earning type is active + * @param currentRecord Boolean + * @return EarningsRate + **/ public EarningsRate currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Indicates whether an earning type is active - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Indicates whether an earning type is active") - /** + /** * Indicates whether an earning type is active - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Indicates whether an earning type is active - * - * @param currentRecord Boolean - */ + /** + * Indicates whether an earning type is active + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } /** - * The account that will be used for the earnings rate - * - * @param expenseAccountID UUID - * @return EarningsRate - */ + * The account that will be used for the earnings rate + * @param expenseAccountID UUID + * @return EarningsRate + **/ public EarningsRate expenseAccountID(UUID expenseAccountID) { this.expenseAccountID = expenseAccountID; return this; } - /** + /** * The account that will be used for the earnings rate - * * @return expenseAccountID - */ + **/ @ApiModelProperty(required = true, value = "The account that will be used for the earnings rate") - /** + /** * The account that will be used for the earnings rate - * * @return expenseAccountID UUID - */ + **/ public UUID getExpenseAccountID() { return expenseAccountID; } - /** - * The account that will be used for the earnings rate - * - * @param expenseAccountID UUID - */ + /** + * The account that will be used for the earnings rate + * @param expenseAccountID UUID + **/ + public void setExpenseAccountID(UUID expenseAccountID) { this.expenseAccountID = expenseAccountID; } /** - * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * - * @param ratePerUnit Double - * @return EarningsRate - */ + * Default rate per unit (optional). Only applicable if RateType is RatePerUnit + * @param ratePerUnit Double + * @return EarningsRate + **/ public EarningsRate ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * * @return ratePerUnit - */ - @ApiModelProperty( - value = "Default rate per unit (optional). Only applicable if RateType is RatePerUnit") - /** + **/ + @ApiModelProperty(value = "Default rate per unit (optional). Only applicable if RateType is RatePerUnit") + /** * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * - * @param ratePerUnit Double - */ + /** + * Default rate per unit (optional). Only applicable if RateType is RatePerUnit + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * - * @param multipleOfOrdinaryEarningsRate Double - * @return EarningsRate - */ + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + * @param multipleOfOrdinaryEarningsRate Double + * @return EarningsRate + **/ public EarningsRate multipleOfOrdinaryEarningsRate(Double multipleOfOrdinaryEarningsRate) { this.multipleOfOrdinaryEarningsRate = multipleOfOrdinaryEarningsRate; return this; } - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate * @return multipleOfOrdinaryEarningsRate - */ - @ApiModelProperty( - value = - "This is the multiplier used to calculate the rate per unit, based on the employee’s" - + " ordinary earnings rate. For example, for time and a half enter 1.5. Only" - + " applicable if RateType is MultipleOfOrdinaryEarningsRate") - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * + **/ + @ApiModelProperty(value = "This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate") + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate * @return multipleOfOrdinaryEarningsRate Double - */ + **/ public Double getMultipleOfOrdinaryEarningsRate() { return multipleOfOrdinaryEarningsRate; } - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is - * MultipleOfOrdinaryEarningsRate - * - * @param multipleOfOrdinaryEarningsRate Double - */ + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + * @param multipleOfOrdinaryEarningsRate Double + **/ + public void setMultipleOfOrdinaryEarningsRate(Double multipleOfOrdinaryEarningsRate) { this.multipleOfOrdinaryEarningsRate = multipleOfOrdinaryEarningsRate; } /** - * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * - * @param fixedAmount Double - * @return EarningsRate - */ + * Optional Fixed Rate Amount. Applicable for FixedAmount Rate + * @param fixedAmount Double + * @return EarningsRate + **/ public EarningsRate fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * * @return fixedAmount - */ + **/ @ApiModelProperty(value = "Optional Fixed Rate Amount. Applicable for FixedAmount Rate") - /** + /** * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * - * @param fixedAmount Double - */ + /** + * Optional Fixed Rate Amount. Applicable for FixedAmount Rate + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -596,34 +617,24 @@ public boolean equals(java.lang.Object o) { return false; } EarningsRate earningsRate = (EarningsRate) o; - return Objects.equals(this.earningsRateID, earningsRate.earningsRateID) - && Objects.equals(this.name, earningsRate.name) - && Objects.equals(this.earningsType, earningsRate.earningsType) - && Objects.equals(this.rateType, earningsRate.rateType) - && Objects.equals(this.typeOfUnits, earningsRate.typeOfUnits) - && Objects.equals(this.currentRecord, earningsRate.currentRecord) - && Objects.equals(this.expenseAccountID, earningsRate.expenseAccountID) - && Objects.equals(this.ratePerUnit, earningsRate.ratePerUnit) - && Objects.equals( - this.multipleOfOrdinaryEarningsRate, earningsRate.multipleOfOrdinaryEarningsRate) - && Objects.equals(this.fixedAmount, earningsRate.fixedAmount); + return Objects.equals(this.earningsRateID, earningsRate.earningsRateID) && + Objects.equals(this.name, earningsRate.name) && + Objects.equals(this.earningsType, earningsRate.earningsType) && + Objects.equals(this.rateType, earningsRate.rateType) && + Objects.equals(this.typeOfUnits, earningsRate.typeOfUnits) && + Objects.equals(this.currentRecord, earningsRate.currentRecord) && + Objects.equals(this.expenseAccountID, earningsRate.expenseAccountID) && + Objects.equals(this.ratePerUnit, earningsRate.ratePerUnit) && + Objects.equals(this.multipleOfOrdinaryEarningsRate, earningsRate.multipleOfOrdinaryEarningsRate) && + Objects.equals(this.fixedAmount, earningsRate.fixedAmount); } @Override public int hashCode() { - return Objects.hash( - earningsRateID, - name, - earningsType, - rateType, - typeOfUnits, - currentRecord, - expenseAccountID, - ratePerUnit, - multipleOfOrdinaryEarningsRate, - fixedAmount); + return Objects.hash(earningsRateID, name, earningsType, rateType, typeOfUnits, currentRecord, expenseAccountID, ratePerUnit, multipleOfOrdinaryEarningsRate, fixedAmount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -636,16 +647,15 @@ public String toString() { sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append(" expenseAccountID: ").append(toIndentedString(expenseAccountID)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); - sb.append(" multipleOfOrdinaryEarningsRate: ") - .append(toIndentedString(multipleOfOrdinaryEarningsRate)) - .append("\n"); + sb.append(" multipleOfOrdinaryEarningsRate: ").append(toIndentedString(multipleOfOrdinaryEarningsRate)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -653,4 +663,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsRateObject.java b/src/main/java/com/xero/models/payrolluk/EarningsRateObject.java index af77c1aab..bb5714312 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsRateObject.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsRateObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EarningsRate; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsRateObject + */ -/** EarningsRateObject */ public class EarningsRateObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EarningsRateObject { @JsonProperty("earningsRate") private EarningsRate earningsRate; /** - * pagination - * - * @param pagination Pagination - * @return EarningsRateObject - */ + * pagination + * @param pagination Pagination + * @return EarningsRateObject + **/ public EarningsRateObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsRateObject - */ + * problem + * @param problem Problem + * @return EarningsRateObject + **/ public EarningsRateObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningsRate - * - * @param earningsRate EarningsRate - * @return EarningsRateObject - */ + * earningsRate + * @param earningsRate EarningsRate + * @return EarningsRateObject + **/ public EarningsRateObject earningsRate(EarningsRate earningsRate) { this.earningsRate = earningsRate; return this; } - /** + /** * Get earningsRate - * * @return earningsRate - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsRate - * * @return earningsRate EarningsRate - */ + **/ public EarningsRate getEarningsRate() { return earningsRate; } - /** - * earningsRate - * - * @param earningsRate EarningsRate - */ + /** + * earningsRate + * @param earningsRate EarningsRate + **/ + public void setEarningsRate(EarningsRate earningsRate) { this.earningsRate = earningsRate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsRateObject earningsRateObject = (EarningsRateObject) o; - return Objects.equals(this.pagination, earningsRateObject.pagination) - && Objects.equals(this.problem, earningsRateObject.problem) - && Objects.equals(this.earningsRate, earningsRateObject.earningsRate); + return Objects.equals(this.pagination, earningsRateObject.pagination) && + Objects.equals(this.problem, earningsRateObject.problem) && + Objects.equals(this.earningsRate, earningsRateObject.earningsRate); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningsRate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsRates.java b/src/main/java/com/xero/models/payrolluk/EarningsRates.java index d246cf83c..4f98b06dc 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsRates.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsRates.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EarningsRate; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsRates + */ -/** EarningsRates */ public class EarningsRates { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EarningsRates { @JsonProperty("earningsRates") private List earningsRates = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EarningsRates - */ + * pagination + * @param pagination Pagination + * @return EarningsRates + **/ public EarningsRates pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsRates - */ + * problem + * @param problem Problem + * @return EarningsRates + **/ public EarningsRates problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningsRates - * - * @param earningsRates List<EarningsRate> - * @return EarningsRates - */ + * earningsRates + * @param earningsRates List<EarningsRate> + * @return EarningsRates + **/ public EarningsRates earningsRates(List earningsRates) { this.earningsRates = earningsRates; return this; @@ -113,10 +126,9 @@ public EarningsRates earningsRates(List earningsRates) { /** * earningsRates - * - * @param earningsRatesItem EarningsRate + * @param earningsRatesItem EarningsRate * @return EarningsRates - */ + **/ public EarningsRates addEarningsRatesItem(EarningsRate earningsRatesItem) { if (this.earningsRates == null) { this.earningsRates = new ArrayList(); @@ -125,30 +137,29 @@ public EarningsRates addEarningsRatesItem(EarningsRate earningsRatesItem) { return this; } - /** + /** * Get earningsRates - * * @return earningsRates - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsRates - * * @return earningsRates List - */ + **/ public List getEarningsRates() { return earningsRates; } - /** - * earningsRates - * - * @param earningsRates List<EarningsRate> - */ + /** + * earningsRates + * @param earningsRates List<EarningsRate> + **/ + public void setEarningsRates(List earningsRates) { this.earningsRates = earningsRates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsRates earningsRates = (EarningsRates) o; - return Objects.equals(this.pagination, earningsRates.pagination) - && Objects.equals(this.problem, earningsRates.problem) - && Objects.equals(this.earningsRates, earningsRates.earningsRates); + return Objects.equals(this.pagination, earningsRates.pagination) && + Objects.equals(this.problem, earningsRates.problem) && + Objects.equals(this.earningsRates, earningsRates.earningsRates); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningsRates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsTemplate.java b/src/main/java/com/xero/models/payrolluk/EarningsTemplate.java index 1eec08c2e..c2acc588f 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsTemplate.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsTemplate.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsTemplate + */ -/** EarningsTemplate */ public class EarningsTemplate { StringUtil util = new StringUtil(); @@ -39,215 +56,198 @@ public class EarningsTemplate { @JsonProperty("name") private String name; /** - * The Xero identifier for the earnings template - * - * @param payTemplateEarningID UUID - * @return EarningsTemplate - */ + * The Xero identifier for the earnings template + * @param payTemplateEarningID UUID + * @return EarningsTemplate + **/ public EarningsTemplate payTemplateEarningID(UUID payTemplateEarningID) { this.payTemplateEarningID = payTemplateEarningID; return this; } - /** + /** * The Xero identifier for the earnings template - * * @return payTemplateEarningID - */ + **/ @ApiModelProperty(value = "The Xero identifier for the earnings template") - /** + /** * The Xero identifier for the earnings template - * * @return payTemplateEarningID UUID - */ + **/ public UUID getPayTemplateEarningID() { return payTemplateEarningID; } - /** - * The Xero identifier for the earnings template - * - * @param payTemplateEarningID UUID - */ + /** + * The Xero identifier for the earnings template + * @param payTemplateEarningID UUID + **/ + public void setPayTemplateEarningID(UUID payTemplateEarningID) { this.payTemplateEarningID = payTemplateEarningID; } /** - * The rate per unit - * - * @param ratePerUnit Double - * @return EarningsTemplate - */ + * The rate per unit + * @param ratePerUnit Double + * @return EarningsTemplate + **/ public EarningsTemplate ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * The rate per unit - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "The rate per unit") - /** + /** * The rate per unit - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * The rate per unit - * - * @param ratePerUnit Double - */ + /** + * The rate per unit + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * The rate per unit - * - * @param numberOfUnits Double - * @return EarningsTemplate - */ + * The rate per unit + * @param numberOfUnits Double + * @return EarningsTemplate + **/ public EarningsTemplate numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The rate per unit - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "The rate per unit") - /** + /** * The rate per unit - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The rate per unit - * - * @param numberOfUnits Double - */ + /** + * The rate per unit + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * The fixed amount per period - * - * @param fixedAmount Double - * @return EarningsTemplate - */ + * The fixed amount per period + * @param fixedAmount Double + * @return EarningsTemplate + **/ public EarningsTemplate fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * The fixed amount per period - * * @return fixedAmount - */ + **/ @ApiModelProperty(value = "The fixed amount per period") - /** + /** * The fixed amount per period - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * The fixed amount per period - * - * @param fixedAmount Double - */ + /** + * The fixed amount per period + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The corresponding earnings rate identifier - * - * @param earningsRateID UUID - * @return EarningsTemplate - */ + * The corresponding earnings rate identifier + * @param earningsRateID UUID + * @return EarningsTemplate + **/ public EarningsTemplate earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * The corresponding earnings rate identifier - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "The corresponding earnings rate identifier") - /** + /** * The corresponding earnings rate identifier - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * The corresponding earnings rate identifier - * - * @param earningsRateID UUID - */ + /** + * The corresponding earnings rate identifier + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * The read-only name of the Earning Template. - * - * @param name String - * @return EarningsTemplate - */ + * The read-only name of the Earning Template. + * @param name String + * @return EarningsTemplate + **/ public EarningsTemplate name(String name) { this.name = name; return this; } - /** + /** * The read-only name of the Earning Template. - * * @return name - */ + **/ @ApiModelProperty(value = "The read-only name of the Earning Template.") - /** + /** * The read-only name of the Earning Template. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The read-only name of the Earning Template. - * - * @param name String - */ + /** + * The read-only name of the Earning Template. + * @param name String + **/ + public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -257,27 +257,25 @@ public boolean equals(java.lang.Object o) { return false; } EarningsTemplate earningsTemplate = (EarningsTemplate) o; - return Objects.equals(this.payTemplateEarningID, earningsTemplate.payTemplateEarningID) - && Objects.equals(this.ratePerUnit, earningsTemplate.ratePerUnit) - && Objects.equals(this.numberOfUnits, earningsTemplate.numberOfUnits) - && Objects.equals(this.fixedAmount, earningsTemplate.fixedAmount) - && Objects.equals(this.earningsRateID, earningsTemplate.earningsRateID) - && Objects.equals(this.name, earningsTemplate.name); + return Objects.equals(this.payTemplateEarningID, earningsTemplate.payTemplateEarningID) && + Objects.equals(this.ratePerUnit, earningsTemplate.ratePerUnit) && + Objects.equals(this.numberOfUnits, earningsTemplate.numberOfUnits) && + Objects.equals(this.fixedAmount, earningsTemplate.fixedAmount) && + Objects.equals(this.earningsRateID, earningsTemplate.earningsRateID) && + Objects.equals(this.name, earningsTemplate.name); } @Override public int hashCode() { - return Objects.hash( - payTemplateEarningID, ratePerUnit, numberOfUnits, fixedAmount, earningsRateID, name); + return Objects.hash(payTemplateEarningID, ratePerUnit, numberOfUnits, fixedAmount, earningsRateID, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EarningsTemplate {\n"); - sb.append(" payTemplateEarningID: ") - .append(toIndentedString(payTemplateEarningID)) - .append("\n"); + sb.append(" payTemplateEarningID: ").append(toIndentedString(payTemplateEarningID)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); @@ -288,7 +286,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -296,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EarningsTemplateObject.java b/src/main/java/com/xero/models/payrolluk/EarningsTemplateObject.java index 7c30c007d..c86aa924e 100644 --- a/src/main/java/com/xero/models/payrolluk/EarningsTemplateObject.java +++ b/src/main/java/com/xero/models/payrolluk/EarningsTemplateObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EarningsTemplate; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EarningsTemplateObject + */ -/** EarningsTemplateObject */ public class EarningsTemplateObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EarningsTemplateObject { @JsonProperty("earningTemplate") private EarningsTemplate earningTemplate; /** - * pagination - * - * @param pagination Pagination - * @return EarningsTemplateObject - */ + * pagination + * @param pagination Pagination + * @return EarningsTemplateObject + **/ public EarningsTemplateObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EarningsTemplateObject - */ + * problem + * @param problem Problem + * @return EarningsTemplateObject + **/ public EarningsTemplateObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningTemplate - * - * @param earningTemplate EarningsTemplate - * @return EarningsTemplateObject - */ + * earningTemplate + * @param earningTemplate EarningsTemplate + * @return EarningsTemplateObject + **/ public EarningsTemplateObject earningTemplate(EarningsTemplate earningTemplate) { this.earningTemplate = earningTemplate; return this; } - /** + /** * Get earningTemplate - * * @return earningTemplate - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningTemplate - * * @return earningTemplate EarningsTemplate - */ + **/ public EarningsTemplate getEarningTemplate() { return earningTemplate; } - /** - * earningTemplate - * - * @param earningTemplate EarningsTemplate - */ + /** + * earningTemplate + * @param earningTemplate EarningsTemplate + **/ + public void setEarningTemplate(EarningsTemplate earningTemplate) { this.earningTemplate = earningTemplate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EarningsTemplateObject earningsTemplateObject = (EarningsTemplateObject) o; - return Objects.equals(this.pagination, earningsTemplateObject.pagination) - && Objects.equals(this.problem, earningsTemplateObject.problem) - && Objects.equals(this.earningTemplate, earningsTemplateObject.earningTemplate); + return Objects.equals(this.pagination, earningsTemplateObject.pagination) && + Objects.equals(this.problem, earningsTemplateObject.problem) && + Objects.equals(this.earningTemplate, earningsTemplateObject.earningTemplate); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningTemplate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Employee.java b/src/main/java/com/xero/models/payrolluk/Employee.java index 7436d3e80..c18ef8260 100644 --- a/src/main/java/com/xero/models/payrolluk/Employee.java +++ b/src/main/java/com/xero/models/payrolluk/Employee.java @@ -9,21 +9,39 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrolluk.Address; +import com.xero.models.payrolluk.NICategory; +import com.xero.models.payrolluk.NICategoryLetter; +import io.swagger.annotations.ApiModel; 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; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employee + */ -/** Employee */ public class Employee { StringUtil util = new StringUtil(); @@ -47,12 +65,18 @@ public class Employee { @JsonProperty("email") private String email; - /** The employee’s gender */ + /** + * The employee’s gender + */ public enum GenderEnum { - /** M */ + /** + * M + */ M("M"), - - /** F */ + + /** + * F + */ F("F"); private String value; @@ -61,31 +85,25 @@ public enum GenderEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static GenderEnum fromValue(String value) { for (GenderEnum b : GenderEnum.values()) { @@ -97,6 +115,7 @@ public static GenderEnum fromValue(String value) { } } + @JsonProperty("gender") private GenderEnum gender; @@ -130,544 +149,490 @@ public static GenderEnum fromValue(String value) { @JsonProperty("isOffPayrollWorker") private Boolean isOffPayrollWorker; /** - * Xero unique identifier for the employee - * - * @param employeeID UUID - * @return Employee - */ + * Xero unique identifier for the employee + * @param employeeID UUID + * @return Employee + **/ public Employee employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * Xero unique identifier for the employee - * * @return employeeID - */ - @ApiModelProperty( - example = "d90457c4-f1be-4f2e-b4e3-f766390a7e30", - value = "Xero unique identifier for the employee") - /** + **/ + @ApiModelProperty(example = "d90457c4-f1be-4f2e-b4e3-f766390a7e30", value = "Xero unique identifier for the employee") + /** * Xero unique identifier for the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * Xero unique identifier for the employee - * - * @param employeeID UUID - */ + /** + * Xero unique identifier for the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * Title of the employee - * - * @param title String - * @return Employee - */ + * Title of the employee + * @param title String + * @return Employee + **/ public Employee title(String title) { this.title = title; return this; } - /** + /** * Title of the employee - * * @return title - */ + **/ @ApiModelProperty(example = "Mrs", value = "Title of the employee") - /** + /** * Title of the employee - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * Title of the employee - * - * @param title String - */ + /** + * Title of the employee + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * First name of employee - * - * @param firstName String - * @return Employee - */ + * First name of employee + * @param firstName String + * @return Employee + **/ public Employee firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * First name of employee - * * @return firstName - */ + **/ @ApiModelProperty(example = "Karen", value = "First name of employee") - /** + /** * First name of employee - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * First name of employee - * - * @param firstName String - */ + /** + * First name of employee + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Last name of employee - * - * @param lastName String - * @return Employee - */ + * Last name of employee + * @param lastName String + * @return Employee + **/ public Employee lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Last name of employee - * * @return lastName - */ + **/ @ApiModelProperty(example = "Jones", value = "Last name of employee") - /** + /** * Last name of employee - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Last name of employee - * - * @param lastName String - */ + /** + * Last name of employee + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Date of birth of the employee (YYYY-MM-DD) - * - * @param dateOfBirth LocalDate - * @return Employee - */ + * Date of birth of the employee (YYYY-MM-DD) + * @param dateOfBirth LocalDate + * @return Employee + **/ public Employee dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; return this; } - /** + /** * Date of birth of the employee (YYYY-MM-DD) - * * @return dateOfBirth - */ - @ApiModelProperty( - example = "Wed Jan 02 00:00:00 UTC 2019", - value = "Date of birth of the employee (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(example = "Wed Jan 02 00:00:00 UTC 2019", value = "Date of birth of the employee (YYYY-MM-DD)") + /** * Date of birth of the employee (YYYY-MM-DD) - * * @return dateOfBirth LocalDate - */ + **/ public LocalDate getDateOfBirth() { return dateOfBirth; } - /** - * Date of birth of the employee (YYYY-MM-DD) - * - * @param dateOfBirth LocalDate - */ + /** + * Date of birth of the employee (YYYY-MM-DD) + * @param dateOfBirth LocalDate + **/ + public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } /** - * address - * - * @param address Address - * @return Employee - */ + * address + * @param address Address + * @return Employee + **/ public Employee address(Address address) { this.address = address; return this; } - /** + /** * Get address - * * @return address - */ + **/ @ApiModelProperty(value = "") - /** + /** * address - * * @return address Address - */ + **/ public Address getAddress() { return address; } - /** - * address - * - * @param address Address - */ + /** + * address + * @param address Address + **/ + public void setAddress(Address address) { this.address = address; } /** - * The email address for the employee - * - * @param email String - * @return Employee - */ + * The email address for the employee + * @param email String + * @return Employee + **/ public Employee email(String email) { this.email = email; return this; } - /** + /** * The email address for the employee - * * @return email - */ + **/ @ApiModelProperty(example = "developer@me.com", value = "The email address for the employee") - /** + /** * The email address for the employee - * * @return email String - */ + **/ public String getEmail() { return email; } - /** - * The email address for the employee - * - * @param email String - */ + /** + * The email address for the employee + * @param email String + **/ + public void setEmail(String email) { this.email = email; } /** - * The employee’s gender - * - * @param gender GenderEnum - * @return Employee - */ + * The employee’s gender + * @param gender GenderEnum + * @return Employee + **/ public Employee gender(GenderEnum gender) { this.gender = gender; return this; } - /** + /** * The employee’s gender - * * @return gender - */ + **/ @ApiModelProperty(example = "F", value = "The employee’s gender") - /** + /** * The employee’s gender - * * @return gender GenderEnum - */ + **/ public GenderEnum getGender() { return gender; } - /** - * The employee’s gender - * - * @param gender GenderEnum - */ + /** + * The employee’s gender + * @param gender GenderEnum + **/ + public void setGender(GenderEnum gender) { this.gender = gender; } /** - * Employee phone number - * - * @param phoneNumber String - * @return Employee - */ + * Employee phone number + * @param phoneNumber String + * @return Employee + **/ public Employee phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; return this; } - /** + /** * Employee phone number - * * @return phoneNumber - */ + **/ @ApiModelProperty(example = "415-555-1212", value = "Employee phone number") - /** + /** * Employee phone number - * * @return phoneNumber String - */ + **/ public String getPhoneNumber() { return phoneNumber; } - /** - * Employee phone number - * - * @param phoneNumber String - */ + /** + * Employee phone number + * @param phoneNumber String + **/ + public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } /** - * Employment start date of the employee at the time it was requested - * - * @param startDate LocalDate - * @return Employee - */ + * Employment start date of the employee at the time it was requested + * @param startDate LocalDate + * @return Employee + **/ public Employee startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Employment start date of the employee at the time it was requested - * * @return startDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = "Employment start date of the employee at the time it was requested") - /** + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "Employment start date of the employee at the time it was requested") + /** * Employment start date of the employee at the time it was requested - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Employment start date of the employee at the time it was requested - * - * @param startDate LocalDate - */ + /** + * Employment start date of the employee at the time it was requested + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * Employment end date of the employee at the time it was requested - * - * @param endDate LocalDate - * @return Employee - */ + * Employment end date of the employee at the time it was requested + * @param endDate LocalDate + * @return Employee + **/ public Employee endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * Employment end date of the employee at the time it was requested - * * @return endDate - */ - @ApiModelProperty( - example = "Sun Jan 19 00:00:00 UTC 2020", - value = "Employment end date of the employee at the time it was requested") - /** + **/ + @ApiModelProperty(example = "Sun Jan 19 00:00:00 UTC 2020", value = "Employment end date of the employee at the time it was requested") + /** * Employment end date of the employee at the time it was requested - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * Employment end date of the employee at the time it was requested - * - * @param endDate LocalDate - */ + /** + * Employment end date of the employee at the time it was requested + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - * @return Employee - */ + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + * @return Employee + **/ public Employee payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar of the employee") - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * UTC timestamp of last update to the employee - * - * @param updatedDateUTC LocalDateTime - * @return Employee - */ + * UTC timestamp of last update to the employee + * @param updatedDateUTC LocalDateTime + * @return Employee + **/ public Employee updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of last update to the employee - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of last update to the employee") - /** + /** * UTC timestamp of last update to the employee - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of last update to the employee - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of last update to the employee + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } /** - * UTC timestamp when the employee was created in Xero - * - * @param createdDateUTC LocalDateTime - * @return Employee - */ + * UTC timestamp when the employee was created in Xero + * @param createdDateUTC LocalDateTime + * @return Employee + **/ public Employee createdDateUTC(LocalDateTime createdDateUTC) { this.createdDateUTC = createdDateUTC; return this; } - /** + /** * UTC timestamp when the employee was created in Xero - * * @return createdDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp when the employee was created in Xero") - /** + /** * UTC timestamp when the employee was created in Xero - * * @return createdDateUTC LocalDateTime - */ + **/ public LocalDateTime getCreatedDateUTC() { return createdDateUTC; } - /** - * UTC timestamp when the employee was created in Xero - * - * @param createdDateUTC LocalDateTime - */ + /** + * UTC timestamp when the employee was created in Xero + * @param createdDateUTC LocalDateTime + **/ + public void setCreatedDateUTC(LocalDateTime createdDateUTC) { this.createdDateUTC = createdDateUTC; } /** - * niCategory - * - * @param niCategory NICategoryLetter - * @return Employee - */ + * 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 - */ + /** + * niCategory + * @param niCategory NICategoryLetter + **/ + public void setNiCategory(NICategoryLetter niCategory) { this.niCategory = niCategory; } /** - * The employee's NI categories - * - * @param niCategories List<NICategory> - * @return Employee - */ + * The employee's NI categories + * @param niCategories List<NICategory> + * @return Employee + **/ public Employee niCategories(List niCategories) { this.niCategories = niCategories; return this; @@ -675,10 +640,9 @@ public Employee niCategories(List niCategories) { /** * The employee's NI categories - * - * @param niCategoriesItem NICategory + * @param niCategoriesItem NICategory * @return Employee - */ + **/ public Employee addNiCategoriesItem(NICategory niCategoriesItem) { if (this.niCategories == null) { this.niCategories = new ArrayList(); @@ -687,100 +651,93 @@ public Employee addNiCategoriesItem(NICategory 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> - */ + /** + * The employee's NI categories + * @param niCategories List<NICategory> + **/ + public void setNiCategories(List niCategories) { this.niCategories = niCategories; } /** - * National insurance number of the employee - * - * @param nationalInsuranceNumber String - * @return Employee - */ + * National insurance number of the employee + * @param nationalInsuranceNumber String + * @return Employee + **/ public Employee nationalInsuranceNumber(String nationalInsuranceNumber) { this.nationalInsuranceNumber = nationalInsuranceNumber; return this; } - /** + /** * National insurance number of the employee - * * @return nationalInsuranceNumber - */ + **/ @ApiModelProperty(example = "AB123456C", value = "National insurance number of the employee") - /** + /** * National insurance number of the employee - * * @return nationalInsuranceNumber String - */ + **/ public String getNationalInsuranceNumber() { return nationalInsuranceNumber; } - /** - * National insurance number of the employee - * - * @param nationalInsuranceNumber String - */ + /** + * National insurance number of the employee + * @param nationalInsuranceNumber String + **/ + public void setNationalInsuranceNumber(String nationalInsuranceNumber) { this.nationalInsuranceNumber = nationalInsuranceNumber; } /** - * Whether the employee is an off payroll worker - * - * @param isOffPayrollWorker Boolean - * @return Employee - */ + * Whether the employee is an off payroll worker + * @param isOffPayrollWorker Boolean + * @return Employee + **/ public Employee isOffPayrollWorker(Boolean isOffPayrollWorker) { this.isOffPayrollWorker = isOffPayrollWorker; return this; } - /** + /** * Whether the employee is an off payroll worker - * * @return isOffPayrollWorker - */ + **/ @ApiModelProperty(value = "Whether the employee is an off payroll worker") - /** + /** * Whether the employee is an off payroll worker - * * @return isOffPayrollWorker Boolean - */ + **/ public Boolean getIsOffPayrollWorker() { return isOffPayrollWorker; } - /** - * Whether the employee is an off payroll worker - * - * @param isOffPayrollWorker Boolean - */ + /** + * Whether the employee is an off payroll worker + * @param isOffPayrollWorker Boolean + **/ + public void setIsOffPayrollWorker(Boolean isOffPayrollWorker) { this.isOffPayrollWorker = isOffPayrollWorker; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -790,49 +747,32 @@ public boolean equals(java.lang.Object o) { return false; } Employee employee = (Employee) o; - return Objects.equals(this.employeeID, employee.employeeID) - && Objects.equals(this.title, employee.title) - && Objects.equals(this.firstName, employee.firstName) - && Objects.equals(this.lastName, employee.lastName) - && Objects.equals(this.dateOfBirth, employee.dateOfBirth) - && Objects.equals(this.address, employee.address) - && Objects.equals(this.email, employee.email) - && Objects.equals(this.gender, employee.gender) - && Objects.equals(this.phoneNumber, employee.phoneNumber) - && Objects.equals(this.startDate, employee.startDate) - && Objects.equals(this.endDate, employee.endDate) - && 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); + return Objects.equals(this.employeeID, employee.employeeID) && + Objects.equals(this.title, employee.title) && + Objects.equals(this.firstName, employee.firstName) && + Objects.equals(this.lastName, employee.lastName) && + Objects.equals(this.dateOfBirth, employee.dateOfBirth) && + Objects.equals(this.address, employee.address) && + Objects.equals(this.email, employee.email) && + Objects.equals(this.gender, employee.gender) && + Objects.equals(this.phoneNumber, employee.phoneNumber) && + Objects.equals(this.startDate, employee.startDate) && + Objects.equals(this.endDate, employee.endDate) && + 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); } @Override public int hashCode() { - return Objects.hash( - employeeID, - title, - firstName, - lastName, - dateOfBirth, - address, - email, - gender, - phoneNumber, - startDate, - endDate, - payrollCalendarID, - updatedDateUTC, - createdDateUTC, - niCategory, - niCategories, - nationalInsuranceNumber, - isOffPayrollWorker); + return Objects.hash(employeeID, title, firstName, lastName, dateOfBirth, address, email, gender, phoneNumber, startDate, endDate, payrollCalendarID, updatedDateUTC, createdDateUTC, niCategory, niCategories, nationalInsuranceNumber, isOffPayrollWorker); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -853,16 +793,15 @@ public String toString() { 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"); + sb.append(" nationalInsuranceNumber: ").append(toIndentedString(nationalInsuranceNumber)).append("\n"); sb.append(" isOffPayrollWorker: ").append(toIndentedString(isOffPayrollWorker)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -870,4 +809,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeave.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeave.java index 6757f8249..c8a610eda 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeave.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeave.java @@ -9,19 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.LeavePeriod; +import io.swagger.annotations.ApiModel; 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; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeave + */ -/** EmployeeLeave */ public class EmployeeLeave { StringUtil util = new StringUtil(); @@ -46,201 +64,180 @@ public class EmployeeLeave { @JsonProperty("updatedDateUTC") private LocalDateTime updatedDateUTC; /** - * The Xero identifier for LeaveType - * - * @param leaveID UUID - * @return EmployeeLeave - */ + * The Xero identifier for LeaveType + * @param leaveID UUID + * @return EmployeeLeave + **/ public EmployeeLeave leaveID(UUID leaveID) { this.leaveID = leaveID; return this; } - /** + /** * The Xero identifier for LeaveType - * * @return leaveID - */ + **/ @ApiModelProperty(value = "The Xero identifier for LeaveType") - /** + /** * The Xero identifier for LeaveType - * * @return leaveID UUID - */ + **/ public UUID getLeaveID() { return leaveID; } - /** - * The Xero identifier for LeaveType - * - * @param leaveID UUID - */ + /** + * The Xero identifier for LeaveType + * @param leaveID UUID + **/ + public void setLeaveID(UUID leaveID) { this.leaveID = leaveID; } /** - * The Xero identifier for LeaveType - * - * @param leaveTypeID UUID - * @return EmployeeLeave - */ + * The Xero identifier for LeaveType + * @param leaveTypeID UUID + * @return EmployeeLeave + **/ public EmployeeLeave leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * The Xero identifier for LeaveType - * * @return leaveTypeID - */ + **/ @ApiModelProperty(required = true, value = "The Xero identifier for LeaveType") - /** + /** * The Xero identifier for LeaveType - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The Xero identifier for LeaveType - * - * @param leaveTypeID UUID - */ + /** + * The Xero identifier for LeaveType + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The description of the leave (max length = 50) - * - * @param description String - * @return EmployeeLeave - */ + * The description of the leave (max length = 50) + * @param description String + * @return EmployeeLeave + **/ public EmployeeLeave description(String description) { this.description = description; return this; } - /** - * The description of the leave (max length = 50) - * + /** + * The description of the leave (max length = 50) * @return description - */ + **/ @ApiModelProperty(required = true, value = "The description of the leave (max length = 50)") - /** - * The description of the leave (max length = 50) - * + /** + * The description of the leave (max length = 50) * @return description String - */ + **/ public String getDescription() { return description; } - /** - * The description of the leave (max length = 50) - * - * @param description String - */ + /** + * The description of the leave (max length = 50) + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Start date of the leave (YYYY-MM-DD) - * - * @param startDate LocalDate - * @return EmployeeLeave - */ + * Start date of the leave (YYYY-MM-DD) + * @param startDate LocalDate + * @return EmployeeLeave + **/ public EmployeeLeave startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the leave (YYYY-MM-DD) - * * @return startDate - */ + **/ @ApiModelProperty(required = true, value = "Start date of the leave (YYYY-MM-DD)") - /** + /** * Start date of the leave (YYYY-MM-DD) - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the leave (YYYY-MM-DD) - * - * @param startDate LocalDate - */ + /** + * Start date of the leave (YYYY-MM-DD) + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * End date of the leave (YYYY-MM-DD) - * - * @param endDate LocalDate - * @return EmployeeLeave - */ + * End date of the leave (YYYY-MM-DD) + * @param endDate LocalDate + * @return EmployeeLeave + **/ public EmployeeLeave endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * End date of the leave (YYYY-MM-DD) - * * @return endDate - */ + **/ @ApiModelProperty(required = true, value = "End date of the leave (YYYY-MM-DD)") - /** + /** * End date of the leave (YYYY-MM-DD) - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * End date of the leave (YYYY-MM-DD) - * - * @param endDate LocalDate - */ + /** + * End date of the leave (YYYY-MM-DD) + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * - * @param periods List<LeavePeriod> - * @return EmployeeLeave - */ + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + * @param periods List<LeavePeriod> + * @return EmployeeLeave + **/ public EmployeeLeave periods(List periods) { this.periods = periods; return this; } /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * - * @param periodsItem LeavePeriod + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + * @param periodsItem LeavePeriod * @return EmployeeLeave - */ + **/ public EmployeeLeave addPeriodsItem(LeavePeriod periodsItem) { if (this.periods == null) { this.periods = new ArrayList(); @@ -249,76 +246,61 @@ public EmployeeLeave addPeriodsItem(LeavePeriod periodsItem) { return this; } - /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * + /** + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. * @return periods - */ - @ApiModelProperty( - value = - "The leave period information. The StartDate, EndDate and NumberOfUnits needs to be" - + " specified when you do not want to calculate NumberOfUnits automatically. Using" - + " incorrect period StartDate and EndDate will result in automatic computation of" - + " the NumberOfUnits.") - /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * + **/ + @ApiModelProperty(value = "The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits.") + /** + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. * @return periods List - */ + **/ public List getPeriods() { return periods; } - /** - * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified - * when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate - * and EndDate will result in automatic computation of the NumberOfUnits. - * - * @param periods List<LeavePeriod> - */ + /** + * The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. + * @param periods List<LeavePeriod> + **/ + public void setPeriods(List periods) { this.periods = periods; } /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - * @return EmployeeLeave - */ + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + * @return EmployeeLeave + **/ public EmployeeLeave updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of last update to the leave type note") - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -328,21 +310,21 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeave employeeLeave = (EmployeeLeave) o; - return Objects.equals(this.leaveID, employeeLeave.leaveID) - && Objects.equals(this.leaveTypeID, employeeLeave.leaveTypeID) - && Objects.equals(this.description, employeeLeave.description) - && Objects.equals(this.startDate, employeeLeave.startDate) - && Objects.equals(this.endDate, employeeLeave.endDate) - && Objects.equals(this.periods, employeeLeave.periods) - && Objects.equals(this.updatedDateUTC, employeeLeave.updatedDateUTC); + return Objects.equals(this.leaveID, employeeLeave.leaveID) && + Objects.equals(this.leaveTypeID, employeeLeave.leaveTypeID) && + Objects.equals(this.description, employeeLeave.description) && + Objects.equals(this.startDate, employeeLeave.startDate) && + Objects.equals(this.endDate, employeeLeave.endDate) && + Objects.equals(this.periods, employeeLeave.periods) && + Objects.equals(this.updatedDateUTC, employeeLeave.updatedDateUTC); } @Override public int hashCode() { - return Objects.hash( - leaveID, leaveTypeID, description, startDate, endDate, periods, updatedDateUTC); + return Objects.hash(leaveID, leaveTypeID, description, startDate, endDate, periods, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -359,7 +341,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -367,4 +350,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalance.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalance.java index 247a8d999..7fbb2cd74 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalance.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalance.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveBalance + */ -/** EmployeeLeaveBalance */ public class EmployeeLeaveBalance { StringUtil util = new StringUtil(); @@ -33,145 +50,134 @@ public class EmployeeLeaveBalance { @JsonProperty("typeOfUnits") private String typeOfUnits; /** - * Name of the leave type. - * - * @param name String - * @return EmployeeLeaveBalance - */ + * Name of the leave type. + * @param name String + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance name(String name) { this.name = name; return this; } - /** + /** * Name of the leave type. - * * @return name - */ + **/ @ApiModelProperty(example = "Holiday", value = "Name of the leave type.") - /** + /** * Name of the leave type. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the leave type. - * - * @param name String - */ + /** + * Name of the leave type. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - * @return EmployeeLeaveBalance - */ + * The Xero identifier for leave type + * @param leaveTypeID UUID + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(value = "The Xero identifier for leave type") - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - */ + /** + * The Xero identifier for leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The employees current balance for the corresponding leave type. - * - * @param balance Double - * @return EmployeeLeaveBalance - */ + * The employees current balance for the corresponding leave type. + * @param balance Double + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance balance(Double balance) { this.balance = balance; return this; } - /** + /** * The employees current balance for the corresponding leave type. - * * @return balance - */ + **/ @ApiModelProperty(value = "The employees current balance for the corresponding leave type.") - /** + /** * The employees current balance for the corresponding leave type. - * * @return balance Double - */ + **/ public Double getBalance() { return balance; } - /** - * The employees current balance for the corresponding leave type. - * - * @param balance Double - */ + /** + * The employees current balance for the corresponding leave type. + * @param balance Double + **/ + public void setBalance(Double balance) { this.balance = balance; } /** - * The type of the units of the leave. - * - * @param typeOfUnits String - * @return EmployeeLeaveBalance - */ + * The type of the units of the leave. + * @param typeOfUnits String + * @return EmployeeLeaveBalance + **/ public EmployeeLeaveBalance typeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; return this; } - /** + /** * The type of the units of the leave. - * * @return typeOfUnits - */ + **/ @ApiModelProperty(example = "hours", value = "The type of the units of the leave.") - /** + /** * The type of the units of the leave. - * * @return typeOfUnits String - */ + **/ public String getTypeOfUnits() { return typeOfUnits; } - /** - * The type of the units of the leave. - * - * @param typeOfUnits String - */ + /** + * The type of the units of the leave. + * @param typeOfUnits String + **/ + public void setTypeOfUnits(String typeOfUnits) { this.typeOfUnits = typeOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveBalance employeeLeaveBalance = (EmployeeLeaveBalance) o; - return Objects.equals(this.name, employeeLeaveBalance.name) - && Objects.equals(this.leaveTypeID, employeeLeaveBalance.leaveTypeID) - && Objects.equals(this.balance, employeeLeaveBalance.balance) - && Objects.equals(this.typeOfUnits, employeeLeaveBalance.typeOfUnits); + return Objects.equals(this.name, employeeLeaveBalance.name) && + Objects.equals(this.leaveTypeID, employeeLeaveBalance.leaveTypeID) && + Objects.equals(this.balance, employeeLeaveBalance.balance) && + Objects.equals(this.typeOfUnits, employeeLeaveBalance.typeOfUnits); } @Override @@ -192,6 +198,7 @@ public int hashCode() { return Objects.hash(name, leaveTypeID, balance, typeOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -205,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -213,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalances.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalances.java index 1991845f5..cbbe38243 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalances.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveBalances.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeLeaveBalance; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveBalances + */ -/** EmployeeLeaveBalances */ public class EmployeeLeaveBalances { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeeLeaveBalances { @JsonProperty("leaveBalances") private List leaveBalances = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveBalances - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveBalances + **/ public EmployeeLeaveBalances pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveBalances - */ + * problem + * @param problem Problem + * @return EmployeeLeaveBalances + **/ public EmployeeLeaveBalances problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveBalances - * - * @param leaveBalances List<EmployeeLeaveBalance> - * @return EmployeeLeaveBalances - */ + * leaveBalances + * @param leaveBalances List<EmployeeLeaveBalance> + * @return EmployeeLeaveBalances + **/ public EmployeeLeaveBalances leaveBalances(List leaveBalances) { this.leaveBalances = leaveBalances; return this; @@ -113,10 +126,9 @@ public EmployeeLeaveBalances leaveBalances(List leaveBalan /** * leaveBalances - * - * @param leaveBalancesItem EmployeeLeaveBalance + * @param leaveBalancesItem EmployeeLeaveBalance * @return EmployeeLeaveBalances - */ + **/ public EmployeeLeaveBalances addLeaveBalancesItem(EmployeeLeaveBalance leaveBalancesItem) { if (this.leaveBalances == null) { this.leaveBalances = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeeLeaveBalances addLeaveBalancesItem(EmployeeLeaveBalance leaveBala return this; } - /** + /** * Get leaveBalances - * * @return leaveBalances - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveBalances - * * @return leaveBalances List - */ + **/ public List getLeaveBalances() { return leaveBalances; } - /** - * leaveBalances - * - * @param leaveBalances List<EmployeeLeaveBalance> - */ + /** + * leaveBalances + * @param leaveBalances List<EmployeeLeaveBalance> + **/ + public void setLeaveBalances(List leaveBalances) { this.leaveBalances = leaveBalances; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveBalances employeeLeaveBalances = (EmployeeLeaveBalances) o; - return Objects.equals(this.pagination, employeeLeaveBalances.pagination) - && Objects.equals(this.problem, employeeLeaveBalances.problem) - && Objects.equals(this.leaveBalances, employeeLeaveBalances.leaveBalances); + return Objects.equals(this.pagination, employeeLeaveBalances.pagination) && + Objects.equals(this.problem, employeeLeaveBalances.problem) && + Objects.equals(this.leaveBalances, employeeLeaveBalances.leaveBalances); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveBalances); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveObject.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveObject.java index 3502dd060..0fc49aef2 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeLeave; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveObject + */ -/** EmployeeLeaveObject */ public class EmployeeLeaveObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeLeaveObject { @JsonProperty("leave") private EmployeeLeave leave; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveObject + **/ public EmployeeLeaveObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveObject - */ + * problem + * @param problem Problem + * @return EmployeeLeaveObject + **/ public EmployeeLeaveObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leave - * - * @param leave EmployeeLeave - * @return EmployeeLeaveObject - */ + * leave + * @param leave EmployeeLeave + * @return EmployeeLeaveObject + **/ public EmployeeLeaveObject leave(EmployeeLeave leave) { this.leave = leave; return this; } - /** + /** * Get leave - * * @return leave - */ + **/ @ApiModelProperty(value = "") - /** + /** * leave - * * @return leave EmployeeLeave - */ + **/ public EmployeeLeave getLeave() { return leave; } - /** - * leave - * - * @param leave EmployeeLeave - */ + /** + * leave + * @param leave EmployeeLeave + **/ + public void setLeave(EmployeeLeave leave) { this.leave = leave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveObject employeeLeaveObject = (EmployeeLeaveObject) o; - return Objects.equals(this.pagination, employeeLeaveObject.pagination) - && Objects.equals(this.problem, employeeLeaveObject.problem) - && Objects.equals(this.leave, employeeLeaveObject.leave); + return Objects.equals(this.pagination, employeeLeaveObject.pagination) && + Objects.equals(this.problem, employeeLeaveObject.problem) && + Objects.equals(this.leave, employeeLeaveObject.leave); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveType.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveType.java index d2ac08838..1aaf73cc0 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveType.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveType.java @@ -9,35 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveType + */ -/** EmployeeLeaveType */ public class EmployeeLeaveType { StringUtil util = new StringUtil(); @JsonProperty("leaveTypeID") private UUID leaveTypeID; - /** The schedule of accrual */ + /** + * The schedule of accrual + */ public enum ScheduleOfAccrualEnum { - /** BEGINNINGOFCALENDARYEAR */ + /** + * BEGINNINGOFCALENDARYEAR + */ BEGINNINGOFCALENDARYEAR("BeginningOfCalendarYear"), - - /** ONANNIVERSARYDATE */ + + /** + * ONANNIVERSARYDATE + */ ONANNIVERSARYDATE("OnAnniversaryDate"), - - /** EACHPAYPERIOD */ + + /** + * EACHPAYPERIOD + */ EACHPAYPERIOD("EachPayPeriod"), - - /** ONHOURWORKED */ + + /** + * ONHOURWORKED + */ ONHOURWORKED("OnHourWorked"); private String value; @@ -46,31 +71,25 @@ public enum ScheduleOfAccrualEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static ScheduleOfAccrualEnum fromValue(String value) { for (ScheduleOfAccrualEnum b : ScheduleOfAccrualEnum.values()) { @@ -82,6 +101,7 @@ public static ScheduleOfAccrualEnum fromValue(String value) { } } + @JsonProperty("scheduleOfAccrual") private ScheduleOfAccrualEnum scheduleOfAccrual; @@ -100,273 +120,230 @@ public static ScheduleOfAccrualEnum fromValue(String value) { @JsonProperty("scheduleOfAccrualDate") private LocalDate scheduleOfAccrualDate; /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - * @return EmployeeLeaveType - */ + * The Xero identifier for leave type + * @param leaveTypeID UUID + * @return EmployeeLeaveType + **/ public EmployeeLeaveType leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(required = true, value = "The Xero identifier for leave type") - /** + /** * The Xero identifier for leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The Xero identifier for leave type - * - * @param leaveTypeID UUID - */ + /** + * The Xero identifier for leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The schedule of accrual - * - * @param scheduleOfAccrual ScheduleOfAccrualEnum - * @return EmployeeLeaveType - */ + * The schedule of accrual + * @param scheduleOfAccrual ScheduleOfAccrualEnum + * @return EmployeeLeaveType + **/ public EmployeeLeaveType scheduleOfAccrual(ScheduleOfAccrualEnum scheduleOfAccrual) { this.scheduleOfAccrual = scheduleOfAccrual; return this; } - /** + /** * The schedule of accrual - * * @return scheduleOfAccrual - */ + **/ @ApiModelProperty(required = true, value = "The schedule of accrual") - /** + /** * The schedule of accrual - * * @return scheduleOfAccrual ScheduleOfAccrualEnum - */ + **/ public ScheduleOfAccrualEnum getScheduleOfAccrual() { return scheduleOfAccrual; } - /** - * The schedule of accrual - * - * @param scheduleOfAccrual ScheduleOfAccrualEnum - */ + /** + * The schedule of accrual + * @param scheduleOfAccrual ScheduleOfAccrualEnum + **/ + public void setScheduleOfAccrual(ScheduleOfAccrualEnum scheduleOfAccrual) { this.scheduleOfAccrual = scheduleOfAccrual; } /** - * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen - * is \"OnHourWorked\" - * - * @param hoursAccruedAnnually Double - * @return EmployeeLeaveType - */ + * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" + * @param hoursAccruedAnnually Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType hoursAccruedAnnually(Double hoursAccruedAnnually) { this.hoursAccruedAnnually = hoursAccruedAnnually; return this; } - /** - * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen - * is \"OnHourWorked\" - * + /** + * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" * @return hoursAccruedAnnually - */ - @ApiModelProperty( - value = - "The number of hours accrued for the leave annually. This is 0 when the" - + " scheduleOfAccrual chosen is \"OnHourWorked\"") - /** - * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen - * is \"OnHourWorked\" - * + **/ + @ApiModelProperty(value = "The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\"") + /** + * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" * @return hoursAccruedAnnually Double - */ + **/ public Double getHoursAccruedAnnually() { return hoursAccruedAnnually; } - /** - * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen - * is \"OnHourWorked\" - * - * @param hoursAccruedAnnually Double - */ + /** + * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is \"OnHourWorked\" + * @param hoursAccruedAnnually Double + **/ + public void setHoursAccruedAnnually(Double hoursAccruedAnnually) { this.hoursAccruedAnnually = hoursAccruedAnnually; } /** - * The maximum number of hours that can be accrued for the leave - * - * @param maximumToAccrue Double - * @return EmployeeLeaveType - */ + * The maximum number of hours that can be accrued for the leave + * @param maximumToAccrue Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType maximumToAccrue(Double maximumToAccrue) { this.maximumToAccrue = maximumToAccrue; return this; } - /** + /** * The maximum number of hours that can be accrued for the leave - * * @return maximumToAccrue - */ + **/ @ApiModelProperty(value = "The maximum number of hours that can be accrued for the leave") - /** + /** * The maximum number of hours that can be accrued for the leave - * * @return maximumToAccrue Double - */ + **/ public Double getMaximumToAccrue() { return maximumToAccrue; } - /** - * The maximum number of hours that can be accrued for the leave - * - * @param maximumToAccrue Double - */ + /** + * The maximum number of hours that can be accrued for the leave + * @param maximumToAccrue Double + **/ + public void setMaximumToAccrue(Double maximumToAccrue) { this.maximumToAccrue = maximumToAccrue; } /** - * The initial number of hours assigned when the leave was added to the employee - * - * @param openingBalance Double - * @return EmployeeLeaveType - */ + * The initial number of hours assigned when the leave was added to the employee + * @param openingBalance Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType openingBalance(Double openingBalance) { this.openingBalance = openingBalance; return this; } - /** + /** * The initial number of hours assigned when the leave was added to the employee - * * @return openingBalance - */ - @ApiModelProperty( - value = "The initial number of hours assigned when the leave was added to the employee") - /** + **/ + @ApiModelProperty(value = "The initial number of hours assigned when the leave was added to the employee") + /** * The initial number of hours assigned when the leave was added to the employee - * * @return openingBalance Double - */ + **/ public Double getOpeningBalance() { return openingBalance; } - /** - * The initial number of hours assigned when the leave was added to the employee - * - * @param openingBalance Double - */ + /** + * The initial number of hours assigned when the leave was added to the employee + * @param openingBalance Double + **/ + public void setOpeningBalance(Double openingBalance) { this.openingBalance = openingBalance; } /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * - * @param rateAccruedHourly Double - * @return EmployeeLeaveType - */ + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" + * @param rateAccruedHourly Double + * @return EmployeeLeaveType + **/ public EmployeeLeaveType rateAccruedHourly(Double rateAccruedHourly) { this.rateAccruedHourly = rateAccruedHourly; return this; } - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" * @return rateAccruedHourly - */ - @ApiModelProperty( - value = - "The number of hours added to the leave balance for every hour worked by the employee." - + " This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\"") - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * + **/ + @ApiModelProperty(value = "The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\"") + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" * @return rateAccruedHourly Double - */ + **/ public Double getRateAccruedHourly() { return rateAccruedHourly; } - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is - * normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" - * - * @param rateAccruedHourly Double - */ + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is \"OnHourWorked\" + * @param rateAccruedHourly Double + **/ + public void setRateAccruedHourly(Double rateAccruedHourly) { this.rateAccruedHourly = rateAccruedHourly; } /** - * The date when an employee becomes entitled to their accrual. Only applicable when - * scheduleOfAccrual is \"OnAnniversaryDate\" - * - * @param scheduleOfAccrualDate LocalDate - * @return EmployeeLeaveType - */ + * The date when an employee becomes entitled to their accrual. Only applicable when scheduleOfAccrual is \"OnAnniversaryDate\" + * @param scheduleOfAccrualDate LocalDate + * @return EmployeeLeaveType + **/ public EmployeeLeaveType scheduleOfAccrualDate(LocalDate scheduleOfAccrualDate) { this.scheduleOfAccrualDate = scheduleOfAccrualDate; return this; } - /** - * The date when an employee becomes entitled to their accrual. Only applicable when - * scheduleOfAccrual is \"OnAnniversaryDate\" - * + /** + * The date when an employee becomes entitled to their accrual. Only applicable when scheduleOfAccrual is \"OnAnniversaryDate\" * @return scheduleOfAccrualDate - */ - @ApiModelProperty( - example = "Mon Apr 01 00:00:00 UTC 2024", - value = - "The date when an employee becomes entitled to their accrual. Only applicable when" - + " scheduleOfAccrual is \"OnAnniversaryDate\"") - /** - * The date when an employee becomes entitled to their accrual. Only applicable when - * scheduleOfAccrual is \"OnAnniversaryDate\" - * + **/ + @ApiModelProperty(example = "Mon Apr 01 00:00:00 UTC 2024", value = "The date when an employee becomes entitled to their accrual. Only applicable when scheduleOfAccrual is \"OnAnniversaryDate\"") + /** + * The date when an employee becomes entitled to their accrual. Only applicable when scheduleOfAccrual is \"OnAnniversaryDate\" * @return scheduleOfAccrualDate LocalDate - */ + **/ public LocalDate getScheduleOfAccrualDate() { return scheduleOfAccrualDate; } - /** - * The date when an employee becomes entitled to their accrual. Only applicable when - * scheduleOfAccrual is \"OnAnniversaryDate\" - * - * @param scheduleOfAccrualDate LocalDate - */ + /** + * The date when an employee becomes entitled to their accrual. Only applicable when scheduleOfAccrual is \"OnAnniversaryDate\" + * @param scheduleOfAccrualDate LocalDate + **/ + public void setScheduleOfAccrualDate(LocalDate scheduleOfAccrualDate) { this.scheduleOfAccrualDate = scheduleOfAccrualDate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -376,48 +353,39 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveType employeeLeaveType = (EmployeeLeaveType) o; - return Objects.equals(this.leaveTypeID, employeeLeaveType.leaveTypeID) - && Objects.equals(this.scheduleOfAccrual, employeeLeaveType.scheduleOfAccrual) - && Objects.equals(this.hoursAccruedAnnually, employeeLeaveType.hoursAccruedAnnually) - && Objects.equals(this.maximumToAccrue, employeeLeaveType.maximumToAccrue) - && Objects.equals(this.openingBalance, employeeLeaveType.openingBalance) - && Objects.equals(this.rateAccruedHourly, employeeLeaveType.rateAccruedHourly) - && Objects.equals(this.scheduleOfAccrualDate, employeeLeaveType.scheduleOfAccrualDate); + return Objects.equals(this.leaveTypeID, employeeLeaveType.leaveTypeID) && + Objects.equals(this.scheduleOfAccrual, employeeLeaveType.scheduleOfAccrual) && + Objects.equals(this.hoursAccruedAnnually, employeeLeaveType.hoursAccruedAnnually) && + Objects.equals(this.maximumToAccrue, employeeLeaveType.maximumToAccrue) && + Objects.equals(this.openingBalance, employeeLeaveType.openingBalance) && + Objects.equals(this.rateAccruedHourly, employeeLeaveType.rateAccruedHourly) && + Objects.equals(this.scheduleOfAccrualDate, employeeLeaveType.scheduleOfAccrualDate); } @Override public int hashCode() { - return Objects.hash( - leaveTypeID, - scheduleOfAccrual, - hoursAccruedAnnually, - maximumToAccrue, - openingBalance, - rateAccruedHourly, - scheduleOfAccrualDate); + return Objects.hash(leaveTypeID, scheduleOfAccrual, hoursAccruedAnnually, maximumToAccrue, openingBalance, rateAccruedHourly, scheduleOfAccrualDate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeLeaveType {\n"); sb.append(" leaveTypeID: ").append(toIndentedString(leaveTypeID)).append("\n"); sb.append(" scheduleOfAccrual: ").append(toIndentedString(scheduleOfAccrual)).append("\n"); - sb.append(" hoursAccruedAnnually: ") - .append(toIndentedString(hoursAccruedAnnually)) - .append("\n"); + sb.append(" hoursAccruedAnnually: ").append(toIndentedString(hoursAccruedAnnually)).append("\n"); sb.append(" maximumToAccrue: ").append(toIndentedString(maximumToAccrue)).append("\n"); sb.append(" openingBalance: ").append(toIndentedString(openingBalance)).append("\n"); sb.append(" rateAccruedHourly: ").append(toIndentedString(rateAccruedHourly)).append("\n"); - sb.append(" scheduleOfAccrualDate: ") - .append(toIndentedString(scheduleOfAccrualDate)) - .append("\n"); + sb.append(" scheduleOfAccrualDate: ").append(toIndentedString(scheduleOfAccrualDate)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -425,4 +393,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypeObject.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypeObject.java index 913d3a843..df7f47e01 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypeObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypeObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeLeaveType; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveTypeObject + */ -/** EmployeeLeaveTypeObject */ public class EmployeeLeaveTypeObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeLeaveTypeObject { @JsonProperty("leaveType") private EmployeeLeaveType leaveType; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveTypeObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveTypeObject + **/ public EmployeeLeaveTypeObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveTypeObject - */ + * problem + * @param problem Problem + * @return EmployeeLeaveTypeObject + **/ public EmployeeLeaveTypeObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveType - * - * @param leaveType EmployeeLeaveType - * @return EmployeeLeaveTypeObject - */ + * leaveType + * @param leaveType EmployeeLeaveType + * @return EmployeeLeaveTypeObject + **/ public EmployeeLeaveTypeObject leaveType(EmployeeLeaveType leaveType) { this.leaveType = leaveType; return this; } - /** + /** * Get leaveType - * * @return leaveType - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveType - * * @return leaveType EmployeeLeaveType - */ + **/ public EmployeeLeaveType getLeaveType() { return leaveType; } - /** - * leaveType - * - * @param leaveType EmployeeLeaveType - */ + /** + * leaveType + * @param leaveType EmployeeLeaveType + **/ + public void setLeaveType(EmployeeLeaveType leaveType) { this.leaveType = leaveType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveTypeObject employeeLeaveTypeObject = (EmployeeLeaveTypeObject) o; - return Objects.equals(this.pagination, employeeLeaveTypeObject.pagination) - && Objects.equals(this.problem, employeeLeaveTypeObject.problem) - && Objects.equals(this.leaveType, employeeLeaveTypeObject.leaveType); + return Objects.equals(this.pagination, employeeLeaveTypeObject.pagination) && + Objects.equals(this.problem, employeeLeaveTypeObject.problem) && + Objects.equals(this.leaveType, employeeLeaveTypeObject.leaveType); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypes.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypes.java index 02cb8d33d..ff751e960 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypes.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeaveTypes.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeLeaveType; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaveTypes + */ -/** EmployeeLeaveTypes */ public class EmployeeLeaveTypes { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeeLeaveTypes { @JsonProperty("leaveTypes") private List leaveTypes = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaveTypes - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaveTypes + **/ public EmployeeLeaveTypes pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaveTypes - */ + * problem + * @param problem Problem + * @return EmployeeLeaveTypes + **/ public EmployeeLeaveTypes problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveTypes - * - * @param leaveTypes List<EmployeeLeaveType> - * @return EmployeeLeaveTypes - */ + * leaveTypes + * @param leaveTypes List<EmployeeLeaveType> + * @return EmployeeLeaveTypes + **/ public EmployeeLeaveTypes leaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; return this; @@ -113,10 +126,9 @@ public EmployeeLeaveTypes leaveTypes(List leaveTypes) { /** * leaveTypes - * - * @param leaveTypesItem EmployeeLeaveType + * @param leaveTypesItem EmployeeLeaveType * @return EmployeeLeaveTypes - */ + **/ public EmployeeLeaveTypes addLeaveTypesItem(EmployeeLeaveType leaveTypesItem) { if (this.leaveTypes == null) { this.leaveTypes = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeeLeaveTypes addLeaveTypesItem(EmployeeLeaveType leaveTypesItem) { return this; } - /** + /** * Get leaveTypes - * * @return leaveTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveTypes - * * @return leaveTypes List - */ + **/ public List getLeaveTypes() { return leaveTypes; } - /** - * leaveTypes - * - * @param leaveTypes List<EmployeeLeaveType> - */ + /** + * leaveTypes + * @param leaveTypes List<EmployeeLeaveType> + **/ + public void setLeaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaveTypes employeeLeaveTypes = (EmployeeLeaveTypes) o; - return Objects.equals(this.pagination, employeeLeaveTypes.pagination) - && Objects.equals(this.problem, employeeLeaveTypes.problem) - && Objects.equals(this.leaveTypes, employeeLeaveTypes.leaveTypes); + return Objects.equals(this.pagination, employeeLeaveTypes.pagination) && + Objects.equals(this.problem, employeeLeaveTypes.problem) && + Objects.equals(this.leaveTypes, employeeLeaveTypes.leaveTypes); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveTypes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeLeaves.java b/src/main/java/com/xero/models/payrolluk/EmployeeLeaves.java index e6831cfbe..2acf43ce4 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeLeaves.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeLeaves.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeLeave; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeLeaves + */ -/** EmployeeLeaves */ public class EmployeeLeaves { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeeLeaves { @JsonProperty("leave") private List leave = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeLeaves - */ + * pagination + * @param pagination Pagination + * @return EmployeeLeaves + **/ public EmployeeLeaves pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeLeaves - */ + * problem + * @param problem Problem + * @return EmployeeLeaves + **/ public EmployeeLeaves problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leave - * - * @param leave List<EmployeeLeave> - * @return EmployeeLeaves - */ + * leave + * @param leave List<EmployeeLeave> + * @return EmployeeLeaves + **/ public EmployeeLeaves leave(List leave) { this.leave = leave; return this; @@ -113,10 +126,9 @@ public EmployeeLeaves leave(List leave) { /** * leave - * - * @param leaveItem EmployeeLeave + * @param leaveItem EmployeeLeave * @return EmployeeLeaves - */ + **/ public EmployeeLeaves addLeaveItem(EmployeeLeave leaveItem) { if (this.leave == null) { this.leave = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeeLeaves addLeaveItem(EmployeeLeave leaveItem) { return this; } - /** + /** * Get leave - * * @return leave - */ + **/ @ApiModelProperty(value = "") - /** + /** * leave - * * @return leave List - */ + **/ public List getLeave() { return leave; } - /** - * leave - * - * @param leave List<EmployeeLeave> - */ + /** + * leave + * @param leave List<EmployeeLeave> + **/ + public void setLeave(List leave) { this.leave = leave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeLeaves employeeLeaves = (EmployeeLeaves) o; - return Objects.equals(this.pagination, employeeLeaves.pagination) - && Objects.equals(this.problem, employeeLeaves.problem) - && Objects.equals(this.leave, employeeLeaves.leave); + return Objects.equals(this.pagination, employeeLeaves.pagination) && + Objects.equals(this.problem, employeeLeaves.problem) && + Objects.equals(this.leave, employeeLeaves.leave); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeObject.java b/src/main/java/com/xero/models/payrolluk/EmployeeObject.java index fc6ceecdc..5c3b36643 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Employee; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeObject + */ -/** EmployeeObject */ public class EmployeeObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeObject { @JsonProperty("problem") private Problem problem; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeObject + **/ public EmployeeObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * employee - * - * @param employee Employee - * @return EmployeeObject - */ + * employee + * @param employee Employee + * @return EmployeeObject + **/ public EmployeeObject employee(Employee employee) { this.employee = employee; return this; } - /** + /** * Get employee - * * @return employee - */ + **/ @ApiModelProperty(value = "") - /** + /** * employee - * * @return employee Employee - */ + **/ public Employee getEmployee() { return employee; } - /** - * employee - * - * @param employee Employee - */ + /** + * employee + * @param employee Employee + **/ + public void setEmployee(Employee employee) { this.employee = employee; } /** - * problem - * - * @param problem Problem - * @return EmployeeObject - */ + * problem + * @param problem Problem + * @return EmployeeObject + **/ public EmployeeObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeObject employeeObject = (EmployeeObject) o; - return Objects.equals(this.pagination, employeeObject.pagination) - && Objects.equals(this.employee, employeeObject.employee) - && Objects.equals(this.problem, employeeObject.problem); + return Objects.equals(this.pagination, employeeObject.pagination) && + Objects.equals(this.employee, employeeObject.employee) && + Objects.equals(this.problem, employeeObject.problem); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, employee, problem); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalances.java b/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalances.java index 23204dc34..ab299b082 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalances.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalances.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeOpeningBalances + */ -/** EmployeeOpeningBalances */ public class EmployeeOpeningBalances { StringUtil util = new StringUtil(); @@ -38,250 +55,198 @@ public class EmployeeOpeningBalances { @JsonProperty("priorEmployeeNumber") private Double priorEmployeeNumber; /** - * The total accumulated statutory adoption pay amount received by the employee for current fiscal - * year to date - * - * @param statutoryAdoptionPay Double - * @return EmployeeOpeningBalances - */ + * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date + * @param statutoryAdoptionPay Double + * @return EmployeeOpeningBalances + **/ public EmployeeOpeningBalances statutoryAdoptionPay(Double statutoryAdoptionPay) { this.statutoryAdoptionPay = statutoryAdoptionPay; return this; } - /** - * The total accumulated statutory adoption pay amount received by the employee for current fiscal - * year to date - * + /** + * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date * @return statutoryAdoptionPay - */ - @ApiModelProperty( - value = - "The total accumulated statutory adoption pay amount received by the employee for" - + " current fiscal year to date") - /** - * The total accumulated statutory adoption pay amount received by the employee for current fiscal - * year to date - * + **/ + @ApiModelProperty(value = "The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date") + /** + * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date * @return statutoryAdoptionPay Double - */ + **/ public Double getStatutoryAdoptionPay() { return statutoryAdoptionPay; } - /** - * The total accumulated statutory adoption pay amount received by the employee for current fiscal - * year to date - * - * @param statutoryAdoptionPay Double - */ + /** + * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date + * @param statutoryAdoptionPay Double + **/ + public void setStatutoryAdoptionPay(Double statutoryAdoptionPay) { this.statutoryAdoptionPay = statutoryAdoptionPay; } /** - * The total accumulated statutory maternity pay amount received by the employee for current - * fiscal year to date - * - * @param statutoryMaternityPay Double - * @return EmployeeOpeningBalances - */ + * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date + * @param statutoryMaternityPay Double + * @return EmployeeOpeningBalances + **/ public EmployeeOpeningBalances statutoryMaternityPay(Double statutoryMaternityPay) { this.statutoryMaternityPay = statutoryMaternityPay; return this; } - /** - * The total accumulated statutory maternity pay amount received by the employee for current - * fiscal year to date - * + /** + * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date * @return statutoryMaternityPay - */ - @ApiModelProperty( - value = - "The total accumulated statutory maternity pay amount received by the employee for" - + " current fiscal year to date") - /** - * The total accumulated statutory maternity pay amount received by the employee for current - * fiscal year to date - * + **/ + @ApiModelProperty(value = "The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date") + /** + * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date * @return statutoryMaternityPay Double - */ + **/ public Double getStatutoryMaternityPay() { return statutoryMaternityPay; } - /** - * The total accumulated statutory maternity pay amount received by the employee for current - * fiscal year to date - * - * @param statutoryMaternityPay Double - */ + /** + * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date + * @param statutoryMaternityPay Double + **/ + public void setStatutoryMaternityPay(Double statutoryMaternityPay) { this.statutoryMaternityPay = statutoryMaternityPay; } /** - * The total accumulated statutory paternity pay amount received by the employee for current - * fiscal year to date - * - * @param statutoryPaternityPay Double - * @return EmployeeOpeningBalances - */ + * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date + * @param statutoryPaternityPay Double + * @return EmployeeOpeningBalances + **/ public EmployeeOpeningBalances statutoryPaternityPay(Double statutoryPaternityPay) { this.statutoryPaternityPay = statutoryPaternityPay; return this; } - /** - * The total accumulated statutory paternity pay amount received by the employee for current - * fiscal year to date - * + /** + * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date * @return statutoryPaternityPay - */ - @ApiModelProperty( - value = - "The total accumulated statutory paternity pay amount received by the employee for" - + " current fiscal year to date") - /** - * The total accumulated statutory paternity pay amount received by the employee for current - * fiscal year to date - * + **/ + @ApiModelProperty(value = "The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date") + /** + * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date * @return statutoryPaternityPay Double - */ + **/ public Double getStatutoryPaternityPay() { return statutoryPaternityPay; } - /** - * The total accumulated statutory paternity pay amount received by the employee for current - * fiscal year to date - * - * @param statutoryPaternityPay Double - */ + /** + * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date + * @param statutoryPaternityPay Double + **/ + public void setStatutoryPaternityPay(Double statutoryPaternityPay) { this.statutoryPaternityPay = statutoryPaternityPay; } /** - * The total accumulated statutory shared parental pay amount received by the employee for current - * fiscal year to date - * - * @param statutorySharedParentalPay Double - * @return EmployeeOpeningBalances - */ + * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date + * @param statutorySharedParentalPay Double + * @return EmployeeOpeningBalances + **/ public EmployeeOpeningBalances statutorySharedParentalPay(Double statutorySharedParentalPay) { this.statutorySharedParentalPay = statutorySharedParentalPay; return this; } - /** - * The total accumulated statutory shared parental pay amount received by the employee for current - * fiscal year to date - * + /** + * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date * @return statutorySharedParentalPay - */ - @ApiModelProperty( - value = - "The total accumulated statutory shared parental pay amount received by the employee for" - + " current fiscal year to date") - /** - * The total accumulated statutory shared parental pay amount received by the employee for current - * fiscal year to date - * + **/ + @ApiModelProperty(value = "The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date") + /** + * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date * @return statutorySharedParentalPay Double - */ + **/ public Double getStatutorySharedParentalPay() { return statutorySharedParentalPay; } - /** - * The total accumulated statutory shared parental pay amount received by the employee for current - * fiscal year to date - * - * @param statutorySharedParentalPay Double - */ + /** + * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date + * @param statutorySharedParentalPay Double + **/ + public void setStatutorySharedParentalPay(Double statutorySharedParentalPay) { this.statutorySharedParentalPay = statutorySharedParentalPay; } /** - * The total accumulated statutory sick pay amount received by the employee for current fiscal - * year to date - * - * @param statutorySickPay Double - * @return EmployeeOpeningBalances - */ + * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date + * @param statutorySickPay Double + * @return EmployeeOpeningBalances + **/ public EmployeeOpeningBalances statutorySickPay(Double statutorySickPay) { this.statutorySickPay = statutorySickPay; return this; } - /** - * The total accumulated statutory sick pay amount received by the employee for current fiscal - * year to date - * + /** + * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date * @return statutorySickPay - */ - @ApiModelProperty( - value = - "The total accumulated statutory sick pay amount received by the employee for current" - + " fiscal year to date") - /** - * The total accumulated statutory sick pay amount received by the employee for current fiscal - * year to date - * + **/ + @ApiModelProperty(value = "The total accumulated statutory sick pay amount received by the employee for current fiscal year to date") + /** + * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date * @return statutorySickPay Double - */ + **/ public Double getStatutorySickPay() { return statutorySickPay; } - /** - * The total accumulated statutory sick pay amount received by the employee for current fiscal - * year to date - * - * @param statutorySickPay Double - */ + /** + * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date + * @param statutorySickPay Double + **/ + public void setStatutorySickPay(Double statutorySickPay) { this.statutorySickPay = statutorySickPay; } /** - * The unique employee number issued by the employee's former employer - * - * @param priorEmployeeNumber Double - * @return EmployeeOpeningBalances - */ + * The unique employee number issued by the employee's former employer + * @param priorEmployeeNumber Double + * @return EmployeeOpeningBalances + **/ public EmployeeOpeningBalances priorEmployeeNumber(Double priorEmployeeNumber) { this.priorEmployeeNumber = priorEmployeeNumber; return this; } - /** + /** * The unique employee number issued by the employee's former employer - * * @return priorEmployeeNumber - */ + **/ @ApiModelProperty(value = "The unique employee number issued by the employee's former employer") - /** + /** * The unique employee number issued by the employee's former employer - * * @return priorEmployeeNumber Double - */ + **/ public Double getPriorEmployeeNumber() { return priorEmployeeNumber; } - /** - * The unique employee number issued by the employee's former employer - * - * @param priorEmployeeNumber Double - */ + /** + * The unique employee number issued by the employee's former employer + * @param priorEmployeeNumber Double + **/ + public void setPriorEmployeeNumber(Double priorEmployeeNumber) { this.priorEmployeeNumber = priorEmployeeNumber; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -291,52 +256,37 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeOpeningBalances employeeOpeningBalances = (EmployeeOpeningBalances) o; - return Objects.equals(this.statutoryAdoptionPay, employeeOpeningBalances.statutoryAdoptionPay) - && Objects.equals(this.statutoryMaternityPay, employeeOpeningBalances.statutoryMaternityPay) - && Objects.equals(this.statutoryPaternityPay, employeeOpeningBalances.statutoryPaternityPay) - && Objects.equals( - this.statutorySharedParentalPay, employeeOpeningBalances.statutorySharedParentalPay) - && Objects.equals(this.statutorySickPay, employeeOpeningBalances.statutorySickPay) - && Objects.equals(this.priorEmployeeNumber, employeeOpeningBalances.priorEmployeeNumber); + return Objects.equals(this.statutoryAdoptionPay, employeeOpeningBalances.statutoryAdoptionPay) && + Objects.equals(this.statutoryMaternityPay, employeeOpeningBalances.statutoryMaternityPay) && + Objects.equals(this.statutoryPaternityPay, employeeOpeningBalances.statutoryPaternityPay) && + Objects.equals(this.statutorySharedParentalPay, employeeOpeningBalances.statutorySharedParentalPay) && + Objects.equals(this.statutorySickPay, employeeOpeningBalances.statutorySickPay) && + Objects.equals(this.priorEmployeeNumber, employeeOpeningBalances.priorEmployeeNumber); } @Override public int hashCode() { - return Objects.hash( - statutoryAdoptionPay, - statutoryMaternityPay, - statutoryPaternityPay, - statutorySharedParentalPay, - statutorySickPay, - priorEmployeeNumber); + return Objects.hash(statutoryAdoptionPay, statutoryMaternityPay, statutoryPaternityPay, statutorySharedParentalPay, statutorySickPay, priorEmployeeNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmployeeOpeningBalances {\n"); - sb.append(" statutoryAdoptionPay: ") - .append(toIndentedString(statutoryAdoptionPay)) - .append("\n"); - sb.append(" statutoryMaternityPay: ") - .append(toIndentedString(statutoryMaternityPay)) - .append("\n"); - sb.append(" statutoryPaternityPay: ") - .append(toIndentedString(statutoryPaternityPay)) - .append("\n"); - sb.append(" statutorySharedParentalPay: ") - .append(toIndentedString(statutorySharedParentalPay)) - .append("\n"); + sb.append(" statutoryAdoptionPay: ").append(toIndentedString(statutoryAdoptionPay)).append("\n"); + sb.append(" statutoryMaternityPay: ").append(toIndentedString(statutoryMaternityPay)).append("\n"); + sb.append(" statutoryPaternityPay: ").append(toIndentedString(statutoryPaternityPay)).append("\n"); + sb.append(" statutorySharedParentalPay: ").append(toIndentedString(statutorySharedParentalPay)).append("\n"); sb.append(" statutorySickPay: ").append(toIndentedString(statutorySickPay)).append("\n"); - sb.append(" priorEmployeeNumber: ") - .append(toIndentedString(priorEmployeeNumber)) - .append("\n"); + sb.append(" priorEmployeeNumber: ").append(toIndentedString(priorEmployeeNumber)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -344,4 +294,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalancesObject.java b/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalancesObject.java index 88bee0f3f..088989876 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalancesObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeOpeningBalancesObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeOpeningBalances; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeOpeningBalancesObject + */ -/** EmployeeOpeningBalancesObject */ public class EmployeeOpeningBalancesObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeOpeningBalancesObject { @JsonProperty("openingBalances") private EmployeeOpeningBalances openingBalances; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeOpeningBalancesObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeOpeningBalancesObject + **/ public EmployeeOpeningBalancesObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeOpeningBalancesObject - */ + * problem + * @param problem Problem + * @return EmployeeOpeningBalancesObject + **/ public EmployeeOpeningBalancesObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * openingBalances - * - * @param openingBalances EmployeeOpeningBalances - * @return EmployeeOpeningBalancesObject - */ + * openingBalances + * @param openingBalances EmployeeOpeningBalances + * @return EmployeeOpeningBalancesObject + **/ public EmployeeOpeningBalancesObject openingBalances(EmployeeOpeningBalances openingBalances) { this.openingBalances = openingBalances; return this; } - /** + /** * Get openingBalances - * * @return openingBalances - */ + **/ @ApiModelProperty(value = "") - /** + /** * openingBalances - * * @return openingBalances EmployeeOpeningBalances - */ + **/ public EmployeeOpeningBalances getOpeningBalances() { return openingBalances; } - /** - * openingBalances - * - * @param openingBalances EmployeeOpeningBalances - */ + /** + * openingBalances + * @param openingBalances EmployeeOpeningBalances + **/ + public void setOpeningBalances(EmployeeOpeningBalances openingBalances) { this.openingBalances = openingBalances; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeOpeningBalancesObject employeeOpeningBalancesObject = (EmployeeOpeningBalancesObject) o; - return Objects.equals(this.pagination, employeeOpeningBalancesObject.pagination) - && Objects.equals(this.problem, employeeOpeningBalancesObject.problem) - && Objects.equals(this.openingBalances, employeeOpeningBalancesObject.openingBalances); + return Objects.equals(this.pagination, employeeOpeningBalancesObject.pagination) && + Objects.equals(this.problem, employeeOpeningBalancesObject.problem) && + Objects.equals(this.openingBalances, employeeOpeningBalancesObject.openingBalances); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, openingBalances); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeePayTemplate.java b/src/main/java/com/xero/models/payrolluk/EmployeePayTemplate.java index 18ab1d803..69a5c6e54 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeePayTemplate.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeePayTemplate.java @@ -9,17 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EarningsTemplate; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeePayTemplate + */ -/** EmployeePayTemplate */ public class EmployeePayTemplate { StringUtil util = new StringUtil(); @@ -29,46 +47,42 @@ public class EmployeePayTemplate { @JsonProperty("earningTemplates") private List earningTemplates = new ArrayList(); /** - * Unique identifier for the employee - * - * @param employeeID UUID - * @return EmployeePayTemplate - */ + * Unique identifier for the employee + * @param employeeID UUID + * @return EmployeePayTemplate + **/ public EmployeePayTemplate employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * Unique identifier for the employee - * * @return employeeID - */ + **/ @ApiModelProperty(value = "Unique identifier for the employee") - /** + /** * Unique identifier for the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * Unique identifier for the employee - * - * @param employeeID UUID - */ + /** + * Unique identifier for the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - * @return EmployeePayTemplate - */ + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + * @return EmployeePayTemplate + **/ public EmployeePayTemplate earningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; return this; @@ -76,10 +90,9 @@ public EmployeePayTemplate earningTemplates(List earningTempla /** * earningTemplates - * - * @param earningTemplatesItem EarningsTemplate + * @param earningTemplatesItem EarningsTemplate * @return EmployeePayTemplate - */ + **/ public EmployeePayTemplate addEarningTemplatesItem(EarningsTemplate earningTemplatesItem) { if (this.earningTemplates == null) { this.earningTemplates = new ArrayList(); @@ -88,30 +101,29 @@ public EmployeePayTemplate addEarningTemplatesItem(EarningsTemplate earningTempl return this; } - /** + /** * Get earningTemplates - * * @return earningTemplates - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningTemplates - * * @return earningTemplates List - */ + **/ public List getEarningTemplates() { return earningTemplates; } - /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - */ + /** + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + **/ + public void setEarningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } EmployeePayTemplate employeePayTemplate = (EmployeePayTemplate) o; - return Objects.equals(this.employeeID, employeePayTemplate.employeeID) - && Objects.equals(this.earningTemplates, employeePayTemplate.earningTemplates); + return Objects.equals(this.employeeID, employeePayTemplate.employeeID) && + Objects.equals(this.earningTemplates, employeePayTemplate.earningTemplates); } @Override @@ -130,6 +142,7 @@ public int hashCode() { return Objects.hash(employeeID, earningTemplates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -149,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeePayTemplateObject.java b/src/main/java/com/xero/models/payrolluk/EmployeePayTemplateObject.java index 1212451cd..e36c50b1b 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeePayTemplateObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeePayTemplateObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeePayTemplate; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeePayTemplateObject + */ -/** EmployeePayTemplateObject */ public class EmployeePayTemplateObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeePayTemplateObject { @JsonProperty("payTemplate") private EmployeePayTemplate payTemplate; /** - * pagination - * - * @param pagination Pagination - * @return EmployeePayTemplateObject - */ + * pagination + * @param pagination Pagination + * @return EmployeePayTemplateObject + **/ public EmployeePayTemplateObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeePayTemplateObject - */ + * problem + * @param problem Problem + * @return EmployeePayTemplateObject + **/ public EmployeePayTemplateObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payTemplate - * - * @param payTemplate EmployeePayTemplate - * @return EmployeePayTemplateObject - */ + * payTemplate + * @param payTemplate EmployeePayTemplate + * @return EmployeePayTemplateObject + **/ public EmployeePayTemplateObject payTemplate(EmployeePayTemplate payTemplate) { this.payTemplate = payTemplate; return this; } - /** + /** * Get payTemplate - * * @return payTemplate - */ + **/ @ApiModelProperty(value = "") - /** + /** * payTemplate - * * @return payTemplate EmployeePayTemplate - */ + **/ public EmployeePayTemplate getPayTemplate() { return payTemplate; } - /** - * payTemplate - * - * @param payTemplate EmployeePayTemplate - */ + /** + * payTemplate + * @param payTemplate EmployeePayTemplate + **/ + public void setPayTemplate(EmployeePayTemplate payTemplate) { this.payTemplate = payTemplate; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeePayTemplateObject employeePayTemplateObject = (EmployeePayTemplateObject) o; - return Objects.equals(this.pagination, employeePayTemplateObject.pagination) - && Objects.equals(this.problem, employeePayTemplateObject.problem) - && Objects.equals(this.payTemplate, employeePayTemplateObject.payTemplate); + return Objects.equals(this.pagination, employeePayTemplateObject.pagination) && + Objects.equals(this.problem, employeePayTemplateObject.problem) && + Objects.equals(this.payTemplate, employeePayTemplateObject.payTemplate); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payTemplate); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeePayTemplates.java b/src/main/java/com/xero/models/payrolluk/EmployeePayTemplates.java index 486c0e068..504cb4bc0 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeePayTemplates.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeePayTemplates.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EarningsTemplate; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeePayTemplates + */ -/** EmployeePayTemplates */ public class EmployeePayTemplates { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class EmployeePayTemplates { @JsonProperty("earningTemplates") private List earningTemplates = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeePayTemplates - */ + * pagination + * @param pagination Pagination + * @return EmployeePayTemplates + **/ public EmployeePayTemplates pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeePayTemplates - */ + * problem + * @param problem Problem + * @return EmployeePayTemplates + **/ public EmployeePayTemplates problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - * @return EmployeePayTemplates - */ + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + * @return EmployeePayTemplates + **/ public EmployeePayTemplates earningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; return this; @@ -113,10 +126,9 @@ public EmployeePayTemplates earningTemplates(List earningTempl /** * earningTemplates - * - * @param earningTemplatesItem EarningsTemplate + * @param earningTemplatesItem EarningsTemplate * @return EmployeePayTemplates - */ + **/ public EmployeePayTemplates addEarningTemplatesItem(EarningsTemplate earningTemplatesItem) { if (this.earningTemplates == null) { this.earningTemplates = new ArrayList(); @@ -125,30 +137,29 @@ public EmployeePayTemplates addEarningTemplatesItem(EarningsTemplate earningTemp return this; } - /** + /** * Get earningTemplates - * * @return earningTemplates - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningTemplates - * * @return earningTemplates List - */ + **/ public List getEarningTemplates() { return earningTemplates; } - /** - * earningTemplates - * - * @param earningTemplates List<EarningsTemplate> - */ + /** + * earningTemplates + * @param earningTemplates List<EarningsTemplate> + **/ + public void setEarningTemplates(List earningTemplates) { this.earningTemplates = earningTemplates; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeePayTemplates employeePayTemplates = (EmployeePayTemplates) o; - return Objects.equals(this.pagination, employeePayTemplates.pagination) - && Objects.equals(this.problem, employeePayTemplates.problem) - && Objects.equals(this.earningTemplates, employeePayTemplates.earningTemplates); + return Objects.equals(this.pagination, employeePayTemplates.pagination) && + Objects.equals(this.problem, employeePayTemplates.problem) && + Objects.equals(this.earningTemplates, employeePayTemplates.earningTemplates); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, earningTemplates); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalance.java b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalance.java index df8a60f68..512afcd2a 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalance.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalance.java @@ -9,33 +9,60 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeaveBalance + */ -/** EmployeeStatutoryLeaveBalance */ public class EmployeeStatutoryLeaveBalance { StringUtil util = new StringUtil(); - /** The type of statutory leave */ + /** + * The type of statutory leave + */ public enum LeaveTypeEnum { - /** SICK */ + /** + * SICK + */ SICK("Sick"), - - /** ADOPTION */ + + /** + * ADOPTION + */ ADOPTION("Adoption"), - - /** MATERNITY */ + + /** + * MATERNITY + */ MATERNITY("Maternity"), - - /** PATERNITY */ + + /** + * PATERNITY + */ PATERNITY("Paternity"), - - /** SHAREDPARENTAL */ + + /** + * SHAREDPARENTAL + */ SHAREDPARENTAL("Sharedparental"); private String value; @@ -44,31 +71,25 @@ public enum LeaveTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static LeaveTypeEnum fromValue(String value) { for (LeaveTypeEnum b : LeaveTypeEnum.values()) { @@ -80,14 +101,19 @@ public static LeaveTypeEnum fromValue(String value) { } } + @JsonProperty("leaveType") private LeaveTypeEnum leaveType; @JsonProperty("balanceRemaining") private Double balanceRemaining; - /** The units will be \"Hours\" */ + /** + * The units will be \"Hours\" + */ public enum UnitsEnum { - /** HOURS */ + /** + * HOURS + */ HOURS("Hours"); private String value; @@ -96,31 +122,25 @@ public enum UnitsEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static UnitsEnum fromValue(String value) { for (UnitsEnum b : UnitsEnum.values()) { @@ -132,114 +152,106 @@ public static UnitsEnum fromValue(String value) { } } + @JsonProperty("units") private UnitsEnum units; /** - * The type of statutory leave - * - * @param leaveType LeaveTypeEnum - * @return EmployeeStatutoryLeaveBalance - */ + * The type of statutory leave + * @param leaveType LeaveTypeEnum + * @return EmployeeStatutoryLeaveBalance + **/ public EmployeeStatutoryLeaveBalance leaveType(LeaveTypeEnum leaveType) { this.leaveType = leaveType; return this; } - /** + /** * The type of statutory leave - * * @return leaveType - */ + **/ @ApiModelProperty(value = "The type of statutory leave") - /** + /** * The type of statutory leave - * * @return leaveType LeaveTypeEnum - */ + **/ public LeaveTypeEnum getLeaveType() { return leaveType; } - /** - * The type of statutory leave - * - * @param leaveType LeaveTypeEnum - */ + /** + * The type of statutory leave + * @param leaveType LeaveTypeEnum + **/ + public void setLeaveType(LeaveTypeEnum leaveType) { this.leaveType = leaveType; } /** - * The balance remaining for the corresponding leave type as of specified date. - * - * @param balanceRemaining Double - * @return EmployeeStatutoryLeaveBalance - */ + * The balance remaining for the corresponding leave type as of specified date. + * @param balanceRemaining Double + * @return EmployeeStatutoryLeaveBalance + **/ public EmployeeStatutoryLeaveBalance balanceRemaining(Double balanceRemaining) { this.balanceRemaining = balanceRemaining; return this; } - /** + /** * The balance remaining for the corresponding leave type as of specified date. - * * @return balanceRemaining - */ - @ApiModelProperty( - value = "The balance remaining for the corresponding leave type as of specified date.") - /** + **/ + @ApiModelProperty(value = "The balance remaining for the corresponding leave type as of specified date.") + /** * The balance remaining for the corresponding leave type as of specified date. - * * @return balanceRemaining Double - */ + **/ public Double getBalanceRemaining() { return balanceRemaining; } - /** - * The balance remaining for the corresponding leave type as of specified date. - * - * @param balanceRemaining Double - */ + /** + * The balance remaining for the corresponding leave type as of specified date. + * @param balanceRemaining Double + **/ + public void setBalanceRemaining(Double balanceRemaining) { this.balanceRemaining = balanceRemaining; } /** - * The units will be \"Hours\" - * - * @param units UnitsEnum - * @return EmployeeStatutoryLeaveBalance - */ + * The units will be \"Hours\" + * @param units UnitsEnum + * @return EmployeeStatutoryLeaveBalance + **/ public EmployeeStatutoryLeaveBalance units(UnitsEnum units) { this.units = units; return this; } - /** + /** * The units will be \"Hours\" - * * @return units - */ + **/ @ApiModelProperty(value = "The units will be \"Hours\"") - /** + /** * The units will be \"Hours\" - * * @return units UnitsEnum - */ + **/ public UnitsEnum getUnits() { return units; } - /** - * The units will be \"Hours\" - * - * @param units UnitsEnum - */ + /** + * The units will be \"Hours\" + * @param units UnitsEnum + **/ + public void setUnits(UnitsEnum units) { this.units = units; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -249,9 +261,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutoryLeaveBalance employeeStatutoryLeaveBalance = (EmployeeStatutoryLeaveBalance) o; - return Objects.equals(this.leaveType, employeeStatutoryLeaveBalance.leaveType) - && Objects.equals(this.balanceRemaining, employeeStatutoryLeaveBalance.balanceRemaining) - && Objects.equals(this.units, employeeStatutoryLeaveBalance.units); + return Objects.equals(this.leaveType, employeeStatutoryLeaveBalance.leaveType) && + Objects.equals(this.balanceRemaining, employeeStatutoryLeaveBalance.balanceRemaining) && + Objects.equals(this.units, employeeStatutoryLeaveBalance.units); } @Override @@ -259,6 +271,7 @@ public int hashCode() { return Objects.hash(leaveType, balanceRemaining, units); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -271,7 +284,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -279,4 +293,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalanceObject.java b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalanceObject.java index c67aee33d..d46a60e61 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalanceObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveBalanceObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeStatutoryLeaveBalance; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeaveBalanceObject + */ -/** EmployeeStatutoryLeaveBalanceObject */ public class EmployeeStatutoryLeaveBalanceObject { StringUtil util = new StringUtil(); @@ -29,111 +49,102 @@ public class EmployeeStatutoryLeaveBalanceObject { @JsonProperty("leaveBalance") private EmployeeStatutoryLeaveBalance leaveBalance; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutoryLeaveBalanceObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutoryLeaveBalanceObject + **/ public EmployeeStatutoryLeaveBalanceObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutoryLeaveBalanceObject - */ + * problem + * @param problem Problem + * @return EmployeeStatutoryLeaveBalanceObject + **/ public EmployeeStatutoryLeaveBalanceObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveBalance - * - * @param leaveBalance EmployeeStatutoryLeaveBalance - * @return EmployeeStatutoryLeaveBalanceObject - */ - public EmployeeStatutoryLeaveBalanceObject leaveBalance( - EmployeeStatutoryLeaveBalance leaveBalance) { + * leaveBalance + * @param leaveBalance EmployeeStatutoryLeaveBalance + * @return EmployeeStatutoryLeaveBalanceObject + **/ + public EmployeeStatutoryLeaveBalanceObject leaveBalance(EmployeeStatutoryLeaveBalance leaveBalance) { this.leaveBalance = leaveBalance; return this; } - /** + /** * Get leaveBalance - * * @return leaveBalance - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveBalance - * * @return leaveBalance EmployeeStatutoryLeaveBalance - */ + **/ public EmployeeStatutoryLeaveBalance getLeaveBalance() { return leaveBalance; } - /** - * leaveBalance - * - * @param leaveBalance EmployeeStatutoryLeaveBalance - */ + /** + * leaveBalance + * @param leaveBalance EmployeeStatutoryLeaveBalance + **/ + public void setLeaveBalance(EmployeeStatutoryLeaveBalance leaveBalance) { this.leaveBalance = leaveBalance; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,11 +153,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeStatutoryLeaveBalanceObject employeeStatutoryLeaveBalanceObject = - (EmployeeStatutoryLeaveBalanceObject) o; - return Objects.equals(this.pagination, employeeStatutoryLeaveBalanceObject.pagination) - && Objects.equals(this.problem, employeeStatutoryLeaveBalanceObject.problem) - && Objects.equals(this.leaveBalance, employeeStatutoryLeaveBalanceObject.leaveBalance); + EmployeeStatutoryLeaveBalanceObject employeeStatutoryLeaveBalanceObject = (EmployeeStatutoryLeaveBalanceObject) o; + return Objects.equals(this.pagination, employeeStatutoryLeaveBalanceObject.pagination) && + Objects.equals(this.problem, employeeStatutoryLeaveBalanceObject.problem) && + Objects.equals(this.leaveBalance, employeeStatutoryLeaveBalanceObject.leaveBalance); } @Override @@ -154,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveBalance); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -166,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -174,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveSummary.java b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveSummary.java index d7e2920a6..f868f80d3 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveSummary.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeaveSummary.java @@ -9,18 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeaveSummary + */ -/** EmployeeStatutoryLeaveSummary */ public class EmployeeStatutoryLeaveSummary { StringUtil util = new StringUtil(); @@ -29,21 +44,33 @@ public class EmployeeStatutoryLeaveSummary { @JsonProperty("employeeID") private UUID employeeID; - /** The category of statutory leave */ + /** + * The category of statutory leave + */ public enum TypeEnum { - /** SICK */ + /** + * SICK + */ SICK("Sick"), - - /** ADOPTION */ + + /** + * ADOPTION + */ ADOPTION("Adoption"), - - /** MATERNITY */ + + /** + * MATERNITY + */ MATERNITY("Maternity"), - - /** PATERNITY */ + + /** + * PATERNITY + */ PATERNITY("Paternity"), - - /** SHAREDPARENTAL */ + + /** + * SHAREDPARENTAL + */ SHAREDPARENTAL("Sharedparental"); private String value; @@ -52,31 +79,25 @@ public enum TypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { @@ -88,6 +109,7 @@ public static TypeEnum fromValue(String value) { } } + @JsonProperty("type") private TypeEnum type; @@ -99,15 +121,23 @@ public static TypeEnum fromValue(String value) { @JsonProperty("isEntitled") private Boolean isEntitled; - /** The status of the leave */ + /** + * The status of the leave + */ public enum StatusEnum { - /** PENDING */ + /** + * PENDING + */ PENDING("Pending"), - - /** IN_PROGRESS */ + + /** + * IN_PROGRESS + */ IN_PROGRESS("In-Progress"), - - /** COMPLETED */ + + /** + * COMPLETED + */ COMPLETED("Completed"); private String value; @@ -116,31 +146,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -152,253 +176,234 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; /** - * The unique identifier (guid) of a statutory leave. - * - * @param statutoryLeaveID UUID - * @return EmployeeStatutoryLeaveSummary - */ + * The unique identifier (guid) of a statutory leave. + * @param statutoryLeaveID UUID + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary statutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; return this; } - /** + /** * The unique identifier (guid) of a statutory leave. - * * @return statutoryLeaveID - */ + **/ @ApiModelProperty(value = "The unique identifier (guid) of a statutory leave.") - /** + /** * The unique identifier (guid) of a statutory leave. - * * @return statutoryLeaveID UUID - */ + **/ public UUID getStatutoryLeaveID() { return statutoryLeaveID; } - /** - * The unique identifier (guid) of a statutory leave. - * - * @param statutoryLeaveID UUID - */ + /** + * The unique identifier (guid) of a statutory leave. + * @param statutoryLeaveID UUID + **/ + public void setStatutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; } /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - * @return EmployeeStatutoryLeaveSummary - */ + * The unique identifier (guid) of the employee + * @param employeeID UUID + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID - */ + **/ @ApiModelProperty(value = "The unique identifier (guid) of the employee") - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - */ + /** + * The unique identifier (guid) of the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The category of statutory leave - * - * @param type TypeEnum - * @return EmployeeStatutoryLeaveSummary - */ + * The category of statutory leave + * @param type TypeEnum + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary type(TypeEnum type) { this.type = type; return this; } - /** + /** * The category of statutory leave - * * @return type - */ + **/ @ApiModelProperty(value = "The category of statutory leave") - /** + /** * The category of statutory leave - * * @return type TypeEnum - */ + **/ public TypeEnum getType() { return type; } - /** - * The category of statutory leave - * - * @param type TypeEnum - */ + /** + * The category of statutory leave + * @param type TypeEnum + **/ + public void setType(TypeEnum type) { this.type = type; } /** - * The date when the leave starts - * - * @param startDate LocalDate - * @return EmployeeStatutoryLeaveSummary - */ + * The date when the leave starts + * @param startDate LocalDate + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * The date when the leave starts - * * @return startDate - */ + **/ @ApiModelProperty(value = "The date when the leave starts") - /** + /** * The date when the leave starts - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * The date when the leave starts - * - * @param startDate LocalDate - */ + /** + * The date when the leave starts + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * The date when the leave ends - * - * @param endDate LocalDate - * @return EmployeeStatutoryLeaveSummary - */ + * The date when the leave ends + * @param endDate LocalDate + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The date when the leave ends - * * @return endDate - */ + **/ @ApiModelProperty(value = "The date when the leave ends") - /** + /** * The date when the leave ends - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The date when the leave ends - * - * @param endDate LocalDate - */ + /** + * The date when the leave ends + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - * @return EmployeeStatutoryLeaveSummary - */ + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary isEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; return this; } - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled - */ + **/ @ApiModelProperty(value = "Whether the leave was entitled to receive payment") - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled Boolean - */ + **/ public Boolean getIsEntitled() { return isEntitled; } - /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - */ + /** + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + **/ + public void setIsEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; } /** - * The status of the leave - * - * @param status StatusEnum - * @return EmployeeStatutoryLeaveSummary - */ + * The status of the leave + * @param status StatusEnum + * @return EmployeeStatutoryLeaveSummary + **/ public EmployeeStatutoryLeaveSummary status(StatusEnum status) { this.status = status; return this; } - /** + /** * The status of the leave - * * @return status - */ + **/ @ApiModelProperty(value = "The status of the leave") - /** + /** * The status of the leave - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The status of the leave - * - * @param status StatusEnum - */ + /** + * The status of the leave + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -408,13 +413,13 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutoryLeaveSummary employeeStatutoryLeaveSummary = (EmployeeStatutoryLeaveSummary) o; - return Objects.equals(this.statutoryLeaveID, employeeStatutoryLeaveSummary.statutoryLeaveID) - && Objects.equals(this.employeeID, employeeStatutoryLeaveSummary.employeeID) - && Objects.equals(this.type, employeeStatutoryLeaveSummary.type) - && Objects.equals(this.startDate, employeeStatutoryLeaveSummary.startDate) - && Objects.equals(this.endDate, employeeStatutoryLeaveSummary.endDate) - && Objects.equals(this.isEntitled, employeeStatutoryLeaveSummary.isEntitled) - && Objects.equals(this.status, employeeStatutoryLeaveSummary.status); + return Objects.equals(this.statutoryLeaveID, employeeStatutoryLeaveSummary.statutoryLeaveID) && + Objects.equals(this.employeeID, employeeStatutoryLeaveSummary.employeeID) && + Objects.equals(this.type, employeeStatutoryLeaveSummary.type) && + Objects.equals(this.startDate, employeeStatutoryLeaveSummary.startDate) && + Objects.equals(this.endDate, employeeStatutoryLeaveSummary.endDate) && + Objects.equals(this.isEntitled, employeeStatutoryLeaveSummary.isEntitled) && + Objects.equals(this.status, employeeStatutoryLeaveSummary.status); } @Override @@ -422,6 +427,7 @@ public int hashCode() { return Objects.hash(statutoryLeaveID, employeeID, type, startDate, endDate, isEntitled, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -438,7 +444,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -446,4 +453,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeavesSummaries.java b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeavesSummaries.java index 225e5a7d0..0b46c4159 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeavesSummaries.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeStatutoryLeavesSummaries.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeStatutoryLeaveSummary; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutoryLeavesSummaries + */ -/** EmployeeStatutoryLeavesSummaries */ public class EmployeeStatutoryLeavesSummaries { StringUtil util = new StringUtil(); @@ -29,98 +49,87 @@ public class EmployeeStatutoryLeavesSummaries { private Problem problem; @JsonProperty("statutoryLeaves") - private List statutoryLeaves = - new ArrayList(); + private List statutoryLeaves = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutoryLeavesSummaries - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutoryLeavesSummaries + **/ public EmployeeStatutoryLeavesSummaries pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutoryLeavesSummaries - */ + * problem + * @param problem Problem + * @return EmployeeStatutoryLeavesSummaries + **/ public EmployeeStatutoryLeavesSummaries problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutoryLeaves - * - * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> - * @return EmployeeStatutoryLeavesSummaries - */ - public EmployeeStatutoryLeavesSummaries statutoryLeaves( - List statutoryLeaves) { + * statutoryLeaves + * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> + * @return EmployeeStatutoryLeavesSummaries + **/ + public EmployeeStatutoryLeavesSummaries statutoryLeaves(List statutoryLeaves) { this.statutoryLeaves = statutoryLeaves; return this; } /** * statutoryLeaves - * - * @param statutoryLeavesItem EmployeeStatutoryLeaveSummary + * @param statutoryLeavesItem EmployeeStatutoryLeaveSummary * @return EmployeeStatutoryLeavesSummaries - */ - public EmployeeStatutoryLeavesSummaries addStatutoryLeavesItem( - EmployeeStatutoryLeaveSummary statutoryLeavesItem) { + **/ + public EmployeeStatutoryLeavesSummaries addStatutoryLeavesItem(EmployeeStatutoryLeaveSummary statutoryLeavesItem) { if (this.statutoryLeaves == null) { this.statutoryLeaves = new ArrayList(); } @@ -128,30 +137,29 @@ public EmployeeStatutoryLeavesSummaries addStatutoryLeavesItem( return this; } - /** + /** * Get statutoryLeaves - * * @return statutoryLeaves - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryLeaves - * * @return statutoryLeaves List - */ + **/ public List getStatutoryLeaves() { return statutoryLeaves; } - /** - * statutoryLeaves - * - * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> - */ + /** + * statutoryLeaves + * @param statutoryLeaves List<EmployeeStatutoryLeaveSummary> + **/ + public void setStatutoryLeaves(List statutoryLeaves) { this.statutoryLeaves = statutoryLeaves; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,11 +168,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeStatutoryLeavesSummaries employeeStatutoryLeavesSummaries = - (EmployeeStatutoryLeavesSummaries) o; - return Objects.equals(this.pagination, employeeStatutoryLeavesSummaries.pagination) - && Objects.equals(this.problem, employeeStatutoryLeavesSummaries.problem) - && Objects.equals(this.statutoryLeaves, employeeStatutoryLeavesSummaries.statutoryLeaves); + EmployeeStatutoryLeavesSummaries employeeStatutoryLeavesSummaries = (EmployeeStatutoryLeavesSummaries) o; + return Objects.equals(this.pagination, employeeStatutoryLeavesSummaries.pagination) && + Objects.equals(this.problem, employeeStatutoryLeavesSummaries.problem) && + Objects.equals(this.statutoryLeaves, employeeStatutoryLeavesSummaries.statutoryLeaves); } @Override @@ -172,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutoryLeaves); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -184,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -192,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeave.java b/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeave.java index 0c7a3ecf6..731f40de5 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeave.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeave.java @@ -9,20 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutorySickLeave + */ -/** EmployeeStatutorySickLeave */ public class EmployeeStatutorySickLeave { StringUtil util = new StringUtil(); @@ -70,24 +85,38 @@ public class EmployeeStatutorySickLeave { @JsonProperty("overlapsWithOtherLeave") private Boolean overlapsWithOtherLeave; - /** Gets or Sets entitlementFailureReasons */ + /** + * Gets or Sets entitlementFailureReasons + */ public enum EntitlementFailureReasonsEnum { - /** UNABLETOCALCULATEAWE */ + /** + * UNABLETOCALCULATEAWE + */ UNABLETOCALCULATEAWE("UnableToCalculateAwe"), - - /** AWELOWERTHANLEL */ + + /** + * AWELOWERTHANLEL + */ AWELOWERTHANLEL("AweLowerThanLel"), - - /** NOTQUALIFIEDINPREVIOUSPIW */ + + /** + * NOTQUALIFIEDINPREVIOUSPIW + */ NOTQUALIFIEDINPREVIOUSPIW("NotQualifiedInPreviousPiw"), - - /** EXCEEDEDMAXIMUMENTITLEMENTWEEKSOFSSP */ + + /** + * EXCEEDEDMAXIMUMENTITLEMENTWEEKSOFSSP + */ EXCEEDEDMAXIMUMENTITLEMENTWEEKSOFSSP("ExceededMaximumEntitlementWeeksOfSsp"), - - /** EXCEEDEDMAXIMUMDURATIONOFPIW */ + + /** + * EXCEEDEDMAXIMUMDURATIONOFPIW + */ EXCEEDEDMAXIMUMDURATIONOFPIW("ExceededMaximumDurationOfPiw"), - - /** SUFFICIENTNOTICENOTGIVEN */ + + /** + * SUFFICIENTNOTICENOTGIVEN + */ SUFFICIENTNOTICENOTGIVEN("SufficientNoticeNotGiven"); private String value; @@ -96,31 +125,25 @@ public enum EntitlementFailureReasonsEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static EntitlementFailureReasonsEnum fromValue(String value) { for (EntitlementFailureReasonsEnum b : EntitlementFailureReasonsEnum.values()) { @@ -132,267 +155,238 @@ public static EntitlementFailureReasonsEnum fromValue(String value) { } } + @JsonProperty("entitlementFailureReasons") - private List entitlementFailureReasons = - new ArrayList(); + private List entitlementFailureReasons = new ArrayList(); /** - * The unique identifier (guid) of a statutory leave - * - * @param statutoryLeaveID UUID - * @return EmployeeStatutorySickLeave - */ + * The unique identifier (guid) of a statutory leave + * @param statutoryLeaveID UUID + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave statutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; return this; } - /** + /** * The unique identifier (guid) of a statutory leave - * * @return statutoryLeaveID - */ + **/ @ApiModelProperty(value = "The unique identifier (guid) of a statutory leave") - /** + /** * The unique identifier (guid) of a statutory leave - * * @return statutoryLeaveID UUID - */ + **/ public UUID getStatutoryLeaveID() { return statutoryLeaveID; } - /** - * The unique identifier (guid) of a statutory leave - * - * @param statutoryLeaveID UUID - */ + /** + * The unique identifier (guid) of a statutory leave + * @param statutoryLeaveID UUID + **/ + public void setStatutoryLeaveID(UUID statutoryLeaveID) { this.statutoryLeaveID = statutoryLeaveID; } /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - * @return EmployeeStatutorySickLeave - */ + * The unique identifier (guid) of the employee + * @param employeeID UUID + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID - */ + **/ @ApiModelProperty(required = true, value = "The unique identifier (guid) of the employee") - /** + /** * The unique identifier (guid) of the employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The unique identifier (guid) of the employee - * - * @param employeeID UUID - */ + /** + * The unique identifier (guid) of the employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * - * @param leaveTypeID UUID - * @return EmployeeStatutorySickLeave - */ + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item + * @param leaveTypeID UUID + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * + /** + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item * @return leaveTypeID - */ - @ApiModelProperty( - required = true, - value = - "The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item") - /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * + **/ + @ApiModelProperty(required = true, value = "The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item") + /** + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay - * item - * - * @param leaveTypeID UUID - */ + /** + * The unique identifier (guid) of the \"Statutory Sick Leave (non-pensionable)\" pay item + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * The date when the leave starts - * - * @param startDate LocalDate - * @return EmployeeStatutorySickLeave - */ + * The date when the leave starts + * @param startDate LocalDate + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * The date when the leave starts - * * @return startDate - */ + **/ @ApiModelProperty(required = true, value = "The date when the leave starts") - /** + /** * The date when the leave starts - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * The date when the leave starts - * - * @param startDate LocalDate - */ + /** + * The date when the leave starts + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * The date when the leave ends - * - * @param endDate LocalDate - * @return EmployeeStatutorySickLeave - */ + * The date when the leave ends + * @param endDate LocalDate + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The date when the leave ends - * * @return endDate - */ + **/ @ApiModelProperty(required = true, value = "The date when the leave ends") - /** + /** * The date when the leave ends - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The date when the leave ends - * - * @param endDate LocalDate - */ + /** + * The date when the leave ends + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * the type of statutory leave - * - * @param type String - * @return EmployeeStatutorySickLeave - */ + * the type of statutory leave + * @param type String + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave type(String type) { this.type = type; return this; } - /** + /** * the type of statutory leave - * * @return type - */ + **/ @ApiModelProperty(example = "Sick", value = "the type of statutory leave") - /** + /** * the type of statutory leave - * * @return type String - */ + **/ public String getType() { return type; } - /** - * the type of statutory leave - * - * @param type String - */ + /** + * the type of statutory leave + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * the type of statutory leave - * - * @param status String - * @return EmployeeStatutorySickLeave - */ + * the type of statutory leave + * @param status String + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave status(String status) { this.status = status; return this; } - /** + /** * the type of statutory leave - * * @return status - */ + **/ @ApiModelProperty(example = "Pending", value = "the type of statutory leave") - /** + /** * the type of statutory leave - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * the type of statutory leave - * - * @param status String - */ + /** + * the type of statutory leave + * @param status String + **/ + public void setStatus(String status) { this.status = status; } /** - * The days of the work week the employee is scheduled to work at the time the leave is taken - * - * @param workPattern List<> - * @return EmployeeStatutorySickLeave - */ + * The days of the work week the employee is scheduled to work at the time the leave is taken + * @param workPattern List<> + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave workPattern(List workPattern) { this.workPattern = workPattern; return this; @@ -400,334 +394,276 @@ public EmployeeStatutorySickLeave workPattern(List workPattern) { /** * The days of the work week the employee is scheduled to work at the time the leave is taken - * - * @param workPatternItem String + * @param workPatternItem String * @return EmployeeStatutorySickLeave - */ + **/ public EmployeeStatutorySickLeave addWorkPatternItem(String workPatternItem) { this.workPattern.add(workPatternItem); return this; } - /** + /** * The days of the work week the employee is scheduled to work at the time the leave is taken - * * @return workPattern - */ - @ApiModelProperty( - required = true, - value = - "The days of the work week the employee is scheduled to work at the time the leave is" - + " taken") - /** + **/ + @ApiModelProperty(required = true, value = "The days of the work week the employee is scheduled to work at the time the leave is taken") + /** * The days of the work week the employee is scheduled to work at the time the leave is taken - * * @return workPattern List - */ + **/ public List getWorkPattern() { return workPattern; } - /** - * The days of the work week the employee is scheduled to work at the time the leave is taken - * - * @param workPattern List<> - */ + /** + * The days of the work week the employee is scheduled to work at the time the leave is taken + * @param workPattern List<> + **/ + public void setWorkPattern(List workPattern) { this.workPattern = workPattern; } /** - * Whether the sick leave was pregnancy related - * - * @param isPregnancyRelated Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether the sick leave was pregnancy related + * @param isPregnancyRelated Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave isPregnancyRelated(Boolean isPregnancyRelated) { this.isPregnancyRelated = isPregnancyRelated; return this; } - /** + /** * Whether the sick leave was pregnancy related - * * @return isPregnancyRelated - */ + **/ @ApiModelProperty(required = true, value = "Whether the sick leave was pregnancy related") - /** + /** * Whether the sick leave was pregnancy related - * * @return isPregnancyRelated Boolean - */ + **/ public Boolean getIsPregnancyRelated() { return isPregnancyRelated; } - /** - * Whether the sick leave was pregnancy related - * - * @param isPregnancyRelated Boolean - */ + /** + * Whether the sick leave was pregnancy related + * @param isPregnancyRelated Boolean + **/ + public void setIsPregnancyRelated(Boolean isPregnancyRelated) { this.isPregnancyRelated = isPregnancyRelated; } /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * - * @param sufficientNotice Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request + * @param sufficientNotice Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave sufficientNotice(Boolean sufficientNotice) { this.sufficientNotice = sufficientNotice; return this; } - /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * + /** + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request * @return sufficientNotice - */ - @ApiModelProperty( - required = true, - value = - "Whether the employee provided sufficient notice and documentation as required by the" - + " employer supporting the sick leave request") - /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * + **/ + @ApiModelProperty(required = true, value = "Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request") + /** + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request * @return sufficientNotice Boolean - */ + **/ public Boolean getSufficientNotice() { return sufficientNotice; } - /** - * Whether the employee provided sufficient notice and documentation as required by the employer - * supporting the sick leave request - * - * @param sufficientNotice Boolean - */ + /** + * Whether the employee provided sufficient notice and documentation as required by the employer supporting the sick leave request + * @param sufficientNotice Boolean + **/ + public void setSufficientNotice(Boolean sufficientNotice) { this.sufficientNotice = sufficientNotice; } /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave isEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; return this; } - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled - */ + **/ @ApiModelProperty(value = "Whether the leave was entitled to receive payment") - /** + /** * Whether the leave was entitled to receive payment - * * @return isEntitled Boolean - */ + **/ public Boolean getIsEntitled() { return isEntitled; } - /** - * Whether the leave was entitled to receive payment - * - * @param isEntitled Boolean - */ + /** + * Whether the leave was entitled to receive payment + * @param isEntitled Boolean + **/ + public void setIsEntitled(Boolean isEntitled) { this.isEntitled = isEntitled; } /** - * The amount of requested time (in weeks) - * - * @param entitlementWeeksRequested Double - * @return EmployeeStatutorySickLeave - */ + * The amount of requested time (in weeks) + * @param entitlementWeeksRequested Double + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave entitlementWeeksRequested(Double entitlementWeeksRequested) { this.entitlementWeeksRequested = entitlementWeeksRequested; return this; } - /** + /** * The amount of requested time (in weeks) - * * @return entitlementWeeksRequested - */ + **/ @ApiModelProperty(value = "The amount of requested time (in weeks)") - /** + /** * The amount of requested time (in weeks) - * * @return entitlementWeeksRequested Double - */ + **/ public Double getEntitlementWeeksRequested() { return entitlementWeeksRequested; } - /** - * The amount of requested time (in weeks) - * - * @param entitlementWeeksRequested Double - */ + /** + * The amount of requested time (in weeks) + * @param entitlementWeeksRequested Double + **/ + public void setEntitlementWeeksRequested(Double entitlementWeeksRequested) { this.entitlementWeeksRequested = entitlementWeeksRequested; } /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * - * @param entitlementWeeksQualified Double - * @return EmployeeStatutorySickLeave - */ + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + * @param entitlementWeeksQualified Double + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave entitlementWeeksQualified(Double entitlementWeeksQualified) { this.entitlementWeeksQualified = entitlementWeeksQualified; return this; } - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested * @return entitlementWeeksQualified - */ - @ApiModelProperty( - value = - "The amount of statutory sick leave time off (in weeks) that is available to take at the" - + " time the leave was requested") - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * + **/ + @ApiModelProperty(value = "The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested") + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested * @return entitlementWeeksQualified Double - */ + **/ public Double getEntitlementWeeksQualified() { return entitlementWeeksQualified; } - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time - * the leave was requested - * - * @param entitlementWeeksQualified Double - */ + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + * @param entitlementWeeksQualified Double + **/ + public void setEntitlementWeeksQualified(Double entitlementWeeksQualified) { this.entitlementWeeksQualified = entitlementWeeksQualified; } /** - * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * - * @param entitlementWeeksRemaining Double - * @return EmployeeStatutorySickLeave - */ + * A calculated amount of time (in weeks) that remains for the statutory sick leave period + * @param entitlementWeeksRemaining Double + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave entitlementWeeksRemaining(Double entitlementWeeksRemaining) { this.entitlementWeeksRemaining = entitlementWeeksRemaining; return this; } - /** + /** * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * * @return entitlementWeeksRemaining - */ - @ApiModelProperty( - value = - "A calculated amount of time (in weeks) that remains for the statutory sick leave period") - /** + **/ + @ApiModelProperty(value = "A calculated amount of time (in weeks) that remains for the statutory sick leave period") + /** * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * * @return entitlementWeeksRemaining Double - */ + **/ public Double getEntitlementWeeksRemaining() { return entitlementWeeksRemaining; } - /** - * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * - * @param entitlementWeeksRemaining Double - */ + /** + * A calculated amount of time (in weeks) that remains for the statutory sick leave period + * @param entitlementWeeksRemaining Double + **/ + public void setEntitlementWeeksRemaining(Double entitlementWeeksRemaining) { this.entitlementWeeksRemaining = entitlementWeeksRemaining; } /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * - * @param overlapsWithOtherLeave Boolean - * @return EmployeeStatutorySickLeave - */ + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts + * @param overlapsWithOtherLeave Boolean + * @return EmployeeStatutorySickLeave + **/ public EmployeeStatutorySickLeave overlapsWithOtherLeave(Boolean overlapsWithOtherLeave) { this.overlapsWithOtherLeave = overlapsWithOtherLeave; return this; } - /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * + /** + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts * @return overlapsWithOtherLeave - */ - @ApiModelProperty( - value = - "Whether another leave (Paternity, Shared Parental specifically) occurs during the" - + " requested leave's period. While this is allowed it could affect payment amounts") - /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * + **/ + @ApiModelProperty(value = "Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts") + /** + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts * @return overlapsWithOtherLeave Boolean - */ + **/ public Boolean getOverlapsWithOtherLeave() { return overlapsWithOtherLeave; } - /** - * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested - * leave's period. While this is allowed it could affect payment amounts - * - * @param overlapsWithOtherLeave Boolean - */ + /** + * Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts + * @param overlapsWithOtherLeave Boolean + **/ + public void setOverlapsWithOtherLeave(Boolean overlapsWithOtherLeave) { this.overlapsWithOtherLeave = overlapsWithOtherLeave; } /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * - * @param entitlementFailureReasons List<> - * @return EmployeeStatutorySickLeave - */ - public EmployeeStatutorySickLeave entitlementFailureReasons( - List entitlementFailureReasons) { + * If the leave requested was considered \"not entitled\", the reasons why are listed here. + * @param entitlementFailureReasons List<> + * @return EmployeeStatutorySickLeave + **/ + public EmployeeStatutorySickLeave entitlementFailureReasons(List entitlementFailureReasons) { this.entitlementFailureReasons = entitlementFailureReasons; return this; } /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * - * @param entitlementFailureReasonsItem EntitlementFailureReasonsEnum + * If the leave requested was considered \"not entitled\", the reasons why are listed here. + * @param entitlementFailureReasonsItem EntitlementFailureReasonsEnum * @return EmployeeStatutorySickLeave - */ - public EmployeeStatutorySickLeave addEntitlementFailureReasonsItem( - EntitlementFailureReasonsEnum entitlementFailureReasonsItem) { + **/ + public EmployeeStatutorySickLeave addEntitlementFailureReasonsItem(EntitlementFailureReasonsEnum entitlementFailureReasonsItem) { if (this.entitlementFailureReasons == null) { this.entitlementFailureReasons = new ArrayList(); } @@ -735,37 +671,29 @@ public EmployeeStatutorySickLeave addEntitlementFailureReasonsItem( return this; } - /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * + /** + * If the leave requested was considered \"not entitled\", the reasons why are listed here. * @return entitlementFailureReasons - */ - @ApiModelProperty( - value = - "If the leave requested was considered \"not entitled\", the reasons why are listed" - + " here.") - /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * + **/ + @ApiModelProperty(value = "If the leave requested was considered \"not entitled\", the reasons why are listed here.") + /** + * If the leave requested was considered \"not entitled\", the reasons why are listed here. * @return entitlementFailureReasons List - */ + **/ public List getEntitlementFailureReasons() { return entitlementFailureReasons; } - /** - * If the leave requested was considered \"not entitled\", the reasons why are listed - * here. - * - * @param entitlementFailureReasons List<> - */ - public void setEntitlementFailureReasons( - List entitlementFailureReasons) { + /** + * If the leave requested was considered \"not entitled\", the reasons why are listed here. + * @param entitlementFailureReasons List<> + **/ + + public void setEntitlementFailureReasons(List entitlementFailureReasons) { this.entitlementFailureReasons = entitlementFailureReasons; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -775,50 +703,30 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutorySickLeave employeeStatutorySickLeave = (EmployeeStatutorySickLeave) o; - return Objects.equals(this.statutoryLeaveID, employeeStatutorySickLeave.statutoryLeaveID) - && Objects.equals(this.employeeID, employeeStatutorySickLeave.employeeID) - && Objects.equals(this.leaveTypeID, employeeStatutorySickLeave.leaveTypeID) - && Objects.equals(this.startDate, employeeStatutorySickLeave.startDate) - && Objects.equals(this.endDate, employeeStatutorySickLeave.endDate) - && Objects.equals(this.type, employeeStatutorySickLeave.type) - && Objects.equals(this.status, employeeStatutorySickLeave.status) - && Objects.equals(this.workPattern, employeeStatutorySickLeave.workPattern) - && Objects.equals(this.isPregnancyRelated, employeeStatutorySickLeave.isPregnancyRelated) - && Objects.equals(this.sufficientNotice, employeeStatutorySickLeave.sufficientNotice) - && Objects.equals(this.isEntitled, employeeStatutorySickLeave.isEntitled) - && Objects.equals( - this.entitlementWeeksRequested, employeeStatutorySickLeave.entitlementWeeksRequested) - && Objects.equals( - this.entitlementWeeksQualified, employeeStatutorySickLeave.entitlementWeeksQualified) - && Objects.equals( - this.entitlementWeeksRemaining, employeeStatutorySickLeave.entitlementWeeksRemaining) - && Objects.equals( - this.overlapsWithOtherLeave, employeeStatutorySickLeave.overlapsWithOtherLeave) - && Objects.equals( - this.entitlementFailureReasons, employeeStatutorySickLeave.entitlementFailureReasons); + return Objects.equals(this.statutoryLeaveID, employeeStatutorySickLeave.statutoryLeaveID) && + Objects.equals(this.employeeID, employeeStatutorySickLeave.employeeID) && + Objects.equals(this.leaveTypeID, employeeStatutorySickLeave.leaveTypeID) && + Objects.equals(this.startDate, employeeStatutorySickLeave.startDate) && + Objects.equals(this.endDate, employeeStatutorySickLeave.endDate) && + Objects.equals(this.type, employeeStatutorySickLeave.type) && + Objects.equals(this.status, employeeStatutorySickLeave.status) && + Objects.equals(this.workPattern, employeeStatutorySickLeave.workPattern) && + Objects.equals(this.isPregnancyRelated, employeeStatutorySickLeave.isPregnancyRelated) && + Objects.equals(this.sufficientNotice, employeeStatutorySickLeave.sufficientNotice) && + Objects.equals(this.isEntitled, employeeStatutorySickLeave.isEntitled) && + Objects.equals(this.entitlementWeeksRequested, employeeStatutorySickLeave.entitlementWeeksRequested) && + Objects.equals(this.entitlementWeeksQualified, employeeStatutorySickLeave.entitlementWeeksQualified) && + Objects.equals(this.entitlementWeeksRemaining, employeeStatutorySickLeave.entitlementWeeksRemaining) && + Objects.equals(this.overlapsWithOtherLeave, employeeStatutorySickLeave.overlapsWithOtherLeave) && + Objects.equals(this.entitlementFailureReasons, employeeStatutorySickLeave.entitlementFailureReasons); } @Override public int hashCode() { - return Objects.hash( - statutoryLeaveID, - employeeID, - leaveTypeID, - startDate, - endDate, - type, - status, - workPattern, - isPregnancyRelated, - sufficientNotice, - isEntitled, - entitlementWeeksRequested, - entitlementWeeksQualified, - entitlementWeeksRemaining, - overlapsWithOtherLeave, - entitlementFailureReasons); + return Objects.hash(statutoryLeaveID, employeeID, leaveTypeID, startDate, endDate, type, status, workPattern, isPregnancyRelated, sufficientNotice, isEntitled, entitlementWeeksRequested, entitlementWeeksQualified, entitlementWeeksRemaining, overlapsWithOtherLeave, entitlementFailureReasons); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -834,27 +742,18 @@ public String toString() { sb.append(" isPregnancyRelated: ").append(toIndentedString(isPregnancyRelated)).append("\n"); sb.append(" sufficientNotice: ").append(toIndentedString(sufficientNotice)).append("\n"); sb.append(" isEntitled: ").append(toIndentedString(isEntitled)).append("\n"); - sb.append(" entitlementWeeksRequested: ") - .append(toIndentedString(entitlementWeeksRequested)) - .append("\n"); - sb.append(" entitlementWeeksQualified: ") - .append(toIndentedString(entitlementWeeksQualified)) - .append("\n"); - sb.append(" entitlementWeeksRemaining: ") - .append(toIndentedString(entitlementWeeksRemaining)) - .append("\n"); - sb.append(" overlapsWithOtherLeave: ") - .append(toIndentedString(overlapsWithOtherLeave)) - .append("\n"); - sb.append(" entitlementFailureReasons: ") - .append(toIndentedString(entitlementFailureReasons)) - .append("\n"); + sb.append(" entitlementWeeksRequested: ").append(toIndentedString(entitlementWeeksRequested)).append("\n"); + sb.append(" entitlementWeeksQualified: ").append(toIndentedString(entitlementWeeksQualified)).append("\n"); + sb.append(" entitlementWeeksRemaining: ").append(toIndentedString(entitlementWeeksRemaining)).append("\n"); + sb.append(" overlapsWithOtherLeave: ").append(toIndentedString(overlapsWithOtherLeave)).append("\n"); + sb.append(" entitlementFailureReasons: ").append(toIndentedString(entitlementFailureReasons)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -862,4 +761,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaveObject.java b/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaveObject.java index 8bd98de02..ef16b9e19 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaveObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaveObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeStatutorySickLeave; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutorySickLeaveObject + */ -/** EmployeeStatutorySickLeaveObject */ public class EmployeeStatutorySickLeaveObject { StringUtil util = new StringUtil(); @@ -29,111 +49,102 @@ public class EmployeeStatutorySickLeaveObject { @JsonProperty("statutorySickLeave") private EmployeeStatutorySickLeave statutorySickLeave; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutorySickLeaveObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutorySickLeaveObject + **/ public EmployeeStatutorySickLeaveObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutorySickLeaveObject - */ + * problem + * @param problem Problem + * @return EmployeeStatutorySickLeaveObject + **/ public EmployeeStatutorySickLeaveObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutorySickLeave - * - * @param statutorySickLeave EmployeeStatutorySickLeave - * @return EmployeeStatutorySickLeaveObject - */ - public EmployeeStatutorySickLeaveObject statutorySickLeave( - EmployeeStatutorySickLeave statutorySickLeave) { + * statutorySickLeave + * @param statutorySickLeave EmployeeStatutorySickLeave + * @return EmployeeStatutorySickLeaveObject + **/ + public EmployeeStatutorySickLeaveObject statutorySickLeave(EmployeeStatutorySickLeave statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; return this; } - /** + /** * Get statutorySickLeave - * * @return statutorySickLeave - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutorySickLeave - * * @return statutorySickLeave EmployeeStatutorySickLeave - */ + **/ public EmployeeStatutorySickLeave getStatutorySickLeave() { return statutorySickLeave; } - /** - * statutorySickLeave - * - * @param statutorySickLeave EmployeeStatutorySickLeave - */ + /** + * statutorySickLeave + * @param statutorySickLeave EmployeeStatutorySickLeave + **/ + public void setStatutorySickLeave(EmployeeStatutorySickLeave statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,12 +153,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - EmployeeStatutorySickLeaveObject employeeStatutorySickLeaveObject = - (EmployeeStatutorySickLeaveObject) o; - return Objects.equals(this.pagination, employeeStatutorySickLeaveObject.pagination) - && Objects.equals(this.problem, employeeStatutorySickLeaveObject.problem) - && Objects.equals( - this.statutorySickLeave, employeeStatutorySickLeaveObject.statutorySickLeave); + EmployeeStatutorySickLeaveObject employeeStatutorySickLeaveObject = (EmployeeStatutorySickLeaveObject) o; + return Objects.equals(this.pagination, employeeStatutorySickLeaveObject.pagination) && + Objects.equals(this.problem, employeeStatutorySickLeaveObject.problem) && + Objects.equals(this.statutorySickLeave, employeeStatutorySickLeaveObject.statutorySickLeave); } @Override @@ -155,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutorySickLeave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -167,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -175,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaves.java b/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaves.java index e906f4ace..0b7bf9403 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaves.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeStatutorySickLeaves.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeStatutorySickLeave; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeStatutorySickLeaves + */ -/** EmployeeStatutorySickLeaves */ public class EmployeeStatutorySickLeaves { StringUtil util = new StringUtil(); @@ -29,98 +49,87 @@ public class EmployeeStatutorySickLeaves { private Problem problem; @JsonProperty("statutorySickLeave") - private List statutorySickLeave = - new ArrayList(); + private List statutorySickLeave = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return EmployeeStatutorySickLeaves - */ + * pagination + * @param pagination Pagination + * @return EmployeeStatutorySickLeaves + **/ public EmployeeStatutorySickLeaves pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeStatutorySickLeaves - */ + * problem + * @param problem Problem + * @return EmployeeStatutorySickLeaves + **/ public EmployeeStatutorySickLeaves problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * statutorySickLeave - * - * @param statutorySickLeave List<EmployeeStatutorySickLeave> - * @return EmployeeStatutorySickLeaves - */ - public EmployeeStatutorySickLeaves statutorySickLeave( - List statutorySickLeave) { + * statutorySickLeave + * @param statutorySickLeave List<EmployeeStatutorySickLeave> + * @return EmployeeStatutorySickLeaves + **/ + public EmployeeStatutorySickLeaves statutorySickLeave(List statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; return this; } /** * statutorySickLeave - * - * @param statutorySickLeaveItem EmployeeStatutorySickLeave + * @param statutorySickLeaveItem EmployeeStatutorySickLeave * @return EmployeeStatutorySickLeaves - */ - public EmployeeStatutorySickLeaves addStatutorySickLeaveItem( - EmployeeStatutorySickLeave statutorySickLeaveItem) { + **/ + public EmployeeStatutorySickLeaves addStatutorySickLeaveItem(EmployeeStatutorySickLeave statutorySickLeaveItem) { if (this.statutorySickLeave == null) { this.statutorySickLeave = new ArrayList(); } @@ -128,30 +137,29 @@ public EmployeeStatutorySickLeaves addStatutorySickLeaveItem( return this; } - /** + /** * Get statutorySickLeave - * * @return statutorySickLeave - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutorySickLeave - * * @return statutorySickLeave List - */ + **/ public List getStatutorySickLeave() { return statutorySickLeave; } - /** - * statutorySickLeave - * - * @param statutorySickLeave List<EmployeeStatutorySickLeave> - */ + /** + * statutorySickLeave + * @param statutorySickLeave List<EmployeeStatutorySickLeave> + **/ + public void setStatutorySickLeave(List statutorySickLeave) { this.statutorySickLeave = statutorySickLeave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -161,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeStatutorySickLeaves employeeStatutorySickLeaves = (EmployeeStatutorySickLeaves) o; - return Objects.equals(this.pagination, employeeStatutorySickLeaves.pagination) - && Objects.equals(this.problem, employeeStatutorySickLeaves.problem) - && Objects.equals(this.statutorySickLeave, employeeStatutorySickLeaves.statutorySickLeave); + return Objects.equals(this.pagination, employeeStatutorySickLeaves.pagination) && + Objects.equals(this.problem, employeeStatutorySickLeaves.problem) && + Objects.equals(this.statutorySickLeave, employeeStatutorySickLeaves.statutorySickLeave); } @Override @@ -171,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, statutorySickLeave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -183,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -191,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeTax.java b/src/main/java/com/xero/models/payrolluk/EmployeeTax.java index 5bafb5f40..d85ba0179 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeTax.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeTax.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeTax + */ -/** EmployeeTax */ public class EmployeeTax { StringUtil util = new StringUtil(); @@ -54,392 +71,358 @@ public class EmployeeTax { @JsonProperty("nicCalculationMethod") private String nicCalculationMethod; /** - * The Starter type. - * - * @param starterType String - * @return EmployeeTax - */ + * The Starter type. + * @param starterType String + * @return EmployeeTax + **/ public EmployeeTax starterType(String starterType) { this.starterType = starterType; return this; } - /** + /** * The Starter type. - * * @return starterType - */ + **/ @ApiModelProperty(example = "New Employee with P45", value = "The Starter type.") - /** + /** * The Starter type. - * * @return starterType String - */ + **/ public String getStarterType() { return starterType; } - /** - * The Starter type. - * - * @param starterType String - */ + /** + * The Starter type. + * @param starterType String + **/ + public void setStarterType(String starterType) { this.starterType = starterType; } /** - * Starter declaration. - * - * @param starterDeclaration String - * @return EmployeeTax - */ + * Starter declaration. + * @param starterDeclaration String + * @return EmployeeTax + **/ public EmployeeTax starterDeclaration(String starterDeclaration) { this.starterDeclaration = starterDeclaration; return this; } - /** + /** * Starter declaration. - * * @return starterDeclaration - */ - @ApiModelProperty( - example = "B.) This is currently their only job", - value = "Starter declaration.") - /** + **/ + @ApiModelProperty(example = "B.) This is currently their only job", value = "Starter declaration.") + /** * Starter declaration. - * * @return starterDeclaration String - */ + **/ public String getStarterDeclaration() { return starterDeclaration; } - /** - * Starter declaration. - * - * @param starterDeclaration String - */ + /** + * Starter declaration. + * @param starterDeclaration String + **/ + public void setStarterDeclaration(String starterDeclaration) { this.starterDeclaration = starterDeclaration; } /** - * The Tax code. - * - * @param taxCode String - * @return EmployeeTax - */ + * The Tax code. + * @param taxCode String + * @return EmployeeTax + **/ public EmployeeTax taxCode(String taxCode) { this.taxCode = taxCode; return this; } - /** + /** * The Tax code. - * * @return taxCode - */ + **/ @ApiModelProperty(example = "1185L", value = "The Tax code.") - /** + /** * The Tax code. - * * @return taxCode String - */ + **/ public String getTaxCode() { return taxCode; } - /** - * The Tax code. - * - * @param taxCode String - */ + /** + * The Tax code. + * @param taxCode String + **/ + public void setTaxCode(String taxCode) { this.taxCode = taxCode; } /** - * Describes whether the tax settings is W1M1 - * - * @param w1M1 Boolean - * @return EmployeeTax - */ + * Describes whether the tax settings is W1M1 + * @param w1M1 Boolean + * @return EmployeeTax + **/ public EmployeeTax w1M1(Boolean w1M1) { this.w1M1 = w1M1; return this; } - /** + /** * Describes whether the tax settings is W1M1 - * * @return w1M1 - */ + **/ @ApiModelProperty(value = "Describes whether the tax settings is W1M1") - /** + /** * Describes whether the tax settings is W1M1 - * * @return w1M1 Boolean - */ + **/ public Boolean getW1M1() { return w1M1; } - /** - * Describes whether the tax settings is W1M1 - * - * @param w1M1 Boolean - */ + /** + * Describes whether the tax settings is W1M1 + * @param w1M1 Boolean + **/ + public void setW1M1(Boolean w1M1) { this.w1M1 = w1M1; } /** - * The previous taxable pay - * - * @param previousTaxablePay Double - * @return EmployeeTax - */ + * The previous taxable pay + * @param previousTaxablePay Double + * @return EmployeeTax + **/ public EmployeeTax previousTaxablePay(Double previousTaxablePay) { this.previousTaxablePay = previousTaxablePay; return this; } - /** + /** * The previous taxable pay - * * @return previousTaxablePay - */ + **/ @ApiModelProperty(value = "The previous taxable pay") - /** + /** * The previous taxable pay - * * @return previousTaxablePay Double - */ + **/ public Double getPreviousTaxablePay() { return previousTaxablePay; } - /** - * The previous taxable pay - * - * @param previousTaxablePay Double - */ + /** + * The previous taxable pay + * @param previousTaxablePay Double + **/ + public void setPreviousTaxablePay(Double previousTaxablePay) { this.previousTaxablePay = previousTaxablePay; } /** - * The tax amount previously paid - * - * @param previousTaxPaid Double - * @return EmployeeTax - */ + * The tax amount previously paid + * @param previousTaxPaid Double + * @return EmployeeTax + **/ public EmployeeTax previousTaxPaid(Double previousTaxPaid) { this.previousTaxPaid = previousTaxPaid; return this; } - /** + /** * The tax amount previously paid - * * @return previousTaxPaid - */ + **/ @ApiModelProperty(value = "The tax amount previously paid") - /** + /** * The tax amount previously paid - * * @return previousTaxPaid Double - */ + **/ public Double getPreviousTaxPaid() { return previousTaxPaid; } - /** - * The tax amount previously paid - * - * @param previousTaxPaid Double - */ + /** + * The tax amount previously paid + * @param previousTaxPaid Double + **/ + public void setPreviousTaxPaid(Double previousTaxPaid) { this.previousTaxPaid = previousTaxPaid; } /** - * The employee's student loan deduction type - * - * @param studentLoanDeduction String - * @return EmployeeTax - */ + * The employee's student loan deduction type + * @param studentLoanDeduction String + * @return EmployeeTax + **/ public EmployeeTax studentLoanDeduction(String studentLoanDeduction) { this.studentLoanDeduction = studentLoanDeduction; return this; } - /** + /** * The employee's student loan deduction type - * * @return studentLoanDeduction - */ + **/ @ApiModelProperty(example = "Plan Type 2", value = "The employee's student loan deduction type") - /** + /** * The employee's student loan deduction type - * * @return studentLoanDeduction String - */ + **/ public String getStudentLoanDeduction() { return studentLoanDeduction; } - /** - * The employee's student loan deduction type - * - * @param studentLoanDeduction String - */ + /** + * The employee's student loan deduction type + * @param studentLoanDeduction String + **/ + public void setStudentLoanDeduction(String studentLoanDeduction) { this.studentLoanDeduction = studentLoanDeduction; } /** - * Describes whether the employee has post graduate loans - * - * @param hasPostGraduateLoans Boolean - * @return EmployeeTax - */ + * Describes whether the employee has post graduate loans + * @param hasPostGraduateLoans Boolean + * @return EmployeeTax + **/ public EmployeeTax hasPostGraduateLoans(Boolean hasPostGraduateLoans) { this.hasPostGraduateLoans = hasPostGraduateLoans; return this; } - /** + /** * Describes whether the employee has post graduate loans - * * @return hasPostGraduateLoans - */ + **/ @ApiModelProperty(value = "Describes whether the employee has post graduate loans") - /** + /** * Describes whether the employee has post graduate loans - * * @return hasPostGraduateLoans Boolean - */ + **/ public Boolean getHasPostGraduateLoans() { return hasPostGraduateLoans; } - /** - * Describes whether the employee has post graduate loans - * - * @param hasPostGraduateLoans Boolean - */ + /** + * Describes whether the employee has post graduate loans + * @param hasPostGraduateLoans Boolean + **/ + public void setHasPostGraduateLoans(Boolean hasPostGraduateLoans) { this.hasPostGraduateLoans = hasPostGraduateLoans; } /** - * Describes whether the employee is director - * - * @param isDirector Boolean - * @return EmployeeTax - */ + * Describes whether the employee is director + * @param isDirector Boolean + * @return EmployeeTax + **/ public EmployeeTax isDirector(Boolean isDirector) { this.isDirector = isDirector; return this; } - /** + /** * Describes whether the employee is director - * * @return isDirector - */ + **/ @ApiModelProperty(value = "Describes whether the employee is director") - /** + /** * Describes whether the employee is director - * * @return isDirector Boolean - */ + **/ public Boolean getIsDirector() { return isDirector; } - /** - * Describes whether the employee is director - * - * @param isDirector Boolean - */ + /** + * Describes whether the employee is director + * @param isDirector Boolean + **/ + public void setIsDirector(Boolean isDirector) { this.isDirector = isDirector; } /** - * The directorship start date - * - * @param directorshipStartDate LocalDate - * @return EmployeeTax - */ + * The directorship start date + * @param directorshipStartDate LocalDate + * @return EmployeeTax + **/ public EmployeeTax directorshipStartDate(LocalDate directorshipStartDate) { this.directorshipStartDate = directorshipStartDate; return this; } - /** + /** * The directorship start date - * * @return directorshipStartDate - */ + **/ @ApiModelProperty(value = "The directorship start date") - /** + /** * The directorship start date - * * @return directorshipStartDate LocalDate - */ + **/ public LocalDate getDirectorshipStartDate() { return directorshipStartDate; } - /** - * The directorship start date - * - * @param directorshipStartDate LocalDate - */ + /** + * The directorship start date + * @param directorshipStartDate LocalDate + **/ + public void setDirectorshipStartDate(LocalDate directorshipStartDate) { this.directorshipStartDate = directorshipStartDate; } /** - * NICs calculation method - * - * @param nicCalculationMethod String - * @return EmployeeTax - */ + * NICs calculation method + * @param nicCalculationMethod String + * @return EmployeeTax + **/ public EmployeeTax nicCalculationMethod(String nicCalculationMethod) { this.nicCalculationMethod = nicCalculationMethod; return this; } - /** + /** * NICs calculation method - * * @return nicCalculationMethod - */ + **/ @ApiModelProperty(example = "Annualized", value = "NICs calculation method") - /** + /** * NICs calculation method - * * @return nicCalculationMethod String - */ + **/ public String getNicCalculationMethod() { return nicCalculationMethod; } - /** - * NICs calculation method - * - * @param nicCalculationMethod String - */ + /** + * NICs calculation method + * @param nicCalculationMethod String + **/ + public void setNicCalculationMethod(String nicCalculationMethod) { this.nicCalculationMethod = nicCalculationMethod; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -449,35 +432,25 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeTax employeeTax = (EmployeeTax) o; - return Objects.equals(this.starterType, employeeTax.starterType) - && Objects.equals(this.starterDeclaration, employeeTax.starterDeclaration) - && Objects.equals(this.taxCode, employeeTax.taxCode) - && Objects.equals(this.w1M1, employeeTax.w1M1) - && Objects.equals(this.previousTaxablePay, employeeTax.previousTaxablePay) - && Objects.equals(this.previousTaxPaid, employeeTax.previousTaxPaid) - && Objects.equals(this.studentLoanDeduction, employeeTax.studentLoanDeduction) - && Objects.equals(this.hasPostGraduateLoans, employeeTax.hasPostGraduateLoans) - && Objects.equals(this.isDirector, employeeTax.isDirector) - && Objects.equals(this.directorshipStartDate, employeeTax.directorshipStartDate) - && Objects.equals(this.nicCalculationMethod, employeeTax.nicCalculationMethod); + return Objects.equals(this.starterType, employeeTax.starterType) && + Objects.equals(this.starterDeclaration, employeeTax.starterDeclaration) && + Objects.equals(this.taxCode, employeeTax.taxCode) && + Objects.equals(this.w1M1, employeeTax.w1M1) && + Objects.equals(this.previousTaxablePay, employeeTax.previousTaxablePay) && + Objects.equals(this.previousTaxPaid, employeeTax.previousTaxPaid) && + Objects.equals(this.studentLoanDeduction, employeeTax.studentLoanDeduction) && + Objects.equals(this.hasPostGraduateLoans, employeeTax.hasPostGraduateLoans) && + Objects.equals(this.isDirector, employeeTax.isDirector) && + Objects.equals(this.directorshipStartDate, employeeTax.directorshipStartDate) && + Objects.equals(this.nicCalculationMethod, employeeTax.nicCalculationMethod); } @Override public int hashCode() { - return Objects.hash( - starterType, - starterDeclaration, - taxCode, - w1M1, - previousTaxablePay, - previousTaxPaid, - studentLoanDeduction, - hasPostGraduateLoans, - isDirector, - directorshipStartDate, - nicCalculationMethod); + return Objects.hash(starterType, starterDeclaration, taxCode, w1M1, previousTaxablePay, previousTaxPaid, studentLoanDeduction, hasPostGraduateLoans, isDirector, directorshipStartDate, nicCalculationMethod); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -488,25 +461,18 @@ public String toString() { sb.append(" w1M1: ").append(toIndentedString(w1M1)).append("\n"); sb.append(" previousTaxablePay: ").append(toIndentedString(previousTaxablePay)).append("\n"); sb.append(" previousTaxPaid: ").append(toIndentedString(previousTaxPaid)).append("\n"); - sb.append(" studentLoanDeduction: ") - .append(toIndentedString(studentLoanDeduction)) - .append("\n"); - sb.append(" hasPostGraduateLoans: ") - .append(toIndentedString(hasPostGraduateLoans)) - .append("\n"); + sb.append(" studentLoanDeduction: ").append(toIndentedString(studentLoanDeduction)).append("\n"); + sb.append(" hasPostGraduateLoans: ").append(toIndentedString(hasPostGraduateLoans)).append("\n"); sb.append(" isDirector: ").append(toIndentedString(isDirector)).append("\n"); - sb.append(" directorshipStartDate: ") - .append(toIndentedString(directorshipStartDate)) - .append("\n"); - sb.append(" nicCalculationMethod: ") - .append(toIndentedString(nicCalculationMethod)) - .append("\n"); + sb.append(" directorshipStartDate: ").append(toIndentedString(directorshipStartDate)).append("\n"); + sb.append(" nicCalculationMethod: ").append(toIndentedString(nicCalculationMethod)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -514,4 +480,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmployeeTaxObject.java b/src/main/java/com/xero/models/payrolluk/EmployeeTaxObject.java index e4a575eb7..5857fba85 100644 --- a/src/main/java/com/xero/models/payrolluk/EmployeeTaxObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmployeeTaxObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.EmployeeTax; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmployeeTaxObject + */ -/** EmployeeTaxObject */ public class EmployeeTaxObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmployeeTaxObject { @JsonProperty("employeeTax") private EmployeeTax employeeTax; /** - * pagination - * - * @param pagination Pagination - * @return EmployeeTaxObject - */ + * pagination + * @param pagination Pagination + * @return EmployeeTaxObject + **/ public EmployeeTaxObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmployeeTaxObject - */ + * problem + * @param problem Problem + * @return EmployeeTaxObject + **/ public EmployeeTaxObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * employeeTax - * - * @param employeeTax EmployeeTax - * @return EmployeeTaxObject - */ + * employeeTax + * @param employeeTax EmployeeTax + * @return EmployeeTaxObject + **/ public EmployeeTaxObject employeeTax(EmployeeTax employeeTax) { this.employeeTax = employeeTax; return this; } - /** + /** * Get employeeTax - * * @return employeeTax - */ + **/ @ApiModelProperty(value = "") - /** + /** * employeeTax - * * @return employeeTax EmployeeTax - */ + **/ public EmployeeTax getEmployeeTax() { return employeeTax; } - /** - * employeeTax - * - * @param employeeTax EmployeeTax - */ + /** + * employeeTax + * @param employeeTax EmployeeTax + **/ + public void setEmployeeTax(EmployeeTax employeeTax) { this.employeeTax = employeeTax; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmployeeTaxObject employeeTaxObject = (EmployeeTaxObject) o; - return Objects.equals(this.pagination, employeeTaxObject.pagination) - && Objects.equals(this.problem, employeeTaxObject.problem) - && Objects.equals(this.employeeTax, employeeTaxObject.employeeTax); + return Objects.equals(this.pagination, employeeTaxObject.pagination) && + Objects.equals(this.problem, employeeTaxObject.problem) && + Objects.equals(this.employeeTax, employeeTaxObject.employeeTax); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, employeeTax); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Employees.java b/src/main/java/com/xero/models/payrolluk/Employees.java index db648cc4a..b702bae6c 100644 --- a/src/main/java/com/xero/models/payrolluk/Employees.java +++ b/src/main/java/com/xero/models/payrolluk/Employees.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Employee; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employees + */ -/** Employees */ public class Employees { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Employees { @JsonProperty("employees") private List employees = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Employees - */ + * pagination + * @param pagination Pagination + * @return Employees + **/ public Employees pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Employees - */ + * problem + * @param problem Problem + * @return Employees + **/ public Employees problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * employees - * - * @param employees List<Employee> - * @return Employees - */ + * employees + * @param employees List<Employee> + * @return Employees + **/ public Employees employees(List employees) { this.employees = employees; return this; @@ -113,10 +126,9 @@ public Employees employees(List employees) { /** * employees - * - * @param employeesItem Employee + * @param employeesItem Employee * @return Employees - */ + **/ public Employees addEmployeesItem(Employee employeesItem) { if (this.employees == null) { this.employees = new ArrayList(); @@ -125,30 +137,29 @@ public Employees addEmployeesItem(Employee employeesItem) { return this; } - /** + /** * Get employees - * * @return employees - */ + **/ @ApiModelProperty(value = "") - /** + /** * employees - * * @return employees List - */ + **/ public List getEmployees() { return employees; } - /** - * employees - * - * @param employees List<Employee> - */ + /** + * employees + * @param employees List<Employee> + **/ + public void setEmployees(List employees) { this.employees = employees; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Employees employees = (Employees) o; - return Objects.equals(this.pagination, employees.pagination) - && Objects.equals(this.problem, employees.problem) - && Objects.equals(this.employees, employees.employees); + return Objects.equals(this.pagination, employees.pagination) && + Objects.equals(this.problem, employees.problem) && + Objects.equals(this.employees, employees.employees); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, employees); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Employment.java b/src/main/java/com/xero/models/payrolluk/Employment.java index a84dd2003..19cc9c2a0 100644 --- a/src/main/java/com/xero/models/payrolluk/Employment.java +++ b/src/main/java/com/xero/models/payrolluk/Employment.java @@ -9,18 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.NICategory; +import com.xero.models.payrolluk.NICategoryLetter; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Employment + */ -/** Employment */ public class Employment { StringUtil util = new StringUtil(); @@ -39,151 +58,138 @@ public class Employment { @JsonProperty("niCategories") private List niCategories = new ArrayList(); /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - * @return Employment - */ + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + * @return Employment + **/ public Employment payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar of the employee") - /** + /** * Xero unique identifier for the payroll calendar of the employee - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar of the employee - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar of the employee + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * Start date of the employment (YYYY-MM-DD) - * - * @param startDate LocalDate - * @return Employment - */ + * Start date of the employment (YYYY-MM-DD) + * @param startDate LocalDate + * @return Employment + **/ public Employment startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * Start date of the employment (YYYY-MM-DD) - * * @return startDate - */ + **/ @ApiModelProperty(value = "Start date of the employment (YYYY-MM-DD)") - /** + /** * Start date of the employment (YYYY-MM-DD) - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * Start date of the employment (YYYY-MM-DD) - * - * @param startDate LocalDate - */ + /** + * Start date of the employment (YYYY-MM-DD) + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * The employment number of the employee - * - * @param employeeNumber String - * @return Employment - */ + * The employment number of the employee + * @param employeeNumber String + * @return Employment + **/ public Employment employeeNumber(String employeeNumber) { this.employeeNumber = employeeNumber; return this; } - /** + /** * The employment number of the employee - * * @return employeeNumber - */ + **/ @ApiModelProperty(example = "7", value = "The employment number of the employee") - /** + /** * The employment number of the employee - * * @return employeeNumber String - */ + **/ public String getEmployeeNumber() { return employeeNumber; } - /** - * The employment number of the employee - * - * @param employeeNumber String - */ + /** + * The employment number of the employee + * @param employeeNumber String + **/ + public void setEmployeeNumber(String employeeNumber) { this.employeeNumber = employeeNumber; } /** - * niCategory - * - * @param niCategory NICategoryLetter - * @return Employment - */ + * niCategory + * @param niCategory NICategoryLetter + * @return Employment + **/ public Employment 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 - */ + /** + * niCategory + * @param niCategory NICategoryLetter + **/ + public void setNiCategory(NICategoryLetter niCategory) { this.niCategory = niCategory; } /** - * The employee's NI categories - * - * @param niCategories List<NICategory> - * @return Employment - */ + * The employee's NI categories + * @param niCategories List<NICategory> + * @return Employment + **/ public Employment niCategories(List niCategories) { this.niCategories = niCategories; return this; @@ -191,10 +197,9 @@ public Employment niCategories(List niCategories) { /** * The employee's NI categories - * - * @param niCategoriesItem NICategory + * @param niCategoriesItem NICategory * @return Employment - */ + **/ public Employment addNiCategoriesItem(NICategory niCategoriesItem) { if (this.niCategories == null) { this.niCategories = new ArrayList(); @@ -203,30 +208,29 @@ public Employment addNiCategoriesItem(NICategory 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> - */ + /** + * 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) { @@ -236,11 +240,11 @@ public boolean equals(java.lang.Object o) { return false; } Employment employment = (Employment) 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.niCategories, employment.niCategories); + 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.niCategories, employment.niCategories); } @Override @@ -248,6 +252,7 @@ public int hashCode() { return Objects.hash(payrollCalendarID, startDate, employeeNumber, niCategory, niCategories); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -262,7 +267,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -270,4 +276,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/EmploymentObject.java b/src/main/java/com/xero/models/payrolluk/EmploymentObject.java index abf4c7126..eca4cdcac 100644 --- a/src/main/java/com/xero/models/payrolluk/EmploymentObject.java +++ b/src/main/java/com/xero/models/payrolluk/EmploymentObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Employment; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * EmploymentObject + */ -/** EmploymentObject */ public class EmploymentObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class EmploymentObject { @JsonProperty("employment") private Employment employment; /** - * pagination - * - * @param pagination Pagination - * @return EmploymentObject - */ + * pagination + * @param pagination Pagination + * @return EmploymentObject + **/ public EmploymentObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return EmploymentObject - */ + * problem + * @param problem Problem + * @return EmploymentObject + **/ public EmploymentObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * employment - * - * @param employment Employment - * @return EmploymentObject - */ + * employment + * @param employment Employment + * @return EmploymentObject + **/ public EmploymentObject employment(Employment employment) { this.employment = employment; return this; } - /** + /** * Get employment - * * @return employment - */ + **/ @ApiModelProperty(value = "") - /** + /** * employment - * * @return employment Employment - */ + **/ public Employment getEmployment() { return employment; } - /** - * employment - * - * @param employment Employment - */ + /** + * employment + * @param employment Employment + **/ + public void setEmployment(Employment employment) { this.employment = employment; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } EmploymentObject employmentObject = (EmploymentObject) o; - return Objects.equals(this.pagination, employmentObject.pagination) - && Objects.equals(this.problem, employmentObject.problem) - && Objects.equals(this.employment, employmentObject.employment); + return Objects.equals(this.pagination, employmentObject.pagination) && + Objects.equals(this.problem, employmentObject.problem) && + Objects.equals(this.employment, employmentObject.employment); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, employment); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/InvalidField.java b/src/main/java/com/xero/models/payrolluk/InvalidField.java index c0267b326..fafc2268d 100644 --- a/src/main/java/com/xero/models/payrolluk/InvalidField.java +++ b/src/main/java/com/xero/models/payrolluk/InvalidField.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * InvalidField + */ -/** InvalidField */ public class InvalidField { StringUtil util = new StringUtil(); @@ -26,77 +43,70 @@ public class InvalidField { @JsonProperty("reason") private String reason; /** - * The name of the field that caused the error - * - * @param name String - * @return InvalidField - */ + * The name of the field that caused the error + * @param name String + * @return InvalidField + **/ public InvalidField name(String name) { this.name = name; return this; } - /** + /** * The name of the field that caused the error - * * @return name - */ + **/ @ApiModelProperty(example = "DateOfBirth", value = "The name of the field that caused the error") - /** + /** * The name of the field that caused the error - * * @return name String - */ + **/ public String getName() { return name; } - /** - * The name of the field that caused the error - * - * @param name String - */ + /** + * The name of the field that caused the error + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * The reason the error occurred - * - * @param reason String - * @return InvalidField - */ + * The reason the error occurred + * @param reason String + * @return InvalidField + **/ public InvalidField reason(String reason) { this.reason = reason; return this; } - /** + /** * The reason the error occurred - * * @return reason - */ - @ApiModelProperty( - example = "The Date of Birth is required.", - value = "The reason the error occurred") - /** + **/ + @ApiModelProperty(example = "The Date of Birth is required.", value = "The reason the error occurred") + /** * The reason the error occurred - * * @return reason String - */ + **/ public String getReason() { return reason; } - /** - * The reason the error occurred - * - * @param reason String - */ + /** + * The reason the error occurred + * @param reason String + **/ + public void setReason(String reason) { this.reason = reason; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -106,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } InvalidField invalidField = (InvalidField) o; - return Objects.equals(this.name, invalidField.name) - && Objects.equals(this.reason, invalidField.reason); + return Objects.equals(this.name, invalidField.name) && + Objects.equals(this.reason, invalidField.reason); } @Override @@ -115,6 +125,7 @@ public int hashCode() { return Objects.hash(name, reason); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -126,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -134,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/LeaveAccrualLine.java b/src/main/java/com/xero/models/payrolluk/LeaveAccrualLine.java index 739631b4d..4872a2c2b 100644 --- a/src/main/java/com/xero/models/payrolluk/LeaveAccrualLine.java +++ b/src/main/java/com/xero/models/payrolluk/LeaveAccrualLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveAccrualLine + */ -/** LeaveAccrualLine */ public class LeaveAccrualLine { StringUtil util = new StringUtil(); @@ -27,75 +44,70 @@ public class LeaveAccrualLine { @JsonProperty("numberOfUnits") private Double numberOfUnits; /** - * Xero identifier for the Leave type - * - * @param leaveTypeID UUID - * @return LeaveAccrualLine - */ + * Xero identifier for the Leave type + * @param leaveTypeID UUID + * @return LeaveAccrualLine + **/ public LeaveAccrualLine leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero identifier for the Leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for the Leave type") - /** + /** * Xero identifier for the Leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero identifier for the Leave type - * - * @param leaveTypeID UUID - */ + /** + * Xero identifier for the Leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * Leave accrual number of units - * - * @param numberOfUnits Double - * @return LeaveAccrualLine - */ + * Leave accrual number of units + * @param numberOfUnits Double + * @return LeaveAccrualLine + **/ public LeaveAccrualLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Leave accrual number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Leave accrual number of units") - /** + /** * Leave accrual number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Leave accrual number of units - * - * @param numberOfUnits Double - */ + /** + * Leave accrual number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } LeaveAccrualLine leaveAccrualLine = (LeaveAccrualLine) o; - return Objects.equals(this.leaveTypeID, leaveAccrualLine.leaveTypeID) - && Objects.equals(this.numberOfUnits, leaveAccrualLine.numberOfUnits); + return Objects.equals(this.leaveTypeID, leaveAccrualLine.leaveTypeID) && + Objects.equals(this.numberOfUnits, leaveAccrualLine.numberOfUnits); } @Override @@ -114,6 +126,7 @@ public int hashCode() { return Objects.hash(leaveTypeID, numberOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -125,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -133,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/LeaveEarningsLine.java b/src/main/java/com/xero/models/payrolluk/LeaveEarningsLine.java index b12070def..d59564c88 100644 --- a/src/main/java/com/xero/models/payrolluk/LeaveEarningsLine.java +++ b/src/main/java/com/xero/models/payrolluk/LeaveEarningsLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveEarningsLine + */ -/** LeaveEarningsLine */ public class LeaveEarningsLine { StringUtil util = new StringUtil(); @@ -39,219 +56,198 @@ public class LeaveEarningsLine { @JsonProperty("isLinkedToTimesheet") private Boolean isLinkedToTimesheet; /** - * Xero identifier for payroll leave earnings rate - * - * @param earningsRateID UUID - * @return LeaveEarningsLine - */ + * Xero identifier for payroll leave earnings rate + * @param earningsRateID UUID + * @return LeaveEarningsLine + **/ public LeaveEarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier for payroll leave earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll leave earnings rate") - /** + /** * Xero identifier for payroll leave earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier for payroll leave earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero identifier for payroll leave earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - * @return LeaveEarningsLine - */ + * Rate per unit for leave earnings line + * @param ratePerUnit Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "Rate per unit for leave earnings line") - /** + /** * Rate per unit for leave earnings line - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit for leave earnings line - * - * @param ratePerUnit Double - */ + /** + * Rate per unit for leave earnings line + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Leave earnings number of units - * - * @param numberOfUnits Double - * @return LeaveEarningsLine - */ + * Leave earnings number of units + * @param numberOfUnits Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Leave earnings number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Leave earnings number of units") - /** + /** * Leave earnings number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Leave earnings number of units - * - * @param numberOfUnits Double - */ + /** + * Leave earnings number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - * @return LeaveEarningsLine - */ + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount - */ - @ApiModelProperty( - value = "Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") - /** + **/ + @ApiModelProperty(value = "Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") + /** * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - */ + /** + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The amount of the earnings line. - * - * @param amount Double - * @return LeaveEarningsLine - */ + * The amount of the earnings line. + * @param amount Double + * @return LeaveEarningsLine + **/ public LeaveEarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the earnings line. - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the earnings line.") - /** + /** * The amount of the earnings line. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the earnings line. - * - * @param amount Double - */ + /** + * The amount of the earnings line. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - * @return LeaveEarningsLine - */ + * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + * @return LeaveEarningsLine + **/ public LeaveEarningsLine isLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; return this; } - /** + /** * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet - */ - @ApiModelProperty( - value = - "Identifies if the leave earnings is taken from the timesheet. False for leave earnings" - + " line") - /** + **/ + @ApiModelProperty(value = "Identifies if the leave earnings is taken from the timesheet. False for leave earnings line") + /** * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet Boolean - */ + **/ public Boolean getIsLinkedToTimesheet() { return isLinkedToTimesheet; } - /** - * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - */ + /** + * Identifies if the leave earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + **/ + public void setIsLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -261,20 +257,20 @@ public boolean equals(java.lang.Object o) { return false; } LeaveEarningsLine leaveEarningsLine = (LeaveEarningsLine) o; - return Objects.equals(this.earningsRateID, leaveEarningsLine.earningsRateID) - && Objects.equals(this.ratePerUnit, leaveEarningsLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, leaveEarningsLine.numberOfUnits) - && Objects.equals(this.fixedAmount, leaveEarningsLine.fixedAmount) - && Objects.equals(this.amount, leaveEarningsLine.amount) - && Objects.equals(this.isLinkedToTimesheet, leaveEarningsLine.isLinkedToTimesheet); + return Objects.equals(this.earningsRateID, leaveEarningsLine.earningsRateID) && + Objects.equals(this.ratePerUnit, leaveEarningsLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, leaveEarningsLine.numberOfUnits) && + Objects.equals(this.fixedAmount, leaveEarningsLine.fixedAmount) && + Objects.equals(this.amount, leaveEarningsLine.amount) && + Objects.equals(this.isLinkedToTimesheet, leaveEarningsLine.isLinkedToTimesheet); } @Override public int hashCode() { - return Objects.hash( - earningsRateID, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet); + return Objects.hash(earningsRateID, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -284,15 +280,14 @@ public String toString() { sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" isLinkedToTimesheet: ") - .append(toIndentedString(isLinkedToTimesheet)) - .append("\n"); + sb.append(" isLinkedToTimesheet: ").append(toIndentedString(isLinkedToTimesheet)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -300,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/LeavePeriod.java b/src/main/java/com/xero/models/payrolluk/LeavePeriod.java index a7067c388..a0da8498b 100644 --- a/src/main/java/com/xero/models/payrolluk/LeavePeriod.java +++ b/src/main/java/com/xero/models/payrolluk/LeavePeriod.java @@ -9,17 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeavePeriod + */ -/** LeavePeriod */ public class LeavePeriod { StringUtil util = new StringUtil(); @@ -31,12 +46,18 @@ public class LeavePeriod { @JsonProperty("numberOfUnits") private Double numberOfUnits; - /** Period Status */ + /** + * Period Status + */ public enum PeriodStatusEnum { - /** APPROVED */ + /** + * APPROVED + */ APPROVED("Approved"), - - /** COMPLETED */ + + /** + * COMPLETED + */ COMPLETED("Completed"); private String value; @@ -45,31 +66,25 @@ public enum PeriodStatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PeriodStatusEnum fromValue(String value) { for (PeriodStatusEnum b : PeriodStatusEnum.values()) { @@ -81,148 +96,138 @@ public static PeriodStatusEnum fromValue(String value) { } } + @JsonProperty("periodStatus") private PeriodStatusEnum periodStatus; /** - * The Pay Period Start Date (YYYY-MM-DD) - * - * @param periodStartDate LocalDate - * @return LeavePeriod - */ + * The Pay Period Start Date (YYYY-MM-DD) + * @param periodStartDate LocalDate + * @return LeavePeriod + **/ public LeavePeriod periodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; return this; } - /** + /** * The Pay Period Start Date (YYYY-MM-DD) - * * @return periodStartDate - */ + **/ @ApiModelProperty(value = "The Pay Period Start Date (YYYY-MM-DD)") - /** + /** * The Pay Period Start Date (YYYY-MM-DD) - * * @return periodStartDate LocalDate - */ + **/ public LocalDate getPeriodStartDate() { return periodStartDate; } - /** - * The Pay Period Start Date (YYYY-MM-DD) - * - * @param periodStartDate LocalDate - */ + /** + * The Pay Period Start Date (YYYY-MM-DD) + * @param periodStartDate LocalDate + **/ + public void setPeriodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; } /** - * The Pay Period End Date (YYYY-MM-DD) - * - * @param periodEndDate LocalDate - * @return LeavePeriod - */ + * The Pay Period End Date (YYYY-MM-DD) + * @param periodEndDate LocalDate + * @return LeavePeriod + **/ public LeavePeriod periodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; return this; } - /** + /** * The Pay Period End Date (YYYY-MM-DD) - * * @return periodEndDate - */ + **/ @ApiModelProperty(value = "The Pay Period End Date (YYYY-MM-DD)") - /** + /** * The Pay Period End Date (YYYY-MM-DD) - * * @return periodEndDate LocalDate - */ + **/ public LocalDate getPeriodEndDate() { return periodEndDate; } - /** - * The Pay Period End Date (YYYY-MM-DD) - * - * @param periodEndDate LocalDate - */ + /** + * The Pay Period End Date (YYYY-MM-DD) + * @param periodEndDate LocalDate + **/ + public void setPeriodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; } /** - * The Number of Units for the leave - * - * @param numberOfUnits Double - * @return LeavePeriod - */ + * The Number of Units for the leave + * @param numberOfUnits Double + * @return LeavePeriod + **/ public LeavePeriod numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The Number of Units for the leave - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "The Number of Units for the leave") - /** + /** * The Number of Units for the leave - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The Number of Units for the leave - * - * @param numberOfUnits Double - */ + /** + * The Number of Units for the leave + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Period Status - * - * @param periodStatus PeriodStatusEnum - * @return LeavePeriod - */ + * Period Status + * @param periodStatus PeriodStatusEnum + * @return LeavePeriod + **/ public LeavePeriod periodStatus(PeriodStatusEnum periodStatus) { this.periodStatus = periodStatus; return this; } - /** + /** * Period Status - * * @return periodStatus - */ + **/ @ApiModelProperty(value = "Period Status") - /** + /** * Period Status - * * @return periodStatus PeriodStatusEnum - */ + **/ public PeriodStatusEnum getPeriodStatus() { return periodStatus; } - /** - * Period Status - * - * @param periodStatus PeriodStatusEnum - */ + /** + * Period Status + * @param periodStatus PeriodStatusEnum + **/ + public void setPeriodStatus(PeriodStatusEnum periodStatus) { this.periodStatus = periodStatus; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -232,10 +237,10 @@ public boolean equals(java.lang.Object o) { return false; } LeavePeriod leavePeriod = (LeavePeriod) o; - return Objects.equals(this.periodStartDate, leavePeriod.periodStartDate) - && Objects.equals(this.periodEndDate, leavePeriod.periodEndDate) - && Objects.equals(this.numberOfUnits, leavePeriod.numberOfUnits) - && Objects.equals(this.periodStatus, leavePeriod.periodStatus); + return Objects.equals(this.periodStartDate, leavePeriod.periodStartDate) && + Objects.equals(this.periodEndDate, leavePeriod.periodEndDate) && + Objects.equals(this.numberOfUnits, leavePeriod.numberOfUnits) && + Objects.equals(this.periodStatus, leavePeriod.periodStatus); } @Override @@ -243,6 +248,7 @@ public int hashCode() { return Objects.hash(periodStartDate, periodEndDate, numberOfUnits, periodStatus); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,7 +262,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -264,4 +271,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/LeavePeriods.java b/src/main/java/com/xero/models/payrolluk/LeavePeriods.java index e8f682e27..06144684e 100644 --- a/src/main/java/com/xero/models/payrolluk/LeavePeriods.java +++ b/src/main/java/com/xero/models/payrolluk/LeavePeriods.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.LeavePeriod; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeavePeriods + */ -/** LeavePeriods */ public class LeavePeriods { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class LeavePeriods { @JsonProperty("periods") private List periods = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return LeavePeriods - */ + * pagination + * @param pagination Pagination + * @return LeavePeriods + **/ public LeavePeriods pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return LeavePeriods - */ + * problem + * @param problem Problem + * @return LeavePeriods + **/ public LeavePeriods problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * periods - * - * @param periods List<LeavePeriod> - * @return LeavePeriods - */ + * periods + * @param periods List<LeavePeriod> + * @return LeavePeriods + **/ public LeavePeriods periods(List periods) { this.periods = periods; return this; @@ -113,10 +126,9 @@ public LeavePeriods periods(List periods) { /** * periods - * - * @param periodsItem LeavePeriod + * @param periodsItem LeavePeriod * @return LeavePeriods - */ + **/ public LeavePeriods addPeriodsItem(LeavePeriod periodsItem) { if (this.periods == null) { this.periods = new ArrayList(); @@ -125,30 +137,29 @@ public LeavePeriods addPeriodsItem(LeavePeriod periodsItem) { return this; } - /** + /** * Get periods - * * @return periods - */ + **/ @ApiModelProperty(value = "") - /** + /** * periods - * * @return periods List - */ + **/ public List getPeriods() { return periods; } - /** - * periods - * - * @param periods List<LeavePeriod> - */ + /** + * periods + * @param periods List<LeavePeriod> + **/ + public void setPeriods(List periods) { this.periods = periods; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } LeavePeriods leavePeriods = (LeavePeriods) o; - return Objects.equals(this.pagination, leavePeriods.pagination) - && Objects.equals(this.problem, leavePeriods.problem) - && Objects.equals(this.periods, leavePeriods.periods); + return Objects.equals(this.pagination, leavePeriods.pagination) && + Objects.equals(this.problem, leavePeriods.problem) && + Objects.equals(this.periods, leavePeriods.periods); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, periods); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/LeaveType.java b/src/main/java/com/xero/models/payrolluk/LeaveType.java index 00448639d..946d40a09 100644 --- a/src/main/java/com/xero/models/payrolluk/LeaveType.java +++ b/src/main/java/com/xero/models/payrolluk/LeaveType.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveType + */ -/** LeaveType */ public class LeaveType { StringUtil util = new StringUtil(); @@ -46,289 +63,262 @@ public class LeaveType { @JsonProperty("isStatutoryLeave") private Boolean isStatutoryLeave; /** - * Xero unique identifier for the leave - * - * @param leaveID UUID - * @return LeaveType - */ + * Xero unique identifier for the leave + * @param leaveID UUID + * @return LeaveType + **/ public LeaveType leaveID(UUID leaveID) { this.leaveID = leaveID; return this; } - /** + /** * Xero unique identifier for the leave - * * @return leaveID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the leave") - /** + /** * Xero unique identifier for the leave - * * @return leaveID UUID - */ + **/ public UUID getLeaveID() { return leaveID; } - /** - * Xero unique identifier for the leave - * - * @param leaveID UUID - */ + /** + * Xero unique identifier for the leave + * @param leaveID UUID + **/ + public void setLeaveID(UUID leaveID) { this.leaveID = leaveID; } /** - * Xero unique identifier for the leave type - * - * @param leaveTypeID UUID - * @return LeaveType - */ + * Xero unique identifier for the leave type + * @param leaveTypeID UUID + * @return LeaveType + **/ public LeaveType leaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; return this; } - /** + /** * Xero unique identifier for the leave type - * * @return leaveTypeID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the leave type") - /** + /** * Xero unique identifier for the leave type - * * @return leaveTypeID UUID - */ + **/ public UUID getLeaveTypeID() { return leaveTypeID; } - /** - * Xero unique identifier for the leave type - * - * @param leaveTypeID UUID - */ + /** + * Xero unique identifier for the leave type + * @param leaveTypeID UUID + **/ + public void setLeaveTypeID(UUID leaveTypeID) { this.leaveTypeID = leaveTypeID; } /** - * Name of the leave type - * - * @param name String - * @return LeaveType - */ + * Name of the leave type + * @param name String + * @return LeaveType + **/ public LeaveType name(String name) { this.name = name; return this; } - /** + /** * Name of the leave type - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the leave type") - /** + /** * Name of the leave type - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the leave type - * - * @param name String - */ + /** + * Name of the leave type + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Indicate that an employee will be paid when taking this type of leave - * - * @param isPaidLeave Boolean - * @return LeaveType - */ + * Indicate that an employee will be paid when taking this type of leave + * @param isPaidLeave Boolean + * @return LeaveType + **/ public LeaveType isPaidLeave(Boolean isPaidLeave) { this.isPaidLeave = isPaidLeave; return this; } - /** + /** * Indicate that an employee will be paid when taking this type of leave - * * @return isPaidLeave - */ - @ApiModelProperty( - required = true, - value = "Indicate that an employee will be paid when taking this type of leave") - /** + **/ + @ApiModelProperty(required = true, value = "Indicate that an employee will be paid when taking this type of leave") + /** * Indicate that an employee will be paid when taking this type of leave - * * @return isPaidLeave Boolean - */ + **/ public Boolean getIsPaidLeave() { return isPaidLeave; } - /** - * Indicate that an employee will be paid when taking this type of leave - * - * @param isPaidLeave Boolean - */ + /** + * Indicate that an employee will be paid when taking this type of leave + * @param isPaidLeave Boolean + **/ + public void setIsPaidLeave(Boolean isPaidLeave) { this.isPaidLeave = isPaidLeave; } /** - * Indicate that a balance for this leave type to be shown on the employee’s payslips - * - * @param showOnPayslip Boolean - * @return LeaveType - */ + * Indicate that a balance for this leave type to be shown on the employee’s payslips + * @param showOnPayslip Boolean + * @return LeaveType + **/ public LeaveType showOnPayslip(Boolean showOnPayslip) { this.showOnPayslip = showOnPayslip; return this; } - /** + /** * Indicate that a balance for this leave type to be shown on the employee’s payslips - * * @return showOnPayslip - */ - @ApiModelProperty( - required = true, - value = "Indicate that a balance for this leave type to be shown on the employee’s payslips") - /** + **/ + @ApiModelProperty(required = true, value = "Indicate that a balance for this leave type to be shown on the employee’s payslips") + /** * Indicate that a balance for this leave type to be shown on the employee’s payslips - * * @return showOnPayslip Boolean - */ + **/ public Boolean getShowOnPayslip() { return showOnPayslip; } - /** - * Indicate that a balance for this leave type to be shown on the employee’s payslips - * - * @param showOnPayslip Boolean - */ + /** + * Indicate that a balance for this leave type to be shown on the employee’s payslips + * @param showOnPayslip Boolean + **/ + public void setShowOnPayslip(Boolean showOnPayslip) { this.showOnPayslip = showOnPayslip; } /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - * @return LeaveType - */ + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + * @return LeaveType + **/ public LeaveType updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of last update to the leave type note") - /** + /** * UTC timestamp of last update to the leave type note - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of last update to the leave type note - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of last update to the leave type note + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } /** - * Shows whether the leave type is active or not - * - * @param isActive Boolean - * @return LeaveType - */ + * Shows whether the leave type is active or not + * @param isActive Boolean + * @return LeaveType + **/ public LeaveType isActive(Boolean isActive) { this.isActive = isActive; return this; } - /** + /** * Shows whether the leave type is active or not - * * @return isActive - */ + **/ @ApiModelProperty(value = "Shows whether the leave type is active or not") - /** + /** * Shows whether the leave type is active or not - * * @return isActive Boolean - */ + **/ public Boolean getIsActive() { return isActive; } - /** - * Shows whether the leave type is active or not - * - * @param isActive Boolean - */ + /** + * Shows whether the leave type is active or not + * @param isActive Boolean + **/ + public void setIsActive(Boolean isActive) { this.isActive = isActive; } /** - * Shows whether the leave type is a statutory leave type or not - * - * @param isStatutoryLeave Boolean - * @return LeaveType - */ + * Shows whether the leave type is a statutory leave type or not + * @param isStatutoryLeave Boolean + * @return LeaveType + **/ public LeaveType isStatutoryLeave(Boolean isStatutoryLeave) { this.isStatutoryLeave = isStatutoryLeave; return this; } - /** + /** * Shows whether the leave type is a statutory leave type or not - * * @return isStatutoryLeave - */ + **/ @ApiModelProperty(value = "Shows whether the leave type is a statutory leave type or not") - /** + /** * Shows whether the leave type is a statutory leave type or not - * * @return isStatutoryLeave Boolean - */ + **/ public Boolean getIsStatutoryLeave() { return isStatutoryLeave; } - /** - * Shows whether the leave type is a statutory leave type or not - * - * @param isStatutoryLeave Boolean - */ + /** + * Shows whether the leave type is a statutory leave type or not + * @param isStatutoryLeave Boolean + **/ + public void setIsStatutoryLeave(Boolean isStatutoryLeave) { this.isStatutoryLeave = isStatutoryLeave; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -338,29 +328,22 @@ public boolean equals(java.lang.Object o) { return false; } LeaveType leaveType = (LeaveType) o; - return Objects.equals(this.leaveID, leaveType.leaveID) - && Objects.equals(this.leaveTypeID, leaveType.leaveTypeID) - && Objects.equals(this.name, leaveType.name) - && Objects.equals(this.isPaidLeave, leaveType.isPaidLeave) - && Objects.equals(this.showOnPayslip, leaveType.showOnPayslip) - && Objects.equals(this.updatedDateUTC, leaveType.updatedDateUTC) - && Objects.equals(this.isActive, leaveType.isActive) - && Objects.equals(this.isStatutoryLeave, leaveType.isStatutoryLeave); + return Objects.equals(this.leaveID, leaveType.leaveID) && + Objects.equals(this.leaveTypeID, leaveType.leaveTypeID) && + Objects.equals(this.name, leaveType.name) && + Objects.equals(this.isPaidLeave, leaveType.isPaidLeave) && + Objects.equals(this.showOnPayslip, leaveType.showOnPayslip) && + Objects.equals(this.updatedDateUTC, leaveType.updatedDateUTC) && + Objects.equals(this.isActive, leaveType.isActive) && + Objects.equals(this.isStatutoryLeave, leaveType.isStatutoryLeave); } @Override public int hashCode() { - return Objects.hash( - leaveID, - leaveTypeID, - name, - isPaidLeave, - showOnPayslip, - updatedDateUTC, - isActive, - isStatutoryLeave); + return Objects.hash(leaveID, leaveTypeID, name, isPaidLeave, showOnPayslip, updatedDateUTC, isActive, isStatutoryLeave); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -378,7 +361,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -386,4 +370,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/LeaveTypeObject.java b/src/main/java/com/xero/models/payrolluk/LeaveTypeObject.java index 8a7f804ff..513b0614c 100644 --- a/src/main/java/com/xero/models/payrolluk/LeaveTypeObject.java +++ b/src/main/java/com/xero/models/payrolluk/LeaveTypeObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.LeaveType; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveTypeObject + */ -/** LeaveTypeObject */ public class LeaveTypeObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class LeaveTypeObject { @JsonProperty("leaveType") private LeaveType leaveType; /** - * pagination - * - * @param pagination Pagination - * @return LeaveTypeObject - */ + * pagination + * @param pagination Pagination + * @return LeaveTypeObject + **/ public LeaveTypeObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return LeaveTypeObject - */ + * problem + * @param problem Problem + * @return LeaveTypeObject + **/ public LeaveTypeObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveType - * - * @param leaveType LeaveType - * @return LeaveTypeObject - */ + * leaveType + * @param leaveType LeaveType + * @return LeaveTypeObject + **/ public LeaveTypeObject leaveType(LeaveType leaveType) { this.leaveType = leaveType; return this; } - /** + /** * Get leaveType - * * @return leaveType - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveType - * * @return leaveType LeaveType - */ + **/ public LeaveType getLeaveType() { return leaveType; } - /** - * leaveType - * - * @param leaveType LeaveType - */ + /** + * leaveType + * @param leaveType LeaveType + **/ + public void setLeaveType(LeaveType leaveType) { this.leaveType = leaveType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } LeaveTypeObject leaveTypeObject = (LeaveTypeObject) o; - return Objects.equals(this.pagination, leaveTypeObject.pagination) - && Objects.equals(this.problem, leaveTypeObject.problem) - && Objects.equals(this.leaveType, leaveTypeObject.leaveType); + return Objects.equals(this.pagination, leaveTypeObject.pagination) && + Objects.equals(this.problem, leaveTypeObject.problem) && + Objects.equals(this.leaveType, leaveTypeObject.leaveType); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/LeaveTypes.java b/src/main/java/com/xero/models/payrolluk/LeaveTypes.java index f4868e5d8..9a44ea6e2 100644 --- a/src/main/java/com/xero/models/payrolluk/LeaveTypes.java +++ b/src/main/java/com/xero/models/payrolluk/LeaveTypes.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.LeaveType; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * LeaveTypes + */ -/** LeaveTypes */ public class LeaveTypes { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class LeaveTypes { @JsonProperty("leaveTypes") private List leaveTypes = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return LeaveTypes - */ + * pagination + * @param pagination Pagination + * @return LeaveTypes + **/ public LeaveTypes pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return LeaveTypes - */ + * problem + * @param problem Problem + * @return LeaveTypes + **/ public LeaveTypes problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * leaveTypes - * - * @param leaveTypes List<LeaveType> - * @return LeaveTypes - */ + * leaveTypes + * @param leaveTypes List<LeaveType> + * @return LeaveTypes + **/ public LeaveTypes leaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; return this; @@ -113,10 +126,9 @@ public LeaveTypes leaveTypes(List leaveTypes) { /** * leaveTypes - * - * @param leaveTypesItem LeaveType + * @param leaveTypesItem LeaveType * @return LeaveTypes - */ + **/ public LeaveTypes addLeaveTypesItem(LeaveType leaveTypesItem) { if (this.leaveTypes == null) { this.leaveTypes = new ArrayList(); @@ -125,30 +137,29 @@ public LeaveTypes addLeaveTypesItem(LeaveType leaveTypesItem) { return this; } - /** + /** * Get leaveTypes - * * @return leaveTypes - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveTypes - * * @return leaveTypes List - */ + **/ public List getLeaveTypes() { return leaveTypes; } - /** - * leaveTypes - * - * @param leaveTypes List<LeaveType> - */ + /** + * leaveTypes + * @param leaveTypes List<LeaveType> + **/ + public void setLeaveTypes(List leaveTypes) { this.leaveTypes = leaveTypes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } LeaveTypes leaveTypes = (LeaveTypes) o; - return Objects.equals(this.pagination, leaveTypes.pagination) - && Objects.equals(this.problem, leaveTypes.problem) - && Objects.equals(this.leaveTypes, leaveTypes.leaveTypes); + return Objects.equals(this.pagination, leaveTypes.pagination) && + Objects.equals(this.problem, leaveTypes.problem) && + Objects.equals(this.leaveTypes, leaveTypes.leaveTypes); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, leaveTypes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/NICategory.java b/src/main/java/com/xero/models/payrolluk/NICategory.java index 918cbc653..dadc46bd9 100644 --- a/src/main/java/com/xero/models/payrolluk/NICategory.java +++ b/src/main/java/com/xero/models/payrolluk/NICategory.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.NICategoryLetter; +import com.xero.models.payrolluk.NICategoryOneOf; +import com.xero.models.payrolluk.NICategoryOneOf1; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import java.util.Objects; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * NICategory + */ -/** NICategory */ public class NICategory { StringUtil util = new StringUtil(); @@ -37,184 +57,166 @@ public class NICategory { @JsonProperty("workplacePostcode") private String workplacePostcode; /** - * The start date of the NI category (YYYY-MM-DD) - * - * @param startDate LocalDate - * @return NICategory - */ + * 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)") - /** + **/ + @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 - */ + /** + * 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 - */ + * 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 - */ + /** + * niCategory + * @param niCategory NICategoryLetter + **/ + public void setNiCategory(NICategoryLetter niCategory) { this.niCategory = niCategory; } /** - * Xero unique identifier for the NI category - * - * @param niCategoryID BigDecimal - * @return 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 - */ + /** + * 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 - */ + * 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)") - /** + **/ + @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 - */ + /** + * 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 - */ + * 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 - */ + /** + * 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) { @@ -224,19 +226,19 @@ public boolean equals(java.lang.Object o) { 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); + 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); + return Objects.hash(startDate, niCategory, niCategoryID, dateFirstEmployedAsCivilian, workplacePostcode); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -244,16 +246,15 @@ public String toString() { 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(" 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). + * 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) { @@ -261,4 +262,6 @@ private String toIndentedString(java.lang.Object o) { } 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 index 7b7e213e2..4305433ed 100644 --- a/src/main/java/com/xero/models/payrolluk/NICategoryLetter.java +++ b/src/main/java/com/xero/models/payrolluk/NICategoryLetter.java @@ -9,64 +9,110 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; - +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The employee's NI Category letter. */ +/** + * The employee's NI Category letter. + */ public enum NICategoryLetter { - - /** A */ + + /** + * A + */ A("A"), - - /** B */ + + /** + * B + */ B("B"), - - /** C */ + + /** + * C + */ C("C"), - - /** F */ + + /** + * F + */ F("F"), - - /** H */ + + /** + * H + */ H("H"), - - /** I */ + + /** + * I + */ I("I"), - - /** J */ + + /** + * J + */ J("J"), - - /** L */ + + /** + * L + */ L("L"), - - /** M */ + + /** + * M + */ M("M"), - - /** S */ + + /** + * S + */ S("S"), - - /** V */ + + /** + * V + */ V("V"), - - /** X */ + + /** + * X + */ X("X"), - - /** Z */ + + /** + * Z + */ Z("Z"), - - /** D */ + + /** + * D + */ D("D"), - - /** E */ + + /** + * E + */ E("E"), - - /** K */ + + /** + * K + */ K("K"), - - /** N */ + + /** + * N + */ N("N"); private String value; @@ -75,26 +121,24 @@ public enum NICategoryLetter { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static NICategoryLetter fromValue(String value) { @@ -106,3 +150,4 @@ public static NICategoryLetter fromValue(String value) { 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 index 699207a98..967c77c31 100644 --- a/src/main/java/com/xero/models/payrolluk/NICategoryOneOf.java +++ b/src/main/java/com/xero/models/payrolluk/NICategoryOneOf.java @@ -9,42 +9,75 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * NICategoryOneOf + */ -/** NICategoryOneOf */ public class NICategoryOneOf { StringUtil util = new StringUtil(); - /** Gets or Sets niCategory */ + /** + * Gets or Sets niCategory + */ public enum NiCategoryEnum { - /** F */ + /** + * F + */ F("F"), - - /** I */ + + /** + * I + */ I("I"), - - /** L */ + + /** + * L + */ L("L"), - - /** S */ + + /** + * S + */ S("S"), - - /** N */ + + /** + * N + */ N("N"), - - /** E */ + + /** + * E + */ E("E"), - - /** D */ + + /** + * D + */ D("D"), - - /** K */ + + /** + * K + */ K("K"); private String value; @@ -53,31 +86,25 @@ public enum NiCategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static NiCategoryEnum fromValue(String value) { for (NiCategoryEnum b : NiCategoryEnum.values()) { @@ -89,43 +116,42 @@ public static NiCategoryEnum fromValue(String value) { } } + @JsonProperty("niCategory") private NiCategoryEnum niCategory; /** - * niCategory - * - * @param niCategory NiCategoryEnum - * @return NICategoryOneOf - */ + * 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 - */ + /** + * niCategory + * @param niCategory NiCategoryEnum + **/ + public void setNiCategory(NiCategoryEnum niCategory) { this.niCategory = niCategory; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -143,6 +169,7 @@ public int hashCode() { return Objects.hash(niCategory); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -153,7 +180,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -161,4 +189,6 @@ private String toIndentedString(java.lang.Object o) { } 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 index 2336f6cfb..e70d0e59d 100644 --- a/src/main/java/com/xero/models/payrolluk/NICategoryOneOf1.java +++ b/src/main/java/com/xero/models/payrolluk/NICategoryOneOf1.java @@ -9,21 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * NICategoryOneOf1 + */ -/** NICategoryOneOf1 */ public class NICategoryOneOf1 { StringUtil util = new StringUtil(); - /** Gets or Sets niCategory */ + /** + * Gets or Sets niCategory + */ public enum NiCategoryEnum { - /** V */ + /** + * V + */ V("V"); private String value; @@ -32,31 +51,25 @@ public enum NiCategoryEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static NiCategoryEnum fromValue(String value) { for (NiCategoryEnum b : NiCategoryEnum.values()) { @@ -68,43 +81,42 @@ public static NiCategoryEnum fromValue(String value) { } } + @JsonProperty("niCategory") private NiCategoryEnum niCategory; /** - * niCategory - * - * @param niCategory NiCategoryEnum - * @return NICategoryOneOf1 - */ + * 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 - */ + /** + * niCategory + * @param niCategory NiCategoryEnum + **/ + public void setNiCategory(NiCategoryEnum niCategory) { this.niCategory = niCategory; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -122,6 +134,7 @@ public int hashCode() { return Objects.hash(niCategory); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,7 +145,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -140,4 +154,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Pagination.java b/src/main/java/com/xero/models/payrolluk/Pagination.java index e80daf4a8..ed5782b49 100644 --- a/src/main/java/com/xero/models/payrolluk/Pagination.java +++ b/src/main/java/com/xero/models/payrolluk/Pagination.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Pagination + */ -/** Pagination */ public class Pagination { StringUtil util = new StringUtil(); @@ -32,145 +49,134 @@ public class Pagination { @JsonProperty("itemCount") private Integer itemCount; /** - * page - * - * @param page Integer - * @return Pagination - */ + * page + * @param page Integer + * @return Pagination + **/ public Pagination page(Integer page) { this.page = page; return this; } - /** + /** * Get page - * * @return page - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * page - * * @return page Integer - */ + **/ public Integer getPage() { return page; } - /** - * page - * - * @param page Integer - */ + /** + * page + * @param page Integer + **/ + public void setPage(Integer page) { this.page = page; } /** - * pageSize - * - * @param pageSize Integer - * @return Pagination - */ + * pageSize + * @param pageSize Integer + * @return Pagination + **/ public Pagination pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } - /** + /** * Get pageSize - * * @return pageSize - */ + **/ @ApiModelProperty(example = "10", value = "") - /** + /** * pageSize - * * @return pageSize Integer - */ + **/ public Integer getPageSize() { return pageSize; } - /** - * pageSize - * - * @param pageSize Integer - */ + /** + * pageSize + * @param pageSize Integer + **/ + public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** - * pageCount - * - * @param pageCount Integer - * @return Pagination - */ + * pageCount + * @param pageCount Integer + * @return Pagination + **/ public Pagination pageCount(Integer pageCount) { this.pageCount = pageCount; return this; } - /** + /** * Get pageCount - * * @return pageCount - */ + **/ @ApiModelProperty(example = "1", value = "") - /** + /** * pageCount - * * @return pageCount Integer - */ + **/ public Integer getPageCount() { return pageCount; } - /** - * pageCount - * - * @param pageCount Integer - */ + /** + * pageCount + * @param pageCount Integer + **/ + public void setPageCount(Integer pageCount) { this.pageCount = pageCount; } /** - * itemCount - * - * @param itemCount Integer - * @return Pagination - */ + * itemCount + * @param itemCount Integer + * @return Pagination + **/ public Pagination itemCount(Integer itemCount) { this.itemCount = itemCount; return this; } - /** + /** * Get itemCount - * * @return itemCount - */ + **/ @ApiModelProperty(example = "2", value = "") - /** + /** * itemCount - * * @return itemCount Integer - */ + **/ public Integer getItemCount() { return itemCount; } - /** - * itemCount - * - * @param itemCount Integer - */ + /** + * itemCount + * @param itemCount Integer + **/ + public void setItemCount(Integer itemCount) { this.itemCount = itemCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } Pagination pagination = (Pagination) o; - return Objects.equals(this.page, pagination.page) - && Objects.equals(this.pageSize, pagination.pageSize) - && Objects.equals(this.pageCount, pagination.pageCount) - && Objects.equals(this.itemCount, pagination.itemCount); + return Objects.equals(this.page, pagination.page) && + Objects.equals(this.pageSize, pagination.pageSize) && + Objects.equals(this.pageCount, pagination.pageCount) && + Objects.equals(this.itemCount, pagination.itemCount); } @Override @@ -191,6 +197,7 @@ public int hashCode() { return Objects.hash(page, pageSize, pageCount, itemCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -212,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PayRun.java b/src/main/java/com/xero/models/payrolluk/PayRun.java index bd4c0310c..b876bc850 100644 --- a/src/main/java/com/xero/models/payrolluk/PayRun.java +++ b/src/main/java/com/xero/models/payrolluk/PayRun.java @@ -9,20 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrolluk.Payslip; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRun + */ -/** PayRun */ public class PayRun { StringUtil util = new StringUtil(); @@ -46,12 +62,18 @@ public class PayRun { @JsonProperty("totalPay") private Double totalPay; - /** Pay run status */ + /** + * Pay run status + */ public enum PayRunStatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("Draft"), - - /** POSTED */ + + /** + * POSTED + */ POSTED("Posted"); private String value; @@ -60,31 +82,25 @@ public enum PayRunStatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PayRunStatusEnum fromValue(String value) { for (PayRunStatusEnum b : PayRunStatusEnum.values()) { @@ -96,17 +112,26 @@ public static PayRunStatusEnum fromValue(String value) { } } + @JsonProperty("payRunStatus") private PayRunStatusEnum payRunStatus; - /** Pay run type */ + /** + * Pay run type + */ public enum PayRunTypeEnum { - /** SCHEDULED */ + /** + * SCHEDULED + */ SCHEDULED("Scheduled"), - - /** UNSCHEDULED */ + + /** + * UNSCHEDULED + */ UNSCHEDULED("Unscheduled"), - - /** EARLIERYEARUPDATE */ + + /** + * EARLIERYEARUPDATE + */ EARLIERYEARUPDATE("EarlierYearUpdate"); private String value; @@ -115,31 +140,25 @@ public enum PayRunTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PayRunTypeEnum fromValue(String value) { for (PayRunTypeEnum b : PayRunTypeEnum.values()) { @@ -151,26 +170,41 @@ public static PayRunTypeEnum fromValue(String value) { } } + @JsonProperty("payRunType") private PayRunTypeEnum payRunType; - /** Calendar type of the pay run */ + /** + * Calendar type of the pay run + */ public enum CalendarTypeEnum { - /** WEEKLY */ + /** + * WEEKLY + */ WEEKLY("Weekly"), - - /** FORTNIGHTLY */ + + /** + * FORTNIGHTLY + */ FORTNIGHTLY("Fortnightly"), - - /** FOURWEEKLY */ + + /** + * FOURWEEKLY + */ FOURWEEKLY("FourWeekly"), - - /** MONTHLY */ + + /** + * MONTHLY + */ MONTHLY("Monthly"), - - /** ANNUAL */ + + /** + * ANNUAL + */ ANNUAL("Annual"), - - /** QUARTERLY */ + + /** + * QUARTERLY + */ QUARTERLY("Quarterly"); private String value; @@ -179,31 +213,25 @@ public enum CalendarTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CalendarTypeEnum fromValue(String value) { for (CalendarTypeEnum b : CalendarTypeEnum.values()) { @@ -215,6 +243,7 @@ public static CalendarTypeEnum fromValue(String value) { } } + @JsonProperty("calendarType") private CalendarTypeEnum calendarType; @@ -224,396 +253,362 @@ public static CalendarTypeEnum fromValue(String value) { @JsonProperty("paySlips") private List paySlips = new ArrayList(); /** - * Xero unique identifier for the pay run - * - * @param payRunID UUID - * @return PayRun - */ + * Xero unique identifier for the pay run + * @param payRunID UUID + * @return PayRun + **/ public PayRun payRunID(UUID payRunID) { this.payRunID = payRunID; return this; } - /** + /** * Xero unique identifier for the pay run - * * @return payRunID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the pay run") - /** + /** * Xero unique identifier for the pay run - * * @return payRunID UUID - */ + **/ public UUID getPayRunID() { return payRunID; } - /** - * Xero unique identifier for the pay run - * - * @param payRunID UUID - */ + /** + * Xero unique identifier for the pay run + * @param payRunID UUID + **/ + public void setPayRunID(UUID payRunID) { this.payRunID = payRunID; } /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - * @return PayRun - */ + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + * @return PayRun + **/ public PayRun payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar") - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * Period start date of the payroll calendar - * - * @param periodStartDate LocalDate - * @return PayRun - */ + * Period start date of the payroll calendar + * @param periodStartDate LocalDate + * @return PayRun + **/ public PayRun periodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; return this; } - /** + /** * Period start date of the payroll calendar - * * @return periodStartDate - */ + **/ @ApiModelProperty(value = "Period start date of the payroll calendar") - /** + /** * Period start date of the payroll calendar - * * @return periodStartDate LocalDate - */ + **/ public LocalDate getPeriodStartDate() { return periodStartDate; } - /** - * Period start date of the payroll calendar - * - * @param periodStartDate LocalDate - */ + /** + * Period start date of the payroll calendar + * @param periodStartDate LocalDate + **/ + public void setPeriodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; } /** - * Period end date of the payroll calendar - * - * @param periodEndDate LocalDate - * @return PayRun - */ + * Period end date of the payroll calendar + * @param periodEndDate LocalDate + * @return PayRun + **/ public PayRun periodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; return this; } - /** + /** * Period end date of the payroll calendar - * * @return periodEndDate - */ + **/ @ApiModelProperty(value = "Period end date of the payroll calendar") - /** + /** * Period end date of the payroll calendar - * * @return periodEndDate LocalDate - */ + **/ public LocalDate getPeriodEndDate() { return periodEndDate; } - /** - * Period end date of the payroll calendar - * - * @param periodEndDate LocalDate - */ + /** + * Period end date of the payroll calendar + * @param periodEndDate LocalDate + **/ + public void setPeriodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; } /** - * Payment date of the pay run - * - * @param paymentDate LocalDate - * @return PayRun - */ + * Payment date of the pay run + * @param paymentDate LocalDate + * @return PayRun + **/ public PayRun paymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; return this; } - /** + /** * Payment date of the pay run - * * @return paymentDate - */ + **/ @ApiModelProperty(value = "Payment date of the pay run") - /** + /** * Payment date of the pay run - * * @return paymentDate LocalDate - */ + **/ public LocalDate getPaymentDate() { return paymentDate; } - /** - * Payment date of the pay run - * - * @param paymentDate LocalDate - */ + /** + * Payment date of the pay run + * @param paymentDate LocalDate + **/ + public void setPaymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; } /** - * Total cost of the pay run - * - * @param totalCost Double - * @return PayRun - */ + * Total cost of the pay run + * @param totalCost Double + * @return PayRun + **/ public PayRun totalCost(Double totalCost) { this.totalCost = totalCost; return this; } - /** + /** * Total cost of the pay run - * * @return totalCost - */ + **/ @ApiModelProperty(value = "Total cost of the pay run") - /** + /** * Total cost of the pay run - * * @return totalCost Double - */ + **/ public Double getTotalCost() { return totalCost; } - /** - * Total cost of the pay run - * - * @param totalCost Double - */ + /** + * Total cost of the pay run + * @param totalCost Double + **/ + public void setTotalCost(Double totalCost) { this.totalCost = totalCost; } /** - * Total pay of the pay run - * - * @param totalPay Double - * @return PayRun - */ + * Total pay of the pay run + * @param totalPay Double + * @return PayRun + **/ public PayRun totalPay(Double totalPay) { this.totalPay = totalPay; return this; } - /** + /** * Total pay of the pay run - * * @return totalPay - */ + **/ @ApiModelProperty(value = "Total pay of the pay run") - /** + /** * Total pay of the pay run - * * @return totalPay Double - */ + **/ public Double getTotalPay() { return totalPay; } - /** - * Total pay of the pay run - * - * @param totalPay Double - */ + /** + * Total pay of the pay run + * @param totalPay Double + **/ + public void setTotalPay(Double totalPay) { this.totalPay = totalPay; } /** - * Pay run status - * - * @param payRunStatus PayRunStatusEnum - * @return PayRun - */ + * Pay run status + * @param payRunStatus PayRunStatusEnum + * @return PayRun + **/ public PayRun payRunStatus(PayRunStatusEnum payRunStatus) { this.payRunStatus = payRunStatus; return this; } - /** + /** * Pay run status - * * @return payRunStatus - */ + **/ @ApiModelProperty(value = "Pay run status") - /** + /** * Pay run status - * * @return payRunStatus PayRunStatusEnum - */ + **/ public PayRunStatusEnum getPayRunStatus() { return payRunStatus; } - /** - * Pay run status - * - * @param payRunStatus PayRunStatusEnum - */ + /** + * Pay run status + * @param payRunStatus PayRunStatusEnum + **/ + public void setPayRunStatus(PayRunStatusEnum payRunStatus) { this.payRunStatus = payRunStatus; } /** - * Pay run type - * - * @param payRunType PayRunTypeEnum - * @return PayRun - */ + * Pay run type + * @param payRunType PayRunTypeEnum + * @return PayRun + **/ public PayRun payRunType(PayRunTypeEnum payRunType) { this.payRunType = payRunType; return this; } - /** + /** * Pay run type - * * @return payRunType - */ + **/ @ApiModelProperty(value = "Pay run type") - /** + /** * Pay run type - * * @return payRunType PayRunTypeEnum - */ + **/ public PayRunTypeEnum getPayRunType() { return payRunType; } - /** - * Pay run type - * - * @param payRunType PayRunTypeEnum - */ + /** + * Pay run type + * @param payRunType PayRunTypeEnum + **/ + public void setPayRunType(PayRunTypeEnum payRunType) { this.payRunType = payRunType; } /** - * Calendar type of the pay run - * - * @param calendarType CalendarTypeEnum - * @return PayRun - */ + * Calendar type of the pay run + * @param calendarType CalendarTypeEnum + * @return PayRun + **/ public PayRun calendarType(CalendarTypeEnum calendarType) { this.calendarType = calendarType; return this; } - /** + /** * Calendar type of the pay run - * * @return calendarType - */ + **/ @ApiModelProperty(value = "Calendar type of the pay run") - /** + /** * Calendar type of the pay run - * * @return calendarType CalendarTypeEnum - */ + **/ public CalendarTypeEnum getCalendarType() { return calendarType; } - /** - * Calendar type of the pay run - * - * @param calendarType CalendarTypeEnum - */ + /** + * Calendar type of the pay run + * @param calendarType CalendarTypeEnum + **/ + public void setCalendarType(CalendarTypeEnum calendarType) { this.calendarType = calendarType; } /** - * Posted date time of the pay run - * - * @param postedDateTime LocalDate - * @return PayRun - */ + * Posted date time of the pay run + * @param postedDateTime LocalDate + * @return PayRun + **/ public PayRun postedDateTime(LocalDate postedDateTime) { this.postedDateTime = postedDateTime; return this; } - /** + /** * Posted date time of the pay run - * * @return postedDateTime - */ + **/ @ApiModelProperty(value = "Posted date time of the pay run") - /** + /** * Posted date time of the pay run - * * @return postedDateTime LocalDate - */ + **/ public LocalDate getPostedDateTime() { return postedDateTime; } - /** - * Posted date time of the pay run - * - * @param postedDateTime LocalDate - */ + /** + * Posted date time of the pay run + * @param postedDateTime LocalDate + **/ + public void setPostedDateTime(LocalDate postedDateTime) { this.postedDateTime = postedDateTime; } /** - * paySlips - * - * @param paySlips List<Payslip> - * @return PayRun - */ + * paySlips + * @param paySlips List<Payslip> + * @return PayRun + **/ public PayRun paySlips(List paySlips) { this.paySlips = paySlips; return this; @@ -621,10 +616,9 @@ public PayRun paySlips(List paySlips) { /** * paySlips - * - * @param paySlipsItem Payslip + * @param paySlipsItem Payslip * @return PayRun - */ + **/ public PayRun addPaySlipsItem(Payslip paySlipsItem) { if (this.paySlips == null) { this.paySlips = new ArrayList(); @@ -633,30 +627,29 @@ public PayRun addPaySlipsItem(Payslip paySlipsItem) { return this; } - /** + /** * Get paySlips - * * @return paySlips - */ + **/ @ApiModelProperty(value = "") - /** + /** * paySlips - * * @return paySlips List - */ + **/ public List getPaySlips() { return paySlips; } - /** - * paySlips - * - * @param paySlips List<Payslip> - */ + /** + * paySlips + * @param paySlips List<Payslip> + **/ + public void setPaySlips(List paySlips) { this.paySlips = paySlips; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -666,37 +659,26 @@ public boolean equals(java.lang.Object o) { return false; } PayRun payRun = (PayRun) o; - return Objects.equals(this.payRunID, payRun.payRunID) - && Objects.equals(this.payrollCalendarID, payRun.payrollCalendarID) - && Objects.equals(this.periodStartDate, payRun.periodStartDate) - && Objects.equals(this.periodEndDate, payRun.periodEndDate) - && Objects.equals(this.paymentDate, payRun.paymentDate) - && Objects.equals(this.totalCost, payRun.totalCost) - && Objects.equals(this.totalPay, payRun.totalPay) - && Objects.equals(this.payRunStatus, payRun.payRunStatus) - && Objects.equals(this.payRunType, payRun.payRunType) - && Objects.equals(this.calendarType, payRun.calendarType) - && Objects.equals(this.postedDateTime, payRun.postedDateTime) - && Objects.equals(this.paySlips, payRun.paySlips); + return Objects.equals(this.payRunID, payRun.payRunID) && + Objects.equals(this.payrollCalendarID, payRun.payrollCalendarID) && + Objects.equals(this.periodStartDate, payRun.periodStartDate) && + Objects.equals(this.periodEndDate, payRun.periodEndDate) && + Objects.equals(this.paymentDate, payRun.paymentDate) && + Objects.equals(this.totalCost, payRun.totalCost) && + Objects.equals(this.totalPay, payRun.totalPay) && + Objects.equals(this.payRunStatus, payRun.payRunStatus) && + Objects.equals(this.payRunType, payRun.payRunType) && + Objects.equals(this.calendarType, payRun.calendarType) && + Objects.equals(this.postedDateTime, payRun.postedDateTime) && + Objects.equals(this.paySlips, payRun.paySlips); } @Override public int hashCode() { - return Objects.hash( - payRunID, - payrollCalendarID, - periodStartDate, - periodEndDate, - paymentDate, - totalCost, - totalPay, - payRunStatus, - payRunType, - calendarType, - postedDateTime, - paySlips); + return Objects.hash(payRunID, payrollCalendarID, periodStartDate, periodEndDate, paymentDate, totalCost, totalPay, payRunStatus, payRunType, calendarType, postedDateTime, paySlips); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -718,7 +700,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -726,4 +709,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PayRunCalendar.java b/src/main/java/com/xero/models/payrolluk/PayRunCalendar.java index ad1830408..1e4391ee5 100644 --- a/src/main/java/com/xero/models/payrolluk/PayRunCalendar.java +++ b/src/main/java/com/xero/models/payrolluk/PayRunCalendar.java @@ -9,19 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunCalendar + */ -/** PayRunCalendar */ public class PayRunCalendar { StringUtil util = new StringUtil(); @@ -30,24 +45,38 @@ public class PayRunCalendar { @JsonProperty("name") private String name; - /** Type of the calendar */ + /** + * Type of the calendar + */ public enum CalendarTypeEnum { - /** WEEKLY */ + /** + * WEEKLY + */ WEEKLY("Weekly"), - - /** FORTNIGHTLY */ + + /** + * FORTNIGHTLY + */ FORTNIGHTLY("Fortnightly"), - - /** FOURWEEKLY */ + + /** + * FOURWEEKLY + */ FOURWEEKLY("FourWeekly"), - - /** MONTHLY */ + + /** + * MONTHLY + */ MONTHLY("Monthly"), - - /** ANNUAL */ + + /** + * ANNUAL + */ ANNUAL("Annual"), - - /** QUARTERLY */ + + /** + * QUARTERLY + */ QUARTERLY("Quarterly"); private String value; @@ -56,31 +85,25 @@ public enum CalendarTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static CalendarTypeEnum fromValue(String value) { for (CalendarTypeEnum b : CalendarTypeEnum.values()) { @@ -92,6 +115,7 @@ public static CalendarTypeEnum fromValue(String value) { } } + @JsonProperty("calendarType") private CalendarTypeEnum calendarType; @@ -107,250 +131,230 @@ public static CalendarTypeEnum fromValue(String value) { @JsonProperty("updatedDateUTC") private LocalDateTime updatedDateUTC; /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - * @return PayRunCalendar - */ + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + * @return PayRunCalendar + **/ public PayRunCalendar payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for the payroll calendar") - /** + /** * Xero unique identifier for the payroll calendar - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * Xero unique identifier for the payroll calendar - * - * @param payrollCalendarID UUID - */ + /** + * Xero unique identifier for the payroll calendar + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * Name of the calendar - * - * @param name String - * @return PayRunCalendar - */ + * Name of the calendar + * @param name String + * @return PayRunCalendar + **/ public PayRunCalendar name(String name) { this.name = name; return this; } - /** + /** * Name of the calendar - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the calendar") - /** + /** * Name of the calendar - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the calendar - * - * @param name String - */ + /** + * Name of the calendar + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Type of the calendar - * - * @param calendarType CalendarTypeEnum - * @return PayRunCalendar - */ + * Type of the calendar + * @param calendarType CalendarTypeEnum + * @return PayRunCalendar + **/ public PayRunCalendar calendarType(CalendarTypeEnum calendarType) { this.calendarType = calendarType; return this; } - /** + /** * Type of the calendar - * * @return calendarType - */ + **/ @ApiModelProperty(required = true, value = "Type of the calendar") - /** + /** * Type of the calendar - * * @return calendarType CalendarTypeEnum - */ + **/ public CalendarTypeEnum getCalendarType() { return calendarType; } - /** - * Type of the calendar - * - * @param calendarType CalendarTypeEnum - */ + /** + * Type of the calendar + * @param calendarType CalendarTypeEnum + **/ + public void setCalendarType(CalendarTypeEnum calendarType) { this.calendarType = calendarType; } /** - * Period start date of the calendar - * - * @param periodStartDate LocalDate - * @return PayRunCalendar - */ + * Period start date of the calendar + * @param periodStartDate LocalDate + * @return PayRunCalendar + **/ public PayRunCalendar periodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; return this; } - /** + /** * Period start date of the calendar - * * @return periodStartDate - */ + **/ @ApiModelProperty(required = true, value = "Period start date of the calendar") - /** + /** * Period start date of the calendar - * * @return periodStartDate LocalDate - */ + **/ public LocalDate getPeriodStartDate() { return periodStartDate; } - /** - * Period start date of the calendar - * - * @param periodStartDate LocalDate - */ + /** + * Period start date of the calendar + * @param periodStartDate LocalDate + **/ + public void setPeriodStartDate(LocalDate periodStartDate) { this.periodStartDate = periodStartDate; } /** - * Period end date of the calendar - * - * @param periodEndDate LocalDate - * @return PayRunCalendar - */ + * Period end date of the calendar + * @param periodEndDate LocalDate + * @return PayRunCalendar + **/ public PayRunCalendar periodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; return this; } - /** + /** * Period end date of the calendar - * * @return periodEndDate - */ + **/ @ApiModelProperty(value = "Period end date of the calendar") - /** + /** * Period end date of the calendar - * * @return periodEndDate LocalDate - */ + **/ public LocalDate getPeriodEndDate() { return periodEndDate; } - /** - * Period end date of the calendar - * - * @param periodEndDate LocalDate - */ + /** + * Period end date of the calendar + * @param periodEndDate LocalDate + **/ + public void setPeriodEndDate(LocalDate periodEndDate) { this.periodEndDate = periodEndDate; } /** - * Payment date of the calendar - * - * @param paymentDate LocalDate - * @return PayRunCalendar - */ + * Payment date of the calendar + * @param paymentDate LocalDate + * @return PayRunCalendar + **/ public PayRunCalendar paymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; return this; } - /** + /** * Payment date of the calendar - * * @return paymentDate - */ + **/ @ApiModelProperty(required = true, value = "Payment date of the calendar") - /** + /** * Payment date of the calendar - * * @return paymentDate LocalDate - */ + **/ public LocalDate getPaymentDate() { return paymentDate; } - /** - * Payment date of the calendar - * - * @param paymentDate LocalDate - */ + /** + * Payment date of the calendar + * @param paymentDate LocalDate + **/ + public void setPaymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; } /** - * UTC timestamp of the last update to the pay run calendar - * - * @param updatedDateUTC LocalDateTime - * @return PayRunCalendar - */ + * UTC timestamp of the last update to the pay run calendar + * @param updatedDateUTC LocalDateTime + * @return PayRunCalendar + **/ public PayRunCalendar updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * UTC timestamp of the last update to the pay run calendar - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "UTC timestamp of the last update to the pay run calendar") - /** + /** * UTC timestamp of the last update to the pay run calendar - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * UTC timestamp of the last update to the pay run calendar - * - * @param updatedDateUTC LocalDateTime - */ + /** + * UTC timestamp of the last update to the pay run calendar + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -360,27 +364,21 @@ public boolean equals(java.lang.Object o) { return false; } PayRunCalendar payRunCalendar = (PayRunCalendar) o; - return Objects.equals(this.payrollCalendarID, payRunCalendar.payrollCalendarID) - && Objects.equals(this.name, payRunCalendar.name) - && Objects.equals(this.calendarType, payRunCalendar.calendarType) - && Objects.equals(this.periodStartDate, payRunCalendar.periodStartDate) - && Objects.equals(this.periodEndDate, payRunCalendar.periodEndDate) - && Objects.equals(this.paymentDate, payRunCalendar.paymentDate) - && Objects.equals(this.updatedDateUTC, payRunCalendar.updatedDateUTC); + return Objects.equals(this.payrollCalendarID, payRunCalendar.payrollCalendarID) && + Objects.equals(this.name, payRunCalendar.name) && + Objects.equals(this.calendarType, payRunCalendar.calendarType) && + Objects.equals(this.periodStartDate, payRunCalendar.periodStartDate) && + Objects.equals(this.periodEndDate, payRunCalendar.periodEndDate) && + Objects.equals(this.paymentDate, payRunCalendar.paymentDate) && + Objects.equals(this.updatedDateUTC, payRunCalendar.updatedDateUTC); } @Override public int hashCode() { - return Objects.hash( - payrollCalendarID, - name, - calendarType, - periodStartDate, - periodEndDate, - paymentDate, - updatedDateUTC); + return Objects.hash(payrollCalendarID, name, calendarType, periodStartDate, periodEndDate, paymentDate, updatedDateUTC); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -397,7 +395,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -405,4 +404,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PayRunCalendarObject.java b/src/main/java/com/xero/models/payrolluk/PayRunCalendarObject.java index 0e9c84b74..1f8ec5902 100644 --- a/src/main/java/com/xero/models/payrolluk/PayRunCalendarObject.java +++ b/src/main/java/com/xero/models/payrolluk/PayRunCalendarObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.PayRunCalendar; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunCalendarObject + */ -/** PayRunCalendarObject */ public class PayRunCalendarObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PayRunCalendarObject { @JsonProperty("payRunCalendar") private PayRunCalendar payRunCalendar; /** - * pagination - * - * @param pagination Pagination - * @return PayRunCalendarObject - */ + * pagination + * @param pagination Pagination + * @return PayRunCalendarObject + **/ public PayRunCalendarObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRunCalendarObject - */ + * problem + * @param problem Problem + * @return PayRunCalendarObject + **/ public PayRunCalendarObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRunCalendar - * - * @param payRunCalendar PayRunCalendar - * @return PayRunCalendarObject - */ + * payRunCalendar + * @param payRunCalendar PayRunCalendar + * @return PayRunCalendarObject + **/ public PayRunCalendarObject payRunCalendar(PayRunCalendar payRunCalendar) { this.payRunCalendar = payRunCalendar; return this; } - /** + /** * Get payRunCalendar - * * @return payRunCalendar - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRunCalendar - * * @return payRunCalendar PayRunCalendar - */ + **/ public PayRunCalendar getPayRunCalendar() { return payRunCalendar; } - /** - * payRunCalendar - * - * @param payRunCalendar PayRunCalendar - */ + /** + * payRunCalendar + * @param payRunCalendar PayRunCalendar + **/ + public void setPayRunCalendar(PayRunCalendar payRunCalendar) { this.payRunCalendar = payRunCalendar; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRunCalendarObject payRunCalendarObject = (PayRunCalendarObject) o; - return Objects.equals(this.pagination, payRunCalendarObject.pagination) - && Objects.equals(this.problem, payRunCalendarObject.problem) - && Objects.equals(this.payRunCalendar, payRunCalendarObject.payRunCalendar); + return Objects.equals(this.pagination, payRunCalendarObject.pagination) && + Objects.equals(this.problem, payRunCalendarObject.problem) && + Objects.equals(this.payRunCalendar, payRunCalendarObject.payRunCalendar); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRunCalendar); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PayRunCalendars.java b/src/main/java/com/xero/models/payrolluk/PayRunCalendars.java index ad4388a9d..2db6b91d9 100644 --- a/src/main/java/com/xero/models/payrolluk/PayRunCalendars.java +++ b/src/main/java/com/xero/models/payrolluk/PayRunCalendars.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.PayRunCalendar; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunCalendars + */ -/** PayRunCalendars */ public class PayRunCalendars { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class PayRunCalendars { @JsonProperty("payRunCalendars") private List payRunCalendars = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return PayRunCalendars - */ + * pagination + * @param pagination Pagination + * @return PayRunCalendars + **/ public PayRunCalendars pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRunCalendars - */ + * problem + * @param problem Problem + * @return PayRunCalendars + **/ public PayRunCalendars problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRunCalendars - * - * @param payRunCalendars List<PayRunCalendar> - * @return PayRunCalendars - */ + * payRunCalendars + * @param payRunCalendars List<PayRunCalendar> + * @return PayRunCalendars + **/ public PayRunCalendars payRunCalendars(List payRunCalendars) { this.payRunCalendars = payRunCalendars; return this; @@ -113,10 +126,9 @@ public PayRunCalendars payRunCalendars(List payRunCalendars) { /** * payRunCalendars - * - * @param payRunCalendarsItem PayRunCalendar + * @param payRunCalendarsItem PayRunCalendar * @return PayRunCalendars - */ + **/ public PayRunCalendars addPayRunCalendarsItem(PayRunCalendar payRunCalendarsItem) { if (this.payRunCalendars == null) { this.payRunCalendars = new ArrayList(); @@ -125,30 +137,29 @@ public PayRunCalendars addPayRunCalendarsItem(PayRunCalendar payRunCalendarsItem return this; } - /** + /** * Get payRunCalendars - * * @return payRunCalendars - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRunCalendars - * * @return payRunCalendars List - */ + **/ public List getPayRunCalendars() { return payRunCalendars; } - /** - * payRunCalendars - * - * @param payRunCalendars List<PayRunCalendar> - */ + /** + * payRunCalendars + * @param payRunCalendars List<PayRunCalendar> + **/ + public void setPayRunCalendars(List payRunCalendars) { this.payRunCalendars = payRunCalendars; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRunCalendars payRunCalendars = (PayRunCalendars) o; - return Objects.equals(this.pagination, payRunCalendars.pagination) - && Objects.equals(this.problem, payRunCalendars.problem) - && Objects.equals(this.payRunCalendars, payRunCalendars.payRunCalendars); + return Objects.equals(this.pagination, payRunCalendars.pagination) && + Objects.equals(this.problem, payRunCalendars.problem) && + Objects.equals(this.payRunCalendars, payRunCalendars.payRunCalendars); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRunCalendars); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PayRunObject.java b/src/main/java/com/xero/models/payrolluk/PayRunObject.java index ef31605ae..7e097cd8a 100644 --- a/src/main/java/com/xero/models/payrolluk/PayRunObject.java +++ b/src/main/java/com/xero/models/payrolluk/PayRunObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.PayRun; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRunObject + */ -/** PayRunObject */ public class PayRunObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PayRunObject { @JsonProperty("payRun") private PayRun payRun; /** - * pagination - * - * @param pagination Pagination - * @return PayRunObject - */ + * pagination + * @param pagination Pagination + * @return PayRunObject + **/ public PayRunObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRunObject - */ + * problem + * @param problem Problem + * @return PayRunObject + **/ public PayRunObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRun - * - * @param payRun PayRun - * @return PayRunObject - */ + * payRun + * @param payRun PayRun + * @return PayRunObject + **/ public PayRunObject payRun(PayRun payRun) { this.payRun = payRun; return this; } - /** + /** * Get payRun - * * @return payRun - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRun - * * @return payRun PayRun - */ + **/ public PayRun getPayRun() { return payRun; } - /** - * payRun - * - * @param payRun PayRun - */ + /** + * payRun + * @param payRun PayRun + **/ + public void setPayRun(PayRun payRun) { this.payRun = payRun; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRunObject payRunObject = (PayRunObject) o; - return Objects.equals(this.pagination, payRunObject.pagination) - && Objects.equals(this.problem, payRunObject.problem) - && Objects.equals(this.payRun, payRunObject.payRun); + return Objects.equals(this.pagination, payRunObject.pagination) && + Objects.equals(this.problem, payRunObject.problem) && + Objects.equals(this.payRun, payRunObject.payRun); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRun); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PayRuns.java b/src/main/java/com/xero/models/payrolluk/PayRuns.java index 12c9dcb9c..fbbd84c6b 100644 --- a/src/main/java/com/xero/models/payrolluk/PayRuns.java +++ b/src/main/java/com/xero/models/payrolluk/PayRuns.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.PayRun; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayRuns + */ -/** PayRuns */ public class PayRuns { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class PayRuns { @JsonProperty("payRuns") private List payRuns = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return PayRuns - */ + * pagination + * @param pagination Pagination + * @return PayRuns + **/ public PayRuns pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayRuns - */ + * problem + * @param problem Problem + * @return PayRuns + **/ public PayRuns problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * payRuns - * - * @param payRuns List<PayRun> - * @return PayRuns - */ + * payRuns + * @param payRuns List<PayRun> + * @return PayRuns + **/ public PayRuns payRuns(List payRuns) { this.payRuns = payRuns; return this; @@ -113,10 +126,9 @@ public PayRuns payRuns(List payRuns) { /** * payRuns - * - * @param payRunsItem PayRun + * @param payRunsItem PayRun * @return PayRuns - */ + **/ public PayRuns addPayRunsItem(PayRun payRunsItem) { if (this.payRuns == null) { this.payRuns = new ArrayList(); @@ -125,30 +137,29 @@ public PayRuns addPayRunsItem(PayRun payRunsItem) { return this; } - /** + /** * Get payRuns - * * @return payRuns - */ + **/ @ApiModelProperty(value = "") - /** + /** * payRuns - * * @return payRuns List - */ + **/ public List getPayRuns() { return payRuns; } - /** - * payRuns - * - * @param payRuns List<PayRun> - */ + /** + * payRuns + * @param payRuns List<PayRun> + **/ + public void setPayRuns(List payRuns) { this.payRuns = payRuns; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } PayRuns payRuns = (PayRuns) o; - return Objects.equals(this.pagination, payRuns.pagination) - && Objects.equals(this.problem, payRuns.problem) - && Objects.equals(this.payRuns, payRuns.payRuns); + return Objects.equals(this.pagination, payRuns.pagination) && + Objects.equals(this.problem, payRuns.problem) && + Objects.equals(this.payRuns, payRuns.payRuns); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, payRuns); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PaymentLine.java b/src/main/java/com/xero/models/payrolluk/PaymentLine.java index b2581e080..5ce1dada4 100644 --- a/src/main/java/com/xero/models/payrolluk/PaymentLine.java +++ b/src/main/java/com/xero/models/payrolluk/PaymentLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentLine + */ -/** PaymentLine */ public class PaymentLine { StringUtil util = new StringUtil(); @@ -36,180 +53,166 @@ public class PaymentLine { @JsonProperty("accountName") private String accountName; /** - * Xero identifier for payroll payment line - * - * @param paymentLineID UUID - * @return PaymentLine - */ + * Xero identifier for payroll payment line + * @param paymentLineID UUID + * @return PaymentLine + **/ public PaymentLine paymentLineID(UUID paymentLineID) { this.paymentLineID = paymentLineID; return this; } - /** + /** * Xero identifier for payroll payment line - * * @return paymentLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll payment line") - /** + /** * Xero identifier for payroll payment line - * * @return paymentLineID UUID - */ + **/ public UUID getPaymentLineID() { return paymentLineID; } - /** - * Xero identifier for payroll payment line - * - * @param paymentLineID UUID - */ + /** + * Xero identifier for payroll payment line + * @param paymentLineID UUID + **/ + public void setPaymentLineID(UUID paymentLineID) { this.paymentLineID = paymentLineID; } /** - * The amount of the payment line - * - * @param amount Double - * @return PaymentLine - */ + * The amount of the payment line + * @param amount Double + * @return PaymentLine + **/ public PaymentLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the payment line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the payment line") - /** + /** * The amount of the payment line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the payment line - * - * @param amount Double - */ + /** + * The amount of the payment line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * The account number - * - * @param accountNumber String - * @return PaymentLine - */ + * The account number + * @param accountNumber String + * @return PaymentLine + **/ public PaymentLine accountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; } - /** + /** * The account number - * * @return accountNumber - */ + **/ @ApiModelProperty(value = "The account number") - /** + /** * The account number - * * @return accountNumber String - */ + **/ public String getAccountNumber() { return accountNumber; } - /** - * The account number - * - * @param accountNumber String - */ + /** + * The account number + * @param accountNumber String + **/ + public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } /** - * The account sort code - * - * @param sortCode String - * @return PaymentLine - */ + * The account sort code + * @param sortCode String + * @return PaymentLine + **/ public PaymentLine sortCode(String sortCode) { this.sortCode = sortCode; return this; } - /** + /** * The account sort code - * * @return sortCode - */ + **/ @ApiModelProperty(value = "The account sort code") - /** + /** * The account sort code - * * @return sortCode String - */ + **/ public String getSortCode() { return sortCode; } - /** - * The account sort code - * - * @param sortCode String - */ + /** + * The account sort code + * @param sortCode String + **/ + public void setSortCode(String sortCode) { this.sortCode = sortCode; } /** - * The account name - * - * @param accountName String - * @return PaymentLine - */ + * The account name + * @param accountName String + * @return PaymentLine + **/ public PaymentLine accountName(String accountName) { this.accountName = accountName; return this; } - /** + /** * The account name - * * @return accountName - */ + **/ @ApiModelProperty(value = "The account name") - /** + /** * The account name - * * @return accountName String - */ + **/ public String getAccountName() { return accountName; } - /** - * The account name - * - * @param accountName String - */ + /** + * The account name + * @param accountName String + **/ + public void setAccountName(String accountName) { this.accountName = accountName; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,11 +222,11 @@ public boolean equals(java.lang.Object o) { return false; } PaymentLine paymentLine = (PaymentLine) o; - return Objects.equals(this.paymentLineID, paymentLine.paymentLineID) - && Objects.equals(this.amount, paymentLine.amount) - && Objects.equals(this.accountNumber, paymentLine.accountNumber) - && Objects.equals(this.sortCode, paymentLine.sortCode) - && Objects.equals(this.accountName, paymentLine.accountName); + return Objects.equals(this.paymentLineID, paymentLine.paymentLineID) && + Objects.equals(this.amount, paymentLine.amount) && + Objects.equals(this.accountNumber, paymentLine.accountNumber) && + Objects.equals(this.sortCode, paymentLine.sortCode) && + Objects.equals(this.accountName, paymentLine.accountName); } @Override @@ -231,6 +234,7 @@ public int hashCode() { return Objects.hash(paymentLineID, amount, accountNumber, sortCode, accountName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -245,7 +249,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -253,4 +258,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PaymentMethod.java b/src/main/java/com/xero/models/payrolluk/PaymentMethod.java index 886487080..cf248f84c 100644 --- a/src/main/java/com/xero/models/payrolluk/PaymentMethod.java +++ b/src/main/java/com/xero/models/payrolluk/PaymentMethod.java @@ -9,29 +9,53 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrolluk.BankAccount; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentMethod + */ -/** PaymentMethod */ public class PaymentMethod { StringUtil util = new StringUtil(); - /** The payment method code */ + /** + * The payment method code + */ public enum PaymentMethodEnum { - /** CHEQUE */ + /** + * CHEQUE + */ CHEQUE("Cheque"), - - /** ELECTRONICALLY */ + + /** + * ELECTRONICALLY + */ ELECTRONICALLY("Electronically"), - - /** MANUAL */ + + /** + * MANUAL + */ MANUAL("Manual"); private String value; @@ -40,31 +64,25 @@ public enum PaymentMethodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PaymentMethodEnum fromValue(String value) { for (PaymentMethodEnum b : PaymentMethodEnum.values()) { @@ -76,52 +94,49 @@ public static PaymentMethodEnum fromValue(String value) { } } + @JsonProperty("paymentMethod") private PaymentMethodEnum paymentMethod; @JsonProperty("bankAccounts") private List bankAccounts = new ArrayList(); /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - * @return PaymentMethod - */ + * The payment method code + * @param paymentMethod PaymentMethodEnum + * @return PaymentMethod + **/ public PaymentMethod paymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; return this; } - /** + /** * The payment method code - * * @return paymentMethod - */ + **/ @ApiModelProperty(required = true, value = "The payment method code") - /** + /** * The payment method code - * * @return paymentMethod PaymentMethodEnum - */ + **/ public PaymentMethodEnum getPaymentMethod() { return paymentMethod; } - /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - */ + /** + * The payment method code + * @param paymentMethod PaymentMethodEnum + **/ + public void setPaymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; } /** - * bankAccounts - * - * @param bankAccounts List<BankAccount> - * @return PaymentMethod - */ + * bankAccounts + * @param bankAccounts List<BankAccount> + * @return PaymentMethod + **/ public PaymentMethod bankAccounts(List bankAccounts) { this.bankAccounts = bankAccounts; return this; @@ -129,10 +144,9 @@ public PaymentMethod bankAccounts(List bankAccounts) { /** * bankAccounts - * - * @param bankAccountsItem BankAccount + * @param bankAccountsItem BankAccount * @return PaymentMethod - */ + **/ public PaymentMethod addBankAccountsItem(BankAccount bankAccountsItem) { if (this.bankAccounts == null) { this.bankAccounts = new ArrayList(); @@ -141,30 +155,29 @@ public PaymentMethod addBankAccountsItem(BankAccount bankAccountsItem) { return this; } - /** + /** * Get bankAccounts - * * @return bankAccounts - */ + **/ @ApiModelProperty(value = "") - /** + /** * bankAccounts - * * @return bankAccounts List - */ + **/ public List getBankAccounts() { return bankAccounts; } - /** - * bankAccounts - * - * @param bankAccounts List<BankAccount> - */ + /** + * bankAccounts + * @param bankAccounts List<BankAccount> + **/ + public void setBankAccounts(List bankAccounts) { this.bankAccounts = bankAccounts; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -174,8 +187,8 @@ public boolean equals(java.lang.Object o) { return false; } PaymentMethod paymentMethod = (PaymentMethod) o; - return Objects.equals(this.paymentMethod, paymentMethod.paymentMethod) - && Objects.equals(this.bankAccounts, paymentMethod.bankAccounts); + return Objects.equals(this.paymentMethod, paymentMethod.paymentMethod) && + Objects.equals(this.bankAccounts, paymentMethod.bankAccounts); } @Override @@ -183,6 +196,7 @@ public int hashCode() { return Objects.hash(paymentMethod, bankAccounts); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -194,7 +208,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -202,4 +217,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PaymentMethodObject.java b/src/main/java/com/xero/models/payrolluk/PaymentMethodObject.java index 1116b81f1..8233ea4ae 100644 --- a/src/main/java/com/xero/models/payrolluk/PaymentMethodObject.java +++ b/src/main/java/com/xero/models/payrolluk/PaymentMethodObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.PaymentMethod; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PaymentMethodObject + */ -/** PaymentMethodObject */ public class PaymentMethodObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PaymentMethodObject { @JsonProperty("paymentMethod") private PaymentMethod paymentMethod; /** - * pagination - * - * @param pagination Pagination - * @return PaymentMethodObject - */ + * pagination + * @param pagination Pagination + * @return PaymentMethodObject + **/ public PaymentMethodObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PaymentMethodObject - */ + * problem + * @param problem Problem + * @return PaymentMethodObject + **/ public PaymentMethodObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * paymentMethod - * - * @param paymentMethod PaymentMethod - * @return PaymentMethodObject - */ + * paymentMethod + * @param paymentMethod PaymentMethod + * @return PaymentMethodObject + **/ public PaymentMethodObject paymentMethod(PaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; return this; } - /** + /** * Get paymentMethod - * * @return paymentMethod - */ + **/ @ApiModelProperty(value = "") - /** + /** * paymentMethod - * * @return paymentMethod PaymentMethod - */ + **/ public PaymentMethod getPaymentMethod() { return paymentMethod; } - /** - * paymentMethod - * - * @param paymentMethod PaymentMethod - */ + /** + * paymentMethod + * @param paymentMethod PaymentMethod + **/ + public void setPaymentMethod(PaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PaymentMethodObject paymentMethodObject = (PaymentMethodObject) o; - return Objects.equals(this.pagination, paymentMethodObject.pagination) - && Objects.equals(this.problem, paymentMethodObject.problem) - && Objects.equals(this.paymentMethod, paymentMethodObject.paymentMethod); + return Objects.equals(this.pagination, paymentMethodObject.pagination) && + Objects.equals(this.problem, paymentMethodObject.problem) && + Objects.equals(this.paymentMethod, paymentMethodObject.paymentMethod); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, paymentMethod); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Payslip.java b/src/main/java/com/xero/models/payrolluk/Payslip.java index d148f2234..a45d779ad 100644 --- a/src/main/java/com/xero/models/payrolluk/Payslip.java +++ b/src/main/java/com/xero/models/payrolluk/Payslip.java @@ -9,20 +9,45 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrolluk.BenefitLine; +import com.xero.models.payrolluk.CourtOrderLine; +import com.xero.models.payrolluk.DeductionLine; +import com.xero.models.payrolluk.EarningsLine; +import com.xero.models.payrolluk.LeaveAccrualLine; +import com.xero.models.payrolluk.LeaveEarningsLine; +import com.xero.models.payrolluk.PaymentLine; +import com.xero.models.payrolluk.ReimbursementLine; +import com.xero.models.payrolluk.TaxLine; +import com.xero.models.payrolluk.TimesheetEarningsLine; +import io.swagger.annotations.ApiModel; 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; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Payslip + */ -/** Payslip */ public class Payslip { StringUtil util = new StringUtil(); @@ -73,15 +98,23 @@ public class Payslip { @JsonProperty("bacsHash") private String bacsHash; - /** The payment method code */ + /** + * The payment method code + */ public enum PaymentMethodEnum { - /** CHEQUE */ + /** + * CHEQUE + */ CHEQUE("Cheque"), - - /** ELECTRONICALLY */ + + /** + * ELECTRONICALLY + */ ELECTRONICALLY("Electronically"), - - /** MANUAL */ + + /** + * MANUAL + */ MANUAL("Manual"); private String value; @@ -90,31 +123,25 @@ public enum PaymentMethodEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PaymentMethodEnum fromValue(String value) { for (PaymentMethodEnum b : PaymentMethodEnum.values()) { @@ -126,6 +153,7 @@ public static PaymentMethodEnum fromValue(String value) { } } + @JsonProperty("paymentMethod") private PaymentMethodEnum paymentMethod; @@ -136,8 +164,7 @@ public static PaymentMethodEnum fromValue(String value) { private List leaveEarningsLines = new ArrayList(); @JsonProperty("timesheetEarningsLines") - private List timesheetEarningsLines = - new ArrayList(); + private List timesheetEarningsLines = new ArrayList(); @JsonProperty("deductionLines") private List deductionLines = new ArrayList(); @@ -163,623 +190,554 @@ public static PaymentMethodEnum fromValue(String value) { @JsonProperty("courtOrderLines") private List courtOrderLines = new ArrayList(); /** - * The Xero identifier for a Payslip - * - * @param paySlipID UUID - * @return Payslip - */ + * The Xero identifier for a Payslip + * @param paySlipID UUID + * @return Payslip + **/ public Payslip paySlipID(UUID paySlipID) { this.paySlipID = paySlipID; return this; } - /** + /** * The Xero identifier for a Payslip - * * @return paySlipID - */ + **/ @ApiModelProperty(value = "The Xero identifier for a Payslip") - /** + /** * The Xero identifier for a Payslip - * * @return paySlipID UUID - */ + **/ public UUID getPaySlipID() { return paySlipID; } - /** - * The Xero identifier for a Payslip - * - * @param paySlipID UUID - */ + /** + * The Xero identifier for a Payslip + * @param paySlipID UUID + **/ + public void setPaySlipID(UUID paySlipID) { this.paySlipID = paySlipID; } /** - * The Xero identifier for payroll employee - * - * @param employeeID UUID - * @return Payslip - */ + * The Xero identifier for payroll employee + * @param employeeID UUID + * @return Payslip + **/ public Payslip employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for payroll employee - * * @return employeeID - */ + **/ @ApiModelProperty(value = "The Xero identifier for payroll employee") - /** + /** * The Xero identifier for payroll employee - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for payroll employee - * - * @param employeeID UUID - */ + /** + * The Xero identifier for payroll employee + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The Xero identifier for the associated payrun - * - * @param payRunID UUID - * @return Payslip - */ + * The Xero identifier for the associated payrun + * @param payRunID UUID + * @return Payslip + **/ public Payslip payRunID(UUID payRunID) { this.payRunID = payRunID; return this; } - /** + /** * The Xero identifier for the associated payrun - * * @return payRunID - */ + **/ @ApiModelProperty(value = "The Xero identifier for the associated payrun") - /** + /** * The Xero identifier for the associated payrun - * * @return payRunID UUID - */ + **/ public UUID getPayRunID() { return payRunID; } - /** - * The Xero identifier for the associated payrun - * - * @param payRunID UUID - */ + /** + * The Xero identifier for the associated payrun + * @param payRunID UUID + **/ + public void setPayRunID(UUID payRunID) { this.payRunID = payRunID; } /** - * The date payslip was last updated - * - * @param lastEdited LocalDateTime - * @return Payslip - */ + * The date payslip was last updated + * @param lastEdited LocalDateTime + * @return Payslip + **/ public Payslip lastEdited(LocalDateTime lastEdited) { this.lastEdited = lastEdited; return this; } - /** + /** * The date payslip was last updated - * * @return lastEdited - */ + **/ @ApiModelProperty(value = "The date payslip was last updated") - /** + /** * The date payslip was last updated - * * @return lastEdited LocalDateTime - */ + **/ public LocalDateTime getLastEdited() { return lastEdited; } - /** - * The date payslip was last updated - * - * @param lastEdited LocalDateTime - */ + /** + * The date payslip was last updated + * @param lastEdited LocalDateTime + **/ + public void setLastEdited(LocalDateTime lastEdited) { this.lastEdited = lastEdited; } /** - * Employee first name - * - * @param firstName String - * @return Payslip - */ + * Employee first name + * @param firstName String + * @return Payslip + **/ public Payslip firstName(String firstName) { this.firstName = firstName; return this; } - /** + /** * Employee first name - * * @return firstName - */ + **/ @ApiModelProperty(value = "Employee first name") - /** + /** * Employee first name - * * @return firstName String - */ + **/ public String getFirstName() { return firstName; } - /** - * Employee first name - * - * @param firstName String - */ + /** + * Employee first name + * @param firstName String + **/ + public void setFirstName(String firstName) { this.firstName = firstName; } /** - * Employee last name - * - * @param lastName String - * @return Payslip - */ + * Employee last name + * @param lastName String + * @return Payslip + **/ public Payslip lastName(String lastName) { this.lastName = lastName; return this; } - /** + /** * Employee last name - * * @return lastName - */ + **/ @ApiModelProperty(value = "Employee last name") - /** + /** * Employee last name - * * @return lastName String - */ + **/ public String getLastName() { return lastName; } - /** - * Employee last name - * - * @param lastName String - */ + /** + * Employee last name + * @param lastName String + **/ + public void setLastName(String lastName) { this.lastName = lastName; } /** - * Total earnings before any deductions. Same as gross earnings for UK. - * - * @param totalEarnings Double - * @return Payslip - */ + * Total earnings before any deductions. Same as gross earnings for UK. + * @param totalEarnings Double + * @return Payslip + **/ public Payslip totalEarnings(Double totalEarnings) { this.totalEarnings = totalEarnings; return this; } - /** + /** * Total earnings before any deductions. Same as gross earnings for UK. - * * @return totalEarnings - */ + **/ @ApiModelProperty(value = "Total earnings before any deductions. Same as gross earnings for UK.") - /** + /** * Total earnings before any deductions. Same as gross earnings for UK. - * * @return totalEarnings Double - */ + **/ public Double getTotalEarnings() { return totalEarnings; } - /** - * Total earnings before any deductions. Same as gross earnings for UK. - * - * @param totalEarnings Double - */ + /** + * Total earnings before any deductions. Same as gross earnings for UK. + * @param totalEarnings Double + **/ + public void setTotalEarnings(Double totalEarnings) { this.totalEarnings = totalEarnings; } /** - * Total earnings before any deductions. Same as total earnings for UK. - * - * @param grossEarnings Double - * @return Payslip - */ + * Total earnings before any deductions. Same as total earnings for UK. + * @param grossEarnings Double + * @return Payslip + **/ public Payslip grossEarnings(Double grossEarnings) { this.grossEarnings = grossEarnings; return this; } - /** + /** * Total earnings before any deductions. Same as total earnings for UK. - * * @return grossEarnings - */ + **/ @ApiModelProperty(value = "Total earnings before any deductions. Same as total earnings for UK.") - /** + /** * Total earnings before any deductions. Same as total earnings for UK. - * * @return grossEarnings Double - */ + **/ public Double getGrossEarnings() { return grossEarnings; } - /** - * Total earnings before any deductions. Same as total earnings for UK. - * - * @param grossEarnings Double - */ + /** + * Total earnings before any deductions. Same as total earnings for UK. + * @param grossEarnings Double + **/ + public void setGrossEarnings(Double grossEarnings) { this.grossEarnings = grossEarnings; } /** - * The employee net pay - * - * @param totalPay Double - * @return Payslip - */ + * The employee net pay + * @param totalPay Double + * @return Payslip + **/ public Payslip totalPay(Double totalPay) { this.totalPay = totalPay; return this; } - /** + /** * The employee net pay - * * @return totalPay - */ + **/ @ApiModelProperty(value = "The employee net pay") - /** + /** * The employee net pay - * * @return totalPay Double - */ + **/ public Double getTotalPay() { return totalPay; } - /** - * The employee net pay - * - * @param totalPay Double - */ + /** + * The employee net pay + * @param totalPay Double + **/ + public void setTotalPay(Double totalPay) { this.totalPay = totalPay; } /** - * The employer's tax obligation - * - * @param totalEmployerTaxes Double - * @return Payslip - */ + * The employer's tax obligation + * @param totalEmployerTaxes Double + * @return Payslip + **/ public Payslip totalEmployerTaxes(Double totalEmployerTaxes) { this.totalEmployerTaxes = totalEmployerTaxes; return this; } - /** + /** * The employer's tax obligation - * * @return totalEmployerTaxes - */ + **/ @ApiModelProperty(value = "The employer's tax obligation") - /** + /** * The employer's tax obligation - * * @return totalEmployerTaxes Double - */ + **/ public Double getTotalEmployerTaxes() { return totalEmployerTaxes; } - /** - * The employer's tax obligation - * - * @param totalEmployerTaxes Double - */ + /** + * The employer's tax obligation + * @param totalEmployerTaxes Double + **/ + public void setTotalEmployerTaxes(Double totalEmployerTaxes) { this.totalEmployerTaxes = totalEmployerTaxes; } /** - * The part of an employee's earnings that is deducted for tax purposes - * - * @param totalEmployeeTaxes Double - * @return Payslip - */ + * The part of an employee's earnings that is deducted for tax purposes + * @param totalEmployeeTaxes Double + * @return Payslip + **/ public Payslip totalEmployeeTaxes(Double totalEmployeeTaxes) { this.totalEmployeeTaxes = totalEmployeeTaxes; return this; } - /** + /** * The part of an employee's earnings that is deducted for tax purposes - * * @return totalEmployeeTaxes - */ + **/ @ApiModelProperty(value = "The part of an employee's earnings that is deducted for tax purposes") - /** + /** * The part of an employee's earnings that is deducted for tax purposes - * * @return totalEmployeeTaxes Double - */ + **/ public Double getTotalEmployeeTaxes() { return totalEmployeeTaxes; } - /** - * The part of an employee's earnings that is deducted for tax purposes - * - * @param totalEmployeeTaxes Double - */ + /** + * The part of an employee's earnings that is deducted for tax purposes + * @param totalEmployeeTaxes Double + **/ + public void setTotalEmployeeTaxes(Double totalEmployeeTaxes) { this.totalEmployeeTaxes = totalEmployeeTaxes; } /** - * Total amount subtracted from an employee's earnings to reach total pay - * - * @param totalDeductions Double - * @return Payslip - */ + * Total amount subtracted from an employee's earnings to reach total pay + * @param totalDeductions Double + * @return Payslip + **/ public Payslip totalDeductions(Double totalDeductions) { this.totalDeductions = totalDeductions; return this; } - /** + /** * Total amount subtracted from an employee's earnings to reach total pay - * * @return totalDeductions - */ - @ApiModelProperty( - value = "Total amount subtracted from an employee's earnings to reach total pay") - /** + **/ + @ApiModelProperty(value = "Total amount subtracted from an employee's earnings to reach total pay") + /** * Total amount subtracted from an employee's earnings to reach total pay - * * @return totalDeductions Double - */ + **/ public Double getTotalDeductions() { return totalDeductions; } - /** - * Total amount subtracted from an employee's earnings to reach total pay - * - * @param totalDeductions Double - */ + /** + * Total amount subtracted from an employee's earnings to reach total pay + * @param totalDeductions Double + **/ + public void setTotalDeductions(Double totalDeductions) { this.totalDeductions = totalDeductions; } /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * - * @param totalReimbursements Double - * @return Payslip - */ + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + * @param totalReimbursements Double + * @return Payslip + **/ public Payslip totalReimbursements(Double totalReimbursements) { this.totalReimbursements = totalReimbursements; return this; } - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment * @return totalReimbursements - */ - @ApiModelProperty( - value = - "Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket" - + " expenses when the person incurs those expenses through employment") - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * + **/ + @ApiModelProperty(value = "Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment") + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment * @return totalReimbursements Double - */ + **/ public Double getTotalReimbursements() { return totalReimbursements; } - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket - * expenses when the person incurs those expenses through employment - * - * @param totalReimbursements Double - */ + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + * @param totalReimbursements Double + **/ + public void setTotalReimbursements(Double totalReimbursements) { this.totalReimbursements = totalReimbursements; } /** - * Total amounts required by law to subtract from the employee's earnings - * - * @param totalCourtOrders Double - * @return Payslip - */ + * Total amounts required by law to subtract from the employee's earnings + * @param totalCourtOrders Double + * @return Payslip + **/ public Payslip totalCourtOrders(Double totalCourtOrders) { this.totalCourtOrders = totalCourtOrders; return this; } - /** + /** * Total amounts required by law to subtract from the employee's earnings - * * @return totalCourtOrders - */ - @ApiModelProperty( - value = "Total amounts required by law to subtract from the employee's earnings") - /** + **/ + @ApiModelProperty(value = "Total amounts required by law to subtract from the employee's earnings") + /** * Total amounts required by law to subtract from the employee's earnings - * * @return totalCourtOrders Double - */ + **/ public Double getTotalCourtOrders() { return totalCourtOrders; } - /** - * Total amounts required by law to subtract from the employee's earnings - * - * @param totalCourtOrders Double - */ + /** + * Total amounts required by law to subtract from the employee's earnings + * @param totalCourtOrders Double + **/ + public void setTotalCourtOrders(Double totalCourtOrders) { this.totalCourtOrders = totalCourtOrders; } /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * - * @param totalBenefits Double - * @return Payslip - */ + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + * @param totalBenefits Double + * @return Payslip + **/ public Payslip totalBenefits(Double totalBenefits) { this.totalBenefits = totalBenefits; return this; } - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries * @return totalBenefits - */ - @ApiModelProperty( - value = - "Benefits (also called fringe benefits, perquisites or perks) are various non-earnings" - + " compensations provided to employees in addition to their normal earnings or" - + " salaries") - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * + **/ + @ApiModelProperty(value = "Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries") + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries * @return totalBenefits Double - */ + **/ public Double getTotalBenefits() { return totalBenefits; } - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings - * compensations provided to employees in addition to their normal earnings or salaries - * - * @param totalBenefits Double - */ + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + * @param totalBenefits Double + **/ + public void setTotalBenefits(Double totalBenefits) { this.totalBenefits = totalBenefits; } /** - * BACS Service User Number - * - * @param bacsHash String - * @return Payslip - */ + * BACS Service User Number + * @param bacsHash String + * @return Payslip + **/ public Payslip bacsHash(String bacsHash) { this.bacsHash = bacsHash; return this; } - /** + /** * BACS Service User Number - * * @return bacsHash - */ + **/ @ApiModelProperty(value = "BACS Service User Number") - /** + /** * BACS Service User Number - * * @return bacsHash String - */ + **/ public String getBacsHash() { return bacsHash; } - /** - * BACS Service User Number - * - * @param bacsHash String - */ + /** + * BACS Service User Number + * @param bacsHash String + **/ + public void setBacsHash(String bacsHash) { this.bacsHash = bacsHash; } /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - * @return Payslip - */ + * The payment method code + * @param paymentMethod PaymentMethodEnum + * @return Payslip + **/ public Payslip paymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; return this; } - /** + /** * The payment method code - * * @return paymentMethod - */ + **/ @ApiModelProperty(value = "The payment method code") - /** + /** * The payment method code - * * @return paymentMethod PaymentMethodEnum - */ + **/ public PaymentMethodEnum getPaymentMethod() { return paymentMethod; } - /** - * The payment method code - * - * @param paymentMethod PaymentMethodEnum - */ + /** + * The payment method code + * @param paymentMethod PaymentMethodEnum + **/ + public void setPaymentMethod(PaymentMethodEnum paymentMethod) { this.paymentMethod = paymentMethod; } /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - * @return Payslip - */ + * earningsLines + * @param earningsLines List<EarningsLine> + * @return Payslip + **/ public Payslip earningsLines(List earningsLines) { this.earningsLines = earningsLines; return this; @@ -787,10 +745,9 @@ public Payslip earningsLines(List earningsLines) { /** * earningsLines - * - * @param earningsLinesItem EarningsLine + * @param earningsLinesItem EarningsLine * @return Payslip - */ + **/ public Payslip addEarningsLinesItem(EarningsLine earningsLinesItem) { if (this.earningsLines == null) { this.earningsLines = new ArrayList(); @@ -799,36 +756,33 @@ public Payslip addEarningsLinesItem(EarningsLine earningsLinesItem) { return this; } - /** + /** * Get earningsLines - * * @return earningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * earningsLines - * * @return earningsLines List - */ + **/ public List getEarningsLines() { return earningsLines; } - /** - * earningsLines - * - * @param earningsLines List<EarningsLine> - */ + /** + * earningsLines + * @param earningsLines List<EarningsLine> + **/ + public void setEarningsLines(List earningsLines) { this.earningsLines = earningsLines; } /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - * @return Payslip - */ + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + * @return Payslip + **/ public Payslip leaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; return this; @@ -836,10 +790,9 @@ public Payslip leaveEarningsLines(List leaveEarningsLines) { /** * leaveEarningsLines - * - * @param leaveEarningsLinesItem LeaveEarningsLine + * @param leaveEarningsLinesItem LeaveEarningsLine * @return Payslip - */ + **/ public Payslip addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLinesItem) { if (this.leaveEarningsLines == null) { this.leaveEarningsLines = new ArrayList(); @@ -848,36 +801,33 @@ public Payslip addLeaveEarningsLinesItem(LeaveEarningsLine leaveEarningsLinesIte return this; } - /** + /** * Get leaveEarningsLines - * * @return leaveEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveEarningsLines - * * @return leaveEarningsLines List - */ + **/ public List getLeaveEarningsLines() { return leaveEarningsLines; } - /** - * leaveEarningsLines - * - * @param leaveEarningsLines List<LeaveEarningsLine> - */ + /** + * leaveEarningsLines + * @param leaveEarningsLines List<LeaveEarningsLine> + **/ + public void setLeaveEarningsLines(List leaveEarningsLines) { this.leaveEarningsLines = leaveEarningsLines; } /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<TimesheetEarningsLine> - * @return Payslip - */ + * timesheetEarningsLines + * @param timesheetEarningsLines List<TimesheetEarningsLine> + * @return Payslip + **/ public Payslip timesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; return this; @@ -885,10 +835,9 @@ public Payslip timesheetEarningsLines(List timesheetEarni /** * timesheetEarningsLines - * - * @param timesheetEarningsLinesItem TimesheetEarningsLine + * @param timesheetEarningsLinesItem TimesheetEarningsLine * @return Payslip - */ + **/ public Payslip addTimesheetEarningsLinesItem(TimesheetEarningsLine timesheetEarningsLinesItem) { if (this.timesheetEarningsLines == null) { this.timesheetEarningsLines = new ArrayList(); @@ -897,36 +846,33 @@ public Payslip addTimesheetEarningsLinesItem(TimesheetEarningsLine timesheetEarn return this; } - /** + /** * Get timesheetEarningsLines - * * @return timesheetEarningsLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetEarningsLines - * * @return timesheetEarningsLines List - */ + **/ public List getTimesheetEarningsLines() { return timesheetEarningsLines; } - /** - * timesheetEarningsLines - * - * @param timesheetEarningsLines List<TimesheetEarningsLine> - */ + /** + * timesheetEarningsLines + * @param timesheetEarningsLines List<TimesheetEarningsLine> + **/ + public void setTimesheetEarningsLines(List timesheetEarningsLines) { this.timesheetEarningsLines = timesheetEarningsLines; } /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - * @return Payslip - */ + * deductionLines + * @param deductionLines List<DeductionLine> + * @return Payslip + **/ public Payslip deductionLines(List deductionLines) { this.deductionLines = deductionLines; return this; @@ -934,10 +880,9 @@ public Payslip deductionLines(List deductionLines) { /** * deductionLines - * - * @param deductionLinesItem DeductionLine + * @param deductionLinesItem DeductionLine * @return Payslip - */ + **/ public Payslip addDeductionLinesItem(DeductionLine deductionLinesItem) { if (this.deductionLines == null) { this.deductionLines = new ArrayList(); @@ -946,36 +891,33 @@ public Payslip addDeductionLinesItem(DeductionLine deductionLinesItem) { return this; } - /** + /** * Get deductionLines - * * @return deductionLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * deductionLines - * * @return deductionLines List - */ + **/ public List getDeductionLines() { return deductionLines; } - /** - * deductionLines - * - * @param deductionLines List<DeductionLine> - */ + /** + * deductionLines + * @param deductionLines List<DeductionLine> + **/ + public void setDeductionLines(List deductionLines) { this.deductionLines = deductionLines; } /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - * @return Payslip - */ + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + * @return Payslip + **/ public Payslip reimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; return this; @@ -983,10 +925,9 @@ public Payslip reimbursementLines(List reimbursementLines) { /** * reimbursementLines - * - * @param reimbursementLinesItem ReimbursementLine + * @param reimbursementLinesItem ReimbursementLine * @return Payslip - */ + **/ public Payslip addReimbursementLinesItem(ReimbursementLine reimbursementLinesItem) { if (this.reimbursementLines == null) { this.reimbursementLines = new ArrayList(); @@ -995,36 +936,33 @@ public Payslip addReimbursementLinesItem(ReimbursementLine reimbursementLinesIte return this; } - /** + /** * Get reimbursementLines - * * @return reimbursementLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursementLines - * * @return reimbursementLines List - */ + **/ public List getReimbursementLines() { return reimbursementLines; } - /** - * reimbursementLines - * - * @param reimbursementLines List<ReimbursementLine> - */ + /** + * reimbursementLines + * @param reimbursementLines List<ReimbursementLine> + **/ + public void setReimbursementLines(List reimbursementLines) { this.reimbursementLines = reimbursementLines; } /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - * @return Payslip - */ + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + * @return Payslip + **/ public Payslip leaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; return this; @@ -1032,10 +970,9 @@ public Payslip leaveAccrualLines(List leaveAccrualLines) { /** * leaveAccrualLines - * - * @param leaveAccrualLinesItem LeaveAccrualLine + * @param leaveAccrualLinesItem LeaveAccrualLine * @return Payslip - */ + **/ public Payslip addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesItem) { if (this.leaveAccrualLines == null) { this.leaveAccrualLines = new ArrayList(); @@ -1044,36 +981,33 @@ public Payslip addLeaveAccrualLinesItem(LeaveAccrualLine leaveAccrualLinesItem) return this; } - /** + /** * Get leaveAccrualLines - * * @return leaveAccrualLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * leaveAccrualLines - * * @return leaveAccrualLines List - */ + **/ public List getLeaveAccrualLines() { return leaveAccrualLines; } - /** - * leaveAccrualLines - * - * @param leaveAccrualLines List<LeaveAccrualLine> - */ + /** + * leaveAccrualLines + * @param leaveAccrualLines List<LeaveAccrualLine> + **/ + public void setLeaveAccrualLines(List leaveAccrualLines) { this.leaveAccrualLines = leaveAccrualLines; } /** - * benefitLines - * - * @param benefitLines List<BenefitLine> - * @return Payslip - */ + * benefitLines + * @param benefitLines List<BenefitLine> + * @return Payslip + **/ public Payslip benefitLines(List benefitLines) { this.benefitLines = benefitLines; return this; @@ -1081,10 +1015,9 @@ public Payslip benefitLines(List benefitLines) { /** * benefitLines - * - * @param benefitLinesItem BenefitLine + * @param benefitLinesItem BenefitLine * @return Payslip - */ + **/ public Payslip addBenefitLinesItem(BenefitLine benefitLinesItem) { if (this.benefitLines == null) { this.benefitLines = new ArrayList(); @@ -1093,36 +1026,33 @@ public Payslip addBenefitLinesItem(BenefitLine benefitLinesItem) { return this; } - /** + /** * Get benefitLines - * * @return benefitLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * benefitLines - * * @return benefitLines List - */ + **/ public List getBenefitLines() { return benefitLines; } - /** - * benefitLines - * - * @param benefitLines List<BenefitLine> - */ + /** + * benefitLines + * @param benefitLines List<BenefitLine> + **/ + public void setBenefitLines(List benefitLines) { this.benefitLines = benefitLines; } /** - * paymentLines - * - * @param paymentLines List<PaymentLine> - * @return Payslip - */ + * paymentLines + * @param paymentLines List<PaymentLine> + * @return Payslip + **/ public Payslip paymentLines(List paymentLines) { this.paymentLines = paymentLines; return this; @@ -1130,10 +1060,9 @@ public Payslip paymentLines(List paymentLines) { /** * paymentLines - * - * @param paymentLinesItem PaymentLine + * @param paymentLinesItem PaymentLine * @return Payslip - */ + **/ public Payslip addPaymentLinesItem(PaymentLine paymentLinesItem) { if (this.paymentLines == null) { this.paymentLines = new ArrayList(); @@ -1142,36 +1071,33 @@ public Payslip addPaymentLinesItem(PaymentLine paymentLinesItem) { return this; } - /** + /** * Get paymentLines - * * @return paymentLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * paymentLines - * * @return paymentLines List - */ + **/ public List getPaymentLines() { return paymentLines; } - /** - * paymentLines - * - * @param paymentLines List<PaymentLine> - */ + /** + * paymentLines + * @param paymentLines List<PaymentLine> + **/ + public void setPaymentLines(List paymentLines) { this.paymentLines = paymentLines; } /** - * employeeTaxLines - * - * @param employeeTaxLines List<TaxLine> - * @return Payslip - */ + * employeeTaxLines + * @param employeeTaxLines List<TaxLine> + * @return Payslip + **/ public Payslip employeeTaxLines(List employeeTaxLines) { this.employeeTaxLines = employeeTaxLines; return this; @@ -1179,10 +1105,9 @@ public Payslip employeeTaxLines(List employeeTaxLines) { /** * employeeTaxLines - * - * @param employeeTaxLinesItem TaxLine + * @param employeeTaxLinesItem TaxLine * @return Payslip - */ + **/ public Payslip addEmployeeTaxLinesItem(TaxLine employeeTaxLinesItem) { if (this.employeeTaxLines == null) { this.employeeTaxLines = new ArrayList(); @@ -1191,36 +1116,33 @@ public Payslip addEmployeeTaxLinesItem(TaxLine employeeTaxLinesItem) { return this; } - /** + /** * Get employeeTaxLines - * * @return employeeTaxLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * employeeTaxLines - * * @return employeeTaxLines List - */ + **/ public List getEmployeeTaxLines() { return employeeTaxLines; } - /** - * employeeTaxLines - * - * @param employeeTaxLines List<TaxLine> - */ + /** + * employeeTaxLines + * @param employeeTaxLines List<TaxLine> + **/ + public void setEmployeeTaxLines(List employeeTaxLines) { this.employeeTaxLines = employeeTaxLines; } /** - * employerTaxLines - * - * @param employerTaxLines List<TaxLine> - * @return Payslip - */ + * employerTaxLines + * @param employerTaxLines List<TaxLine> + * @return Payslip + **/ public Payslip employerTaxLines(List employerTaxLines) { this.employerTaxLines = employerTaxLines; return this; @@ -1228,10 +1150,9 @@ public Payslip employerTaxLines(List employerTaxLines) { /** * employerTaxLines - * - * @param employerTaxLinesItem TaxLine + * @param employerTaxLinesItem TaxLine * @return Payslip - */ + **/ public Payslip addEmployerTaxLinesItem(TaxLine employerTaxLinesItem) { if (this.employerTaxLines == null) { this.employerTaxLines = new ArrayList(); @@ -1240,36 +1161,33 @@ public Payslip addEmployerTaxLinesItem(TaxLine employerTaxLinesItem) { return this; } - /** + /** * Get employerTaxLines - * * @return employerTaxLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * employerTaxLines - * * @return employerTaxLines List - */ + **/ public List getEmployerTaxLines() { return employerTaxLines; } - /** - * employerTaxLines - * - * @param employerTaxLines List<TaxLine> - */ + /** + * employerTaxLines + * @param employerTaxLines List<TaxLine> + **/ + public void setEmployerTaxLines(List employerTaxLines) { this.employerTaxLines = employerTaxLines; } /** - * courtOrderLines - * - * @param courtOrderLines List<CourtOrderLine> - * @return Payslip - */ + * courtOrderLines + * @param courtOrderLines List<CourtOrderLine> + * @return Payslip + **/ public Payslip courtOrderLines(List courtOrderLines) { this.courtOrderLines = courtOrderLines; return this; @@ -1277,10 +1195,9 @@ public Payslip courtOrderLines(List courtOrderLines) { /** * courtOrderLines - * - * @param courtOrderLinesItem CourtOrderLine + * @param courtOrderLinesItem CourtOrderLine * @return Payslip - */ + **/ public Payslip addCourtOrderLinesItem(CourtOrderLine courtOrderLinesItem) { if (this.courtOrderLines == null) { this.courtOrderLines = new ArrayList(); @@ -1289,30 +1206,29 @@ public Payslip addCourtOrderLinesItem(CourtOrderLine courtOrderLinesItem) { return this; } - /** + /** * Get courtOrderLines - * * @return courtOrderLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * courtOrderLines - * * @return courtOrderLines List - */ + **/ public List getCourtOrderLines() { return courtOrderLines; } - /** - * courtOrderLines - * - * @param courtOrderLines List<CourtOrderLine> - */ + /** + * courtOrderLines + * @param courtOrderLines List<CourtOrderLine> + **/ + public void setCourtOrderLines(List courtOrderLines) { this.courtOrderLines = courtOrderLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1322,69 +1238,42 @@ public boolean equals(java.lang.Object o) { return false; } Payslip payslip = (Payslip) o; - return Objects.equals(this.paySlipID, payslip.paySlipID) - && Objects.equals(this.employeeID, payslip.employeeID) - && Objects.equals(this.payRunID, payslip.payRunID) - && Objects.equals(this.lastEdited, payslip.lastEdited) - && Objects.equals(this.firstName, payslip.firstName) - && Objects.equals(this.lastName, payslip.lastName) - && Objects.equals(this.totalEarnings, payslip.totalEarnings) - && Objects.equals(this.grossEarnings, payslip.grossEarnings) - && Objects.equals(this.totalPay, payslip.totalPay) - && Objects.equals(this.totalEmployerTaxes, payslip.totalEmployerTaxes) - && Objects.equals(this.totalEmployeeTaxes, payslip.totalEmployeeTaxes) - && Objects.equals(this.totalDeductions, payslip.totalDeductions) - && Objects.equals(this.totalReimbursements, payslip.totalReimbursements) - && Objects.equals(this.totalCourtOrders, payslip.totalCourtOrders) - && Objects.equals(this.totalBenefits, payslip.totalBenefits) - && Objects.equals(this.bacsHash, payslip.bacsHash) - && Objects.equals(this.paymentMethod, payslip.paymentMethod) - && Objects.equals(this.earningsLines, payslip.earningsLines) - && Objects.equals(this.leaveEarningsLines, payslip.leaveEarningsLines) - && Objects.equals(this.timesheetEarningsLines, payslip.timesheetEarningsLines) - && Objects.equals(this.deductionLines, payslip.deductionLines) - && Objects.equals(this.reimbursementLines, payslip.reimbursementLines) - && Objects.equals(this.leaveAccrualLines, payslip.leaveAccrualLines) - && Objects.equals(this.benefitLines, payslip.benefitLines) - && Objects.equals(this.paymentLines, payslip.paymentLines) - && Objects.equals(this.employeeTaxLines, payslip.employeeTaxLines) - && Objects.equals(this.employerTaxLines, payslip.employerTaxLines) - && Objects.equals(this.courtOrderLines, payslip.courtOrderLines); + return Objects.equals(this.paySlipID, payslip.paySlipID) && + Objects.equals(this.employeeID, payslip.employeeID) && + Objects.equals(this.payRunID, payslip.payRunID) && + Objects.equals(this.lastEdited, payslip.lastEdited) && + Objects.equals(this.firstName, payslip.firstName) && + Objects.equals(this.lastName, payslip.lastName) && + Objects.equals(this.totalEarnings, payslip.totalEarnings) && + Objects.equals(this.grossEarnings, payslip.grossEarnings) && + Objects.equals(this.totalPay, payslip.totalPay) && + Objects.equals(this.totalEmployerTaxes, payslip.totalEmployerTaxes) && + Objects.equals(this.totalEmployeeTaxes, payslip.totalEmployeeTaxes) && + Objects.equals(this.totalDeductions, payslip.totalDeductions) && + Objects.equals(this.totalReimbursements, payslip.totalReimbursements) && + Objects.equals(this.totalCourtOrders, payslip.totalCourtOrders) && + Objects.equals(this.totalBenefits, payslip.totalBenefits) && + Objects.equals(this.bacsHash, payslip.bacsHash) && + Objects.equals(this.paymentMethod, payslip.paymentMethod) && + Objects.equals(this.earningsLines, payslip.earningsLines) && + Objects.equals(this.leaveEarningsLines, payslip.leaveEarningsLines) && + Objects.equals(this.timesheetEarningsLines, payslip.timesheetEarningsLines) && + Objects.equals(this.deductionLines, payslip.deductionLines) && + Objects.equals(this.reimbursementLines, payslip.reimbursementLines) && + Objects.equals(this.leaveAccrualLines, payslip.leaveAccrualLines) && + Objects.equals(this.benefitLines, payslip.benefitLines) && + Objects.equals(this.paymentLines, payslip.paymentLines) && + Objects.equals(this.employeeTaxLines, payslip.employeeTaxLines) && + Objects.equals(this.employerTaxLines, payslip.employerTaxLines) && + Objects.equals(this.courtOrderLines, payslip.courtOrderLines); } @Override public int hashCode() { - return Objects.hash( - paySlipID, - employeeID, - payRunID, - lastEdited, - firstName, - lastName, - totalEarnings, - grossEarnings, - totalPay, - totalEmployerTaxes, - totalEmployeeTaxes, - totalDeductions, - totalReimbursements, - totalCourtOrders, - totalBenefits, - bacsHash, - paymentMethod, - earningsLines, - leaveEarningsLines, - timesheetEarningsLines, - deductionLines, - reimbursementLines, - leaveAccrualLines, - benefitLines, - paymentLines, - employeeTaxLines, - employerTaxLines, - courtOrderLines); + return Objects.hash(paySlipID, employeeID, payRunID, lastEdited, firstName, lastName, totalEarnings, grossEarnings, totalPay, totalEmployerTaxes, totalEmployeeTaxes, totalDeductions, totalReimbursements, totalCourtOrders, totalBenefits, bacsHash, paymentMethod, earningsLines, leaveEarningsLines, timesheetEarningsLines, deductionLines, reimbursementLines, leaveAccrualLines, benefitLines, paymentLines, employeeTaxLines, employerTaxLines, courtOrderLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -1401,18 +1290,14 @@ public String toString() { sb.append(" totalEmployerTaxes: ").append(toIndentedString(totalEmployerTaxes)).append("\n"); sb.append(" totalEmployeeTaxes: ").append(toIndentedString(totalEmployeeTaxes)).append("\n"); sb.append(" totalDeductions: ").append(toIndentedString(totalDeductions)).append("\n"); - sb.append(" totalReimbursements: ") - .append(toIndentedString(totalReimbursements)) - .append("\n"); + sb.append(" totalReimbursements: ").append(toIndentedString(totalReimbursements)).append("\n"); sb.append(" totalCourtOrders: ").append(toIndentedString(totalCourtOrders)).append("\n"); sb.append(" totalBenefits: ").append(toIndentedString(totalBenefits)).append("\n"); sb.append(" bacsHash: ").append(toIndentedString(bacsHash)).append("\n"); sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" earningsLines: ").append(toIndentedString(earningsLines)).append("\n"); sb.append(" leaveEarningsLines: ").append(toIndentedString(leaveEarningsLines)).append("\n"); - sb.append(" timesheetEarningsLines: ") - .append(toIndentedString(timesheetEarningsLines)) - .append("\n"); + sb.append(" timesheetEarningsLines: ").append(toIndentedString(timesheetEarningsLines)).append("\n"); sb.append(" deductionLines: ").append(toIndentedString(deductionLines)).append("\n"); sb.append(" reimbursementLines: ").append(toIndentedString(reimbursementLines)).append("\n"); sb.append(" leaveAccrualLines: ").append(toIndentedString(leaveAccrualLines)).append("\n"); @@ -1426,7 +1311,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -1434,4 +1320,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/PayslipObject.java b/src/main/java/com/xero/models/payrolluk/PayslipObject.java index 39e32805f..62fcba68a 100644 --- a/src/main/java/com/xero/models/payrolluk/PayslipObject.java +++ b/src/main/java/com/xero/models/payrolluk/PayslipObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Payslip; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * PayslipObject + */ -/** PayslipObject */ public class PayslipObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class PayslipObject { @JsonProperty("paySlip") private Payslip paySlip; /** - * pagination - * - * @param pagination Pagination - * @return PayslipObject - */ + * pagination + * @param pagination Pagination + * @return PayslipObject + **/ public PayslipObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return PayslipObject - */ + * problem + * @param problem Problem + * @return PayslipObject + **/ public PayslipObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * paySlip - * - * @param paySlip Payslip - * @return PayslipObject - */ + * paySlip + * @param paySlip Payslip + * @return PayslipObject + **/ public PayslipObject paySlip(Payslip paySlip) { this.paySlip = paySlip; return this; } - /** + /** * Get paySlip - * * @return paySlip - */ + **/ @ApiModelProperty(value = "") - /** + /** * paySlip - * * @return paySlip Payslip - */ + **/ public Payslip getPaySlip() { return paySlip; } - /** - * paySlip - * - * @param paySlip Payslip - */ + /** + * paySlip + * @param paySlip Payslip + **/ + public void setPaySlip(Payslip paySlip) { this.paySlip = paySlip; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } PayslipObject payslipObject = (PayslipObject) o; - return Objects.equals(this.pagination, payslipObject.pagination) - && Objects.equals(this.problem, payslipObject.problem) - && Objects.equals(this.paySlip, payslipObject.paySlip); + return Objects.equals(this.pagination, payslipObject.pagination) && + Objects.equals(this.problem, payslipObject.problem) && + Objects.equals(this.paySlip, payslipObject.paySlip); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, paySlip); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Payslips.java b/src/main/java/com/xero/models/payrolluk/Payslips.java index 45cd2845a..5bd99d8de 100644 --- a/src/main/java/com/xero/models/payrolluk/Payslips.java +++ b/src/main/java/com/xero/models/payrolluk/Payslips.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Payslip; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Payslips + */ -/** Payslips */ public class Payslips { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Payslips { @JsonProperty("paySlips") private List paySlips = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Payslips - */ + * pagination + * @param pagination Pagination + * @return Payslips + **/ public Payslips pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Payslips - */ + * problem + * @param problem Problem + * @return Payslips + **/ public Payslips problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * paySlips - * - * @param paySlips List<Payslip> - * @return Payslips - */ + * paySlips + * @param paySlips List<Payslip> + * @return Payslips + **/ public Payslips paySlips(List paySlips) { this.paySlips = paySlips; return this; @@ -113,10 +126,9 @@ public Payslips paySlips(List paySlips) { /** * paySlips - * - * @param paySlipsItem Payslip + * @param paySlipsItem Payslip * @return Payslips - */ + **/ public Payslips addPaySlipsItem(Payslip paySlipsItem) { if (this.paySlips == null) { this.paySlips = new ArrayList(); @@ -125,30 +137,29 @@ public Payslips addPaySlipsItem(Payslip paySlipsItem) { return this; } - /** + /** * Get paySlips - * * @return paySlips - */ + **/ @ApiModelProperty(value = "") - /** + /** * paySlips - * * @return paySlips List - */ + **/ public List getPaySlips() { return paySlips; } - /** - * paySlips - * - * @param paySlips List<Payslip> - */ + /** + * paySlips + * @param paySlips List<Payslip> + **/ + public void setPaySlips(List paySlips) { this.paySlips = paySlips; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Payslips payslips = (Payslips) o; - return Objects.equals(this.pagination, payslips.pagination) - && Objects.equals(this.problem, payslips.problem) - && Objects.equals(this.paySlips, payslips.paySlips); + return Objects.equals(this.pagination, payslips.pagination) && + Objects.equals(this.problem, payslips.problem) && + Objects.equals(this.paySlips, payslips.paySlips); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, paySlips); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Problem.java b/src/main/java/com/xero/models/payrolluk/Problem.java index 560a7212f..b2e9c8e38 100644 --- a/src/main/java/com/xero/models/payrolluk/Problem.java +++ b/src/main/java/com/xero/models/payrolluk/Problem.java @@ -9,18 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.InvalidField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; -/** The object returned for a bad request */ +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * The object returned for a bad request + */ @ApiModel(description = "The object returned for a bad request") + public class Problem { StringUtil util = new StringUtil(); @@ -42,186 +59,170 @@ public class Problem { @JsonProperty("invalidFields") private List invalidFields = new ArrayList(); /** - * The type of error format - * - * @param type String - * @return Problem - */ + * The type of error format + * @param type String + * @return Problem + **/ public Problem type(String type) { this.type = type; return this; } - /** + /** * The type of error format - * * @return type - */ + **/ @ApiModelProperty(example = "application/problem+json", value = "The type of error format") - /** + /** * The type of error format - * * @return type String - */ + **/ public String getType() { return type; } - /** - * The type of error format - * - * @param type String - */ + /** + * The type of error format + * @param type String + **/ + public void setType(String type) { this.type = type; } /** - * The type of the error - * - * @param title String - * @return Problem - */ + * The type of the error + * @param title String + * @return Problem + **/ public Problem title(String title) { this.title = title; return this; } - /** + /** * The type of the error - * * @return title - */ + **/ @ApiModelProperty(example = "BadRequest", value = "The type of the error") - /** + /** * The type of the error - * * @return title String - */ + **/ public String getTitle() { return title; } - /** - * The type of the error - * - * @param title String - */ + /** + * The type of the error + * @param title String + **/ + public void setTitle(String title) { this.title = title; } /** - * The error status code - * - * @param status String - * @return Problem - */ + * The error status code + * @param status String + * @return Problem + **/ public Problem status(String status) { this.status = status; return this; } - /** + /** * The error status code - * * @return status - */ + **/ @ApiModelProperty(example = "400", value = "The error status code") - /** + /** * The error status code - * * @return status String - */ + **/ public String getStatus() { return status; } - /** - * The error status code - * - * @param status String - */ + /** + * The error status code + * @param status String + **/ + public void setStatus(String status) { this.status = status; } /** - * A description of the error - * - * @param detail String - * @return Problem - */ + * A description of the error + * @param detail String + * @return Problem + **/ public Problem detail(String detail) { this.detail = detail; return this; } - /** + /** * A description of the error - * * @return detail - */ + **/ @ApiModelProperty(example = "Validation error occurred.", value = "A description of the error") - /** + /** * A description of the error - * * @return detail String - */ + **/ public String getDetail() { return detail; } - /** - * A description of the error - * - * @param detail String - */ + /** + * A description of the error + * @param detail String + **/ + public void setDetail(String detail) { this.detail = detail; } /** - * instance - * - * @param instance String - * @return Problem - */ + * instance + * @param instance String + * @return Problem + **/ public Problem instance(String instance) { this.instance = instance; return this; } - /** + /** * Get instance - * * @return instance - */ + **/ @ApiModelProperty(value = "") - /** + /** * instance - * * @return instance String - */ + **/ public String getInstance() { return instance; } - /** - * instance - * - * @param instance String - */ + /** + * instance + * @param instance String + **/ + public void setInstance(String instance) { this.instance = instance; } /** - * invalidFields - * - * @param invalidFields List<InvalidField> - * @return Problem - */ + * invalidFields + * @param invalidFields List<InvalidField> + * @return Problem + **/ public Problem invalidFields(List invalidFields) { this.invalidFields = invalidFields; return this; @@ -229,10 +230,9 @@ public Problem invalidFields(List invalidFields) { /** * invalidFields - * - * @param invalidFieldsItem InvalidField + * @param invalidFieldsItem InvalidField * @return Problem - */ + **/ public Problem addInvalidFieldsItem(InvalidField invalidFieldsItem) { if (this.invalidFields == null) { this.invalidFields = new ArrayList(); @@ -241,30 +241,29 @@ public Problem addInvalidFieldsItem(InvalidField invalidFieldsItem) { return this; } - /** + /** * Get invalidFields - * * @return invalidFields - */ + **/ @ApiModelProperty(value = "") - /** + /** * invalidFields - * * @return invalidFields List - */ + **/ public List getInvalidFields() { return invalidFields; } - /** - * invalidFields - * - * @param invalidFields List<InvalidField> - */ + /** + * invalidFields + * @param invalidFields List<InvalidField> + **/ + public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -274,12 +273,12 @@ public boolean equals(java.lang.Object o) { return false; } Problem problem = (Problem) o; - return Objects.equals(this.type, problem.type) - && Objects.equals(this.title, problem.title) - && Objects.equals(this.status, problem.status) - && Objects.equals(this.detail, problem.detail) - && Objects.equals(this.instance, problem.instance) - && Objects.equals(this.invalidFields, problem.invalidFields); + return Objects.equals(this.type, problem.type) && + Objects.equals(this.title, problem.title) && + Objects.equals(this.status, problem.status) && + Objects.equals(this.detail, problem.detail) && + Objects.equals(this.instance, problem.instance) && + Objects.equals(this.invalidFields, problem.invalidFields); } @Override @@ -287,6 +286,7 @@ public int hashCode() { return Objects.hash(type, title, status, detail, instance, invalidFields); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,7 +302,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -310,4 +311,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Reimbursement.java b/src/main/java/com/xero/models/payrolluk/Reimbursement.java index 86c555a87..320189d05 100644 --- a/src/main/java/com/xero/models/payrolluk/Reimbursement.java +++ b/src/main/java/com/xero/models/payrolluk/Reimbursement.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Reimbursement + */ -/** Reimbursement */ public class Reimbursement { StringUtil util = new StringUtil(); @@ -33,147 +50,134 @@ public class Reimbursement { @JsonProperty("currentRecord") private Boolean currentRecord; /** - * Xero unique identifier for a reimbursement - * - * @param reimbursementID UUID - * @return Reimbursement - */ + * Xero unique identifier for a reimbursement + * @param reimbursementID UUID + * @return Reimbursement + **/ public Reimbursement reimbursementID(UUID reimbursementID) { this.reimbursementID = reimbursementID; return this; } - /** + /** * Xero unique identifier for a reimbursement - * * @return reimbursementID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for a reimbursement") - /** + /** * Xero unique identifier for a reimbursement - * * @return reimbursementID UUID - */ + **/ public UUID getReimbursementID() { return reimbursementID; } - /** - * Xero unique identifier for a reimbursement - * - * @param reimbursementID UUID - */ + /** + * Xero unique identifier for a reimbursement + * @param reimbursementID UUID + **/ + public void setReimbursementID(UUID reimbursementID) { this.reimbursementID = reimbursementID; } /** - * Name of the reimbursement - * - * @param name String - * @return Reimbursement - */ + * Name of the reimbursement + * @param name String + * @return Reimbursement + **/ public Reimbursement name(String name) { this.name = name; return this; } - /** + /** * Name of the reimbursement - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the reimbursement") - /** + /** * Name of the reimbursement - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the reimbursement - * - * @param name String - */ + /** + * Name of the reimbursement + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Xero unique identifier for the account used for the reimbursement - * - * @param accountID UUID - * @return Reimbursement - */ + * Xero unique identifier for the account used for the reimbursement + * @param accountID UUID + * @return Reimbursement + **/ public Reimbursement accountID(UUID accountID) { this.accountID = accountID; return this; } - /** + /** * Xero unique identifier for the account used for the reimbursement - * * @return accountID - */ - @ApiModelProperty( - required = true, - value = "Xero unique identifier for the account used for the reimbursement") - /** + **/ + @ApiModelProperty(required = true, value = "Xero unique identifier for the account used for the reimbursement") + /** * Xero unique identifier for the account used for the reimbursement - * * @return accountID UUID - */ + **/ public UUID getAccountID() { return accountID; } - /** - * Xero unique identifier for the account used for the reimbursement - * - * @param accountID UUID - */ + /** + * Xero unique identifier for the account used for the reimbursement + * @param accountID UUID + **/ + public void setAccountID(UUID accountID) { this.accountID = accountID; } /** - * Indicates that whether the reimbursement is active - * - * @param currentRecord Boolean - * @return Reimbursement - */ + * Indicates that whether the reimbursement is active + * @param currentRecord Boolean + * @return Reimbursement + **/ public Reimbursement currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Indicates that whether the reimbursement is active - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Indicates that whether the reimbursement is active") - /** + /** * Indicates that whether the reimbursement is active - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Indicates that whether the reimbursement is active - * - * @param currentRecord Boolean - */ + /** + * Indicates that whether the reimbursement is active + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -183,10 +187,10 @@ public boolean equals(java.lang.Object o) { return false; } Reimbursement reimbursement = (Reimbursement) o; - return Objects.equals(this.reimbursementID, reimbursement.reimbursementID) - && Objects.equals(this.name, reimbursement.name) - && Objects.equals(this.accountID, reimbursement.accountID) - && Objects.equals(this.currentRecord, reimbursement.currentRecord); + return Objects.equals(this.reimbursementID, reimbursement.reimbursementID) && + Objects.equals(this.name, reimbursement.name) && + Objects.equals(this.accountID, reimbursement.accountID) && + Objects.equals(this.currentRecord, reimbursement.currentRecord); } @Override @@ -194,6 +198,7 @@ public int hashCode() { return Objects.hash(reimbursementID, name, accountID, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -207,7 +212,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -215,4 +221,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/ReimbursementLine.java b/src/main/java/com/xero/models/payrolluk/ReimbursementLine.java index 915f8aad8..d6ef2e735 100644 --- a/src/main/java/com/xero/models/payrolluk/ReimbursementLine.java +++ b/src/main/java/com/xero/models/payrolluk/ReimbursementLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReimbursementLine + */ -/** ReimbursementLine */ public class ReimbursementLine { StringUtil util = new StringUtil(); @@ -30,110 +47,102 @@ public class ReimbursementLine { @JsonProperty("amount") private Double amount; /** - * Xero identifier for payroll reimbursement - * - * @param reimbursementTypeID UUID - * @return ReimbursementLine - */ + * Xero identifier for payroll reimbursement + * @param reimbursementTypeID UUID + * @return ReimbursementLine + **/ public ReimbursementLine reimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; return this; } - /** + /** * Xero identifier for payroll reimbursement - * * @return reimbursementTypeID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll reimbursement") - /** + /** * Xero identifier for payroll reimbursement - * * @return reimbursementTypeID UUID - */ + **/ public UUID getReimbursementTypeID() { return reimbursementTypeID; } - /** - * Xero identifier for payroll reimbursement - * - * @param reimbursementTypeID UUID - */ + /** + * Xero identifier for payroll reimbursement + * @param reimbursementTypeID UUID + **/ + public void setReimbursementTypeID(UUID reimbursementTypeID) { this.reimbursementTypeID = reimbursementTypeID; } /** - * Reimbursement line description - * - * @param description String - * @return ReimbursementLine - */ + * Reimbursement line description + * @param description String + * @return ReimbursementLine + **/ public ReimbursementLine description(String description) { this.description = description; return this; } - /** + /** * Reimbursement line description - * * @return description - */ + **/ @ApiModelProperty(value = "Reimbursement line description") - /** + /** * Reimbursement line description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Reimbursement line description - * - * @param description String - */ + /** + * Reimbursement line description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Reimbursement amount - * - * @param amount Double - * @return ReimbursementLine - */ + * Reimbursement amount + * @param amount Double + * @return ReimbursementLine + **/ public ReimbursementLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * Reimbursement amount - * * @return amount - */ + **/ @ApiModelProperty(value = "Reimbursement amount") - /** + /** * Reimbursement amount - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * Reimbursement amount - * - * @param amount Double - */ + /** + * Reimbursement amount + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -143,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } ReimbursementLine reimbursementLine = (ReimbursementLine) o; - return Objects.equals(this.reimbursementTypeID, reimbursementLine.reimbursementTypeID) - && Objects.equals(this.description, reimbursementLine.description) - && Objects.equals(this.amount, reimbursementLine.amount); + return Objects.equals(this.reimbursementTypeID, reimbursementLine.reimbursementTypeID) && + Objects.equals(this.description, reimbursementLine.description) && + Objects.equals(this.amount, reimbursementLine.amount); } @Override @@ -153,13 +162,12 @@ public int hashCode() { return Objects.hash(reimbursementTypeID, description, amount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReimbursementLine {\n"); - sb.append(" reimbursementTypeID: ") - .append(toIndentedString(reimbursementTypeID)) - .append("\n"); + sb.append(" reimbursementTypeID: ").append(toIndentedString(reimbursementTypeID)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append("}"); @@ -167,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -175,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/ReimbursementObject.java b/src/main/java/com/xero/models/payrolluk/ReimbursementObject.java index 67194175a..fc562040a 100644 --- a/src/main/java/com/xero/models/payrolluk/ReimbursementObject.java +++ b/src/main/java/com/xero/models/payrolluk/ReimbursementObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.Reimbursement; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ReimbursementObject + */ -/** ReimbursementObject */ public class ReimbursementObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class ReimbursementObject { @JsonProperty("reimbursement") private Reimbursement reimbursement; /** - * pagination - * - * @param pagination Pagination - * @return ReimbursementObject - */ + * pagination + * @param pagination Pagination + * @return ReimbursementObject + **/ public ReimbursementObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return ReimbursementObject - */ + * problem + * @param problem Problem + * @return ReimbursementObject + **/ public ReimbursementObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * reimbursement - * - * @param reimbursement Reimbursement - * @return ReimbursementObject - */ + * reimbursement + * @param reimbursement Reimbursement + * @return ReimbursementObject + **/ public ReimbursementObject reimbursement(Reimbursement reimbursement) { this.reimbursement = reimbursement; return this; } - /** + /** * Get reimbursement - * * @return reimbursement - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursement - * * @return reimbursement Reimbursement - */ + **/ public Reimbursement getReimbursement() { return reimbursement; } - /** - * reimbursement - * - * @param reimbursement Reimbursement - */ + /** + * reimbursement + * @param reimbursement Reimbursement + **/ + public void setReimbursement(Reimbursement reimbursement) { this.reimbursement = reimbursement; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } ReimbursementObject reimbursementObject = (ReimbursementObject) o; - return Objects.equals(this.pagination, reimbursementObject.pagination) - && Objects.equals(this.problem, reimbursementObject.problem) - && Objects.equals(this.reimbursement, reimbursementObject.reimbursement); + return Objects.equals(this.pagination, reimbursementObject.pagination) && + Objects.equals(this.problem, reimbursementObject.problem) && + Objects.equals(this.reimbursement, reimbursementObject.reimbursement); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, reimbursement); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Reimbursements.java b/src/main/java/com/xero/models/payrolluk/Reimbursements.java index 85691f589..cde34f3c2 100644 --- a/src/main/java/com/xero/models/payrolluk/Reimbursements.java +++ b/src/main/java/com/xero/models/payrolluk/Reimbursements.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.Reimbursement; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Reimbursements + */ -/** Reimbursements */ public class Reimbursements { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Reimbursements { @JsonProperty("reimbursements") private List reimbursements = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Reimbursements - */ + * pagination + * @param pagination Pagination + * @return Reimbursements + **/ public Reimbursements pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Reimbursements - */ + * problem + * @param problem Problem + * @return Reimbursements + **/ public Reimbursements problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * reimbursements - * - * @param reimbursements List<Reimbursement> - * @return Reimbursements - */ + * reimbursements + * @param reimbursements List<Reimbursement> + * @return Reimbursements + **/ public Reimbursements reimbursements(List reimbursements) { this.reimbursements = reimbursements; return this; @@ -113,10 +126,9 @@ public Reimbursements reimbursements(List reimbursements) { /** * reimbursements - * - * @param reimbursementsItem Reimbursement + * @param reimbursementsItem Reimbursement * @return Reimbursements - */ + **/ public Reimbursements addReimbursementsItem(Reimbursement reimbursementsItem) { if (this.reimbursements == null) { this.reimbursements = new ArrayList(); @@ -125,30 +137,29 @@ public Reimbursements addReimbursementsItem(Reimbursement reimbursementsItem) { return this; } - /** + /** * Get reimbursements - * * @return reimbursements - */ + **/ @ApiModelProperty(value = "") - /** + /** * reimbursements - * * @return reimbursements List - */ + **/ public List getReimbursements() { return reimbursements; } - /** - * reimbursements - * - * @param reimbursements List<Reimbursement> - */ + /** + * reimbursements + * @param reimbursements List<Reimbursement> + **/ + public void setReimbursements(List reimbursements) { this.reimbursements = reimbursements; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Reimbursements reimbursements = (Reimbursements) o; - return Objects.equals(this.pagination, reimbursements.pagination) - && Objects.equals(this.problem, reimbursements.problem) - && Objects.equals(this.reimbursements, reimbursements.reimbursements); + return Objects.equals(this.pagination, reimbursements.pagination) && + Objects.equals(this.problem, reimbursements.problem) && + Objects.equals(this.reimbursements, reimbursements.reimbursements); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, reimbursements); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/SalaryAndWage.java b/src/main/java/com/xero/models/payrolluk/SalaryAndWage.java index 12a054e99..c5b15e173 100644 --- a/src/main/java/com/xero/models/payrolluk/SalaryAndWage.java +++ b/src/main/java/com/xero/models/payrolluk/SalaryAndWage.java @@ -9,18 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SalaryAndWage + */ -/** SalaryAndWage */ public class SalaryAndWage { StringUtil util = new StringUtil(); @@ -44,15 +59,23 @@ public class SalaryAndWage { @JsonProperty("annualSalary") private Double annualSalary; - /** The current status of the corresponding salary and wages */ + /** + * The current status of the corresponding salary and wages + */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("Active"), - - /** PENDING */ + + /** + * PENDING + */ PENDING("Pending"), - - /** HISTORY */ + + /** + * HISTORY + */ HISTORY("History"); private String value; @@ -61,31 +84,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -97,14 +114,21 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; - /** The type of the payment of the corresponding salary and wages */ + /** + * The type of the payment of the corresponding salary and wages + */ public enum PaymentTypeEnum { - /** SALARY */ + /** + * SALARY + */ SALARY("Salary"), - - /** HOURLY */ + + /** + * HOURLY + */ HOURLY("Hourly"); private String value; @@ -113,31 +137,25 @@ public enum PaymentTypeEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static PaymentTypeEnum fromValue(String value) { for (PaymentTypeEnum b : PaymentTypeEnum.values()) { @@ -149,331 +167,298 @@ public static PaymentTypeEnum fromValue(String value) { } } + @JsonProperty("paymentType") private PaymentTypeEnum paymentType; /** - * Xero unique identifier for a salary and wages record - * - * @param salaryAndWagesID UUID - * @return SalaryAndWage - */ + * Xero unique identifier for a salary and wages record + * @param salaryAndWagesID UUID + * @return SalaryAndWage + **/ public SalaryAndWage salaryAndWagesID(UUID salaryAndWagesID) { this.salaryAndWagesID = salaryAndWagesID; return this; } - /** + /** * Xero unique identifier for a salary and wages record - * * @return salaryAndWagesID - */ + **/ @ApiModelProperty(value = "Xero unique identifier for a salary and wages record") - /** + /** * Xero unique identifier for a salary and wages record - * * @return salaryAndWagesID UUID - */ + **/ public UUID getSalaryAndWagesID() { return salaryAndWagesID; } - /** - * Xero unique identifier for a salary and wages record - * - * @param salaryAndWagesID UUID - */ + /** + * Xero unique identifier for a salary and wages record + * @param salaryAndWagesID UUID + **/ + public void setSalaryAndWagesID(UUID salaryAndWagesID) { this.salaryAndWagesID = salaryAndWagesID; } /** - * Xero unique identifier for an earnings rate - * - * @param earningsRateID UUID - * @return SalaryAndWage - */ + * Xero unique identifier for an earnings rate + * @param earningsRateID UUID + * @return SalaryAndWage + **/ public SalaryAndWage earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero unique identifier for an earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(required = true, value = "Xero unique identifier for an earnings rate") - /** + /** * Xero unique identifier for an earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero unique identifier for an earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero unique identifier for an earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * The Number of Units per week for the corresponding salary and wages - * - * @param numberOfUnitsPerWeek Double - * @return SalaryAndWage - */ + * The Number of Units per week for the corresponding salary and wages + * @param numberOfUnitsPerWeek Double + * @return SalaryAndWage + **/ public SalaryAndWage numberOfUnitsPerWeek(Double numberOfUnitsPerWeek) { this.numberOfUnitsPerWeek = numberOfUnitsPerWeek; return this; } - /** + /** * The Number of Units per week for the corresponding salary and wages - * * @return numberOfUnitsPerWeek - */ - @ApiModelProperty( - required = true, - value = "The Number of Units per week for the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The Number of Units per week for the corresponding salary and wages") + /** * The Number of Units per week for the corresponding salary and wages - * * @return numberOfUnitsPerWeek Double - */ + **/ public Double getNumberOfUnitsPerWeek() { return numberOfUnitsPerWeek; } - /** - * The Number of Units per week for the corresponding salary and wages - * - * @param numberOfUnitsPerWeek Double - */ + /** + * The Number of Units per week for the corresponding salary and wages + * @param numberOfUnitsPerWeek Double + **/ + public void setNumberOfUnitsPerWeek(Double numberOfUnitsPerWeek) { this.numberOfUnitsPerWeek = numberOfUnitsPerWeek; } /** - * The rate of each unit for the corresponding salary and wages - * - * @param ratePerUnit Double - * @return SalaryAndWage - */ + * The rate of each unit for the corresponding salary and wages + * @param ratePerUnit Double + * @return SalaryAndWage + **/ public SalaryAndWage ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * The rate of each unit for the corresponding salary and wages - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "The rate of each unit for the corresponding salary and wages") - /** + /** * The rate of each unit for the corresponding salary and wages - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * The rate of each unit for the corresponding salary and wages - * - * @param ratePerUnit Double - */ + /** + * The rate of each unit for the corresponding salary and wages + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * The Number of Units per day for the corresponding salary and wages - * - * @param numberOfUnitsPerDay Double - * @return SalaryAndWage - */ + * The Number of Units per day for the corresponding salary and wages + * @param numberOfUnitsPerDay Double + * @return SalaryAndWage + **/ public SalaryAndWage numberOfUnitsPerDay(Double numberOfUnitsPerDay) { this.numberOfUnitsPerDay = numberOfUnitsPerDay; return this; } - /** + /** * The Number of Units per day for the corresponding salary and wages - * * @return numberOfUnitsPerDay - */ + **/ @ApiModelProperty(value = "The Number of Units per day for the corresponding salary and wages") - /** + /** * The Number of Units per day for the corresponding salary and wages - * * @return numberOfUnitsPerDay Double - */ + **/ public Double getNumberOfUnitsPerDay() { return numberOfUnitsPerDay; } - /** - * The Number of Units per day for the corresponding salary and wages - * - * @param numberOfUnitsPerDay Double - */ + /** + * The Number of Units per day for the corresponding salary and wages + * @param numberOfUnitsPerDay Double + **/ + public void setNumberOfUnitsPerDay(Double numberOfUnitsPerDay) { this.numberOfUnitsPerDay = numberOfUnitsPerDay; } /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - * @return SalaryAndWage - */ + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + * @return SalaryAndWage + **/ public SalaryAndWage effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; return this; } - /** + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom - */ - @ApiModelProperty( - required = true, - value = "The effective date of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The effective date of the corresponding salary and wages") + /** * The effective date of the corresponding salary and wages - * * @return effectiveFrom LocalDate - */ + **/ public LocalDate getEffectiveFrom() { return effectiveFrom; } - /** - * The effective date of the corresponding salary and wages - * - * @param effectiveFrom LocalDate - */ + /** + * The effective date of the corresponding salary and wages + * @param effectiveFrom LocalDate + **/ + public void setEffectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; } /** - * The annual salary - * - * @param annualSalary Double - * @return SalaryAndWage - */ + * The annual salary + * @param annualSalary Double + * @return SalaryAndWage + **/ public SalaryAndWage annualSalary(Double annualSalary) { this.annualSalary = annualSalary; return this; } - /** + /** * The annual salary - * * @return annualSalary - */ + **/ @ApiModelProperty(required = true, value = "The annual salary") - /** + /** * The annual salary - * * @return annualSalary Double - */ + **/ public Double getAnnualSalary() { return annualSalary; } - /** - * The annual salary - * - * @param annualSalary Double - */ + /** + * The annual salary + * @param annualSalary Double + **/ + public void setAnnualSalary(Double annualSalary) { this.annualSalary = annualSalary; } /** - * The current status of the corresponding salary and wages - * - * @param status StatusEnum - * @return SalaryAndWage - */ + * The current status of the corresponding salary and wages + * @param status StatusEnum + * @return SalaryAndWage + **/ public SalaryAndWage status(StatusEnum status) { this.status = status; return this; } - /** + /** * The current status of the corresponding salary and wages - * * @return status - */ - @ApiModelProperty( - required = true, - value = "The current status of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The current status of the corresponding salary and wages") + /** * The current status of the corresponding salary and wages - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * The current status of the corresponding salary and wages - * - * @param status StatusEnum - */ + /** + * The current status of the corresponding salary and wages + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * The type of the payment of the corresponding salary and wages - * - * @param paymentType PaymentTypeEnum - * @return SalaryAndWage - */ + * The type of the payment of the corresponding salary and wages + * @param paymentType PaymentTypeEnum + * @return SalaryAndWage + **/ public SalaryAndWage paymentType(PaymentTypeEnum paymentType) { this.paymentType = paymentType; return this; } - /** + /** * The type of the payment of the corresponding salary and wages - * * @return paymentType - */ - @ApiModelProperty( - required = true, - value = "The type of the payment of the corresponding salary and wages") - /** + **/ + @ApiModelProperty(required = true, value = "The type of the payment of the corresponding salary and wages") + /** * The type of the payment of the corresponding salary and wages - * * @return paymentType PaymentTypeEnum - */ + **/ public PaymentTypeEnum getPaymentType() { return paymentType; } - /** - * The type of the payment of the corresponding salary and wages - * - * @param paymentType PaymentTypeEnum - */ + /** + * The type of the payment of the corresponding salary and wages + * @param paymentType PaymentTypeEnum + **/ + public void setPaymentType(PaymentTypeEnum paymentType) { this.paymentType = paymentType; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -483,44 +468,32 @@ public boolean equals(java.lang.Object o) { return false; } SalaryAndWage salaryAndWage = (SalaryAndWage) o; - return Objects.equals(this.salaryAndWagesID, salaryAndWage.salaryAndWagesID) - && Objects.equals(this.earningsRateID, salaryAndWage.earningsRateID) - && Objects.equals(this.numberOfUnitsPerWeek, salaryAndWage.numberOfUnitsPerWeek) - && Objects.equals(this.ratePerUnit, salaryAndWage.ratePerUnit) - && Objects.equals(this.numberOfUnitsPerDay, salaryAndWage.numberOfUnitsPerDay) - && Objects.equals(this.effectiveFrom, salaryAndWage.effectiveFrom) - && Objects.equals(this.annualSalary, salaryAndWage.annualSalary) - && Objects.equals(this.status, salaryAndWage.status) - && Objects.equals(this.paymentType, salaryAndWage.paymentType); + return Objects.equals(this.salaryAndWagesID, salaryAndWage.salaryAndWagesID) && + Objects.equals(this.earningsRateID, salaryAndWage.earningsRateID) && + Objects.equals(this.numberOfUnitsPerWeek, salaryAndWage.numberOfUnitsPerWeek) && + Objects.equals(this.ratePerUnit, salaryAndWage.ratePerUnit) && + Objects.equals(this.numberOfUnitsPerDay, salaryAndWage.numberOfUnitsPerDay) && + Objects.equals(this.effectiveFrom, salaryAndWage.effectiveFrom) && + Objects.equals(this.annualSalary, salaryAndWage.annualSalary) && + Objects.equals(this.status, salaryAndWage.status) && + Objects.equals(this.paymentType, salaryAndWage.paymentType); } @Override public int hashCode() { - return Objects.hash( - salaryAndWagesID, - earningsRateID, - numberOfUnitsPerWeek, - ratePerUnit, - numberOfUnitsPerDay, - effectiveFrom, - annualSalary, - status, - paymentType); + return Objects.hash(salaryAndWagesID, earningsRateID, numberOfUnitsPerWeek, ratePerUnit, numberOfUnitsPerDay, effectiveFrom, annualSalary, status, paymentType); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SalaryAndWage {\n"); sb.append(" salaryAndWagesID: ").append(toIndentedString(salaryAndWagesID)).append("\n"); sb.append(" earningsRateID: ").append(toIndentedString(earningsRateID)).append("\n"); - sb.append(" numberOfUnitsPerWeek: ") - .append(toIndentedString(numberOfUnitsPerWeek)) - .append("\n"); + sb.append(" numberOfUnitsPerWeek: ").append(toIndentedString(numberOfUnitsPerWeek)).append("\n"); sb.append(" ratePerUnit: ").append(toIndentedString(ratePerUnit)).append("\n"); - sb.append(" numberOfUnitsPerDay: ") - .append(toIndentedString(numberOfUnitsPerDay)) - .append("\n"); + sb.append(" numberOfUnitsPerDay: ").append(toIndentedString(numberOfUnitsPerDay)).append("\n"); sb.append(" effectiveFrom: ").append(toIndentedString(effectiveFrom)).append("\n"); sb.append(" annualSalary: ").append(toIndentedString(annualSalary)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -530,7 +503,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -538,4 +512,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/SalaryAndWageObject.java b/src/main/java/com/xero/models/payrolluk/SalaryAndWageObject.java index f7889c4e5..022227581 100644 --- a/src/main/java/com/xero/models/payrolluk/SalaryAndWageObject.java +++ b/src/main/java/com/xero/models/payrolluk/SalaryAndWageObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.SalaryAndWage; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SalaryAndWageObject + */ -/** SalaryAndWageObject */ public class SalaryAndWageObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class SalaryAndWageObject { @JsonProperty("salaryAndWages") private SalaryAndWage salaryAndWages; /** - * pagination - * - * @param pagination Pagination - * @return SalaryAndWageObject - */ + * pagination + * @param pagination Pagination + * @return SalaryAndWageObject + **/ public SalaryAndWageObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return SalaryAndWageObject - */ + * problem + * @param problem Problem + * @return SalaryAndWageObject + **/ public SalaryAndWageObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * salaryAndWages - * - * @param salaryAndWages SalaryAndWage - * @return SalaryAndWageObject - */ + * salaryAndWages + * @param salaryAndWages SalaryAndWage + * @return SalaryAndWageObject + **/ public SalaryAndWageObject salaryAndWages(SalaryAndWage salaryAndWages) { this.salaryAndWages = salaryAndWages; return this; } - /** + /** * Get salaryAndWages - * * @return salaryAndWages - */ + **/ @ApiModelProperty(value = "") - /** + /** * salaryAndWages - * * @return salaryAndWages SalaryAndWage - */ + **/ public SalaryAndWage getSalaryAndWages() { return salaryAndWages; } - /** - * salaryAndWages - * - * @param salaryAndWages SalaryAndWage - */ + /** + * salaryAndWages + * @param salaryAndWages SalaryAndWage + **/ + public void setSalaryAndWages(SalaryAndWage salaryAndWages) { this.salaryAndWages = salaryAndWages; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } SalaryAndWageObject salaryAndWageObject = (SalaryAndWageObject) o; - return Objects.equals(this.pagination, salaryAndWageObject.pagination) - && Objects.equals(this.problem, salaryAndWageObject.problem) - && Objects.equals(this.salaryAndWages, salaryAndWageObject.salaryAndWages); + return Objects.equals(this.pagination, salaryAndWageObject.pagination) && + Objects.equals(this.problem, salaryAndWageObject.problem) && + Objects.equals(this.salaryAndWages, salaryAndWageObject.salaryAndWages); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, salaryAndWages); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/SalaryAndWages.java b/src/main/java/com/xero/models/payrolluk/SalaryAndWages.java index c10790adb..bfbc55b14 100644 --- a/src/main/java/com/xero/models/payrolluk/SalaryAndWages.java +++ b/src/main/java/com/xero/models/payrolluk/SalaryAndWages.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.SalaryAndWage; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * SalaryAndWages + */ -/** SalaryAndWages */ public class SalaryAndWages { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class SalaryAndWages { @JsonProperty("salaryAndWages") private List salaryAndWages = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return SalaryAndWages - */ + * pagination + * @param pagination Pagination + * @return SalaryAndWages + **/ public SalaryAndWages pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return SalaryAndWages - */ + * problem + * @param problem Problem + * @return SalaryAndWages + **/ public SalaryAndWages problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * salaryAndWages - * - * @param salaryAndWages List<SalaryAndWage> - * @return SalaryAndWages - */ + * salaryAndWages + * @param salaryAndWages List<SalaryAndWage> + * @return SalaryAndWages + **/ public SalaryAndWages salaryAndWages(List salaryAndWages) { this.salaryAndWages = salaryAndWages; return this; @@ -113,10 +126,9 @@ public SalaryAndWages salaryAndWages(List salaryAndWages) { /** * salaryAndWages - * - * @param salaryAndWagesItem SalaryAndWage + * @param salaryAndWagesItem SalaryAndWage * @return SalaryAndWages - */ + **/ public SalaryAndWages addSalaryAndWagesItem(SalaryAndWage salaryAndWagesItem) { if (this.salaryAndWages == null) { this.salaryAndWages = new ArrayList(); @@ -125,30 +137,29 @@ public SalaryAndWages addSalaryAndWagesItem(SalaryAndWage salaryAndWagesItem) { return this; } - /** + /** * Get salaryAndWages - * * @return salaryAndWages - */ + **/ @ApiModelProperty(value = "") - /** + /** * salaryAndWages - * * @return salaryAndWages List - */ + **/ public List getSalaryAndWages() { return salaryAndWages; } - /** - * salaryAndWages - * - * @param salaryAndWages List<SalaryAndWage> - */ + /** + * salaryAndWages + * @param salaryAndWages List<SalaryAndWage> + **/ + public void setSalaryAndWages(List salaryAndWages) { this.salaryAndWages = salaryAndWages; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } SalaryAndWages salaryAndWages = (SalaryAndWages) o; - return Objects.equals(this.pagination, salaryAndWages.pagination) - && Objects.equals(this.problem, salaryAndWages.problem) - && Objects.equals(this.salaryAndWages, salaryAndWages.salaryAndWages); + return Objects.equals(this.pagination, salaryAndWages.pagination) && + Objects.equals(this.problem, salaryAndWages.problem) && + Objects.equals(this.salaryAndWages, salaryAndWages.salaryAndWages); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, salaryAndWages); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Settings.java b/src/main/java/com/xero/models/payrolluk/Settings.java index e7b826d29..4b6af2f82 100644 --- a/src/main/java/com/xero/models/payrolluk/Settings.java +++ b/src/main/java/com/xero/models/payrolluk/Settings.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Accounts; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Settings + */ -/** Settings */ public class Settings { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class Settings { @JsonProperty("settings") private Accounts settings; /** - * pagination - * - * @param pagination Pagination - * @return Settings - */ + * pagination + * @param pagination Pagination + * @return Settings + **/ public Settings pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Settings - */ + * problem + * @param problem Problem + * @return Settings + **/ public Settings problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * settings - * - * @param settings Accounts - * @return Settings - */ + * settings + * @param settings Accounts + * @return Settings + **/ public Settings settings(Accounts settings) { this.settings = settings; return this; } - /** + /** * Get settings - * * @return settings - */ + **/ @ApiModelProperty(value = "") - /** + /** * settings - * * @return settings Accounts - */ + **/ public Accounts getSettings() { return settings; } - /** - * settings - * - * @param settings Accounts - */ + /** + * settings + * @param settings Accounts + **/ + public void setSettings(Accounts settings) { this.settings = settings; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } Settings settings = (Settings) o; - return Objects.equals(this.pagination, settings.pagination) - && Objects.equals(this.problem, settings.problem) - && Objects.equals(this.settings, settings.settings); + return Objects.equals(this.pagination, settings.pagination) && + Objects.equals(this.problem, settings.problem) && + Objects.equals(this.settings, settings.settings); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, settings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/StatutoryDeduction.java b/src/main/java/com/xero/models/payrolluk/StatutoryDeduction.java index 0d614f628..c6e61f627 100644 --- a/src/main/java/com/xero/models/payrolluk/StatutoryDeduction.java +++ b/src/main/java/com/xero/models/payrolluk/StatutoryDeduction.java @@ -9,15 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.StatutoryDeductionCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * StatutoryDeduction + */ -/** StatutoryDeduction */ public class StatutoryDeduction { StringUtil util = new StringUtil(); @@ -36,181 +54,166 @@ public class StatutoryDeduction { @JsonProperty("currentRecord") private Boolean currentRecord; /** - * The Xero identifier for earnings order - * - * @param id UUID - * @return StatutoryDeduction - */ + * The Xero identifier for earnings order + * @param id UUID + * @return StatutoryDeduction + **/ public StatutoryDeduction id(UUID id) { this.id = id; return this; } - /** + /** * The Xero identifier for earnings order - * * @return id - */ + **/ @ApiModelProperty(value = "The Xero identifier for earnings order") - /** + /** * The Xero identifier for earnings order - * * @return id UUID - */ + **/ public UUID getId() { return id; } - /** - * The Xero identifier for earnings order - * - * @param id UUID - */ + /** + * The Xero identifier for earnings order + * @param id UUID + **/ + public void setId(UUID id) { this.id = id; } /** - * Name of the earnings order - * - * @param name String - * @return StatutoryDeduction - */ + * Name of the earnings order + * @param name String + * @return StatutoryDeduction + **/ public StatutoryDeduction name(String name) { this.name = name; return this; } - /** + /** * Name of the earnings order - * * @return name - */ + **/ @ApiModelProperty(value = "Name of the earnings order") - /** + /** * Name of the earnings order - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the earnings order - * - * @param name String - */ + /** + * Name of the earnings order + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - * @return StatutoryDeduction - */ - public StatutoryDeduction statutoryDeductionCategory( - StatutoryDeductionCategory statutoryDeductionCategory) { + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + * @return StatutoryDeduction + **/ + public StatutoryDeduction statutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; return this; } - /** + /** * Get statutoryDeductionCategory - * * @return statutoryDeductionCategory - */ + **/ @ApiModelProperty(value = "") - /** + /** * statutoryDeductionCategory - * * @return statutoryDeductionCategory StatutoryDeductionCategory - */ + **/ public StatutoryDeductionCategory getStatutoryDeductionCategory() { return statutoryDeductionCategory; } - /** - * statutoryDeductionCategory - * - * @param statutoryDeductionCategory StatutoryDeductionCategory - */ + /** + * statutoryDeductionCategory + * @param statutoryDeductionCategory StatutoryDeductionCategory + **/ + public void setStatutoryDeductionCategory(StatutoryDeductionCategory statutoryDeductionCategory) { this.statutoryDeductionCategory = statutoryDeductionCategory; } /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - * @return StatutoryDeduction - */ + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + * @return StatutoryDeduction + **/ public StatutoryDeduction liabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; return this; } - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId - */ + **/ @ApiModelProperty(value = "Xero identifier for Liability Account") - /** + /** * Xero identifier for Liability Account - * * @return liabilityAccountId UUID - */ + **/ public UUID getLiabilityAccountId() { return liabilityAccountId; } - /** - * Xero identifier for Liability Account - * - * @param liabilityAccountId UUID - */ + /** + * Xero identifier for Liability Account + * @param liabilityAccountId UUID + **/ + public void setLiabilityAccountId(UUID liabilityAccountId) { this.liabilityAccountId = liabilityAccountId; } /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - * @return StatutoryDeduction - */ + * Identifier of a record is active or not. + * @param currentRecord Boolean + * @return StatutoryDeduction + **/ public StatutoryDeduction currentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; return this; } - /** + /** * Identifier of a record is active or not. - * * @return currentRecord - */ + **/ @ApiModelProperty(value = "Identifier of a record is active or not.") - /** + /** * Identifier of a record is active or not. - * * @return currentRecord Boolean - */ + **/ public Boolean getCurrentRecord() { return currentRecord; } - /** - * Identifier of a record is active or not. - * - * @param currentRecord Boolean - */ + /** + * Identifier of a record is active or not. + * @param currentRecord Boolean + **/ + public void setCurrentRecord(Boolean currentRecord) { this.currentRecord = currentRecord; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,12 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } StatutoryDeduction statutoryDeduction = (StatutoryDeduction) o; - return Objects.equals(this.id, statutoryDeduction.id) - && Objects.equals(this.name, statutoryDeduction.name) - && Objects.equals( - this.statutoryDeductionCategory, statutoryDeduction.statutoryDeductionCategory) - && Objects.equals(this.liabilityAccountId, statutoryDeduction.liabilityAccountId) - && Objects.equals(this.currentRecord, statutoryDeduction.currentRecord); + return Objects.equals(this.id, statutoryDeduction.id) && + Objects.equals(this.name, statutoryDeduction.name) && + Objects.equals(this.statutoryDeductionCategory, statutoryDeduction.statutoryDeductionCategory) && + Objects.equals(this.liabilityAccountId, statutoryDeduction.liabilityAccountId) && + Objects.equals(this.currentRecord, statutoryDeduction.currentRecord); } @Override @@ -233,15 +235,14 @@ public int hashCode() { return Objects.hash(id, name, statutoryDeductionCategory, liabilityAccountId, currentRecord); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StatutoryDeduction {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" statutoryDeductionCategory: ") - .append(toIndentedString(statutoryDeductionCategory)) - .append("\n"); + sb.append(" statutoryDeductionCategory: ").append(toIndentedString(statutoryDeductionCategory)).append("\n"); sb.append(" liabilityAccountId: ").append(toIndentedString(liabilityAccountId)).append("\n"); sb.append(" currentRecord: ").append(toIndentedString(currentRecord)).append("\n"); sb.append("}"); @@ -249,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -257,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/StatutoryDeductionCategory.java b/src/main/java/com/xero/models/payrolluk/StatutoryDeductionCategory.java index bbfe62565..2be7d2c4f 100644 --- a/src/main/java/com/xero/models/payrolluk/StatutoryDeductionCategory.java +++ b/src/main/java/com/xero/models/payrolluk/StatutoryDeductionCategory.java @@ -9,55 +9,95 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; - +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Statutory Deduction Category */ +/** + * Statutory Deduction Category + */ public enum StatutoryDeductionCategory { - - /** ADDITIONALSTUDENTLOAN */ + + /** + * ADDITIONALSTUDENTLOAN + */ ADDITIONALSTUDENTLOAN("AdditionalStudentLoan"), - - /** CHILDSUPPORT */ + + /** + * CHILDSUPPORT + */ CHILDSUPPORT("ChildSupport"), - - /** COURTFINES */ + + /** + * COURTFINES + */ COURTFINES("CourtFines"), - - /** CREDITOR */ + + /** + * CREDITOR + */ CREDITOR("Creditor"), - - /** FEDERALLEVY */ + + /** + * FEDERALLEVY + */ FEDERALLEVY("FederalLevy"), - - /** INLANDREVENUEARREARS */ + + /** + * INLANDREVENUEARREARS + */ INLANDREVENUEARREARS("InlandRevenueArrears"), - - /** KIWISAVER */ + + /** + * KIWISAVER + */ KIWISAVER("KiwiSaver"), - - /** MSDREPAYMENTS */ + + /** + * MSDREPAYMENTS + */ MSDREPAYMENTS("MsdRepayments"), - - /** NONPRIORITYORDER */ + + /** + * NONPRIORITYORDER + */ NONPRIORITYORDER("NonPriorityOrder"), - - /** PRIORITYORDER */ + + /** + * PRIORITYORDER + */ PRIORITYORDER("PriorityOrder"), - - /** TABLEBASED */ + + /** + * TABLEBASED + */ TABLEBASED("TableBased"), - - /** STUDENTLOAN */ + + /** + * STUDENTLOAN + */ STUDENTLOAN("StudentLoan"), - - /** VOLUNTARYSTUDENTLOAN */ + + /** + * VOLUNTARYSTUDENTLOAN + */ VOLUNTARYSTUDENTLOAN("VoluntaryStudentLoan"), - - /** USCHILDSUPPORT */ + + /** + * USCHILDSUPPORT + */ USCHILDSUPPORT("USChildSupport"); private String value; @@ -66,26 +106,24 @@ public enum StatutoryDeductionCategory { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static StatutoryDeductionCategory fromValue(String value) { @@ -97,3 +135,4 @@ public static StatutoryDeductionCategory fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/payrolluk/TaxLine.java b/src/main/java/com/xero/models/payrolluk/TaxLine.java index 47479da92..4dbb4eb21 100644 --- a/src/main/java/com/xero/models/payrolluk/TaxLine.java +++ b/src/main/java/com/xero/models/payrolluk/TaxLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaxLine + */ -/** TaxLine */ public class TaxLine { StringUtil util = new StringUtil(); @@ -39,218 +56,198 @@ public class TaxLine { @JsonProperty("manualAdjustment") private Boolean manualAdjustment; /** - * Xero identifier for payroll tax line - * - * @param taxLineID UUID - * @return TaxLine - */ + * Xero identifier for payroll tax line + * @param taxLineID UUID + * @return TaxLine + **/ public TaxLine taxLineID(UUID taxLineID) { this.taxLineID = taxLineID; return this; } - /** + /** * Xero identifier for payroll tax line - * * @return taxLineID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll tax line") - /** + /** * Xero identifier for payroll tax line - * * @return taxLineID UUID - */ + **/ public UUID getTaxLineID() { return taxLineID; } - /** - * Xero identifier for payroll tax line - * - * @param taxLineID UUID - */ + /** + * Xero identifier for payroll tax line + * @param taxLineID UUID + **/ + public void setTaxLineID(UUID taxLineID) { this.taxLineID = taxLineID; } /** - * Tax line description - * - * @param description String - * @return TaxLine - */ + * Tax line description + * @param description String + * @return TaxLine + **/ public TaxLine description(String description) { this.description = description; return this; } - /** + /** * Tax line description - * * @return description - */ + **/ @ApiModelProperty(value = "Tax line description") - /** + /** * Tax line description - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * Tax line description - * - * @param description String - */ + /** + * Tax line description + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Identifies if the amount is paid for by the employee or employer. True if employer pays the tax - * - * @param isEmployerTax Boolean - * @return TaxLine - */ + * Identifies if the amount is paid for by the employee or employer. True if employer pays the tax + * @param isEmployerTax Boolean + * @return TaxLine + **/ public TaxLine isEmployerTax(Boolean isEmployerTax) { this.isEmployerTax = isEmployerTax; return this; } - /** + /** * Identifies if the amount is paid for by the employee or employer. True if employer pays the tax - * * @return isEmployerTax - */ - @ApiModelProperty( - value = - "Identifies if the amount is paid for by the employee or employer. True if employer pays" - + " the tax") - /** + **/ + @ApiModelProperty(value = "Identifies if the amount is paid for by the employee or employer. True if employer pays the tax") + /** * Identifies if the amount is paid for by the employee or employer. True if employer pays the tax - * * @return isEmployerTax Boolean - */ + **/ public Boolean getIsEmployerTax() { return isEmployerTax; } - /** - * Identifies if the amount is paid for by the employee or employer. True if employer pays the tax - * - * @param isEmployerTax Boolean - */ + /** + * Identifies if the amount is paid for by the employee or employer. True if employer pays the tax + * @param isEmployerTax Boolean + **/ + public void setIsEmployerTax(Boolean isEmployerTax) { this.isEmployerTax = isEmployerTax; } /** - * The amount of the tax line - * - * @param amount Double - * @return TaxLine - */ + * The amount of the tax line + * @param amount Double + * @return TaxLine + **/ public TaxLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the tax line - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the tax line") - /** + /** * The amount of the tax line - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the tax line - * - * @param amount Double - */ + /** + * The amount of the tax line + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Tax type ID - * - * @param globalTaxTypeID String - * @return TaxLine - */ + * Tax type ID + * @param globalTaxTypeID String + * @return TaxLine + **/ public TaxLine globalTaxTypeID(String globalTaxTypeID) { this.globalTaxTypeID = globalTaxTypeID; return this; } - /** + /** * Tax type ID - * * @return globalTaxTypeID - */ + **/ @ApiModelProperty(value = "Tax type ID") - /** + /** * Tax type ID - * * @return globalTaxTypeID String - */ + **/ public String getGlobalTaxTypeID() { return globalTaxTypeID; } - /** - * Tax type ID - * - * @param globalTaxTypeID String - */ + /** + * Tax type ID + * @param globalTaxTypeID String + **/ + public void setGlobalTaxTypeID(String globalTaxTypeID) { this.globalTaxTypeID = globalTaxTypeID; } /** - * Identifies if the tax line is a manual adjustment - * - * @param manualAdjustment Boolean - * @return TaxLine - */ + * Identifies if the tax line is a manual adjustment + * @param manualAdjustment Boolean + * @return TaxLine + **/ public TaxLine manualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; return this; } - /** + /** * Identifies if the tax line is a manual adjustment - * * @return manualAdjustment - */ + **/ @ApiModelProperty(value = "Identifies if the tax line is a manual adjustment") - /** + /** * Identifies if the tax line is a manual adjustment - * * @return manualAdjustment Boolean - */ + **/ public Boolean getManualAdjustment() { return manualAdjustment; } - /** - * Identifies if the tax line is a manual adjustment - * - * @param manualAdjustment Boolean - */ + /** + * Identifies if the tax line is a manual adjustment + * @param manualAdjustment Boolean + **/ + public void setManualAdjustment(Boolean manualAdjustment) { this.manualAdjustment = manualAdjustment; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -260,20 +257,20 @@ public boolean equals(java.lang.Object o) { return false; } TaxLine taxLine = (TaxLine) o; - return Objects.equals(this.taxLineID, taxLine.taxLineID) - && Objects.equals(this.description, taxLine.description) - && Objects.equals(this.isEmployerTax, taxLine.isEmployerTax) - && Objects.equals(this.amount, taxLine.amount) - && Objects.equals(this.globalTaxTypeID, taxLine.globalTaxTypeID) - && Objects.equals(this.manualAdjustment, taxLine.manualAdjustment); + return Objects.equals(this.taxLineID, taxLine.taxLineID) && + Objects.equals(this.description, taxLine.description) && + Objects.equals(this.isEmployerTax, taxLine.isEmployerTax) && + Objects.equals(this.amount, taxLine.amount) && + Objects.equals(this.globalTaxTypeID, taxLine.globalTaxTypeID) && + Objects.equals(this.manualAdjustment, taxLine.manualAdjustment); } @Override public int hashCode() { - return Objects.hash( - taxLineID, description, isEmployerTax, amount, globalTaxTypeID, manualAdjustment); + return Objects.hash(taxLineID, description, isEmployerTax, amount, globalTaxTypeID, manualAdjustment); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -289,7 +286,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -297,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Timesheet.java b/src/main/java/com/xero/models/payrolluk/Timesheet.java index 361d58638..bf0801819 100644 --- a/src/main/java/com/xero/models/payrolluk/Timesheet.java +++ b/src/main/java/com/xero/models/payrolluk/Timesheet.java @@ -9,21 +9,37 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.payrolluk.TimesheetLine; +import io.swagger.annotations.ApiModel; 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; +import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Timesheet + */ -/** Timesheet */ public class Timesheet { StringUtil util = new StringUtil(); @@ -41,15 +57,23 @@ public class Timesheet { @JsonProperty("endDate") private LocalDate endDate; - /** Status of the timesheet */ + /** + * Status of the timesheet + */ public enum StatusEnum { - /** DRAFT */ + /** + * DRAFT + */ DRAFT("Draft"), - - /** APPROVED */ + + /** + * APPROVED + */ APPROVED("Approved"), - - /** COMPLETED */ + + /** + * COMPLETED + */ COMPLETED("Completed"); private String value; @@ -58,31 +82,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -94,6 +112,7 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; @@ -106,295 +125,266 @@ public static StatusEnum fromValue(String value) { @JsonProperty("timesheetLines") private List timesheetLines = new ArrayList(); /** - * The Xero identifier for a Timesheet - * - * @param timesheetID UUID - * @return Timesheet - */ + * The Xero identifier for a Timesheet + * @param timesheetID UUID + * @return Timesheet + **/ public Timesheet timesheetID(UUID timesheetID) { this.timesheetID = timesheetID; return this; } - /** + /** * The Xero identifier for a Timesheet - * * @return timesheetID - */ + **/ @ApiModelProperty(value = "The Xero identifier for a Timesheet") - /** + /** * The Xero identifier for a Timesheet - * * @return timesheetID UUID - */ + **/ public UUID getTimesheetID() { return timesheetID; } - /** - * The Xero identifier for a Timesheet - * - * @param timesheetID UUID - */ + /** + * The Xero identifier for a Timesheet + * @param timesheetID UUID + **/ + public void setTimesheetID(UUID timesheetID) { this.timesheetID = timesheetID; } /** - * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * - * @param payrollCalendarID UUID - * @return Timesheet - */ + * The Xero identifier for the Payroll Calendar that the Timesheet applies to + * @param payrollCalendarID UUID + * @return Timesheet + **/ public Timesheet payrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; return this; } - /** + /** * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * * @return payrollCalendarID - */ - @ApiModelProperty( - required = true, - value = "The Xero identifier for the Payroll Calendar that the Timesheet applies to") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero identifier for the Payroll Calendar that the Timesheet applies to") + /** * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * * @return payrollCalendarID UUID - */ + **/ public UUID getPayrollCalendarID() { return payrollCalendarID; } - /** - * The Xero identifier for the Payroll Calendar that the Timesheet applies to - * - * @param payrollCalendarID UUID - */ + /** + * The Xero identifier for the Payroll Calendar that the Timesheet applies to + * @param payrollCalendarID UUID + **/ + public void setPayrollCalendarID(UUID payrollCalendarID) { this.payrollCalendarID = payrollCalendarID; } /** - * The Xero identifier for the Employee that the Timesheet is for - * - * @param employeeID UUID - * @return Timesheet - */ + * The Xero identifier for the Employee that the Timesheet is for + * @param employeeID UUID + * @return Timesheet + **/ public Timesheet employeeID(UUID employeeID) { this.employeeID = employeeID; return this; } - /** + /** * The Xero identifier for the Employee that the Timesheet is for - * * @return employeeID - */ - @ApiModelProperty( - required = true, - value = "The Xero identifier for the Employee that the Timesheet is for") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero identifier for the Employee that the Timesheet is for") + /** * The Xero identifier for the Employee that the Timesheet is for - * * @return employeeID UUID - */ + **/ public UUID getEmployeeID() { return employeeID; } - /** - * The Xero identifier for the Employee that the Timesheet is for - * - * @param employeeID UUID - */ + /** + * The Xero identifier for the Employee that the Timesheet is for + * @param employeeID UUID + **/ + public void setEmployeeID(UUID employeeID) { this.employeeID = employeeID; } /** - * The Start Date of the Timesheet period (YYYY-MM-DD) - * - * @param startDate LocalDate - * @return Timesheet - */ + * The Start Date of the Timesheet period (YYYY-MM-DD) + * @param startDate LocalDate + * @return Timesheet + **/ public Timesheet startDate(LocalDate startDate) { this.startDate = startDate; return this; } - /** + /** * The Start Date of the Timesheet period (YYYY-MM-DD) - * * @return startDate - */ + **/ @ApiModelProperty(required = true, value = "The Start Date of the Timesheet period (YYYY-MM-DD)") - /** + /** * The Start Date of the Timesheet period (YYYY-MM-DD) - * * @return startDate LocalDate - */ + **/ public LocalDate getStartDate() { return startDate; } - /** - * The Start Date of the Timesheet period (YYYY-MM-DD) - * - * @param startDate LocalDate - */ + /** + * The Start Date of the Timesheet period (YYYY-MM-DD) + * @param startDate LocalDate + **/ + public void setStartDate(LocalDate startDate) { this.startDate = startDate; } /** - * The End Date of the Timesheet period (YYYY-MM-DD) - * - * @param endDate LocalDate - * @return Timesheet - */ + * The End Date of the Timesheet period (YYYY-MM-DD) + * @param endDate LocalDate + * @return Timesheet + **/ public Timesheet endDate(LocalDate endDate) { this.endDate = endDate; return this; } - /** + /** * The End Date of the Timesheet period (YYYY-MM-DD) - * * @return endDate - */ + **/ @ApiModelProperty(required = true, value = "The End Date of the Timesheet period (YYYY-MM-DD)") - /** + /** * The End Date of the Timesheet period (YYYY-MM-DD) - * * @return endDate LocalDate - */ + **/ public LocalDate getEndDate() { return endDate; } - /** - * The End Date of the Timesheet period (YYYY-MM-DD) - * - * @param endDate LocalDate - */ + /** + * The End Date of the Timesheet period (YYYY-MM-DD) + * @param endDate LocalDate + **/ + public void setEndDate(LocalDate endDate) { this.endDate = endDate; } /** - * Status of the timesheet - * - * @param status StatusEnum - * @return Timesheet - */ + * Status of the timesheet + * @param status StatusEnum + * @return Timesheet + **/ public Timesheet status(StatusEnum status) { this.status = status; return this; } - /** + /** * Status of the timesheet - * * @return status - */ + **/ @ApiModelProperty(value = "Status of the timesheet") - /** + /** * Status of the timesheet - * * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the timesheet - * - * @param status StatusEnum - */ + /** + * Status of the timesheet + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } /** - * The Total Hours of the Timesheet - * - * @param totalHours Double - * @return Timesheet - */ + * The Total Hours of the Timesheet + * @param totalHours Double + * @return Timesheet + **/ public Timesheet totalHours(Double totalHours) { this.totalHours = totalHours; return this; } - /** + /** * The Total Hours of the Timesheet - * * @return totalHours - */ + **/ @ApiModelProperty(value = "The Total Hours of the Timesheet") - /** + /** * The Total Hours of the Timesheet - * * @return totalHours Double - */ + **/ public Double getTotalHours() { return totalHours; } - /** - * The Total Hours of the Timesheet - * - * @param totalHours Double - */ + /** + * The Total Hours of the Timesheet + * @param totalHours Double + **/ + public void setTotalHours(Double totalHours) { this.totalHours = totalHours; } /** - * The UTC date time that the Timesheet was last updated - * - * @param updatedDateUTC LocalDateTime - * @return Timesheet - */ + * The UTC date time that the Timesheet was last updated + * @param updatedDateUTC LocalDateTime + * @return Timesheet + **/ public Timesheet updatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; return this; } - /** + /** * The UTC date time that the Timesheet was last updated - * * @return updatedDateUTC - */ + **/ @ApiModelProperty(value = "The UTC date time that the Timesheet was last updated") - /** + /** * The UTC date time that the Timesheet was last updated - * * @return updatedDateUTC LocalDateTime - */ + **/ public LocalDateTime getUpdatedDateUTC() { return updatedDateUTC; } - /** - * The UTC date time that the Timesheet was last updated - * - * @param updatedDateUTC LocalDateTime - */ + /** + * The UTC date time that the Timesheet was last updated + * @param updatedDateUTC LocalDateTime + **/ + public void setUpdatedDateUTC(LocalDateTime updatedDateUTC) { this.updatedDateUTC = updatedDateUTC; } /** - * timesheetLines - * - * @param timesheetLines List<TimesheetLine> - * @return Timesheet - */ + * timesheetLines + * @param timesheetLines List<TimesheetLine> + * @return Timesheet + **/ public Timesheet timesheetLines(List timesheetLines) { this.timesheetLines = timesheetLines; return this; @@ -402,10 +392,9 @@ public Timesheet timesheetLines(List timesheetLines) { /** * timesheetLines - * - * @param timesheetLinesItem TimesheetLine + * @param timesheetLinesItem TimesheetLine * @return Timesheet - */ + **/ public Timesheet addTimesheetLinesItem(TimesheetLine timesheetLinesItem) { if (this.timesheetLines == null) { this.timesheetLines = new ArrayList(); @@ -414,30 +403,29 @@ public Timesheet addTimesheetLinesItem(TimesheetLine timesheetLinesItem) { return this; } - /** + /** * Get timesheetLines - * * @return timesheetLines - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetLines - * * @return timesheetLines List - */ + **/ public List getTimesheetLines() { return timesheetLines; } - /** - * timesheetLines - * - * @param timesheetLines List<TimesheetLine> - */ + /** + * timesheetLines + * @param timesheetLines List<TimesheetLine> + **/ + public void setTimesheetLines(List timesheetLines) { this.timesheetLines = timesheetLines; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -447,31 +435,23 @@ public boolean equals(java.lang.Object o) { return false; } Timesheet timesheet = (Timesheet) o; - return Objects.equals(this.timesheetID, timesheet.timesheetID) - && Objects.equals(this.payrollCalendarID, timesheet.payrollCalendarID) - && Objects.equals(this.employeeID, timesheet.employeeID) - && Objects.equals(this.startDate, timesheet.startDate) - && Objects.equals(this.endDate, timesheet.endDate) - && Objects.equals(this.status, timesheet.status) - && Objects.equals(this.totalHours, timesheet.totalHours) - && Objects.equals(this.updatedDateUTC, timesheet.updatedDateUTC) - && Objects.equals(this.timesheetLines, timesheet.timesheetLines); + return Objects.equals(this.timesheetID, timesheet.timesheetID) && + Objects.equals(this.payrollCalendarID, timesheet.payrollCalendarID) && + Objects.equals(this.employeeID, timesheet.employeeID) && + Objects.equals(this.startDate, timesheet.startDate) && + Objects.equals(this.endDate, timesheet.endDate) && + Objects.equals(this.status, timesheet.status) && + Objects.equals(this.totalHours, timesheet.totalHours) && + Objects.equals(this.updatedDateUTC, timesheet.updatedDateUTC) && + Objects.equals(this.timesheetLines, timesheet.timesheetLines); } @Override public int hashCode() { - return Objects.hash( - timesheetID, - payrollCalendarID, - employeeID, - startDate, - endDate, - status, - totalHours, - updatedDateUTC, - timesheetLines); + return Objects.hash(timesheetID, payrollCalendarID, employeeID, startDate, endDate, status, totalHours, updatedDateUTC, timesheetLines); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -490,7 +470,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -498,4 +479,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/TimesheetEarningsLine.java b/src/main/java/com/xero/models/payrolluk/TimesheetEarningsLine.java index 59d1afdf7..b053307fd 100644 --- a/src/main/java/com/xero/models/payrolluk/TimesheetEarningsLine.java +++ b/src/main/java/com/xero/models/payrolluk/TimesheetEarningsLine.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetEarningsLine + */ -/** TimesheetEarningsLine */ public class TimesheetEarningsLine { StringUtil util = new StringUtil(); @@ -39,220 +56,198 @@ public class TimesheetEarningsLine { @JsonProperty("isLinkedToTimesheet") private Boolean isLinkedToTimesheet; /** - * Xero identifier for payroll timesheet earnings rate - * - * @param earningsRateID UUID - * @return TimesheetEarningsLine - */ + * Xero identifier for payroll timesheet earnings rate + * @param earningsRateID UUID + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * Xero identifier for payroll timesheet earnings rate - * * @return earningsRateID - */ + **/ @ApiModelProperty(value = "Xero identifier for payroll timesheet earnings rate") - /** + /** * Xero identifier for payroll timesheet earnings rate - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * Xero identifier for payroll timesheet earnings rate - * - * @param earningsRateID UUID - */ + /** + * Xero identifier for payroll timesheet earnings rate + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * Rate per unit for timesheet earnings line - * - * @param ratePerUnit Double - * @return TimesheetEarningsLine - */ + * Rate per unit for timesheet earnings line + * @param ratePerUnit Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine ratePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; return this; } - /** + /** * Rate per unit for timesheet earnings line - * * @return ratePerUnit - */ + **/ @ApiModelProperty(value = "Rate per unit for timesheet earnings line") - /** + /** * Rate per unit for timesheet earnings line - * * @return ratePerUnit Double - */ + **/ public Double getRatePerUnit() { return ratePerUnit; } - /** - * Rate per unit for timesheet earnings line - * - * @param ratePerUnit Double - */ + /** + * Rate per unit for timesheet earnings line + * @param ratePerUnit Double + **/ + public void setRatePerUnit(Double ratePerUnit) { this.ratePerUnit = ratePerUnit; } /** - * Timesheet earnings number of units - * - * @param numberOfUnits Double - * @return TimesheetEarningsLine - */ + * Timesheet earnings number of units + * @param numberOfUnits Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * Timesheet earnings number of units - * * @return numberOfUnits - */ + **/ @ApiModelProperty(value = "Timesheet earnings number of units") - /** + /** * Timesheet earnings number of units - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * Timesheet earnings number of units - * - * @param numberOfUnits Double - */ + /** + * Timesheet earnings number of units + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } /** - * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - * @return TimesheetEarningsLine - */ + * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine fixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; return this; } - /** + /** * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount - */ - @ApiModelProperty( - value = - "Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") - /** + **/ + @ApiModelProperty(value = "Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed") + /** * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * * @return fixedAmount Double - */ + **/ public Double getFixedAmount() { return fixedAmount; } - /** - * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * - * @param fixedAmount Double - */ + /** + * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * @param fixedAmount Double + **/ + public void setFixedAmount(Double fixedAmount) { this.fixedAmount = fixedAmount; } /** - * The amount of the timesheet earnings line. - * - * @param amount Double - * @return TimesheetEarningsLine - */ + * The amount of the timesheet earnings line. + * @param amount Double + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine amount(Double amount) { this.amount = amount; return this; } - /** + /** * The amount of the timesheet earnings line. - * * @return amount - */ + **/ @ApiModelProperty(value = "The amount of the timesheet earnings line.") - /** + /** * The amount of the timesheet earnings line. - * * @return amount Double - */ + **/ public Double getAmount() { return amount; } - /** - * The amount of the timesheet earnings line. - * - * @param amount Double - */ + /** + * The amount of the timesheet earnings line. + * @param amount Double + **/ + public void setAmount(Double amount) { this.amount = amount; } /** - * Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - * @return TimesheetEarningsLine - */ + * Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + * @return TimesheetEarningsLine + **/ public TimesheetEarningsLine isLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; return this; } - /** + /** * Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet - */ - @ApiModelProperty( - value = - "Identifies if the timesheet earnings is taken from the timesheet. False for leave" - + " earnings line") - /** + **/ + @ApiModelProperty(value = "Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line") + /** * Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line - * * @return isLinkedToTimesheet Boolean - */ + **/ public Boolean getIsLinkedToTimesheet() { return isLinkedToTimesheet; } - /** - * Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line - * - * @param isLinkedToTimesheet Boolean - */ + /** + * Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line + * @param isLinkedToTimesheet Boolean + **/ + public void setIsLinkedToTimesheet(Boolean isLinkedToTimesheet) { this.isLinkedToTimesheet = isLinkedToTimesheet; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,20 +257,20 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetEarningsLine timesheetEarningsLine = (TimesheetEarningsLine) o; - return Objects.equals(this.earningsRateID, timesheetEarningsLine.earningsRateID) - && Objects.equals(this.ratePerUnit, timesheetEarningsLine.ratePerUnit) - && Objects.equals(this.numberOfUnits, timesheetEarningsLine.numberOfUnits) - && Objects.equals(this.fixedAmount, timesheetEarningsLine.fixedAmount) - && Objects.equals(this.amount, timesheetEarningsLine.amount) - && Objects.equals(this.isLinkedToTimesheet, timesheetEarningsLine.isLinkedToTimesheet); + return Objects.equals(this.earningsRateID, timesheetEarningsLine.earningsRateID) && + Objects.equals(this.ratePerUnit, timesheetEarningsLine.ratePerUnit) && + Objects.equals(this.numberOfUnits, timesheetEarningsLine.numberOfUnits) && + Objects.equals(this.fixedAmount, timesheetEarningsLine.fixedAmount) && + Objects.equals(this.amount, timesheetEarningsLine.amount) && + Objects.equals(this.isLinkedToTimesheet, timesheetEarningsLine.isLinkedToTimesheet); } @Override public int hashCode() { - return Objects.hash( - earningsRateID, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet); + return Objects.hash(earningsRateID, ratePerUnit, numberOfUnits, fixedAmount, amount, isLinkedToTimesheet); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -285,15 +280,14 @@ public String toString() { sb.append(" numberOfUnits: ").append(toIndentedString(numberOfUnits)).append("\n"); sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" isLinkedToTimesheet: ") - .append(toIndentedString(isLinkedToTimesheet)) - .append("\n"); + sb.append(" isLinkedToTimesheet: ").append(toIndentedString(isLinkedToTimesheet)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -301,4 +295,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/TimesheetLine.java b/src/main/java/com/xero/models/payrolluk/TimesheetLine.java index 9b4d5599b..c67943118 100644 --- a/src/main/java/com/xero/models/payrolluk/TimesheetLine.java +++ b/src/main/java/com/xero/models/payrolluk/TimesheetLine.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetLine + */ -/** TimesheetLine */ public class TimesheetLine { StringUtil util = new StringUtil(); @@ -37,184 +54,166 @@ public class TimesheetLine { @JsonProperty("numberOfUnits") private Double numberOfUnits; /** - * The Xero identifier for a Timesheet Line - * - * @param timesheetLineID UUID - * @return TimesheetLine - */ + * The Xero identifier for a Timesheet Line + * @param timesheetLineID UUID + * @return TimesheetLine + **/ public TimesheetLine timesheetLineID(UUID timesheetLineID) { this.timesheetLineID = timesheetLineID; return this; } - /** + /** * The Xero identifier for a Timesheet Line - * * @return timesheetLineID - */ + **/ @ApiModelProperty(value = "The Xero identifier for a Timesheet Line") - /** + /** * The Xero identifier for a Timesheet Line - * * @return timesheetLineID UUID - */ + **/ public UUID getTimesheetLineID() { return timesheetLineID; } - /** - * The Xero identifier for a Timesheet Line - * - * @param timesheetLineID UUID - */ + /** + * The Xero identifier for a Timesheet Line + * @param timesheetLineID UUID + **/ + public void setTimesheetLineID(UUID timesheetLineID) { this.timesheetLineID = timesheetLineID; } /** - * The Date that this Timesheet Line is for (YYYY-MM-DD) - * - * @param date LocalDate - * @return TimesheetLine - */ + * The Date that this Timesheet Line is for (YYYY-MM-DD) + * @param date LocalDate + * @return TimesheetLine + **/ public TimesheetLine date(LocalDate date) { this.date = date; return this; } - /** + /** * The Date that this Timesheet Line is for (YYYY-MM-DD) - * * @return date - */ - @ApiModelProperty( - required = true, - value = "The Date that this Timesheet Line is for (YYYY-MM-DD)") - /** + **/ + @ApiModelProperty(required = true, value = "The Date that this Timesheet Line is for (YYYY-MM-DD)") + /** * The Date that this Timesheet Line is for (YYYY-MM-DD) - * * @return date LocalDate - */ + **/ public LocalDate getDate() { return date; } - /** - * The Date that this Timesheet Line is for (YYYY-MM-DD) - * - * @param date LocalDate - */ + /** + * The Date that this Timesheet Line is for (YYYY-MM-DD) + * @param date LocalDate + **/ + public void setDate(LocalDate date) { this.date = date; } /** - * The Xero identifier for the Earnings Rate that the Timesheet is for - * - * @param earningsRateID UUID - * @return TimesheetLine - */ + * The Xero identifier for the Earnings Rate that the Timesheet is for + * @param earningsRateID UUID + * @return TimesheetLine + **/ public TimesheetLine earningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } - /** + /** * The Xero identifier for the Earnings Rate that the Timesheet is for - * * @return earningsRateID - */ - @ApiModelProperty( - required = true, - value = "The Xero identifier for the Earnings Rate that the Timesheet is for") - /** + **/ + @ApiModelProperty(required = true, value = "The Xero identifier for the Earnings Rate that the Timesheet is for") + /** * The Xero identifier for the Earnings Rate that the Timesheet is for - * * @return earningsRateID UUID - */ + **/ public UUID getEarningsRateID() { return earningsRateID; } - /** - * The Xero identifier for the Earnings Rate that the Timesheet is for - * - * @param earningsRateID UUID - */ + /** + * The Xero identifier for the Earnings Rate that the Timesheet is for + * @param earningsRateID UUID + **/ + public void setEarningsRateID(UUID earningsRateID) { this.earningsRateID = earningsRateID; } /** - * The Xero identifier for the Tracking Item that the Timesheet is for - * - * @param trackingItemID UUID - * @return TimesheetLine - */ + * The Xero identifier for the Tracking Item that the Timesheet is for + * @param trackingItemID UUID + * @return TimesheetLine + **/ public TimesheetLine trackingItemID(UUID trackingItemID) { this.trackingItemID = trackingItemID; return this; } - /** + /** * The Xero identifier for the Tracking Item that the Timesheet is for - * * @return trackingItemID - */ + **/ @ApiModelProperty(value = "The Xero identifier for the Tracking Item that the Timesheet is for") - /** + /** * The Xero identifier for the Tracking Item that the Timesheet is for - * * @return trackingItemID UUID - */ + **/ public UUID getTrackingItemID() { return trackingItemID; } - /** - * The Xero identifier for the Tracking Item that the Timesheet is for - * - * @param trackingItemID UUID - */ + /** + * The Xero identifier for the Tracking Item that the Timesheet is for + * @param trackingItemID UUID + **/ + public void setTrackingItemID(UUID trackingItemID) { this.trackingItemID = trackingItemID; } /** - * The Number of Units of the Timesheet Line - * - * @param numberOfUnits Double - * @return TimesheetLine - */ + * The Number of Units of the Timesheet Line + * @param numberOfUnits Double + * @return TimesheetLine + **/ public TimesheetLine numberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** + /** * The Number of Units of the Timesheet Line - * * @return numberOfUnits - */ + **/ @ApiModelProperty(required = true, value = "The Number of Units of the Timesheet Line") - /** + /** * The Number of Units of the Timesheet Line - * * @return numberOfUnits Double - */ + **/ public Double getNumberOfUnits() { return numberOfUnits; } - /** - * The Number of Units of the Timesheet Line - * - * @param numberOfUnits Double - */ + /** + * The Number of Units of the Timesheet Line + * @param numberOfUnits Double + **/ + public void setNumberOfUnits(Double numberOfUnits) { this.numberOfUnits = numberOfUnits; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -224,11 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetLine timesheetLine = (TimesheetLine) o; - return Objects.equals(this.timesheetLineID, timesheetLine.timesheetLineID) - && Objects.equals(this.date, timesheetLine.date) - && Objects.equals(this.earningsRateID, timesheetLine.earningsRateID) - && Objects.equals(this.trackingItemID, timesheetLine.trackingItemID) - && Objects.equals(this.numberOfUnits, timesheetLine.numberOfUnits); + return Objects.equals(this.timesheetLineID, timesheetLine.timesheetLineID) && + Objects.equals(this.date, timesheetLine.date) && + Objects.equals(this.earningsRateID, timesheetLine.earningsRateID) && + Objects.equals(this.trackingItemID, timesheetLine.trackingItemID) && + Objects.equals(this.numberOfUnits, timesheetLine.numberOfUnits); } @Override @@ -236,6 +235,7 @@ public int hashCode() { return Objects.hash(timesheetLineID, date, earningsRateID, trackingItemID, numberOfUnits); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -258,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/TimesheetLineObject.java b/src/main/java/com/xero/models/payrolluk/TimesheetLineObject.java index b4c65f9fe..fe2da38f3 100644 --- a/src/main/java/com/xero/models/payrolluk/TimesheetLineObject.java +++ b/src/main/java/com/xero/models/payrolluk/TimesheetLineObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.TimesheetLine; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetLineObject + */ -/** TimesheetLineObject */ public class TimesheetLineObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class TimesheetLineObject { @JsonProperty("timesheetLine") private TimesheetLine timesheetLine; /** - * pagination - * - * @param pagination Pagination - * @return TimesheetLineObject - */ + * pagination + * @param pagination Pagination + * @return TimesheetLineObject + **/ public TimesheetLineObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return TimesheetLineObject - */ + * problem + * @param problem Problem + * @return TimesheetLineObject + **/ public TimesheetLineObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * timesheetLine - * - * @param timesheetLine TimesheetLine - * @return TimesheetLineObject - */ + * timesheetLine + * @param timesheetLine TimesheetLine + * @return TimesheetLineObject + **/ public TimesheetLineObject timesheetLine(TimesheetLine timesheetLine) { this.timesheetLine = timesheetLine; return this; } - /** + /** * Get timesheetLine - * * @return timesheetLine - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheetLine - * * @return timesheetLine TimesheetLine - */ + **/ public TimesheetLine getTimesheetLine() { return timesheetLine; } - /** - * timesheetLine - * - * @param timesheetLine TimesheetLine - */ + /** + * timesheetLine + * @param timesheetLine TimesheetLine + **/ + public void setTimesheetLine(TimesheetLine timesheetLine) { this.timesheetLine = timesheetLine; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetLineObject timesheetLineObject = (TimesheetLineObject) o; - return Objects.equals(this.pagination, timesheetLineObject.pagination) - && Objects.equals(this.problem, timesheetLineObject.problem) - && Objects.equals(this.timesheetLine, timesheetLineObject.timesheetLine); + return Objects.equals(this.pagination, timesheetLineObject.pagination) && + Objects.equals(this.problem, timesheetLineObject.problem) && + Objects.equals(this.timesheetLine, timesheetLineObject.timesheetLine); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, timesheetLine); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/TimesheetObject.java b/src/main/java/com/xero/models/payrolluk/TimesheetObject.java index af832743c..657ffb76e 100644 --- a/src/main/java/com/xero/models/payrolluk/TimesheetObject.java +++ b/src/main/java/com/xero/models/payrolluk/TimesheetObject.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.Timesheet; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimesheetObject + */ -/** TimesheetObject */ public class TimesheetObject { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class TimesheetObject { @JsonProperty("timesheet") private Timesheet timesheet; /** - * pagination - * - * @param pagination Pagination - * @return TimesheetObject - */ + * pagination + * @param pagination Pagination + * @return TimesheetObject + **/ public TimesheetObject pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return TimesheetObject - */ + * problem + * @param problem Problem + * @return TimesheetObject + **/ public TimesheetObject problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * timesheet - * - * @param timesheet Timesheet - * @return TimesheetObject - */ + * timesheet + * @param timesheet Timesheet + * @return TimesheetObject + **/ public TimesheetObject timesheet(Timesheet timesheet) { this.timesheet = timesheet; return this; } - /** + /** * Get timesheet - * * @return timesheet - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheet - * * @return timesheet Timesheet - */ + **/ public Timesheet getTimesheet() { return timesheet; } - /** - * timesheet - * - * @param timesheet Timesheet - */ + /** + * timesheet + * @param timesheet Timesheet + **/ + public void setTimesheet(Timesheet timesheet) { this.timesheet = timesheet; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } TimesheetObject timesheetObject = (TimesheetObject) o; - return Objects.equals(this.pagination, timesheetObject.pagination) - && Objects.equals(this.problem, timesheetObject.problem) - && Objects.equals(this.timesheet, timesheetObject.timesheet); + return Objects.equals(this.pagination, timesheetObject.pagination) && + Objects.equals(this.problem, timesheetObject.problem) && + Objects.equals(this.timesheet, timesheetObject.timesheet); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, timesheet); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/Timesheets.java b/src/main/java/com/xero/models/payrolluk/Timesheets.java index eef272544..712d1a8e2 100644 --- a/src/main/java/com/xero/models/payrolluk/Timesheets.java +++ b/src/main/java/com/xero/models/payrolluk/Timesheets.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.Timesheet; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Timesheets + */ -/** Timesheets */ public class Timesheets { StringUtil util = new StringUtil(); @@ -31,81 +51,74 @@ public class Timesheets { @JsonProperty("timesheets") private List timesheets = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Timesheets - */ + * pagination + * @param pagination Pagination + * @return Timesheets + **/ public Timesheets pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return Timesheets - */ + * problem + * @param problem Problem + * @return Timesheets + **/ public Timesheets problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * timesheets - * - * @param timesheets List<Timesheet> - * @return Timesheets - */ + * timesheets + * @param timesheets List<Timesheet> + * @return Timesheets + **/ public Timesheets timesheets(List timesheets) { this.timesheets = timesheets; return this; @@ -113,10 +126,9 @@ public Timesheets timesheets(List timesheets) { /** * timesheets - * - * @param timesheetsItem Timesheet + * @param timesheetsItem Timesheet * @return Timesheets - */ + **/ public Timesheets addTimesheetsItem(Timesheet timesheetsItem) { if (this.timesheets == null) { this.timesheets = new ArrayList(); @@ -125,30 +137,29 @@ public Timesheets addTimesheetsItem(Timesheet timesheetsItem) { return this; } - /** + /** * Get timesheets - * * @return timesheets - */ + **/ @ApiModelProperty(value = "") - /** + /** * timesheets - * * @return timesheets List - */ + **/ public List getTimesheets() { return timesheets; } - /** - * timesheets - * - * @param timesheets List<Timesheet> - */ + /** + * timesheets + * @param timesheets List<Timesheet> + **/ + public void setTimesheets(List timesheets) { this.timesheets = timesheets; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -158,9 +169,9 @@ public boolean equals(java.lang.Object o) { return false; } Timesheets timesheets = (Timesheets) o; - return Objects.equals(this.pagination, timesheets.pagination) - && Objects.equals(this.problem, timesheets.problem) - && Objects.equals(this.timesheets, timesheets.timesheets); + return Objects.equals(this.pagination, timesheets.pagination) && + Objects.equals(this.problem, timesheets.problem) && + Objects.equals(this.timesheets, timesheets.timesheets); } @Override @@ -168,6 +179,7 @@ public int hashCode() { return Objects.hash(pagination, problem, timesheets); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,7 +192,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -188,4 +201,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/TrackingCategories.java b/src/main/java/com/xero/models/payrolluk/TrackingCategories.java index 05cc63ad1..13fefa6f9 100644 --- a/src/main/java/com/xero/models/payrolluk/TrackingCategories.java +++ b/src/main/java/com/xero/models/payrolluk/TrackingCategories.java @@ -9,14 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.payrolluk.Pagination; +import com.xero.models.payrolluk.Problem; +import com.xero.models.payrolluk.TrackingCategory; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingCategories + */ -/** TrackingCategories */ public class TrackingCategories { StringUtil util = new StringUtil(); @@ -29,110 +49,102 @@ public class TrackingCategories { @JsonProperty("trackingCategories") private TrackingCategory trackingCategories; /** - * pagination - * - * @param pagination Pagination - * @return TrackingCategories - */ + * pagination + * @param pagination Pagination + * @return TrackingCategories + **/ public TrackingCategories pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * problem - * - * @param problem Problem - * @return TrackingCategories - */ + * problem + * @param problem Problem + * @return TrackingCategories + **/ public TrackingCategories problem(Problem problem) { this.problem = problem; return this; } - /** + /** * Get problem - * * @return problem - */ + **/ @ApiModelProperty(value = "") - /** + /** * problem - * * @return problem Problem - */ + **/ public Problem getProblem() { return problem; } - /** - * problem - * - * @param problem Problem - */ + /** + * problem + * @param problem Problem + **/ + public void setProblem(Problem problem) { this.problem = problem; } /** - * trackingCategories - * - * @param trackingCategories TrackingCategory - * @return TrackingCategories - */ + * trackingCategories + * @param trackingCategories TrackingCategory + * @return TrackingCategories + **/ public TrackingCategories trackingCategories(TrackingCategory trackingCategories) { this.trackingCategories = trackingCategories; return this; } - /** + /** * Get trackingCategories - * * @return trackingCategories - */ + **/ @ApiModelProperty(value = "") - /** + /** * trackingCategories - * * @return trackingCategories TrackingCategory - */ + **/ public TrackingCategory getTrackingCategories() { return trackingCategories; } - /** - * trackingCategories - * - * @param trackingCategories TrackingCategory - */ + /** + * trackingCategories + * @param trackingCategories TrackingCategory + **/ + public void setTrackingCategories(TrackingCategory trackingCategories) { this.trackingCategories = trackingCategories; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,9 +154,9 @@ public boolean equals(java.lang.Object o) { return false; } TrackingCategories trackingCategories = (TrackingCategories) o; - return Objects.equals(this.pagination, trackingCategories.pagination) - && Objects.equals(this.problem, trackingCategories.problem) - && Objects.equals(this.trackingCategories, trackingCategories.trackingCategories); + return Objects.equals(this.pagination, trackingCategories.pagination) && + Objects.equals(this.problem, trackingCategories.problem) && + Objects.equals(this.trackingCategories, trackingCategories.trackingCategories); } @Override @@ -152,6 +164,7 @@ public int hashCode() { return Objects.hash(pagination, problem, trackingCategories); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,7 +177,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -172,4 +186,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/payrolluk/TrackingCategory.java b/src/main/java/com/xero/models/payrolluk/TrackingCategory.java index f44928e7c..141a81bb2 100644 --- a/src/main/java/com/xero/models/payrolluk/TrackingCategory.java +++ b/src/main/java/com/xero/models/payrolluk/TrackingCategory.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.payrolluk; +package com.xero.models.payrolluk; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TrackingCategory + */ -/** TrackingCategory */ public class TrackingCategory { StringUtil util = new StringUtil(); @@ -27,75 +44,70 @@ public class TrackingCategory { @JsonProperty("timesheetTrackingCategoryID") private UUID timesheetTrackingCategoryID; /** - * The Xero identifier for Employee groups tracking category. - * - * @param employeeGroupsTrackingCategoryID UUID - * @return TrackingCategory - */ + * The Xero identifier for Employee groups tracking category. + * @param employeeGroupsTrackingCategoryID UUID + * @return TrackingCategory + **/ public TrackingCategory employeeGroupsTrackingCategoryID(UUID employeeGroupsTrackingCategoryID) { this.employeeGroupsTrackingCategoryID = employeeGroupsTrackingCategoryID; return this; } - /** + /** * The Xero identifier for Employee groups tracking category. - * * @return employeeGroupsTrackingCategoryID - */ + **/ @ApiModelProperty(value = "The Xero identifier for Employee groups tracking category.") - /** + /** * The Xero identifier for Employee groups tracking category. - * * @return employeeGroupsTrackingCategoryID UUID - */ + **/ public UUID getEmployeeGroupsTrackingCategoryID() { return employeeGroupsTrackingCategoryID; } - /** - * The Xero identifier for Employee groups tracking category. - * - * @param employeeGroupsTrackingCategoryID UUID - */ + /** + * The Xero identifier for Employee groups tracking category. + * @param employeeGroupsTrackingCategoryID UUID + **/ + public void setEmployeeGroupsTrackingCategoryID(UUID employeeGroupsTrackingCategoryID) { this.employeeGroupsTrackingCategoryID = employeeGroupsTrackingCategoryID; } /** - * The Xero identifier for Timesheet tracking category. - * - * @param timesheetTrackingCategoryID UUID - * @return TrackingCategory - */ + * The Xero identifier for Timesheet tracking category. + * @param timesheetTrackingCategoryID UUID + * @return TrackingCategory + **/ public TrackingCategory timesheetTrackingCategoryID(UUID timesheetTrackingCategoryID) { this.timesheetTrackingCategoryID = timesheetTrackingCategoryID; return this; } - /** + /** * The Xero identifier for Timesheet tracking category. - * * @return timesheetTrackingCategoryID - */ + **/ @ApiModelProperty(value = "The Xero identifier for Timesheet tracking category.") - /** + /** * The Xero identifier for Timesheet tracking category. - * * @return timesheetTrackingCategoryID UUID - */ + **/ public UUID getTimesheetTrackingCategoryID() { return timesheetTrackingCategoryID; } - /** - * The Xero identifier for Timesheet tracking category. - * - * @param timesheetTrackingCategoryID UUID - */ + /** + * The Xero identifier for Timesheet tracking category. + * @param timesheetTrackingCategoryID UUID + **/ + public void setTimesheetTrackingCategoryID(UUID timesheetTrackingCategoryID) { this.timesheetTrackingCategoryID = timesheetTrackingCategoryID; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,11 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } TrackingCategory trackingCategory = (TrackingCategory) o; - return Objects.equals( - this.employeeGroupsTrackingCategoryID, - trackingCategory.employeeGroupsTrackingCategoryID) - && Objects.equals( - this.timesheetTrackingCategoryID, trackingCategory.timesheetTrackingCategoryID); + return Objects.equals(this.employeeGroupsTrackingCategoryID, trackingCategory.employeeGroupsTrackingCategoryID) && + Objects.equals(this.timesheetTrackingCategoryID, trackingCategory.timesheetTrackingCategoryID); } @Override @@ -117,22 +126,20 @@ public int hashCode() { return Objects.hash(employeeGroupsTrackingCategoryID, timesheetTrackingCategoryID); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TrackingCategory {\n"); - sb.append(" employeeGroupsTrackingCategoryID: ") - .append(toIndentedString(employeeGroupsTrackingCategoryID)) - .append("\n"); - sb.append(" timesheetTrackingCategoryID: ") - .append(toIndentedString(timesheetTrackingCategoryID)) - .append("\n"); + sb.append(" employeeGroupsTrackingCategoryID: ").append(toIndentedString(employeeGroupsTrackingCategoryID)).append("\n"); + sb.append(" timesheetTrackingCategoryID: ").append(toIndentedString(timesheetTrackingCategoryID)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -140,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/Amount.java b/src/main/java/com/xero/models/project/Amount.java index 26f533a7d..03b30295b 100644 --- a/src/main/java/com/xero/models/project/Amount.java +++ b/src/main/java/com/xero/models/project/Amount.java @@ -9,14 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.CurrencyCode; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Amount + */ -/** Amount */ public class Amount { StringUtil util = new StringUtil(); @@ -26,75 +44,70 @@ public class Amount { @JsonProperty("value") private Double value; /** - * currency - * - * @param currency CurrencyCode - * @return Amount - */ + * currency + * @param currency CurrencyCode + * @return Amount + **/ public Amount currency(CurrencyCode currency) { this.currency = currency; return this; } - /** + /** * Get currency - * * @return currency - */ + **/ @ApiModelProperty(value = "") - /** + /** * currency - * * @return currency CurrencyCode - */ + **/ public CurrencyCode getCurrency() { return currency; } - /** - * currency - * - * @param currency CurrencyCode - */ + /** + * currency + * @param currency CurrencyCode + **/ + public void setCurrency(CurrencyCode currency) { this.currency = currency; } /** - * value - * - * @param value Double - * @return Amount - */ + * value + * @param value Double + * @return Amount + **/ public Amount value(Double value) { this.value = value; return this; } - /** + /** * Get value - * * @return value - */ + **/ @ApiModelProperty(example = "1.0", value = "") - /** + /** * value - * * @return value Double - */ + **/ public Double getValue() { return value; } - /** - * value - * - * @param value Double - */ + /** + * value + * @param value Double + **/ + public void setValue(Double value) { this.value = value; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +117,8 @@ public boolean equals(java.lang.Object o) { return false; } Amount amount = (Amount) o; - return Objects.equals(this.currency, amount.currency) - && Objects.equals(this.value, amount.value); + return Objects.equals(this.currency, amount.currency) && + Objects.equals(this.value, amount.value); } @Override @@ -113,6 +126,7 @@ public int hashCode() { return Objects.hash(currency, value); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +138,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +147,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/ChargeType.java b/src/main/java/com/xero/models/project/ChargeType.java index f07612be1..904afed86 100644 --- a/src/main/java/com/xero/models/project/ChargeType.java +++ b/src/main/java/com/xero/models/project/ChargeType.java @@ -9,26 +9,40 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * Can be `TIME`, `FIXED` or `NON_CHARGEABLE`, defines how the task - * will be charged. Use `TIME` when you want to charge per hour and `FIXED` to - * charge as a fixed amount. If the task will not be charged use `NON_CHARGEABLE`. + * Can be `TIME`, `FIXED` or `NON_CHARGEABLE`, defines how the task will be charged. Use `TIME` when you want to charge per hour and `FIXED` to charge as a fixed amount. If the task will not be charged use `NON_CHARGEABLE`. */ public enum ChargeType { - - /** TIME */ + + /** + * TIME + */ TIME("TIME"), - - /** FIXED */ + + /** + * FIXED + */ FIXED("FIXED"), - - /** NON_CHARGEABLE */ + + /** + * NON_CHARGEABLE + */ NON_CHARGEABLE("NON_CHARGEABLE"); private String value; @@ -37,26 +51,24 @@ public enum ChargeType { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static ChargeType fromValue(String value) { @@ -68,3 +80,4 @@ public static ChargeType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/project/CurrencyCode.java b/src/main/java/com/xero/models/project/CurrencyCode.java index 6de805cb7..0f720fc97 100644 --- a/src/main/java/com/xero/models/project/CurrencyCode.java +++ b/src/main/java/com/xero/models/project/CurrencyCode.java @@ -9,502 +9,840 @@ * Do not edit the class manually. */ -package com.xero.models.project; - +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ +/** + * 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. + */ public enum CurrencyCode { - - /** AED */ + + /** + * AED + */ AED("AED"), - - /** AFN */ + + /** + * AFN + */ AFN("AFN"), - - /** ALL */ + + /** + * ALL + */ ALL("ALL"), - - /** AMD */ + + /** + * AMD + */ AMD("AMD"), - - /** ANG */ + + /** + * ANG + */ ANG("ANG"), - - /** AOA */ + + /** + * AOA + */ AOA("AOA"), - - /** ARS */ + + /** + * ARS + */ ARS("ARS"), - - /** AUD */ + + /** + * AUD + */ AUD("AUD"), - - /** AWG */ + + /** + * AWG + */ AWG("AWG"), - - /** AZN */ + + /** + * AZN + */ AZN("AZN"), - - /** BAM */ + + /** + * BAM + */ BAM("BAM"), - - /** BBD */ + + /** + * BBD + */ BBD("BBD"), - - /** BDT */ + + /** + * BDT + */ BDT("BDT"), - - /** BGN */ + + /** + * BGN + */ BGN("BGN"), - - /** BHD */ + + /** + * BHD + */ BHD("BHD"), - - /** BIF */ + + /** + * BIF + */ BIF("BIF"), - - /** BMD */ + + /** + * BMD + */ BMD("BMD"), - - /** BND */ + + /** + * BND + */ BND("BND"), - - /** BOB */ + + /** + * BOB + */ BOB("BOB"), - - /** BRL */ + + /** + * BRL + */ BRL("BRL"), - - /** BSD */ + + /** + * BSD + */ BSD("BSD"), - - /** BTN */ + + /** + * BTN + */ BTN("BTN"), - - /** BWP */ + + /** + * BWP + */ BWP("BWP"), - - /** BYN */ + + /** + * BYN + */ BYN("BYN"), - - /** BZD */ + + /** + * BZD + */ BZD("BZD"), - - /** CAD */ + + /** + * CAD + */ CAD("CAD"), - - /** CDF */ + + /** + * CDF + */ CDF("CDF"), - - /** CHF */ + + /** + * CHF + */ CHF("CHF"), - - /** CLP */ + + /** + * CLP + */ CLP("CLP"), - - /** CNY */ + + /** + * CNY + */ CNY("CNY"), - - /** COP */ + + /** + * COP + */ COP("COP"), - - /** CRC */ + + /** + * CRC + */ CRC("CRC"), - - /** CUC */ + + /** + * CUC + */ CUC("CUC"), - - /** CUP */ + + /** + * CUP + */ CUP("CUP"), - - /** CVE */ + + /** + * CVE + */ CVE("CVE"), - - /** CZK */ + + /** + * CZK + */ CZK("CZK"), - - /** DJF */ + + /** + * DJF + */ DJF("DJF"), - - /** DKK */ + + /** + * DKK + */ DKK("DKK"), - - /** DOP */ + + /** + * DOP + */ DOP("DOP"), - - /** DZD */ + + /** + * DZD + */ DZD("DZD"), - - /** EGP */ + + /** + * EGP + */ EGP("EGP"), - - /** ERN */ + + /** + * ERN + */ ERN("ERN"), - - /** ETB */ + + /** + * ETB + */ ETB("ETB"), - - /** EUR */ + + /** + * EUR + */ EUR("EUR"), - - /** FJD */ + + /** + * FJD + */ FJD("FJD"), - - /** FKP */ + + /** + * FKP + */ FKP("FKP"), - - /** GBP */ + + /** + * GBP + */ GBP("GBP"), - - /** GEL */ + + /** + * GEL + */ GEL("GEL"), - - /** GGP */ + + /** + * GGP + */ GGP("GGP"), - - /** GHS */ + + /** + * GHS + */ GHS("GHS"), - - /** GIP */ + + /** + * GIP + */ GIP("GIP"), - - /** GMD */ + + /** + * GMD + */ GMD("GMD"), - - /** GNF */ + + /** + * GNF + */ GNF("GNF"), - - /** GTQ */ + + /** + * GTQ + */ GTQ("GTQ"), - - /** GYD */ + + /** + * GYD + */ GYD("GYD"), - - /** HKD */ + + /** + * HKD + */ HKD("HKD"), - - /** HNL */ + + /** + * HNL + */ HNL("HNL"), - - /** HRK */ + + /** + * HRK + */ HRK("HRK"), - - /** HTG */ + + /** + * HTG + */ HTG("HTG"), - - /** HUF */ + + /** + * HUF + */ HUF("HUF"), - - /** IDR */ + + /** + * IDR + */ IDR("IDR"), - - /** ILS */ + + /** + * ILS + */ ILS("ILS"), - - /** IMP */ + + /** + * IMP + */ IMP("IMP"), - - /** INR */ + + /** + * INR + */ INR("INR"), - - /** IQD */ + + /** + * IQD + */ IQD("IQD"), - - /** IRR */ + + /** + * IRR + */ IRR("IRR"), - - /** ISK */ + + /** + * ISK + */ ISK("ISK"), - - /** JEP */ + + /** + * JEP + */ JEP("JEP"), - - /** JMD */ + + /** + * JMD + */ JMD("JMD"), - - /** JOD */ + + /** + * JOD + */ JOD("JOD"), - - /** JPY */ + + /** + * JPY + */ JPY("JPY"), - - /** KES */ + + /** + * KES + */ KES("KES"), - - /** KGS */ + + /** + * KGS + */ KGS("KGS"), - - /** KHR */ + + /** + * KHR + */ KHR("KHR"), - - /** KMF */ + + /** + * KMF + */ KMF("KMF"), - - /** KPW */ + + /** + * KPW + */ KPW("KPW"), - - /** KRW */ + + /** + * KRW + */ KRW("KRW"), - - /** KWD */ + + /** + * KWD + */ KWD("KWD"), - - /** KYD */ + + /** + * KYD + */ KYD("KYD"), - - /** KZT */ + + /** + * KZT + */ KZT("KZT"), - - /** LAK */ + + /** + * LAK + */ LAK("LAK"), - - /** LBP */ + + /** + * LBP + */ LBP("LBP"), - - /** LKR */ + + /** + * LKR + */ LKR("LKR"), - - /** LRD */ + + /** + * LRD + */ LRD("LRD"), - - /** LSL */ + + /** + * LSL + */ LSL("LSL"), - - /** LYD */ + + /** + * LYD + */ LYD("LYD"), - - /** MAD */ + + /** + * MAD + */ MAD("MAD"), - - /** MDL */ + + /** + * MDL + */ MDL("MDL"), - - /** MGA */ + + /** + * MGA + */ MGA("MGA"), - - /** MKD */ + + /** + * MKD + */ MKD("MKD"), - - /** MMK */ + + /** + * MMK + */ MMK("MMK"), - - /** MNT */ + + /** + * MNT + */ MNT("MNT"), - - /** MOP */ + + /** + * MOP + */ MOP("MOP"), - - /** MRU */ + + /** + * MRU + */ MRU("MRU"), - - /** MUR */ + + /** + * MUR + */ MUR("MUR"), - - /** MVR */ + + /** + * MVR + */ MVR("MVR"), - - /** MWK */ + + /** + * MWK + */ MWK("MWK"), - - /** MXN */ + + /** + * MXN + */ MXN("MXN"), - - /** MYR */ + + /** + * MYR + */ MYR("MYR"), - - /** MZN */ + + /** + * MZN + */ MZN("MZN"), - - /** NAD */ + + /** + * NAD + */ NAD("NAD"), - - /** NGN */ + + /** + * NGN + */ NGN("NGN"), - - /** NIO */ + + /** + * NIO + */ NIO("NIO"), - - /** NOK */ + + /** + * NOK + */ NOK("NOK"), - - /** NPR */ + + /** + * NPR + */ NPR("NPR"), - - /** NZD */ + + /** + * NZD + */ NZD("NZD"), - - /** OMR */ + + /** + * OMR + */ OMR("OMR"), - - /** PAB */ + + /** + * PAB + */ PAB("PAB"), - - /** PEN */ + + /** + * PEN + */ PEN("PEN"), - - /** PGK */ + + /** + * PGK + */ PGK("PGK"), - - /** PHP */ + + /** + * PHP + */ PHP("PHP"), - - /** PKR */ + + /** + * PKR + */ PKR("PKR"), - - /** PLN */ + + /** + * PLN + */ PLN("PLN"), - - /** PYG */ + + /** + * PYG + */ PYG("PYG"), - - /** QAR */ + + /** + * QAR + */ QAR("QAR"), - - /** RON */ + + /** + * RON + */ RON("RON"), - - /** RSD */ + + /** + * RSD + */ RSD("RSD"), - - /** RUB */ + + /** + * RUB + */ RUB("RUB"), - - /** RWF */ + + /** + * RWF + */ RWF("RWF"), - - /** SAR */ + + /** + * SAR + */ SAR("SAR"), - - /** SBD */ + + /** + * SBD + */ SBD("SBD"), - - /** SCR */ + + /** + * SCR + */ SCR("SCR"), - - /** SDG */ + + /** + * SDG + */ SDG("SDG"), - - /** SEK */ + + /** + * SEK + */ SEK("SEK"), - - /** SGD */ + + /** + * SGD + */ SGD("SGD"), - - /** SHP */ + + /** + * SHP + */ SHP("SHP"), - - /** SLL */ + + /** + * SLL + */ SLL("SLL"), - - /** SOS */ + + /** + * SOS + */ SOS("SOS"), - - /** SPL */ + + /** + * SPL + */ SPL("SPL"), - - /** SRD */ + + /** + * SRD + */ SRD("SRD"), - - /** STN */ + + /** + * STN + */ STN("STN"), - - /** SVC */ + + /** + * SVC + */ SVC("SVC"), - - /** SYP */ + + /** + * SYP + */ SYP("SYP"), - - /** SZL */ + + /** + * SZL + */ SZL("SZL"), - - /** THB */ + + /** + * THB + */ THB("THB"), - - /** TJS */ + + /** + * TJS + */ TJS("TJS"), - - /** TMT */ + + /** + * TMT + */ TMT("TMT"), - - /** TND */ + + /** + * TND + */ TND("TND"), - - /** TOP */ + + /** + * TOP + */ TOP("TOP"), - - /** TRY */ + + /** + * TRY + */ TRY("TRY"), - - /** TTD */ + + /** + * TTD + */ TTD("TTD"), - - /** TVD */ + + /** + * TVD + */ TVD("TVD"), - - /** TWD */ + + /** + * TWD + */ TWD("TWD"), - - /** TZS */ + + /** + * TZS + */ TZS("TZS"), - - /** UAH */ + + /** + * UAH + */ UAH("UAH"), - - /** UGX */ + + /** + * UGX + */ UGX("UGX"), - - /** USD */ + + /** + * USD + */ USD("USD"), - - /** UYU */ + + /** + * UYU + */ UYU("UYU"), - - /** UZS */ + + /** + * UZS + */ UZS("UZS"), - - /** VEF */ + + /** + * VEF + */ VEF("VEF"), - - /** VND */ + + /** + * VND + */ VND("VND"), - - /** VUV */ + + /** + * VUV + */ VUV("VUV"), - - /** WST */ + + /** + * WST + */ WST("WST"), - - /** XAF */ + + /** + * XAF + */ XAF("XAF"), - - /** XCD */ + + /** + * XCD + */ XCD("XCD"), - - /** XDR */ + + /** + * XDR + */ XDR("XDR"), - - /** XOF */ + + /** + * XOF + */ XOF("XOF"), - - /** XPF */ + + /** + * XPF + */ XPF("XPF"), - - /** YER */ + + /** + * YER + */ YER("YER"), - - /** ZAR */ + + /** + * ZAR + */ ZAR("ZAR"), - - /** ZMW */ + + /** + * ZMW + */ ZMW("ZMW"), - - /** ZMK */ + + /** + * ZMK + */ ZMK("ZMK"), - - /** ZWD */ + + /** + * ZWD + */ ZWD("ZWD"); private String value; @@ -513,26 +851,24 @@ public enum CurrencyCode { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static CurrencyCode fromValue(String value) { @@ -544,3 +880,4 @@ public static CurrencyCode fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/project/Error.java b/src/main/java/com/xero/models/project/Error.java index b87fe4444..eddaf5072 100644 --- a/src/main/java/com/xero/models/project/Error.java +++ b/src/main/java/com/xero/models/project/Error.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Error + */ -/** Error */ public class Error { StringUtil util = new StringUtil(); @@ -26,75 +43,70 @@ public class Error { @JsonProperty("modelState") private Object modelState; /** - * Exception message - * - * @param message String - * @return Error - */ + * Exception message + * @param message String + * @return Error + **/ public Error message(String message) { this.message = message; return this; } - /** + /** * Exception message - * * @return message - */ + **/ @ApiModelProperty(value = "Exception message") - /** + /** * Exception message - * * @return message String - */ + **/ public String getMessage() { return message; } - /** - * Exception message - * - * @param message String - */ + /** + * Exception message + * @param message String + **/ + public void setMessage(String message) { this.message = message; } /** - * Array of Elements of validation Errors - * - * @param modelState Object - * @return Error - */ + * Array of Elements of validation Errors + * @param modelState Object + * @return Error + **/ public Error modelState(Object modelState) { this.modelState = modelState; return this; } - /** + /** * Array of Elements of validation Errors - * * @return modelState - */ + **/ @ApiModelProperty(value = "Array of Elements of validation Errors") - /** + /** * Array of Elements of validation Errors - * * @return modelState Object - */ + **/ public Object getModelState() { return modelState; } - /** - * Array of Elements of validation Errors - * - * @param modelState Object - */ + /** + * Array of Elements of validation Errors + * @param modelState Object + **/ + public void setModelState(Object modelState) { this.modelState = modelState; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +116,8 @@ public boolean equals(java.lang.Object o) { return false; } Error error = (Error) o; - return Objects.equals(this.message, error.message) - && Objects.equals(this.modelState, error.modelState); + return Objects.equals(this.message, error.message) && + Objects.equals(this.modelState, error.modelState); } @Override @@ -113,6 +125,7 @@ public int hashCode() { return Objects.hash(message, modelState); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -124,7 +137,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -132,4 +146,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/Pagination.java b/src/main/java/com/xero/models/project/Pagination.java index 1a61b6b4e..ede0d592c 100644 --- a/src/main/java/com/xero/models/project/Pagination.java +++ b/src/main/java/com/xero/models/project/Pagination.java @@ -9,14 +9,31 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Pagination + */ -/** Pagination */ public class Pagination { StringUtil util = new StringUtil(); @@ -32,161 +49,134 @@ public class Pagination { @JsonProperty("itemCount") private Integer itemCount; /** - * Set to 1 by default. The requested number of the page in paged response - Must be a number - * greater than 0. - * - * @param page Integer - * @return Pagination - */ + * Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param page Integer + * @return Pagination + **/ public Pagination page(Integer page) { this.page = page; return this; } - /** - * Set to 1 by default. The requested number of the page in paged response - Must be a number - * greater than 0. - * + /** + * Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. * @return page - */ - @ApiModelProperty( - example = "1", - value = - "Set to 1 by default. The requested number of the page in paged response - Must be a" - + " number greater than 0.") - /** - * Set to 1 by default. The requested number of the page in paged response - Must be a number - * greater than 0. - * + **/ + @ApiModelProperty(example = "1", value = "Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.") + /** + * Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. * @return page Integer - */ + **/ public Integer getPage() { return page; } - /** - * Set to 1 by default. The requested number of the page in paged response - Must be a number - * greater than 0. - * - * @param page Integer - */ + /** + * Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + * @param page Integer + **/ + public void setPage(Integer page) { this.page = page; } /** - * Optional, it is set to 50 by default. The number of items to return per page in a paged - * response - Must be a number between 1 and 500. - * - * @param pageSize Integer - * @return Pagination - */ + * Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param pageSize Integer + * @return Pagination + **/ public Pagination pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } - /** - * Optional, it is set to 50 by default. The number of items to return per page in a paged - * response - Must be a number between 1 and 500. - * + /** + * Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. * @return pageSize - */ - @ApiModelProperty( - example = "10", - value = - "Optional, it is set to 50 by default. The number of items to return per page in a paged" - + " response - Must be a number between 1 and 500.") - /** - * Optional, it is set to 50 by default. The number of items to return per page in a paged - * response - Must be a number between 1 and 500. - * + **/ + @ApiModelProperty(example = "10", value = "Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.") + /** + * Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. * @return pageSize Integer - */ + **/ public Integer getPageSize() { return pageSize; } - /** - * Optional, it is set to 50 by default. The number of items to return per page in a paged - * response - Must be a number between 1 and 500. - * - * @param pageSize Integer - */ + /** + * Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + * @param pageSize Integer + **/ + public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** - * Number of pages available - * - * @param pageCount Integer - * @return Pagination - */ + * Number of pages available + * @param pageCount Integer + * @return Pagination + **/ public Pagination pageCount(Integer pageCount) { this.pageCount = pageCount; return this; } - /** + /** * Number of pages available - * * @return pageCount - */ + **/ @ApiModelProperty(example = "1", value = "Number of pages available") - /** + /** * Number of pages available - * * @return pageCount Integer - */ + **/ public Integer getPageCount() { return pageCount; } - /** - * Number of pages available - * - * @param pageCount Integer - */ + /** + * Number of pages available + * @param pageCount Integer + **/ + public void setPageCount(Integer pageCount) { this.pageCount = pageCount; } /** - * Number of items returned - * - * @param itemCount Integer - * @return Pagination - */ + * Number of items returned + * @param itemCount Integer + * @return Pagination + **/ public Pagination itemCount(Integer itemCount) { this.itemCount = itemCount; return this; } - /** + /** * Number of items returned - * * @return itemCount - */ + **/ @ApiModelProperty(example = "2", value = "Number of items returned") - /** + /** * Number of items returned - * * @return itemCount Integer - */ + **/ public Integer getItemCount() { return itemCount; } - /** - * Number of items returned - * - * @param itemCount Integer - */ + /** + * Number of items returned + * @param itemCount Integer + **/ + public void setItemCount(Integer itemCount) { this.itemCount = itemCount; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -196,10 +186,10 @@ public boolean equals(java.lang.Object o) { return false; } Pagination pagination = (Pagination) o; - return Objects.equals(this.page, pagination.page) - && Objects.equals(this.pageSize, pagination.pageSize) - && Objects.equals(this.pageCount, pagination.pageCount) - && Objects.equals(this.itemCount, pagination.itemCount); + return Objects.equals(this.page, pagination.page) && + Objects.equals(this.pageSize, pagination.pageSize) && + Objects.equals(this.pageCount, pagination.pageCount) && + Objects.equals(this.itemCount, pagination.itemCount); } @Override @@ -207,6 +197,7 @@ public int hashCode() { return Objects.hash(page, pageSize, pageCount, itemCount); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -220,7 +211,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -228,4 +220,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/Project.java b/src/main/java/com/xero/models/project/Project.java index 2f0b7cb3f..53dcefe51 100644 --- a/src/main/java/com/xero/models/project/Project.java +++ b/src/main/java/com/xero/models/project/Project.java @@ -9,16 +9,36 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.Amount; +import com.xero.models.project.CurrencyCode; +import com.xero.models.project.ProjectStatus; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Project + */ -/** Project */ public class Project { StringUtil util = new StringUtil(); @@ -88,785 +108,710 @@ public class Project { @JsonProperty("status") private ProjectStatus status; /** - * Identifier of the project. - * - * @param projectId UUID - * @return Project - */ + * Identifier of the project. + * @param projectId UUID + * @return Project + **/ public Project projectId(UUID projectId) { this.projectId = projectId; return this; } - /** + /** * Identifier of the project. - * * @return projectId - */ - @ApiModelProperty( - example = "254553fa-2be8-4991-bd5e-70a97ea12ef8", - value = "Identifier of the project.") - /** + **/ + @ApiModelProperty(example = "254553fa-2be8-4991-bd5e-70a97ea12ef8", value = "Identifier of the project.") + /** * Identifier of the project. - * * @return projectId UUID - */ + **/ public UUID getProjectId() { return projectId; } - /** - * Identifier of the project. - * - * @param projectId UUID - */ + /** + * Identifier of the project. + * @param projectId UUID + **/ + public void setProjectId(UUID projectId) { this.projectId = projectId; } /** - * Identifier of the contact this project was created for. - * - * @param contactId UUID - * @return Project - */ + * Identifier of the contact this project was created for. + * @param contactId UUID + * @return Project + **/ public Project contactId(UUID contactId) { this.contactId = contactId; return this; } - /** + /** * Identifier of the contact this project was created for. - * * @return contactId - */ - @ApiModelProperty( - example = "01234567-89ab-cdef-0123-456789abcdef", - value = "Identifier of the contact this project was created for.") - /** + **/ + @ApiModelProperty(example = "01234567-89ab-cdef-0123-456789abcdef", value = "Identifier of the contact this project was created for.") + /** * Identifier of the contact this project was created for. - * * @return contactId UUID - */ + **/ public UUID getContactId() { return contactId; } - /** - * Identifier of the contact this project was created for. - * - * @param contactId UUID - */ + /** + * Identifier of the contact this project was created for. + * @param contactId UUID + **/ + public void setContactId(UUID contactId) { this.contactId = contactId; } /** - * Name of the project. - * - * @param name String - * @return Project - */ + * Name of the project. + * @param name String + * @return Project + **/ public Project name(String name) { this.name = name; return this; } - /** + /** * Name of the project. - * * @return name - */ + **/ @ApiModelProperty(example = "New Kitchen", required = true, value = "Name of the project.") - /** + /** * Name of the project. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the project. - * - * @param name String - */ + /** + * Name of the project. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * currencyCode - * - * @param currencyCode CurrencyCode - * @return Project - */ + * currencyCode + * @param currencyCode CurrencyCode + * @return Project + **/ public Project currencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; return this; } - /** + /** * Get currencyCode - * * @return currencyCode - */ + **/ @ApiModelProperty(value = "") - /** + /** * currencyCode - * * @return currencyCode CurrencyCode - */ + **/ public CurrencyCode getCurrencyCode() { return currencyCode; } - /** - * currencyCode - * - * @param currencyCode CurrencyCode - */ + /** + * currencyCode + * @param currencyCode CurrencyCode + **/ + public void setCurrencyCode(CurrencyCode currencyCode) { this.currencyCode = currencyCode; } /** - * A total of minutes logged against all tasks on the Project. - * - * @param minutesLogged Integer - * @return Project - */ + * A total of minutes logged against all tasks on the Project. + * @param minutesLogged Integer + * @return Project + **/ public Project minutesLogged(Integer minutesLogged) { this.minutesLogged = minutesLogged; return this; } - /** + /** * A total of minutes logged against all tasks on the Project. - * * @return minutesLogged - */ - @ApiModelProperty( - example = "0", - value = "A total of minutes logged against all tasks on the Project.") - /** + **/ + @ApiModelProperty(example = "0", value = "A total of minutes logged against all tasks on the Project.") + /** * A total of minutes logged against all tasks on the Project. - * * @return minutesLogged Integer - */ + **/ public Integer getMinutesLogged() { return minutesLogged; } - /** - * A total of minutes logged against all tasks on the Project. - * - * @param minutesLogged Integer - */ + /** + * A total of minutes logged against all tasks on the Project. + * @param minutesLogged Integer + **/ + public void setMinutesLogged(Integer minutesLogged) { this.minutesLogged = minutesLogged; } /** - * totalTaskAmount - * - * @param totalTaskAmount Amount - * @return Project - */ + * totalTaskAmount + * @param totalTaskAmount Amount + * @return Project + **/ public Project totalTaskAmount(Amount totalTaskAmount) { this.totalTaskAmount = totalTaskAmount; return this; } - /** + /** * Get totalTaskAmount - * * @return totalTaskAmount - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalTaskAmount - * * @return totalTaskAmount Amount - */ + **/ public Amount getTotalTaskAmount() { return totalTaskAmount; } - /** - * totalTaskAmount - * - * @param totalTaskAmount Amount - */ + /** + * totalTaskAmount + * @param totalTaskAmount Amount + **/ + public void setTotalTaskAmount(Amount totalTaskAmount) { this.totalTaskAmount = totalTaskAmount; } /** - * totalExpenseAmount - * - * @param totalExpenseAmount Amount - * @return Project - */ + * totalExpenseAmount + * @param totalExpenseAmount Amount + * @return Project + **/ public Project totalExpenseAmount(Amount totalExpenseAmount) { this.totalExpenseAmount = totalExpenseAmount; return this; } - /** + /** * Get totalExpenseAmount - * * @return totalExpenseAmount - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalExpenseAmount - * * @return totalExpenseAmount Amount - */ + **/ public Amount getTotalExpenseAmount() { return totalExpenseAmount; } - /** - * totalExpenseAmount - * - * @param totalExpenseAmount Amount - */ + /** + * totalExpenseAmount + * @param totalExpenseAmount Amount + **/ + public void setTotalExpenseAmount(Amount totalExpenseAmount) { this.totalExpenseAmount = totalExpenseAmount; } /** - * estimateAmount - * - * @param estimateAmount Amount - * @return Project - */ + * estimateAmount + * @param estimateAmount Amount + * @return Project + **/ public Project estimateAmount(Amount estimateAmount) { this.estimateAmount = estimateAmount; return this; } - /** + /** * Get estimateAmount - * * @return estimateAmount - */ + **/ @ApiModelProperty(value = "") - /** + /** * estimateAmount - * * @return estimateAmount Amount - */ + **/ public Amount getEstimateAmount() { return estimateAmount; } - /** - * estimateAmount - * - * @param estimateAmount Amount - */ + /** + * estimateAmount + * @param estimateAmount Amount + **/ + public void setEstimateAmount(Amount estimateAmount) { this.estimateAmount = estimateAmount; } /** - * Minutes which have not been invoiced across all chargeable tasks in the project. - * - * @param minutesToBeInvoiced Integer - * @return Project - */ + * Minutes which have not been invoiced across all chargeable tasks in the project. + * @param minutesToBeInvoiced Integer + * @return Project + **/ public Project minutesToBeInvoiced(Integer minutesToBeInvoiced) { this.minutesToBeInvoiced = minutesToBeInvoiced; return this; } - /** + /** * Minutes which have not been invoiced across all chargeable tasks in the project. - * * @return minutesToBeInvoiced - */ - @ApiModelProperty( - example = "0", - value = "Minutes which have not been invoiced across all chargeable tasks in the project.") - /** + **/ + @ApiModelProperty(example = "0", value = "Minutes which have not been invoiced across all chargeable tasks in the project.") + /** * Minutes which have not been invoiced across all chargeable tasks in the project. - * * @return minutesToBeInvoiced Integer - */ + **/ public Integer getMinutesToBeInvoiced() { return minutesToBeInvoiced; } - /** - * Minutes which have not been invoiced across all chargeable tasks in the project. - * - * @param minutesToBeInvoiced Integer - */ + /** + * Minutes which have not been invoiced across all chargeable tasks in the project. + * @param minutesToBeInvoiced Integer + **/ + public void setMinutesToBeInvoiced(Integer minutesToBeInvoiced) { this.minutesToBeInvoiced = minutesToBeInvoiced; } /** - * taskAmountToBeInvoiced - * - * @param taskAmountToBeInvoiced Amount - * @return Project - */ + * taskAmountToBeInvoiced + * @param taskAmountToBeInvoiced Amount + * @return Project + **/ public Project taskAmountToBeInvoiced(Amount taskAmountToBeInvoiced) { this.taskAmountToBeInvoiced = taskAmountToBeInvoiced; return this; } - /** + /** * Get taskAmountToBeInvoiced - * * @return taskAmountToBeInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * taskAmountToBeInvoiced - * * @return taskAmountToBeInvoiced Amount - */ + **/ public Amount getTaskAmountToBeInvoiced() { return taskAmountToBeInvoiced; } - /** - * taskAmountToBeInvoiced - * - * @param taskAmountToBeInvoiced Amount - */ + /** + * taskAmountToBeInvoiced + * @param taskAmountToBeInvoiced Amount + **/ + public void setTaskAmountToBeInvoiced(Amount taskAmountToBeInvoiced) { this.taskAmountToBeInvoiced = taskAmountToBeInvoiced; } /** - * taskAmountInvoiced - * - * @param taskAmountInvoiced Amount - * @return Project - */ + * taskAmountInvoiced + * @param taskAmountInvoiced Amount + * @return Project + **/ public Project taskAmountInvoiced(Amount taskAmountInvoiced) { this.taskAmountInvoiced = taskAmountInvoiced; return this; } - /** + /** * Get taskAmountInvoiced - * * @return taskAmountInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * taskAmountInvoiced - * * @return taskAmountInvoiced Amount - */ + **/ public Amount getTaskAmountInvoiced() { return taskAmountInvoiced; } - /** - * taskAmountInvoiced - * - * @param taskAmountInvoiced Amount - */ + /** + * taskAmountInvoiced + * @param taskAmountInvoiced Amount + **/ + public void setTaskAmountInvoiced(Amount taskAmountInvoiced) { this.taskAmountInvoiced = taskAmountInvoiced; } /** - * expenseAmountToBeInvoiced - * - * @param expenseAmountToBeInvoiced Amount - * @return Project - */ + * expenseAmountToBeInvoiced + * @param expenseAmountToBeInvoiced Amount + * @return Project + **/ public Project expenseAmountToBeInvoiced(Amount expenseAmountToBeInvoiced) { this.expenseAmountToBeInvoiced = expenseAmountToBeInvoiced; return this; } - /** + /** * Get expenseAmountToBeInvoiced - * * @return expenseAmountToBeInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * expenseAmountToBeInvoiced - * * @return expenseAmountToBeInvoiced Amount - */ + **/ public Amount getExpenseAmountToBeInvoiced() { return expenseAmountToBeInvoiced; } - /** - * expenseAmountToBeInvoiced - * - * @param expenseAmountToBeInvoiced Amount - */ + /** + * expenseAmountToBeInvoiced + * @param expenseAmountToBeInvoiced Amount + **/ + public void setExpenseAmountToBeInvoiced(Amount expenseAmountToBeInvoiced) { this.expenseAmountToBeInvoiced = expenseAmountToBeInvoiced; } /** - * expenseAmountInvoiced - * - * @param expenseAmountInvoiced Amount - * @return Project - */ + * expenseAmountInvoiced + * @param expenseAmountInvoiced Amount + * @return Project + **/ public Project expenseAmountInvoiced(Amount expenseAmountInvoiced) { this.expenseAmountInvoiced = expenseAmountInvoiced; return this; } - /** + /** * Get expenseAmountInvoiced - * * @return expenseAmountInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * expenseAmountInvoiced - * * @return expenseAmountInvoiced Amount - */ + **/ public Amount getExpenseAmountInvoiced() { return expenseAmountInvoiced; } - /** - * expenseAmountInvoiced - * - * @param expenseAmountInvoiced Amount - */ + /** + * expenseAmountInvoiced + * @param expenseAmountInvoiced Amount + **/ + public void setExpenseAmountInvoiced(Amount expenseAmountInvoiced) { this.expenseAmountInvoiced = expenseAmountInvoiced; } /** - * projectAmountInvoiced - * - * @param projectAmountInvoiced Amount - * @return Project - */ + * projectAmountInvoiced + * @param projectAmountInvoiced Amount + * @return Project + **/ public Project projectAmountInvoiced(Amount projectAmountInvoiced) { this.projectAmountInvoiced = projectAmountInvoiced; return this; } - /** + /** * Get projectAmountInvoiced - * * @return projectAmountInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * projectAmountInvoiced - * * @return projectAmountInvoiced Amount - */ + **/ public Amount getProjectAmountInvoiced() { return projectAmountInvoiced; } - /** - * projectAmountInvoiced - * - * @param projectAmountInvoiced Amount - */ + /** + * projectAmountInvoiced + * @param projectAmountInvoiced Amount + **/ + public void setProjectAmountInvoiced(Amount projectAmountInvoiced) { this.projectAmountInvoiced = projectAmountInvoiced; } /** - * deposit - * - * @param deposit Amount - * @return Project - */ + * deposit + * @param deposit Amount + * @return Project + **/ public Project deposit(Amount deposit) { this.deposit = deposit; return this; } - /** + /** * Get deposit - * * @return deposit - */ + **/ @ApiModelProperty(value = "") - /** + /** * deposit - * * @return deposit Amount - */ + **/ public Amount getDeposit() { return deposit; } - /** - * deposit - * - * @param deposit Amount - */ + /** + * deposit + * @param deposit Amount + **/ + public void setDeposit(Amount deposit) { this.deposit = deposit; } /** - * depositApplied - * - * @param depositApplied Amount - * @return Project - */ + * depositApplied + * @param depositApplied Amount + * @return Project + **/ public Project depositApplied(Amount depositApplied) { this.depositApplied = depositApplied; return this; } - /** + /** * Get depositApplied - * * @return depositApplied - */ + **/ @ApiModelProperty(value = "") - /** + /** * depositApplied - * * @return depositApplied Amount - */ + **/ public Amount getDepositApplied() { return depositApplied; } - /** - * depositApplied - * - * @param depositApplied Amount - */ + /** + * depositApplied + * @param depositApplied Amount + **/ + public void setDepositApplied(Amount depositApplied) { this.depositApplied = depositApplied; } /** - * creditNoteAmount - * - * @param creditNoteAmount Amount - * @return Project - */ + * creditNoteAmount + * @param creditNoteAmount Amount + * @return Project + **/ public Project creditNoteAmount(Amount creditNoteAmount) { this.creditNoteAmount = creditNoteAmount; return this; } - /** + /** * Get creditNoteAmount - * * @return creditNoteAmount - */ + **/ @ApiModelProperty(value = "") - /** + /** * creditNoteAmount - * * @return creditNoteAmount Amount - */ + **/ public Amount getCreditNoteAmount() { return creditNoteAmount; } - /** - * creditNoteAmount - * - * @param creditNoteAmount Amount - */ + /** + * creditNoteAmount + * @param creditNoteAmount Amount + **/ + public void setCreditNoteAmount(Amount creditNoteAmount) { this.creditNoteAmount = creditNoteAmount; } /** - * Deadline for the project. UTC Date Time in ISO-8601 format. - * - * @param deadlineUtc OffsetDateTime - * @return Project - */ + * Deadline for the project. UTC Date Time in ISO-8601 format. + * @param deadlineUtc OffsetDateTime + * @return Project + **/ public Project deadlineUtc(OffsetDateTime deadlineUtc) { this.deadlineUtc = deadlineUtc; return this; } - /** + /** * Deadline for the project. UTC Date Time in ISO-8601 format. - * * @return deadlineUtc - */ - @ApiModelProperty( - example = "2019-12-10T12:59:59Z", - value = "Deadline for the project. UTC Date Time in ISO-8601 format.") - /** + **/ + @ApiModelProperty(example = "2019-12-10T12:59:59Z", value = "Deadline for the project. UTC Date Time in ISO-8601 format.") + /** * Deadline for the project. UTC Date Time in ISO-8601 format. - * * @return deadlineUtc OffsetDateTime - */ + **/ public OffsetDateTime getDeadlineUtc() { return deadlineUtc; } - /** - * Deadline for the project. UTC Date Time in ISO-8601 format. - * - * @param deadlineUtc OffsetDateTime - */ + /** + * Deadline for the project. UTC Date Time in ISO-8601 format. + * @param deadlineUtc OffsetDateTime + **/ + public void setDeadlineUtc(OffsetDateTime deadlineUtc) { this.deadlineUtc = deadlineUtc; } /** - * totalInvoiced - * - * @param totalInvoiced Amount - * @return Project - */ + * totalInvoiced + * @param totalInvoiced Amount + * @return Project + **/ public Project totalInvoiced(Amount totalInvoiced) { this.totalInvoiced = totalInvoiced; return this; } - /** + /** * Get totalInvoiced - * * @return totalInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalInvoiced - * * @return totalInvoiced Amount - */ + **/ public Amount getTotalInvoiced() { return totalInvoiced; } - /** - * totalInvoiced - * - * @param totalInvoiced Amount - */ + /** + * totalInvoiced + * @param totalInvoiced Amount + **/ + public void setTotalInvoiced(Amount totalInvoiced) { this.totalInvoiced = totalInvoiced; } /** - * totalToBeInvoiced - * - * @param totalToBeInvoiced Amount - * @return Project - */ + * totalToBeInvoiced + * @param totalToBeInvoiced Amount + * @return Project + **/ public Project totalToBeInvoiced(Amount totalToBeInvoiced) { this.totalToBeInvoiced = totalToBeInvoiced; return this; } - /** + /** * Get totalToBeInvoiced - * * @return totalToBeInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalToBeInvoiced - * * @return totalToBeInvoiced Amount - */ + **/ public Amount getTotalToBeInvoiced() { return totalToBeInvoiced; } - /** - * totalToBeInvoiced - * - * @param totalToBeInvoiced Amount - */ + /** + * totalToBeInvoiced + * @param totalToBeInvoiced Amount + **/ + public void setTotalToBeInvoiced(Amount totalToBeInvoiced) { this.totalToBeInvoiced = totalToBeInvoiced; } /** - * estimate - * - * @param estimate Amount - * @return Project - */ + * estimate + * @param estimate Amount + * @return Project + **/ public Project estimate(Amount estimate) { this.estimate = estimate; return this; } - /** + /** * Get estimate - * * @return estimate - */ + **/ @ApiModelProperty(value = "") - /** + /** * estimate - * * @return estimate Amount - */ + **/ public Amount getEstimate() { return estimate; } - /** - * estimate - * - * @param estimate Amount - */ + /** + * estimate + * @param estimate Amount + **/ + public void setEstimate(Amount estimate) { this.estimate = estimate; } /** - * status - * - * @param status ProjectStatus - * @return Project - */ + * status + * @param status ProjectStatus + * @return Project + **/ public Project status(ProjectStatus status) { this.status = status; return this; } - /** + /** * Get status - * * @return status - */ + **/ @ApiModelProperty(value = "") - /** + /** * status - * * @return status ProjectStatus - */ + **/ public ProjectStatus getStatus() { return status; } - /** - * status - * - * @param status ProjectStatus - */ + /** + * status + * @param status ProjectStatus + **/ + public void setStatus(ProjectStatus status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -876,57 +821,36 @@ public boolean equals(java.lang.Object o) { return false; } Project project = (Project) o; - return Objects.equals(this.projectId, project.projectId) - && Objects.equals(this.contactId, project.contactId) - && Objects.equals(this.name, project.name) - && Objects.equals(this.currencyCode, project.currencyCode) - && Objects.equals(this.minutesLogged, project.minutesLogged) - && Objects.equals(this.totalTaskAmount, project.totalTaskAmount) - && Objects.equals(this.totalExpenseAmount, project.totalExpenseAmount) - && Objects.equals(this.estimateAmount, project.estimateAmount) - && Objects.equals(this.minutesToBeInvoiced, project.minutesToBeInvoiced) - && Objects.equals(this.taskAmountToBeInvoiced, project.taskAmountToBeInvoiced) - && Objects.equals(this.taskAmountInvoiced, project.taskAmountInvoiced) - && Objects.equals(this.expenseAmountToBeInvoiced, project.expenseAmountToBeInvoiced) - && Objects.equals(this.expenseAmountInvoiced, project.expenseAmountInvoiced) - && Objects.equals(this.projectAmountInvoiced, project.projectAmountInvoiced) - && Objects.equals(this.deposit, project.deposit) - && Objects.equals(this.depositApplied, project.depositApplied) - && Objects.equals(this.creditNoteAmount, project.creditNoteAmount) - && Objects.equals(this.deadlineUtc, project.deadlineUtc) - && Objects.equals(this.totalInvoiced, project.totalInvoiced) - && Objects.equals(this.totalToBeInvoiced, project.totalToBeInvoiced) - && Objects.equals(this.estimate, project.estimate) - && Objects.equals(this.status, project.status); + return Objects.equals(this.projectId, project.projectId) && + Objects.equals(this.contactId, project.contactId) && + Objects.equals(this.name, project.name) && + Objects.equals(this.currencyCode, project.currencyCode) && + Objects.equals(this.minutesLogged, project.minutesLogged) && + Objects.equals(this.totalTaskAmount, project.totalTaskAmount) && + Objects.equals(this.totalExpenseAmount, project.totalExpenseAmount) && + Objects.equals(this.estimateAmount, project.estimateAmount) && + Objects.equals(this.minutesToBeInvoiced, project.minutesToBeInvoiced) && + Objects.equals(this.taskAmountToBeInvoiced, project.taskAmountToBeInvoiced) && + Objects.equals(this.taskAmountInvoiced, project.taskAmountInvoiced) && + Objects.equals(this.expenseAmountToBeInvoiced, project.expenseAmountToBeInvoiced) && + Objects.equals(this.expenseAmountInvoiced, project.expenseAmountInvoiced) && + Objects.equals(this.projectAmountInvoiced, project.projectAmountInvoiced) && + Objects.equals(this.deposit, project.deposit) && + Objects.equals(this.depositApplied, project.depositApplied) && + Objects.equals(this.creditNoteAmount, project.creditNoteAmount) && + Objects.equals(this.deadlineUtc, project.deadlineUtc) && + Objects.equals(this.totalInvoiced, project.totalInvoiced) && + Objects.equals(this.totalToBeInvoiced, project.totalToBeInvoiced) && + Objects.equals(this.estimate, project.estimate) && + Objects.equals(this.status, project.status); } @Override public int hashCode() { - return Objects.hash( - projectId, - contactId, - name, - currencyCode, - minutesLogged, - totalTaskAmount, - totalExpenseAmount, - estimateAmount, - minutesToBeInvoiced, - taskAmountToBeInvoiced, - taskAmountInvoiced, - expenseAmountToBeInvoiced, - expenseAmountInvoiced, - projectAmountInvoiced, - deposit, - depositApplied, - creditNoteAmount, - deadlineUtc, - totalInvoiced, - totalToBeInvoiced, - estimate, - status); + return Objects.hash(projectId, contactId, name, currencyCode, minutesLogged, totalTaskAmount, totalExpenseAmount, estimateAmount, minutesToBeInvoiced, taskAmountToBeInvoiced, taskAmountInvoiced, expenseAmountToBeInvoiced, expenseAmountInvoiced, projectAmountInvoiced, deposit, depositApplied, creditNoteAmount, deadlineUtc, totalInvoiced, totalToBeInvoiced, estimate, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -939,22 +863,12 @@ public String toString() { sb.append(" totalTaskAmount: ").append(toIndentedString(totalTaskAmount)).append("\n"); sb.append(" totalExpenseAmount: ").append(toIndentedString(totalExpenseAmount)).append("\n"); sb.append(" estimateAmount: ").append(toIndentedString(estimateAmount)).append("\n"); - sb.append(" minutesToBeInvoiced: ") - .append(toIndentedString(minutesToBeInvoiced)) - .append("\n"); - sb.append(" taskAmountToBeInvoiced: ") - .append(toIndentedString(taskAmountToBeInvoiced)) - .append("\n"); + sb.append(" minutesToBeInvoiced: ").append(toIndentedString(minutesToBeInvoiced)).append("\n"); + sb.append(" taskAmountToBeInvoiced: ").append(toIndentedString(taskAmountToBeInvoiced)).append("\n"); sb.append(" taskAmountInvoiced: ").append(toIndentedString(taskAmountInvoiced)).append("\n"); - sb.append(" expenseAmountToBeInvoiced: ") - .append(toIndentedString(expenseAmountToBeInvoiced)) - .append("\n"); - sb.append(" expenseAmountInvoiced: ") - .append(toIndentedString(expenseAmountInvoiced)) - .append("\n"); - sb.append(" projectAmountInvoiced: ") - .append(toIndentedString(projectAmountInvoiced)) - .append("\n"); + sb.append(" expenseAmountToBeInvoiced: ").append(toIndentedString(expenseAmountToBeInvoiced)).append("\n"); + sb.append(" expenseAmountInvoiced: ").append(toIndentedString(expenseAmountInvoiced)).append("\n"); + sb.append(" projectAmountInvoiced: ").append(toIndentedString(projectAmountInvoiced)).append("\n"); sb.append(" deposit: ").append(toIndentedString(deposit)).append("\n"); sb.append(" depositApplied: ").append(toIndentedString(depositApplied)).append("\n"); sb.append(" creditNoteAmount: ").append(toIndentedString(creditNoteAmount)).append("\n"); @@ -968,7 +882,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -976,4 +891,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/ProjectCreateOrUpdate.java b/src/main/java/com/xero/models/project/ProjectCreateOrUpdate.java index 9c2805783..aa6332559 100644 --- a/src/main/java/com/xero/models/project/ProjectCreateOrUpdate.java +++ b/src/main/java/com/xero/models/project/ProjectCreateOrUpdate.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ProjectCreateOrUpdate + */ -/** ProjectCreateOrUpdate */ public class ProjectCreateOrUpdate { StringUtil util = new StringUtil(); @@ -34,149 +51,134 @@ public class ProjectCreateOrUpdate { @JsonProperty("deadlineUtc") private OffsetDateTime deadlineUtc; /** - * Identifier of the contact this project was created for. - * - * @param contactId UUID - * @return ProjectCreateOrUpdate - */ + * Identifier of the contact this project was created for. + * @param contactId UUID + * @return ProjectCreateOrUpdate + **/ public ProjectCreateOrUpdate contactId(UUID contactId) { this.contactId = contactId; return this; } - /** + /** * Identifier of the contact this project was created for. - * * @return contactId - */ - @ApiModelProperty( - example = "01234567-89ab-cdef-0123-456789abcdef", - value = "Identifier of the contact this project was created for.") - /** + **/ + @ApiModelProperty(example = "01234567-89ab-cdef-0123-456789abcdef", value = "Identifier of the contact this project was created for.") + /** * Identifier of the contact this project was created for. - * * @return contactId UUID - */ + **/ public UUID getContactId() { return contactId; } - /** - * Identifier of the contact this project was created for. - * - * @param contactId UUID - */ + /** + * Identifier of the contact this project was created for. + * @param contactId UUID + **/ + public void setContactId(UUID contactId) { this.contactId = contactId; } /** - * Name of the project. - * - * @param name String - * @return ProjectCreateOrUpdate - */ + * Name of the project. + * @param name String + * @return ProjectCreateOrUpdate + **/ public ProjectCreateOrUpdate name(String name) { this.name = name; return this; } - /** + /** * Name of the project. - * * @return name - */ + **/ @ApiModelProperty(example = "New Kitchen", required = true, value = "Name of the project.") - /** + /** * Name of the project. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the project. - * - * @param name String - */ + /** + * Name of the project. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * estimateAmount - * - * @param estimateAmount Double - * @return ProjectCreateOrUpdate - */ + * estimateAmount + * @param estimateAmount Double + * @return ProjectCreateOrUpdate + **/ public ProjectCreateOrUpdate estimateAmount(Double estimateAmount) { this.estimateAmount = estimateAmount; return this; } - /** + /** * Get estimateAmount - * * @return estimateAmount - */ + **/ @ApiModelProperty(example = "1.0", value = "") - /** + /** * estimateAmount - * * @return estimateAmount Double - */ + **/ public Double getEstimateAmount() { return estimateAmount; } - /** - * estimateAmount - * - * @param estimateAmount Double - */ + /** + * estimateAmount + * @param estimateAmount Double + **/ + public void setEstimateAmount(Double estimateAmount) { this.estimateAmount = estimateAmount; } /** - * Deadline for the project. UTC Date Time in ISO-8601 format. - * - * @param deadlineUtc OffsetDateTime - * @return ProjectCreateOrUpdate - */ + * Deadline for the project. UTC Date Time in ISO-8601 format. + * @param deadlineUtc OffsetDateTime + * @return ProjectCreateOrUpdate + **/ public ProjectCreateOrUpdate deadlineUtc(OffsetDateTime deadlineUtc) { this.deadlineUtc = deadlineUtc; return this; } - /** + /** * Deadline for the project. UTC Date Time in ISO-8601 format. - * * @return deadlineUtc - */ - @ApiModelProperty( - example = "2019-12-10T12:59:59Z", - value = "Deadline for the project. UTC Date Time in ISO-8601 format.") - /** + **/ + @ApiModelProperty(example = "2019-12-10T12:59:59Z", value = "Deadline for the project. UTC Date Time in ISO-8601 format.") + /** * Deadline for the project. UTC Date Time in ISO-8601 format. - * * @return deadlineUtc OffsetDateTime - */ + **/ public OffsetDateTime getDeadlineUtc() { return deadlineUtc; } - /** - * Deadline for the project. UTC Date Time in ISO-8601 format. - * - * @param deadlineUtc OffsetDateTime - */ + /** + * Deadline for the project. UTC Date Time in ISO-8601 format. + * @param deadlineUtc OffsetDateTime + **/ + public void setDeadlineUtc(OffsetDateTime deadlineUtc) { this.deadlineUtc = deadlineUtc; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -186,10 +188,10 @@ public boolean equals(java.lang.Object o) { return false; } ProjectCreateOrUpdate projectCreateOrUpdate = (ProjectCreateOrUpdate) o; - return Objects.equals(this.contactId, projectCreateOrUpdate.contactId) - && Objects.equals(this.name, projectCreateOrUpdate.name) - && Objects.equals(this.estimateAmount, projectCreateOrUpdate.estimateAmount) - && Objects.equals(this.deadlineUtc, projectCreateOrUpdate.deadlineUtc); + return Objects.equals(this.contactId, projectCreateOrUpdate.contactId) && + Objects.equals(this.name, projectCreateOrUpdate.name) && + Objects.equals(this.estimateAmount, projectCreateOrUpdate.estimateAmount) && + Objects.equals(this.deadlineUtc, projectCreateOrUpdate.deadlineUtc); } @Override @@ -197,6 +199,7 @@ public int hashCode() { return Objects.hash(contactId, name, estimateAmount, deadlineUtc); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -210,7 +213,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -218,4 +222,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/ProjectPatch.java b/src/main/java/com/xero/models/project/ProjectPatch.java index 8c8d082f0..bca87fb4d 100644 --- a/src/main/java/com/xero/models/project/ProjectPatch.java +++ b/src/main/java/com/xero/models/project/ProjectPatch.java @@ -9,54 +9,70 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.ProjectStatus; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ProjectPatch + */ -/** ProjectPatch */ public class ProjectPatch { StringUtil util = new StringUtil(); @JsonProperty("status") private ProjectStatus status; /** - * status - * - * @param status ProjectStatus - * @return ProjectPatch - */ + * status + * @param status ProjectStatus + * @return ProjectPatch + **/ public ProjectPatch status(ProjectStatus status) { this.status = status; return this; } - /** + /** * Get status - * * @return status - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * status - * * @return status ProjectStatus - */ + **/ public ProjectStatus getStatus() { return status; } - /** - * status - * - * @param status ProjectStatus - */ + /** + * status + * @param status ProjectStatus + **/ + public void setStatus(ProjectStatus status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,6 +90,7 @@ public int hashCode() { return Objects.hash(status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -84,7 +101,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -92,4 +110,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/ProjectStatus.java b/src/main/java/com/xero/models/project/ProjectStatus.java index 0260b71cb..0b5599035 100644 --- a/src/main/java/com/xero/models/project/ProjectStatus.java +++ b/src/main/java/com/xero/models/project/ProjectStatus.java @@ -9,19 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Status for project */ +/** + * Status for project + */ public enum ProjectStatus { - - /** INPROGRESS */ + + /** + * INPROGRESS + */ INPROGRESS("INPROGRESS"), - - /** CLOSED */ + + /** + * CLOSED + */ CLOSED("CLOSED"); private String value; @@ -30,26 +46,24 @@ public enum ProjectStatus { this.value = value; } - /** @return String value */ + /** + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ + /** toString + * @return String value + */ @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String + /** fromValue + * @param value String */ @JsonCreator public static ProjectStatus fromValue(String value) { @@ -61,3 +75,4 @@ public static ProjectStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } + diff --git a/src/main/java/com/xero/models/project/ProjectUser.java b/src/main/java/com/xero/models/project/ProjectUser.java index d9ee06d10..0d2eca455 100644 --- a/src/main/java/com/xero/models/project/ProjectUser.java +++ b/src/main/java/com/xero/models/project/ProjectUser.java @@ -9,15 +9,32 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ProjectUser + */ -/** ProjectUser */ public class ProjectUser { StringUtil util = new StringUtil(); @@ -30,112 +47,102 @@ public class ProjectUser { @JsonProperty("email") private String email; /** - * Identifier of the user of the project. - * - * @param userId UUID - * @return ProjectUser - */ + * Identifier of the user of the project. + * @param userId UUID + * @return ProjectUser + **/ public ProjectUser userId(UUID userId) { this.userId = userId; return this; } - /** + /** * Identifier of the user of the project. - * * @return userId - */ - @ApiModelProperty( - example = "254553fa-2be8-4991-bd5e-70a97ea12ef8", - value = "Identifier of the user of the project.") - /** + **/ + @ApiModelProperty(example = "254553fa-2be8-4991-bd5e-70a97ea12ef8", value = "Identifier of the user of the project.") + /** * Identifier of the user of the project. - * * @return userId UUID - */ + **/ public UUID getUserId() { return userId; } - /** - * Identifier of the user of the project. - * - * @param userId UUID - */ + /** + * Identifier of the user of the project. + * @param userId UUID + **/ + public void setUserId(UUID userId) { this.userId = userId; } /** - * Full name of the user. - * - * @param name String - * @return ProjectUser - */ + * Full name of the user. + * @param name String + * @return ProjectUser + **/ public ProjectUser name(String name) { this.name = name; return this; } - /** + /** * Full name of the user. - * * @return name - */ + **/ @ApiModelProperty(example = "Sidney Allen", value = "Full name of the user.") - /** + /** * Full name of the user. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Full name of the user. - * - * @param name String - */ + /** + * Full name of the user. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * Email address of the user. - * - * @param email String - * @return ProjectUser - */ + * Email address of the user. + * @param email String + * @return ProjectUser + **/ public ProjectUser email(String email) { this.email = email; return this; } - /** + /** * Email address of the user. - * * @return email - */ + **/ @ApiModelProperty(example = "sidneyallen@xero.com", value = "Email address of the user.") - /** + /** * Email address of the user. - * * @return email String - */ + **/ public String getEmail() { return email; } - /** - * Email address of the user. - * - * @param email String - */ + /** + * Email address of the user. + * @param email String + **/ + public void setEmail(String email) { this.email = email; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -145,9 +152,9 @@ public boolean equals(java.lang.Object o) { return false; } ProjectUser projectUser = (ProjectUser) o; - return Objects.equals(this.userId, projectUser.userId) - && Objects.equals(this.name, projectUser.name) - && Objects.equals(this.email, projectUser.email); + return Objects.equals(this.userId, projectUser.userId) && + Objects.equals(this.name, projectUser.name) && + Objects.equals(this.email, projectUser.email); } @Override @@ -155,6 +162,7 @@ public int hashCode() { return Objects.hash(userId, name, email); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -167,7 +175,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -175,4 +184,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/ProjectUsers.java b/src/main/java/com/xero/models/project/ProjectUsers.java index 4467f24b1..2b782756c 100644 --- a/src/main/java/com/xero/models/project/ProjectUsers.java +++ b/src/main/java/com/xero/models/project/ProjectUsers.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.Pagination; +import com.xero.models.project.ProjectUser; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * ProjectUsers + */ -/** ProjectUsers */ public class ProjectUsers { StringUtil util = new StringUtil(); @@ -28,46 +47,42 @@ public class ProjectUsers { @JsonProperty("items") private List items = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return ProjectUsers - */ + * pagination + * @param pagination Pagination + * @return ProjectUsers + **/ public ProjectUsers pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * items - * - * @param items List<ProjectUser> - * @return ProjectUsers - */ + * items + * @param items List<ProjectUser> + * @return ProjectUsers + **/ public ProjectUsers items(List items) { this.items = items; return this; @@ -75,10 +90,9 @@ public ProjectUsers items(List items) { /** * items - * - * @param itemsItem ProjectUser + * @param itemsItem ProjectUser * @return ProjectUsers - */ + **/ public ProjectUsers addItemsItem(ProjectUser itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -87,30 +101,29 @@ public ProjectUsers addItemsItem(ProjectUser itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<ProjectUser> - */ + /** + * items + * @param items List<ProjectUser> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } ProjectUsers projectUsers = (ProjectUsers) o; - return Objects.equals(this.pagination, projectUsers.pagination) - && Objects.equals(this.items, projectUsers.items); + return Objects.equals(this.pagination, projectUsers.pagination) && + Objects.equals(this.items, projectUsers.items); } @Override @@ -129,6 +142,7 @@ public int hashCode() { return Objects.hash(pagination, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/Projects.java b/src/main/java/com/xero/models/project/Projects.java index d19473be5..171dfdbcd 100644 --- a/src/main/java/com/xero/models/project/Projects.java +++ b/src/main/java/com/xero/models/project/Projects.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.Pagination; +import com.xero.models.project.Project; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Projects + */ -/** Projects */ public class Projects { StringUtil util = new StringUtil(); @@ -28,46 +47,42 @@ public class Projects { @JsonProperty("items") private List items = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Projects - */ + * pagination + * @param pagination Pagination + * @return Projects + **/ public Projects pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * items - * - * @param items List<Project> - * @return Projects - */ + * items + * @param items List<Project> + * @return Projects + **/ public Projects items(List items) { this.items = items; return this; @@ -75,10 +90,9 @@ public Projects items(List items) { /** * items - * - * @param itemsItem Project + * @param itemsItem Project * @return Projects - */ + **/ public Projects addItemsItem(Project itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -87,30 +101,29 @@ public Projects addItemsItem(Project itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<Project> - */ + /** + * items + * @param items List<Project> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } Projects projects = (Projects) o; - return Objects.equals(this.pagination, projects.pagination) - && Objects.equals(this.items, projects.items); + return Objects.equals(this.pagination, projects.pagination) && + Objects.equals(this.items, projects.items); } @Override @@ -129,6 +142,7 @@ public int hashCode() { return Objects.hash(pagination, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/Task.java b/src/main/java/com/xero/models/project/Task.java index b575a92ab..f8bc66a54 100644 --- a/src/main/java/com/xero/models/project/Task.java +++ b/src/main/java/com/xero/models/project/Task.java @@ -9,17 +9,34 @@ * Do not edit the class manually. */ -package com.xero.models.project; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import com.xero.models.project.Amount; +import com.xero.models.project.ChargeType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Task + */ -/** Task */ public class Task { StringUtil util = new StringUtil(); @@ -65,20 +82,22 @@ public class Task { @JsonProperty("amountInvoiced") private Amount amountInvoiced; /** - * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is - * invoiced the status will be set to `INVOICED` and can't be modified. A task with - * ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of - * `INVOICED`. A `LOCKED` state indicates that the task is currently changing - * state (for example being invoiced) and can't be modified. + * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** INVOICED */ + + /** + * INVOICED + */ INVOICED("INVOICED"), - - /** LOCKED */ + + /** + * LOCKED + */ LOCKED("LOCKED"); private String value; @@ -87,31 +106,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -123,567 +136,490 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; /** - * Identifier of the task. - * - * @param taskId UUID - * @return Task - */ + * Identifier of the task. + * @param taskId UUID + * @return Task + **/ public Task taskId(UUID taskId) { this.taskId = taskId; return this; } - /** + /** * Identifier of the task. - * * @return taskId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "Identifier of the task.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Identifier of the task.") + /** * Identifier of the task. - * * @return taskId UUID - */ + **/ public UUID getTaskId() { return taskId; } - /** - * Identifier of the task. - * - * @param taskId UUID - */ + /** + * Identifier of the task. + * @param taskId UUID + **/ + public void setTaskId(UUID taskId) { this.taskId = taskId; } /** - * Name of the task. - * - * @param name String - * @return Task - */ + * Name of the task. + * @param name String + * @return Task + **/ public Task name(String name) { this.name = name; return this; } - /** + /** * Name of the task. - * * @return name - */ + **/ @ApiModelProperty(value = "Name of the task.") - /** + /** * Name of the task. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the task. - * - * @param name String - */ + /** + * Name of the task. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * rate - * - * @param rate Amount - * @return Task - */ + * rate + * @param rate Amount + * @return Task + **/ public Task rate(Amount rate) { this.rate = rate; return this; } - /** + /** * Get rate - * * @return rate - */ + **/ @ApiModelProperty(value = "") - /** + /** * rate - * * @return rate Amount - */ + **/ public Amount getRate() { return rate; } - /** - * rate - * - * @param rate Amount - */ + /** + * rate + * @param rate Amount + **/ + public void setRate(Amount rate) { this.rate = rate; } /** - * chargeType - * - * @param chargeType ChargeType - * @return Task - */ + * chargeType + * @param chargeType ChargeType + * @return Task + **/ public Task chargeType(ChargeType chargeType) { this.chargeType = chargeType; return this; } - /** + /** * Get chargeType - * * @return chargeType - */ + **/ @ApiModelProperty(value = "") - /** + /** * chargeType - * * @return chargeType ChargeType - */ + **/ public ChargeType getChargeType() { return chargeType; } - /** - * chargeType - * - * @param chargeType ChargeType - */ + /** + * chargeType + * @param chargeType ChargeType + **/ + public void setChargeType(ChargeType chargeType) { this.chargeType = chargeType; } /** - * An estimated time to perform the task - * - * @param estimateMinutes Integer - * @return Task - */ + * An estimated time to perform the task + * @param estimateMinutes Integer + * @return Task + **/ public Task estimateMinutes(Integer estimateMinutes) { this.estimateMinutes = estimateMinutes; return this; } - /** + /** * An estimated time to perform the task - * * @return estimateMinutes - */ + **/ @ApiModelProperty(value = "An estimated time to perform the task") - /** + /** * An estimated time to perform the task - * * @return estimateMinutes Integer - */ + **/ public Integer getEstimateMinutes() { return estimateMinutes; } - /** - * An estimated time to perform the task - * - * @param estimateMinutes Integer - */ + /** + * An estimated time to perform the task + * @param estimateMinutes Integer + **/ + public void setEstimateMinutes(Integer estimateMinutes) { this.estimateMinutes = estimateMinutes; } /** - * Identifier of the project task belongs to. - * - * @param projectId UUID - * @return Task - */ + * Identifier of the project task belongs to. + * @param projectId UUID + * @return Task + **/ public Task projectId(UUID projectId) { this.projectId = projectId; return this; } - /** + /** * Identifier of the project task belongs to. - * * @return projectId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "Identifier of the project task belongs to.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Identifier of the project task belongs to.") + /** * Identifier of the project task belongs to. - * * @return projectId UUID - */ + **/ public UUID getProjectId() { return projectId; } - /** - * Identifier of the project task belongs to. - * - * @param projectId UUID - */ + /** + * Identifier of the project task belongs to. + * @param projectId UUID + **/ + public void setProjectId(UUID projectId) { this.projectId = projectId; } /** - * Total minutes which have been logged against the task. Logged by assigning a time entry to a - * task - * - * @param totalMinutes Integer - * @return Task - */ + * Total minutes which have been logged against the task. Logged by assigning a time entry to a task + * @param totalMinutes Integer + * @return Task + **/ public Task totalMinutes(Integer totalMinutes) { this.totalMinutes = totalMinutes; return this; } - /** - * Total minutes which have been logged against the task. Logged by assigning a time entry to a - * task - * + /** + * Total minutes which have been logged against the task. Logged by assigning a time entry to a task * @return totalMinutes - */ - @ApiModelProperty( - value = - "Total minutes which have been logged against the task. Logged by assigning a time entry" - + " to a task") - /** - * Total minutes which have been logged against the task. Logged by assigning a time entry to a - * task - * + **/ + @ApiModelProperty(value = "Total minutes which have been logged against the task. Logged by assigning a time entry to a task") + /** + * Total minutes which have been logged against the task. Logged by assigning a time entry to a task * @return totalMinutes Integer - */ + **/ public Integer getTotalMinutes() { return totalMinutes; } - /** - * Total minutes which have been logged against the task. Logged by assigning a time entry to a - * task - * - * @param totalMinutes Integer - */ + /** + * Total minutes which have been logged against the task. Logged by assigning a time entry to a task + * @param totalMinutes Integer + **/ + public void setTotalMinutes(Integer totalMinutes) { this.totalMinutes = totalMinutes; } /** - * totalAmount - * - * @param totalAmount Amount - * @return Task - */ + * totalAmount + * @param totalAmount Amount + * @return Task + **/ public Task totalAmount(Amount totalAmount) { this.totalAmount = totalAmount; return this; } - /** + /** * Get totalAmount - * * @return totalAmount - */ + **/ @ApiModelProperty(value = "") - /** + /** * totalAmount - * * @return totalAmount Amount - */ + **/ public Amount getTotalAmount() { return totalAmount; } - /** - * totalAmount - * - * @param totalAmount Amount - */ + /** + * totalAmount + * @param totalAmount Amount + **/ + public void setTotalAmount(Amount totalAmount) { this.totalAmount = totalAmount; } /** - * Minutes on this task which have been invoiced. - * - * @param minutesInvoiced Integer - * @return Task - */ + * Minutes on this task which have been invoiced. + * @param minutesInvoiced Integer + * @return Task + **/ public Task minutesInvoiced(Integer minutesInvoiced) { this.minutesInvoiced = minutesInvoiced; return this; } - /** + /** * Minutes on this task which have been invoiced. - * * @return minutesInvoiced - */ + **/ @ApiModelProperty(value = "Minutes on this task which have been invoiced.") - /** + /** * Minutes on this task which have been invoiced. - * * @return minutesInvoiced Integer - */ + **/ public Integer getMinutesInvoiced() { return minutesInvoiced; } - /** - * Minutes on this task which have been invoiced. - * - * @param minutesInvoiced Integer - */ + /** + * Minutes on this task which have been invoiced. + * @param minutesInvoiced Integer + **/ + public void setMinutesInvoiced(Integer minutesInvoiced) { this.minutesInvoiced = minutesInvoiced; } /** - * Minutes on this task which have not been invoiced. - * - * @param minutesToBeInvoiced Integer - * @return Task - */ + * Minutes on this task which have not been invoiced. + * @param minutesToBeInvoiced Integer + * @return Task + **/ public Task minutesToBeInvoiced(Integer minutesToBeInvoiced) { this.minutesToBeInvoiced = minutesToBeInvoiced; return this; } - /** + /** * Minutes on this task which have not been invoiced. - * * @return minutesToBeInvoiced - */ + **/ @ApiModelProperty(value = "Minutes on this task which have not been invoiced.") - /** + /** * Minutes on this task which have not been invoiced. - * * @return minutesToBeInvoiced Integer - */ + **/ public Integer getMinutesToBeInvoiced() { return minutesToBeInvoiced; } - /** - * Minutes on this task which have not been invoiced. - * - * @param minutesToBeInvoiced Integer - */ + /** + * Minutes on this task which have not been invoiced. + * @param minutesToBeInvoiced Integer + **/ + public void setMinutesToBeInvoiced(Integer minutesToBeInvoiced) { this.minutesToBeInvoiced = minutesToBeInvoiced; } /** - * Minutes logged against this task if its charge type is `FIXED`. - * - * @param fixedMinutes Integer - * @return Task - */ + * Minutes logged against this task if its charge type is `FIXED`. + * @param fixedMinutes Integer + * @return Task + **/ public Task fixedMinutes(Integer fixedMinutes) { this.fixedMinutes = fixedMinutes; return this; } - /** + /** * Minutes logged against this task if its charge type is `FIXED`. - * * @return fixedMinutes - */ + **/ @ApiModelProperty(value = "Minutes logged against this task if its charge type is `FIXED`.") - /** + /** * Minutes logged against this task if its charge type is `FIXED`. - * * @return fixedMinutes Integer - */ + **/ public Integer getFixedMinutes() { return fixedMinutes; } - /** - * Minutes logged against this task if its charge type is `FIXED`. - * - * @param fixedMinutes Integer - */ + /** + * Minutes logged against this task if its charge type is `FIXED`. + * @param fixedMinutes Integer + **/ + public void setFixedMinutes(Integer fixedMinutes) { this.fixedMinutes = fixedMinutes; } /** - * Minutes logged against this task if its charge type is `NON_CHARGEABLE`. - * - * @param nonChargeableMinutes Integer - * @return Task - */ + * Minutes logged against this task if its charge type is `NON_CHARGEABLE`. + * @param nonChargeableMinutes Integer + * @return Task + **/ public Task nonChargeableMinutes(Integer nonChargeableMinutes) { this.nonChargeableMinutes = nonChargeableMinutes; return this; } - /** + /** * Minutes logged against this task if its charge type is `NON_CHARGEABLE`. - * * @return nonChargeableMinutes - */ - @ApiModelProperty( - value = "Minutes logged against this task if its charge type is `NON_CHARGEABLE`.") - /** + **/ + @ApiModelProperty(value = "Minutes logged against this task if its charge type is `NON_CHARGEABLE`.") + /** * Minutes logged against this task if its charge type is `NON_CHARGEABLE`. - * * @return nonChargeableMinutes Integer - */ + **/ public Integer getNonChargeableMinutes() { return nonChargeableMinutes; } - /** - * Minutes logged against this task if its charge type is `NON_CHARGEABLE`. - * - * @param nonChargeableMinutes Integer - */ + /** + * Minutes logged against this task if its charge type is `NON_CHARGEABLE`. + * @param nonChargeableMinutes Integer + **/ + public void setNonChargeableMinutes(Integer nonChargeableMinutes) { this.nonChargeableMinutes = nonChargeableMinutes; } /** - * amountToBeInvoiced - * - * @param amountToBeInvoiced Amount - * @return Task - */ + * amountToBeInvoiced + * @param amountToBeInvoiced Amount + * @return Task + **/ public Task amountToBeInvoiced(Amount amountToBeInvoiced) { this.amountToBeInvoiced = amountToBeInvoiced; return this; } - /** + /** * Get amountToBeInvoiced - * * @return amountToBeInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * amountToBeInvoiced - * * @return amountToBeInvoiced Amount - */ + **/ public Amount getAmountToBeInvoiced() { return amountToBeInvoiced; } - /** - * amountToBeInvoiced - * - * @param amountToBeInvoiced Amount - */ + /** + * amountToBeInvoiced + * @param amountToBeInvoiced Amount + **/ + public void setAmountToBeInvoiced(Amount amountToBeInvoiced) { this.amountToBeInvoiced = amountToBeInvoiced; } /** - * amountInvoiced - * - * @param amountInvoiced Amount - * @return Task - */ + * amountInvoiced + * @param amountInvoiced Amount + * @return Task + **/ public Task amountInvoiced(Amount amountInvoiced) { this.amountInvoiced = amountInvoiced; return this; } - /** + /** * Get amountInvoiced - * * @return amountInvoiced - */ + **/ @ApiModelProperty(value = "") - /** + /** * amountInvoiced - * * @return amountInvoiced Amount - */ + **/ public Amount getAmountInvoiced() { return amountInvoiced; } - /** - * amountInvoiced - * - * @param amountInvoiced Amount - */ + /** + * amountInvoiced + * @param amountInvoiced Amount + **/ + public void setAmountInvoiced(Amount amountInvoiced) { this.amountInvoiced = amountInvoiced; } /** - * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is - * invoiced the status will be set to `INVOICED` and can't be modified. A task with - * ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of - * `INVOICED`. A `LOCKED` state indicates that the task is currently changing - * state (for example being invoiced) and can't be modified. - * - * @param status StatusEnum - * @return Task - */ + * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. + * @param status StatusEnum + * @return Task + **/ public Task status(StatusEnum status) { this.status = status; return this; } - /** - * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is - * invoiced the status will be set to `INVOICED` and can't be modified. A task with - * ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of - * `INVOICED`. A `LOCKED` state indicates that the task is currently changing - * state (for example being invoiced) and can't be modified. - * + /** + * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. * @return status - */ - @ApiModelProperty( - value = - "Status of the task. When a task of ChargeType is `FIXED` and the rate amount is" - + " invoiced the status will be set to `INVOICED` and can't be modified. A task with" - + " ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A" - + " `LOCKED` state indicates that the task is currently changing state (for example" - + " being invoiced) and can't be modified.") - /** - * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is - * invoiced the status will be set to `INVOICED` and can't be modified. A task with - * ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of - * `INVOICED`. A `LOCKED` state indicates that the task is currently changing - * state (for example being invoiced) and can't be modified. - * + **/ + @ApiModelProperty(value = "Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified.") + /** + * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is - * invoiced the status will be set to `INVOICED` and can't be modified. A task with - * ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of - * `INVOICED`. A `LOCKED` state indicates that the task is currently changing - * state (for example being invoiced) and can't be modified. - * - * @param status StatusEnum - */ + /** + * Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -693,43 +629,29 @@ public boolean equals(java.lang.Object o) { return false; } Task task = (Task) o; - return Objects.equals(this.taskId, task.taskId) - && Objects.equals(this.name, task.name) - && Objects.equals(this.rate, task.rate) - && Objects.equals(this.chargeType, task.chargeType) - && Objects.equals(this.estimateMinutes, task.estimateMinutes) - && Objects.equals(this.projectId, task.projectId) - && Objects.equals(this.totalMinutes, task.totalMinutes) - && Objects.equals(this.totalAmount, task.totalAmount) - && Objects.equals(this.minutesInvoiced, task.minutesInvoiced) - && Objects.equals(this.minutesToBeInvoiced, task.minutesToBeInvoiced) - && Objects.equals(this.fixedMinutes, task.fixedMinutes) - && Objects.equals(this.nonChargeableMinutes, task.nonChargeableMinutes) - && Objects.equals(this.amountToBeInvoiced, task.amountToBeInvoiced) - && Objects.equals(this.amountInvoiced, task.amountInvoiced) - && Objects.equals(this.status, task.status); + return Objects.equals(this.taskId, task.taskId) && + Objects.equals(this.name, task.name) && + Objects.equals(this.rate, task.rate) && + Objects.equals(this.chargeType, task.chargeType) && + Objects.equals(this.estimateMinutes, task.estimateMinutes) && + Objects.equals(this.projectId, task.projectId) && + Objects.equals(this.totalMinutes, task.totalMinutes) && + Objects.equals(this.totalAmount, task.totalAmount) && + Objects.equals(this.minutesInvoiced, task.minutesInvoiced) && + Objects.equals(this.minutesToBeInvoiced, task.minutesToBeInvoiced) && + Objects.equals(this.fixedMinutes, task.fixedMinutes) && + Objects.equals(this.nonChargeableMinutes, task.nonChargeableMinutes) && + Objects.equals(this.amountToBeInvoiced, task.amountToBeInvoiced) && + Objects.equals(this.amountInvoiced, task.amountInvoiced) && + Objects.equals(this.status, task.status); } @Override public int hashCode() { - return Objects.hash( - taskId, - name, - rate, - chargeType, - estimateMinutes, - projectId, - totalMinutes, - totalAmount, - minutesInvoiced, - minutesToBeInvoiced, - fixedMinutes, - nonChargeableMinutes, - amountToBeInvoiced, - amountInvoiced, - status); + return Objects.hash(taskId, name, rate, chargeType, estimateMinutes, projectId, totalMinutes, totalAmount, minutesInvoiced, minutesToBeInvoiced, fixedMinutes, nonChargeableMinutes, amountToBeInvoiced, amountInvoiced, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -743,13 +665,9 @@ public String toString() { sb.append(" totalMinutes: ").append(toIndentedString(totalMinutes)).append("\n"); sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n"); sb.append(" minutesInvoiced: ").append(toIndentedString(minutesInvoiced)).append("\n"); - sb.append(" minutesToBeInvoiced: ") - .append(toIndentedString(minutesToBeInvoiced)) - .append("\n"); + sb.append(" minutesToBeInvoiced: ").append(toIndentedString(minutesToBeInvoiced)).append("\n"); sb.append(" fixedMinutes: ").append(toIndentedString(fixedMinutes)).append("\n"); - sb.append(" nonChargeableMinutes: ") - .append(toIndentedString(nonChargeableMinutes)) - .append("\n"); + sb.append(" nonChargeableMinutes: ").append(toIndentedString(nonChargeableMinutes)).append("\n"); sb.append(" amountToBeInvoiced: ").append(toIndentedString(amountToBeInvoiced)).append("\n"); sb.append(" amountInvoiced: ").append(toIndentedString(amountInvoiced)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -758,7 +676,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -766,4 +685,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/TaskCreateOrUpdate.java b/src/main/java/com/xero/models/project/TaskCreateOrUpdate.java index 39f035371..c1ef073c3 100644 --- a/src/main/java/com/xero/models/project/TaskCreateOrUpdate.java +++ b/src/main/java/com/xero/models/project/TaskCreateOrUpdate.java @@ -9,14 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.Amount; +import com.xero.models.project.ChargeType; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TaskCreateOrUpdate + */ -/** TaskCreateOrUpdate */ public class TaskCreateOrUpdate { StringUtil util = new StringUtil(); @@ -32,145 +51,134 @@ public class TaskCreateOrUpdate { @JsonProperty("estimateMinutes") private Integer estimateMinutes; /** - * Name of the task. Max length 100 characters. - * - * @param name String - * @return TaskCreateOrUpdate - */ + * Name of the task. Max length 100 characters. + * @param name String + * @return TaskCreateOrUpdate + **/ public TaskCreateOrUpdate name(String name) { this.name = name; return this; } - /** + /** * Name of the task. Max length 100 characters. - * * @return name - */ + **/ @ApiModelProperty(required = true, value = "Name of the task. Max length 100 characters.") - /** + /** * Name of the task. Max length 100 characters. - * * @return name String - */ + **/ public String getName() { return name; } - /** - * Name of the task. Max length 100 characters. - * - * @param name String - */ + /** + * Name of the task. Max length 100 characters. + * @param name String + **/ + public void setName(String name) { this.name = name; } /** - * rate - * - * @param rate Amount - * @return TaskCreateOrUpdate - */ + * rate + * @param rate Amount + * @return TaskCreateOrUpdate + **/ public TaskCreateOrUpdate rate(Amount rate) { this.rate = rate; return this; } - /** + /** * Get rate - * * @return rate - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * rate - * * @return rate Amount - */ + **/ public Amount getRate() { return rate; } - /** - * rate - * - * @param rate Amount - */ + /** + * rate + * @param rate Amount + **/ + public void setRate(Amount rate) { this.rate = rate; } /** - * chargeType - * - * @param chargeType ChargeType - * @return TaskCreateOrUpdate - */ + * chargeType + * @param chargeType ChargeType + * @return TaskCreateOrUpdate + **/ public TaskCreateOrUpdate chargeType(ChargeType chargeType) { this.chargeType = chargeType; return this; } - /** + /** * Get chargeType - * * @return chargeType - */ + **/ @ApiModelProperty(required = true, value = "") - /** + /** * chargeType - * * @return chargeType ChargeType - */ + **/ public ChargeType getChargeType() { return chargeType; } - /** - * chargeType - * - * @param chargeType ChargeType - */ + /** + * chargeType + * @param chargeType ChargeType + **/ + public void setChargeType(ChargeType chargeType) { this.chargeType = chargeType; } /** - * An estimated time to perform the task - * - * @param estimateMinutes Integer - * @return TaskCreateOrUpdate - */ + * An estimated time to perform the task + * @param estimateMinutes Integer + * @return TaskCreateOrUpdate + **/ public TaskCreateOrUpdate estimateMinutes(Integer estimateMinutes) { this.estimateMinutes = estimateMinutes; return this; } - /** + /** * An estimated time to perform the task - * * @return estimateMinutes - */ + **/ @ApiModelProperty(value = "An estimated time to perform the task") - /** + /** * An estimated time to perform the task - * * @return estimateMinutes Integer - */ + **/ public Integer getEstimateMinutes() { return estimateMinutes; } - /** - * An estimated time to perform the task - * - * @param estimateMinutes Integer - */ + /** + * An estimated time to perform the task + * @param estimateMinutes Integer + **/ + public void setEstimateMinutes(Integer estimateMinutes) { this.estimateMinutes = estimateMinutes; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,10 +188,10 @@ public boolean equals(java.lang.Object o) { return false; } TaskCreateOrUpdate taskCreateOrUpdate = (TaskCreateOrUpdate) o; - return Objects.equals(this.name, taskCreateOrUpdate.name) - && Objects.equals(this.rate, taskCreateOrUpdate.rate) - && Objects.equals(this.chargeType, taskCreateOrUpdate.chargeType) - && Objects.equals(this.estimateMinutes, taskCreateOrUpdate.estimateMinutes); + return Objects.equals(this.name, taskCreateOrUpdate.name) && + Objects.equals(this.rate, taskCreateOrUpdate.rate) && + Objects.equals(this.chargeType, taskCreateOrUpdate.chargeType) && + Objects.equals(this.estimateMinutes, taskCreateOrUpdate.estimateMinutes); } @Override @@ -191,6 +199,7 @@ public int hashCode() { return Objects.hash(name, rate, chargeType, estimateMinutes); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,7 +213,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -212,4 +222,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/Tasks.java b/src/main/java/com/xero/models/project/Tasks.java index 95e47a7fe..680a05e84 100644 --- a/src/main/java/com/xero/models/project/Tasks.java +++ b/src/main/java/com/xero/models/project/Tasks.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.Pagination; +import com.xero.models.project.Task; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Tasks + */ -/** Tasks */ public class Tasks { StringUtil util = new StringUtil(); @@ -28,46 +47,42 @@ public class Tasks { @JsonProperty("items") private List items = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return Tasks - */ + * pagination + * @param pagination Pagination + * @return Tasks + **/ public Tasks pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * items - * - * @param items List<Task> - * @return Tasks - */ + * items + * @param items List<Task> + * @return Tasks + **/ public Tasks items(List items) { this.items = items; return this; @@ -75,10 +90,9 @@ public Tasks items(List items) { /** * items - * - * @param itemsItem Task + * @param itemsItem Task * @return Tasks - */ + **/ public Tasks addItemsItem(Task itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -87,30 +101,29 @@ public Tasks addItemsItem(Task itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<Task> - */ + /** + * items + * @param items List<Task> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } Tasks tasks = (Tasks) o; - return Objects.equals(this.pagination, tasks.pagination) - && Objects.equals(this.items, tasks.items); + return Objects.equals(this.pagination, tasks.pagination) && + Objects.equals(this.items, tasks.items); } @Override @@ -129,6 +142,7 @@ public int hashCode() { return Objects.hash(pagination, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/TimeEntries.java b/src/main/java/com/xero/models/project/TimeEntries.java index 57f6145e2..ceefa5387 100644 --- a/src/main/java/com/xero/models/project/TimeEntries.java +++ b/src/main/java/com/xero/models/project/TimeEntries.java @@ -9,16 +9,35 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.xero.models.project.Pagination; +import com.xero.models.project.TimeEntry; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimeEntries + */ -/** TimeEntries */ public class TimeEntries { StringUtil util = new StringUtil(); @@ -28,46 +47,42 @@ public class TimeEntries { @JsonProperty("items") private List items = new ArrayList(); /** - * pagination - * - * @param pagination Pagination - * @return TimeEntries - */ + * pagination + * @param pagination Pagination + * @return TimeEntries + **/ public TimeEntries pagination(Pagination pagination) { this.pagination = pagination; return this; } - /** + /** * Get pagination - * * @return pagination - */ + **/ @ApiModelProperty(value = "") - /** + /** * pagination - * * @return pagination Pagination - */ + **/ public Pagination getPagination() { return pagination; } - /** - * pagination - * - * @param pagination Pagination - */ + /** + * pagination + * @param pagination Pagination + **/ + public void setPagination(Pagination pagination) { this.pagination = pagination; } /** - * items - * - * @param items List<TimeEntry> - * @return TimeEntries - */ + * items + * @param items List<TimeEntry> + * @return TimeEntries + **/ public TimeEntries items(List items) { this.items = items; return this; @@ -75,10 +90,9 @@ public TimeEntries items(List items) { /** * items - * - * @param itemsItem TimeEntry + * @param itemsItem TimeEntry * @return TimeEntries - */ + **/ public TimeEntries addItemsItem(TimeEntry itemsItem) { if (this.items == null) { this.items = new ArrayList(); @@ -87,30 +101,29 @@ public TimeEntries addItemsItem(TimeEntry itemsItem) { return this; } - /** + /** * Get items - * * @return items - */ + **/ @ApiModelProperty(value = "") - /** + /** * items - * * @return items List - */ + **/ public List getItems() { return items; } - /** - * items - * - * @param items List<TimeEntry> - */ + /** + * items + * @param items List<TimeEntry> + **/ + public void setItems(List items) { this.items = items; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } TimeEntries timeEntries = (TimeEntries) o; - return Objects.equals(this.pagination, timeEntries.pagination) - && Objects.equals(this.items, timeEntries.items); + return Objects.equals(this.pagination, timeEntries.pagination) && + Objects.equals(this.items, timeEntries.items); } @Override @@ -129,6 +142,7 @@ public int hashCode() { return Objects.hash(pagination, items); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -140,7 +154,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -148,4 +163,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/TimeEntry.java b/src/main/java/com/xero/models/project/TimeEntry.java index 4e914bf63..c39464fb2 100644 --- a/src/main/java/com/xero/models/project/TimeEntry.java +++ b/src/main/java/com/xero/models/project/TimeEntry.java @@ -9,18 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.project; -import com.fasterxml.jackson.annotation.JsonCreator; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.xero.api.StringUtil; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimeEntry + */ -/** TimeEntry */ public class TimeEntry { StringUtil util = new StringUtil(); @@ -48,19 +63,22 @@ public class TimeEntry { @JsonProperty("description") private String description; /** - * Status of the time entry. By default a time entry is created with status of `ACTIVE`. - * A `LOCKED` state indicates that the time entry is currently changing state (for - * example being invoiced). Updates are not allowed when in this state. It will have a status of - * INVOICED once it is invoiced. + * Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. */ public enum StatusEnum { - /** ACTIVE */ + /** + * ACTIVE + */ ACTIVE("ACTIVE"), - - /** LOCKED */ + + /** + * LOCKED + */ LOCKED("LOCKED"), - - /** INVOICED */ + + /** + * INVOICED + */ INVOICED("INVOICED"); private String value; @@ -69,31 +87,25 @@ public enum StatusEnum { this.value = value; } - /** - * getValue - * - * @return String value - */ + /** getValue + * @return String value + */ @JsonValue public String getValue() { return value; } - /** - * toString - * - * @return String value - */ - @Override + /** toString + * @return String value + */ + @Override public String toString() { return String.valueOf(value); } - /** - * fromValue - * - * @param value String - */ + /** fromValue + * @param value String + */ @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { @@ -105,358 +117,298 @@ public static StatusEnum fromValue(String value) { } } + @JsonProperty("status") private StatusEnum status; /** - * Identifier of the time entry. - * - * @param timeEntryId UUID - * @return TimeEntry - */ + * Identifier of the time entry. + * @param timeEntryId UUID + * @return TimeEntry + **/ public TimeEntry timeEntryId(UUID timeEntryId) { this.timeEntryId = timeEntryId; return this; } - /** + /** * Identifier of the time entry. - * * @return timeEntryId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "Identifier of the time entry.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Identifier of the time entry.") + /** * Identifier of the time entry. - * * @return timeEntryId UUID - */ + **/ public UUID getTimeEntryId() { return timeEntryId; } - /** - * Identifier of the time entry. - * - * @param timeEntryId UUID - */ + /** + * Identifier of the time entry. + * @param timeEntryId UUID + **/ + public void setTimeEntryId(UUID timeEntryId) { this.timeEntryId = timeEntryId; } /** - * The xero user identifier of the person who logged time. - * - * @param userId UUID - * @return TimeEntry - */ + * The xero user identifier of the person who logged time. + * @param userId UUID + * @return TimeEntry + **/ public TimeEntry userId(UUID userId) { this.userId = userId; return this; } - /** + /** * The xero user identifier of the person who logged time. - * * @return userId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "The xero user identifier of the person who logged time.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The xero user identifier of the person who logged time.") + /** * The xero user identifier of the person who logged time. - * * @return userId UUID - */ + **/ public UUID getUserId() { return userId; } - /** - * The xero user identifier of the person who logged time. - * - * @param userId UUID - */ + /** + * The xero user identifier of the person who logged time. + * @param userId UUID + **/ + public void setUserId(UUID userId) { this.userId = userId; } /** - * Identifier of the project, that the task (which the time entry is logged against) belongs to. - * - * @param projectId UUID - * @return TimeEntry - */ + * Identifier of the project, that the task (which the time entry is logged against) belongs to. + * @param projectId UUID + * @return TimeEntry + **/ public TimeEntry projectId(UUID projectId) { this.projectId = projectId; return this; } - /** + /** * Identifier of the project, that the task (which the time entry is logged against) belongs to. - * * @return projectId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = - "Identifier of the project, that the task (which the time entry is logged against)" - + " belongs to.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Identifier of the project, that the task (which the time entry is logged against) belongs to.") + /** * Identifier of the project, that the task (which the time entry is logged against) belongs to. - * * @return projectId UUID - */ + **/ public UUID getProjectId() { return projectId; } - /** - * Identifier of the project, that the task (which the time entry is logged against) belongs to. - * - * @param projectId UUID - */ + /** + * Identifier of the project, that the task (which the time entry is logged against) belongs to. + * @param projectId UUID + **/ + public void setProjectId(UUID projectId) { this.projectId = projectId; } /** - * Identifier of the task that time entry is logged against. - * - * @param taskId UUID - * @return TimeEntry - */ + * Identifier of the task that time entry is logged against. + * @param taskId UUID + * @return TimeEntry + **/ public TimeEntry taskId(UUID taskId) { this.taskId = taskId; return this; } - /** + /** * Identifier of the task that time entry is logged against. - * * @return taskId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - value = "Identifier of the task that time entry is logged against.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Identifier of the task that time entry is logged against.") + /** * Identifier of the task that time entry is logged against. - * * @return taskId UUID - */ + **/ public UUID getTaskId() { return taskId; } - /** - * Identifier of the task that time entry is logged against. - * - * @param taskId UUID - */ + /** + * Identifier of the task that time entry is logged against. + * @param taskId UUID + **/ + public void setTaskId(UUID taskId) { this.taskId = taskId; } /** - * The date time that time entry is logged on. UTC Date Time in ISO-8601 format. - * - * @param dateUtc OffsetDateTime - * @return TimeEntry - */ + * The date time that time entry is logged on. UTC Date Time in ISO-8601 format. + * @param dateUtc OffsetDateTime + * @return TimeEntry + **/ public TimeEntry dateUtc(OffsetDateTime dateUtc) { this.dateUtc = dateUtc; return this; } - /** + /** * The date time that time entry is logged on. UTC Date Time in ISO-8601 format. - * * @return dateUtc - */ - @ApiModelProperty( - value = "The date time that time entry is logged on. UTC Date Time in ISO-8601 format.") - /** + **/ + @ApiModelProperty(value = "The date time that time entry is logged on. UTC Date Time in ISO-8601 format.") + /** * The date time that time entry is logged on. UTC Date Time in ISO-8601 format. - * * @return dateUtc OffsetDateTime - */ + **/ public OffsetDateTime getDateUtc() { return dateUtc; } - /** - * The date time that time entry is logged on. UTC Date Time in ISO-8601 format. - * - * @param dateUtc OffsetDateTime - */ + /** + * The date time that time entry is logged on. UTC Date Time in ISO-8601 format. + * @param dateUtc OffsetDateTime + **/ + public void setDateUtc(OffsetDateTime dateUtc) { this.dateUtc = dateUtc; } /** - * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is - * set to server time. - * - * @param dateEnteredUtc OffsetDateTime - * @return TimeEntry - */ + * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time. + * @param dateEnteredUtc OffsetDateTime + * @return TimeEntry + **/ public TimeEntry dateEnteredUtc(OffsetDateTime dateEnteredUtc) { this.dateEnteredUtc = dateEnteredUtc; return this; } - /** - * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is - * set to server time. - * + /** + * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time. * @return dateEnteredUtc - */ - @ApiModelProperty( - value = - "The date time that time entry is created. UTC Date Time in ISO-8601 format. By default" - + " it is set to server time.") - /** - * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is - * set to server time. - * + **/ + @ApiModelProperty(value = "The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time.") + /** + * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time. * @return dateEnteredUtc OffsetDateTime - */ + **/ public OffsetDateTime getDateEnteredUtc() { return dateEnteredUtc; } - /** - * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is - * set to server time. - * - * @param dateEnteredUtc OffsetDateTime - */ + /** + * The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time. + * @param dateEnteredUtc OffsetDateTime + **/ + public void setDateEnteredUtc(OffsetDateTime dateEnteredUtc) { this.dateEnteredUtc = dateEnteredUtc; } /** - * The duration of logged minutes. - * - * @param duration Integer - * @return TimeEntry - */ + * The duration of logged minutes. + * @param duration Integer + * @return TimeEntry + **/ public TimeEntry duration(Integer duration) { this.duration = duration; return this; } - /** + /** * The duration of logged minutes. - * * @return duration - */ + **/ @ApiModelProperty(value = "The duration of logged minutes.") - /** + /** * The duration of logged minutes. - * * @return duration Integer - */ + **/ public Integer getDuration() { return duration; } - /** - * The duration of logged minutes. - * - * @param duration Integer - */ + /** + * The duration of logged minutes. + * @param duration Integer + **/ + public void setDuration(Integer duration) { this.duration = duration; } /** - * A description of the time entry. - * - * @param description String - * @return TimeEntry - */ + * A description of the time entry. + * @param description String + * @return TimeEntry + **/ public TimeEntry description(String description) { this.description = description; return this; } - /** + /** * A description of the time entry. - * * @return description - */ + **/ @ApiModelProperty(value = "A description of the time entry.") - /** + /** * A description of the time entry. - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * A description of the time entry. - * - * @param description String - */ + /** + * A description of the time entry. + * @param description String + **/ + public void setDescription(String description) { this.description = description; } /** - * Status of the time entry. By default a time entry is created with status of `ACTIVE`. - * A `LOCKED` state indicates that the time entry is currently changing state (for - * example being invoiced). Updates are not allowed when in this state. It will have a status of - * INVOICED once it is invoiced. - * - * @param status StatusEnum - * @return TimeEntry - */ + * Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. + * @param status StatusEnum + * @return TimeEntry + **/ public TimeEntry status(StatusEnum status) { this.status = status; return this; } - /** - * Status of the time entry. By default a time entry is created with status of `ACTIVE`. - * A `LOCKED` state indicates that the time entry is currently changing state (for - * example being invoiced). Updates are not allowed when in this state. It will have a status of - * INVOICED once it is invoiced. - * + /** + * Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. * @return status - */ - @ApiModelProperty( - value = - "Status of the time entry. By default a time entry is created with status of `ACTIVE`. A" - + " `LOCKED` state indicates that the time entry is currently changing state (for" - + " example being invoiced). Updates are not allowed when in this state. It will" - + " have a status of INVOICED once it is invoiced.") - /** - * Status of the time entry. By default a time entry is created with status of `ACTIVE`. - * A `LOCKED` state indicates that the time entry is currently changing state (for - * example being invoiced). Updates are not allowed when in this state. It will have a status of - * INVOICED once it is invoiced. - * + **/ + @ApiModelProperty(value = "Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced.") + /** + * Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. * @return status StatusEnum - */ + **/ public StatusEnum getStatus() { return status; } - /** - * Status of the time entry. By default a time entry is created with status of `ACTIVE`. - * A `LOCKED` state indicates that the time entry is currently changing state (for - * example being invoiced). Updates are not allowed when in this state. It will have a status of - * INVOICED once it is invoiced. - * - * @param status StatusEnum - */ + /** + * Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. + * @param status StatusEnum + **/ + public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -466,31 +418,23 @@ public boolean equals(java.lang.Object o) { return false; } TimeEntry timeEntry = (TimeEntry) o; - return Objects.equals(this.timeEntryId, timeEntry.timeEntryId) - && Objects.equals(this.userId, timeEntry.userId) - && Objects.equals(this.projectId, timeEntry.projectId) - && Objects.equals(this.taskId, timeEntry.taskId) - && Objects.equals(this.dateUtc, timeEntry.dateUtc) - && Objects.equals(this.dateEnteredUtc, timeEntry.dateEnteredUtc) - && Objects.equals(this.duration, timeEntry.duration) - && Objects.equals(this.description, timeEntry.description) - && Objects.equals(this.status, timeEntry.status); + return Objects.equals(this.timeEntryId, timeEntry.timeEntryId) && + Objects.equals(this.userId, timeEntry.userId) && + Objects.equals(this.projectId, timeEntry.projectId) && + Objects.equals(this.taskId, timeEntry.taskId) && + Objects.equals(this.dateUtc, timeEntry.dateUtc) && + Objects.equals(this.dateEnteredUtc, timeEntry.dateEnteredUtc) && + Objects.equals(this.duration, timeEntry.duration) && + Objects.equals(this.description, timeEntry.description) && + Objects.equals(this.status, timeEntry.status); } @Override public int hashCode() { - return Objects.hash( - timeEntryId, - userId, - projectId, - taskId, - dateUtc, - dateEnteredUtc, - duration, - description, - status); + return Objects.hash(timeEntryId, userId, projectId, taskId, dateUtc, dateEnteredUtc, duration, description, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -509,7 +453,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -517,4 +462,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } + diff --git a/src/main/java/com/xero/models/project/TimeEntryCreateOrUpdate.java b/src/main/java/com/xero/models/project/TimeEntryCreateOrUpdate.java index 812451947..d2295553a 100644 --- a/src/main/java/com/xero/models/project/TimeEntryCreateOrUpdate.java +++ b/src/main/java/com/xero/models/project/TimeEntryCreateOrUpdate.java @@ -9,16 +9,33 @@ * Do not edit the class manually. */ -package com.xero.models.project; +package com.xero.models.project; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xero.api.StringUtil; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Objects; import java.util.UUID; import org.threeten.bp.OffsetDateTime; +import java.io.IOException; + +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.LocalDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.Instant; +import org.threeten.bp.LocalDate; +import com.xero.api.StringUtil; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * TimeEntryCreateOrUpdate + */ -/** TimeEntryCreateOrUpdate */ public class TimeEntryCreateOrUpdate { StringUtil util = new StringUtil(); @@ -37,193 +54,166 @@ public class TimeEntryCreateOrUpdate { @JsonProperty("description") private String description; /** - * The xero user identifier of the person logging the time. - * - * @param userId UUID - * @return TimeEntryCreateOrUpdate - */ + * The xero user identifier of the person logging the time. + * @param userId UUID + * @return TimeEntryCreateOrUpdate + **/ public TimeEntryCreateOrUpdate userId(UUID userId) { this.userId = userId; return this; } - /** + /** * The xero user identifier of the person logging the time. - * * @return userId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - required = true, - value = "The xero user identifier of the person logging the time.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "The xero user identifier of the person logging the time.") + /** * The xero user identifier of the person logging the time. - * * @return userId UUID - */ + **/ public UUID getUserId() { return userId; } - /** - * The xero user identifier of the person logging the time. - * - * @param userId UUID - */ + /** + * The xero user identifier of the person logging the time. + * @param userId UUID + **/ + public void setUserId(UUID userId) { this.userId = userId; } /** - * Identifier of the task that time entry is logged against. - * - * @param taskId UUID - * @return TimeEntryCreateOrUpdate - */ + * Identifier of the task that time entry is logged against. + * @param taskId UUID + * @return TimeEntryCreateOrUpdate + **/ public TimeEntryCreateOrUpdate taskId(UUID taskId) { this.taskId = taskId; return this; } - /** + /** * Identifier of the task that time entry is logged against. - * * @return taskId - */ - @ApiModelProperty( - example = "00000000-0000-0000-0000-000000000000", - required = true, - value = "Identifier of the task that time entry is logged against.") - /** + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "Identifier of the task that time entry is logged against.") + /** * Identifier of the task that time entry is logged against. - * * @return taskId UUID - */ + **/ public UUID getTaskId() { return taskId; } - /** - * Identifier of the task that time entry is logged against. - * - * @param taskId UUID - */ + /** + * Identifier of the task that time entry is logged against. + * @param taskId UUID + **/ + public void setTaskId(UUID taskId) { this.taskId = taskId; } /** - * Date time entry is logged on. UTC Date Time in ISO-8601 format. - * - * @param dateUtc OffsetDateTime - * @return TimeEntryCreateOrUpdate - */ + * Date time entry is logged on. UTC Date Time in ISO-8601 format. + * @param dateUtc OffsetDateTime + * @return TimeEntryCreateOrUpdate + **/ public TimeEntryCreateOrUpdate dateUtc(OffsetDateTime dateUtc) { this.dateUtc = dateUtc; return this; } - /** + /** * Date time entry is logged on. UTC Date Time in ISO-8601 format. - * * @return dateUtc - */ - @ApiModelProperty( - required = true, - value = "Date time entry is logged on. UTC Date Time in ISO-8601 format.") - /** + **/ + @ApiModelProperty(required = true, value = "Date time entry is logged on. UTC Date Time in ISO-8601 format.") + /** * Date time entry is logged on. UTC Date Time in ISO-8601 format. - * * @return dateUtc OffsetDateTime - */ + **/ public OffsetDateTime getDateUtc() { return dateUtc; } - /** - * Date time entry is logged on. UTC Date Time in ISO-8601 format. - * - * @param dateUtc OffsetDateTime - */ + /** + * Date time entry is logged on. UTC Date Time in ISO-8601 format. + * @param dateUtc OffsetDateTime + **/ + public void setDateUtc(OffsetDateTime dateUtc) { this.dateUtc = dateUtc; } /** - * Number of minutes to be logged. Duration is between 1 and 59940 inclusively. - * - * @param duration Integer - * @return TimeEntryCreateOrUpdate - */ + * Number of minutes to be logged. Duration is between 1 and 59940 inclusively. + * @param duration Integer + * @return TimeEntryCreateOrUpdate + **/ public TimeEntryCreateOrUpdate duration(Integer duration) { this.duration = duration; return this; } - /** + /** * Number of minutes to be logged. Duration is between 1 and 59940 inclusively. - * * @return duration - */ - @ApiModelProperty( - required = true, - value = "Number of minutes to be logged. Duration is between 1 and 59940 inclusively.") - /** + **/ + @ApiModelProperty(required = true, value = "Number of minutes to be logged. Duration is between 1 and 59940 inclusively.") + /** * Number of minutes to be logged. Duration is between 1 and 59940 inclusively. - * * @return duration Integer - */ + **/ public Integer getDuration() { return duration; } - /** - * Number of minutes to be logged. Duration is between 1 and 59940 inclusively. - * - * @param duration Integer - */ + /** + * Number of minutes to be logged. Duration is between 1 and 59940 inclusively. + * @param duration Integer + **/ + public void setDuration(Integer duration) { this.duration = duration; } /** - * An optional description of the time entry, will be set to null if not provided during update. - * - * @param description String - * @return TimeEntryCreateOrUpdate - */ + * An optional description of the time entry, will be set to null if not provided during update. + * @param description String + * @return TimeEntryCreateOrUpdate + **/ public TimeEntryCreateOrUpdate description(String description) { this.description = description; return this; } - /** + /** * An optional description of the time entry, will be set to null if not provided during update. - * * @return description - */ - @ApiModelProperty( - value = - "An optional description of the time entry, will be set to null if not provided during" - + " update.") - /** + **/ + @ApiModelProperty(value = "An optional description of the time entry, will be set to null if not provided during update.") + /** * An optional description of the time entry, will be set to null if not provided during update. - * * @return description String - */ + **/ public String getDescription() { return description; } - /** - * An optional description of the time entry, will be set to null if not provided during update. - * - * @param description String - */ + /** + * An optional description of the time entry, will be set to null if not provided during update. + * @param description String + **/ + public void setDescription(String description) { this.description = description; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -233,11 +223,11 @@ public boolean equals(java.lang.Object o) { return false; } TimeEntryCreateOrUpdate timeEntryCreateOrUpdate = (TimeEntryCreateOrUpdate) o; - return Objects.equals(this.userId, timeEntryCreateOrUpdate.userId) - && Objects.equals(this.taskId, timeEntryCreateOrUpdate.taskId) - && Objects.equals(this.dateUtc, timeEntryCreateOrUpdate.dateUtc) - && Objects.equals(this.duration, timeEntryCreateOrUpdate.duration) - && Objects.equals(this.description, timeEntryCreateOrUpdate.description); + return Objects.equals(this.userId, timeEntryCreateOrUpdate.userId) && + Objects.equals(this.taskId, timeEntryCreateOrUpdate.taskId) && + Objects.equals(this.dateUtc, timeEntryCreateOrUpdate.dateUtc) && + Objects.equals(this.duration, timeEntryCreateOrUpdate.duration) && + Objects.equals(this.description, timeEntryCreateOrUpdate.description); } @Override @@ -245,6 +235,7 @@ public int hashCode() { return Objects.hash(userId, taskId, dateUtc, duration, description); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -259,7 +250,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * 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) { @@ -267,4 +259,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } + } +